You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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
api.openai.com
endpoints).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
ApiProviderProfile
adaptations as well.The text was updated successfully, but these errors were encountered: