Skip to content

Make Provider.Model api.url optional to match providers with a native SDK #205

Open

Description

@byapparov

Context

Provider.Model in packages/cli/src/provider/provider.ts declares api.url as a required z.string(). Providers with a native SDK (for example anthropic, openai, amazon-bedrock, azure) resolve their own endpoint, so their models have no URL:

Runtime is fine: loadBaseURL treats a non-string URL as "no base URL". But the declared schema does not match the data. test/provider/catalog.test.ts has to relax url to optional to validate the catalog. Raised in the #202 review (finding "Model schema requires api.url; 600 catalog models omit it").

Proposal

Make Provider.Model.api.url optional, so the type and schema say what the data holds. Update the consumers that assume a string. Regenerate the SDK types under packages/sdk/src/gen (Model.api.url becomes url?: string) and note the type change for SDK users.

Acceptance criteria

  • Provider.Model.shape.api.shape.url is optional, and every catalog model parses with plain Provider.Model (the relaxed schema in catalog.test.ts is removed).
  • bun turbo typecheck passes with no non-null assertions added for api.url.
  • The regenerated SDK types are committed, and the change is called out in the release notes.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Nice to have - Lowtech-debtTechnical debt cleanup

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions