Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce ApiProviderProfile #244

Open
pstutz opened this issue Dec 9, 2024 · 0 comments
Open

Introduce ApiProviderProfile #244

pstutz opened this issue Dec 9, 2024 · 0 comments

Comments

@pstutz
Copy link
Contributor

pstutz commented Dec 9, 2024

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.
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

No branches or pull requests

1 participant