-
-
Notifications
You must be signed in to change notification settings - Fork 71
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
Provider/Generator Refactor #185
Comments
I'll start with Anthropic and Bedrock and pick whatever's left after 😆 |
I'll pick Gemini, Deepseek, Mistral & XAI in same order. |
I just merged the Ollama refactor as an example of how I think providers could/should look. |
@pushpak1300 have you started on Gemini? If not I have some time this morning and can take on. |
i have not yet. @ChrisB-TL |
@sixlive Bedrock package also refactored. I am assuming we want to still keep it out of the main repo given the AWS SDK dependency? Or would you rather I PR it in? |
@ChrisB-TL lets keep is separate. Before we release the Bedrock package I want to complete #197. I'll prioritize it tomorrow! |
Shipped!! https://github.com/echolabsdev/prism/releases/tag/v0.40.0 Thank you SO MUCH @pushpak1300 and @ChrisB-TL |
Provider Response Type Refactor
To Do
Prism::fake
updatesPrism::fake
Overview
This refactor aims to improve Prism's architecture by moving request handling and response generation logic from the Generator classes to the individual providers. This change will make Prism more flexible and allow providers to implement their own request/response flow in a way that best suits their specific needs.
Current Implementation
Currently, our Provider interface uses a generic
ProviderResponse
type:The Generator classes are responsible for:
This creates a rigid structure where all providers must conform to the same request/response pattern, even when their APIs might work differently.
Proposed Changes
We'll update the Provider interface to use specific response types:
Benefits
Implementation Strategy
To make this transition manageable, we'll:
TextResponse
StructuredResponse
Migrate providers one at a time to return the new response types
Update Generator classes to handle both response types during transition
Once all providers are migrated, remove union types and old response types
Help Needed
This is a major refactor that will touch many parts of the codebase. We need help with:
Getting Started
Pick a provider to migrate:
refactor/provider-responses
Testing Requirements
Questions?
Feel free to ask questions in the comments. This is a significant change to Prism's architecture, so we want to make sure everyone understands the goals and implementation strategy.
The text was updated successfully, but these errors were encountered: