Skip to content

Introduce ApiProviderProfile #244

Open
@pstutz

Description

@pstutz

Current schema transformations are tightly coupled to OpenAI-specific assumptions, some of them undocumented. To better support multiple providers, let’s introduce an ApiProviderProfile that encapsulates any provider-specific logic (e.g., schema transformations like schemaFolder).

Changes

  • Default Selection: By default, select a profile based on the known provider URL (e.g., OpenAIProfile for api.openai.com endpoints).
  • User Overrides: Allow users to explicitly set a different ApiProviderProfile when constructing the client, bypassing the automatic selection logic. This gives them full control over schema transformations, enabling them to remove assumptions or add custom logic for other providers.

Benefit
All provider-specific assumptions move into profiles, making the code cleaner and more maintainable. Users who need custom behavior can easily switch profiles without dealing with undocumented and immutable defaults.

Technical Considerations

  • Evaluate if provider-specific nuances like missing logprobs can/should be handled by ApiProviderProfile adaptations as well.
  • Evaluate if the approach should be extensible into an entire version profile, so it could eventually handle versioning/updates as providers evolve their APIs. Either way, I think it makes sense to start with just the schema transformation and evolve it as we discover new dimensions in which different providers vary.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions