Skip to content

feat: Generate model providers table dynamically#21

Open
github-actions[bot] wants to merge 7 commits intomainfrom
agent-tasks/19
Open

feat: Generate model providers table dynamically#21
github-actions[bot] wants to merge 7 commits intomainfrom
agent-tasks/19

Conversation

@github-actions
Copy link
Copy Markdown

@github-actions github-actions Bot commented Mar 10, 2026

Summary

Replaces the hardcoded model providers table in the overview page with a dynamically generated table that queries the docs collection for pages with integrationType: 'model-provider' frontmatter.

Changes

New Files

  • src/util/integration-content.ts - Reusable typed utilities for querying integration content

Modified Files

  • src/content.config.ts - Added integrationType field to docs schema for filtering
  • src/content/docs/user-guide/concepts/model-providers/index.mdx - Uses new utilities to generate table
  • 18 model provider pages - Added integrationType: 'model-provider' frontmatter; added community: true flag to redirect pages for community providers

Test Files

  • test/model-providers-list.test.ts - Tests for utility functions and integration

Implementation

Created a reusable utility module src/util/integration-content.ts with properly typed helpers:

// Get language support from frontmatter
getLanguageSupport(languages?: string | string[]): LanguageSupport

// Filter and process docs by integration type
getIntegrationEntries(docs, integrationType, basePath): IntegrationEntry[]

// Split into official/community groups
splitByCategory(entries): { official, community }

The MDX file uses these utilities with minimal inline code:

import { getIntegrationEntries, splitByCategory } from '@util/integration-content'

export const modelProviders = getIntegrationEntries(allDocs, 'model-provider', '...')
export const { official, community } = splitByCategory(modelProviders)

Features

  • Filters pages by integrationType: 'model-provider' frontmatter
  • Excludes the index page from the list
  • Sorts providers: non-community first (alphabetically), then community (alphabetically)
  • Detects language support from existing languages field convention
  • Shows Community badge and separate section for community providers
  • Reusable for other integration types (tools, session managers, etc.)

Testing

  • All 289 tests pass (added more unit tests for utilities)
  • Build completes successfully with no broken links

Resolves #19

- Add integrationType field to content schema for filtering docs
- Create ModelProvidersList.astro component to query docs collection
- Update all 18 model provider pages with integrationType: model-provider
- Replace hardcoded table in index.mdx with dynamic component
- Add tests for model providers list functionality

Component features:
- Filters pages by integrationType: 'model-provider' frontmatter
- Sorts non-community providers first, then community alphabetically
- Shows Python/TypeScript support based on languages field
- Displays Community badge for community-contributed providers
- Excludes index page from the generated list

Resolves #19
@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages Bot commented Mar 10, 2026

Deploying docs with  Cloudflare Pages  Cloudflare Pages

Latest commit: 26361fe
Status: ✅  Deploy successful!
Preview URL: https://2c48dd46.docs-72e.pages.dev
Branch Preview URL: https://agent-tasks-19.docs-72e.pages.dev

View logs

Comment thread src/content/docs/user-guide/concepts/model-providers/index.mdx
@zastrowm
Copy link
Copy Markdown
Owner

/strands

Per review feedback, moved the table generation logic directly into the
index.mdx file using MDX exports and JSX, eliminating the need for a
separate ModelProvidersList.astro component.

Benefits:
- All logic is co-located with the content
- Easier to maintain and understand
- Follows MDX best practices for simple data transformations
Comment thread src/content/docs/user-guide/concepts/model-providers/index.mdx Outdated
@zastrowm
Copy link
Copy Markdown
Owner

/strands implement

Per review feedback, moved the filtering and processing logic into a
reusable utility module at src/util/integration-content.ts.

New utilities:
- getLanguageSupport(): Determines Python/TypeScript support from frontmatter
- getIntegrationEntries(): Filters and processes docs by integrationType
- splitByCategory(): Separates official from community entries
- Proper TypeScript types for IntegrationEntry and LanguageSupport

Benefits:
- Reusable for other integration types (tools, etc.)
- Properly typed interfaces
- Easier to test and maintain
- Cleaner MDX file with minimal inline logic
Copy link
Copy Markdown
Owner

@zastrowm zastrowm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/strands

Comment thread src/content/docs/user-guide/concepts/model-providers/index.mdx
Comment thread test/model-providers-list.test.ts Outdated
@zastrowm
Copy link
Copy Markdown
Owner

/strands

- Add getIntegrationEntries utility to extract and sort content by integrationType
- Update model-providers.mdx to auto-generate table from page frontmatter
- Add integrationType and description fields to all community pages
- Update community-packages.mdx to auto-generate tables for all categories
- Add description field to content schema

This reduces manual maintenance by deriving catalog entries from page
frontmatter. New pages with the correct integrationType and description
will automatically appear in the catalog tables.

Community pages updated:
- 6 tools with community-tool integrationType
- 9 model providers with community-model-provider integrationType
- 2 session managers with community-session-manager integrationType
- 1 integration with community-integration integrationType

Resolves #19
| [strands-telegram](./tools/strands-telegram.md) | Telegram bot |
| [strands-telegram-listener](./tools/strands-telegram-listener.md) | Telegram listener |
| [UTCP](./tools/utcp.md) | Universal Tool Calling Protocol |
<table>
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Create a new Astro component SimpleTab;

Usage should look like:

<SimpleTable
    data={tools}
    columns=[
      { header: "Package", cell: tool => <a href={tool.href}>{tool.sidebarLabel || tool.title}</a> },
      { header: "DescriptIon", cell: tool => tool.description
    ]
 />

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done! Created SimpleTable.astro component. Usage in community-packages.mdx:

<SimpleTable
  data={communityTools}
  columns={[
    { header: "Package", key: "title", link: true },
    { header: "Description", key: "description" }
  ]}
/>

The link: true option renders cells as links using item.href.

@zastrowm
Copy link
Copy Markdown
Owner

/strands

Extract inline table JSX into a reusable SimpleTable Astro component.
The component accepts data array and column definitions with optional
link rendering.

Usage:
<SimpleTable
  data={tools}
  columns={[
    { header: 'Package', key: 'title', link: true },
    { header: 'Description', key: 'description' }
  ]}
/>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Construct model providers table automatically

2 participants