-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Refactor LLMProvider to use MODEL_PROVIDER_MAP for model-provider map… #1280
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
base: main
Are you sure you want to change the base?
Conversation
…ping # what changed - Removed the old modelToProviderMap and replaced it with the new MODEL_PROVIDER_MAP for better maintainability and clarity. - Updated the LLMProvider class to utilize the new mapping, ensuring consistent handling of model names and providers. # test plan - Ensure existing functionality remains intact by running all relevant tests and verifying no regressions occur.
🦋 Changeset detectedLatest commit: a7e65c1 The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Greptile Summary
Confidence Score: 5/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant User
participant LLMProvider
participant MODEL_PROVIDER_MAP
participant Client
User->>LLMProvider: "getClient(modelName)"
LLMProvider->>LLMProvider: "Check if modelName contains '/'"
alt AISDK model (contains '/')
LLMProvider->>LLMProvider: "Parse provider and model"
LLMProvider->>Client: "Return AISdkClient"
else Known model
LLMProvider->>MODEL_PROVIDER_MAP: "Lookup modelName as KnownModel"
MODEL_PROVIDER_MAP-->>LLMProvider: "Return provider"
LLMProvider->>Client: "Return provider-specific client (OpenAI/Anthropic/etc)"
end
Client-->>User: "LLMClient instance"
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2 files reviewed, no comments
Edit Code Review Agent Settings | Greptile
React with 👍 or 👎 to share your feedback on this new summary format
|
@shrey150 how about this |
…ping
what changed
test plan
why
what changed
test plan