fix(ai-orchestrator): update LangChain v0.3 constructor params to resolve Anthropic 404#135
Merged
Merged
Conversation
…olve Anthropic 404 - Change modelName to model for ChatOpenAI and ChatAnthropic (v0.3 standard) - Update Anthropic model ID from 'claude-3-5-sonnet-latest' to 'claude-3-5-sonnet-20241022' - Remove unnecessary 'as any' type assertion from ChatAnthropic config - Update unit tests to assert on 'model' property with correct identifiers Closes #134
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
Contributor
There was a problem hiding this comment.
Pull request overview
Updates the ai-orchestrator’s LangChain OpenAI/Anthropic client construction to match the newer constructor shape (model instead of modelName) and pins Anthropic to a dated model identifier to avoid the reported 404.
Changes:
- Bumped
@langchain/openaiand@langchain/anthropicto^0.3.0and updated the lockfile accordingly. - Updated
getOpenAIClient()/getAnthropicClient()constructors to usemodeland pinned Anthropic toclaude-3-5-sonnet-20241022(also removed theas any). - Updated unit tests to assert
config.modelinstead ofconfig.modelNameand addedlogsto.gitignore.
Reviewed changes
Copilot reviewed 4 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
pnpm-lock.yaml |
Locks updated LangChain/OpenAI/Anthropic dependency graph after version bumps. |
package.json |
Bumps root LangChain OpenAI/Anthropic versions to ^0.3.0. |
libs/ai-orchestrator/src/llm/clients.ts |
Switches constructors to model and pins Anthropic model ID; removes as any. |
libs/ai-orchestrator/src/__tests__/clients.spec.ts |
Updates assertions to validate config.model for both clients. |
libs/ai-orchestrator/package.json |
Aligns ai-orchestrator’s direct LangChain dependencies with the bumped versions. |
.gitignore |
Ignores a logs directory/path. |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
…-deps # Conflicts: # libs/ai-orchestrator/package.json # package.json # pnpm-lock.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #134
Updates the LangChain client constructors to adhere to v0.3 standards. The SDK introduced a standardisation where the legacy parameter
modelNamehas been deprecated in favour ofmodel. Additionally, the Anthropic model identifier is changed from a generic alias to an explicit dated version for API stability.Changes
modelName: 'gpt-4o'tomodel: 'gpt-4o'modelName: 'claude-3-5-sonnet-latest'tomodel: 'claude-3-5-sonnet-20241022'as anytype assertion from ChatAnthropic config (now validates cleanly with correct v0.3 types)clients.spec.tsto checkconfig.modelproperty with correct identifiersCopilot Review Triage
Deferred follow-ups
None. This PR fully resolves issue #134.