-
Notifications
You must be signed in to change notification settings - Fork 1
chore(deps): upgrade langchain dependencies to v1.x #18
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?
Changes from 7 commits
a366d8d
c3eb683
4748c8a
374d283
9fa902b
e60862d
ecaadeb
a21eafb
86c9447
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -41,6 +41,10 @@ | |
| "type": "./dist/sub-modules/providers/groq/index.d.ts", | ||
| "default": "./dist/sub-modules/providers/groq/index.js" | ||
| }, | ||
| "./openrouter": { | ||
| "type": "./dist/sub-modules/providers/openrouter/index.d.ts", | ||
| "default": "./dist/sub-modules/providers/openrouter/index.js" | ||
| }, | ||
| "./pg": { | ||
| "type": "./dist/sub-modules/providers/pg/index.d.ts", | ||
| "default": "./dist/sub-modules/providers/pg/index.js" | ||
|
|
@@ -77,6 +81,9 @@ | |
| "groq": [ | ||
| "dist/sub-modules/providers/groq/index.d.ts" | ||
| ], | ||
| "openrouter": [ | ||
| "dist/sub-modules/providers/openrouter/index.d.ts" | ||
| ], | ||
| "pg": [ | ||
| "dist/sub-modules/providers/pg/index.d.ts" | ||
| ], | ||
|
|
@@ -124,59 +131,61 @@ | |
| "!*/__tests__" | ||
| ], | ||
| "peerDependencies": { | ||
| "@loopback/core": "^6.1.11" | ||
| "@loopback/core": "^7.0.11" | ||
| }, | ||
| "dependencies": { | ||
| "@langchain/community": "^0.3.50", | ||
| "@langchain/core": "^0.3.80", | ||
| "@langchain/langgraph": "^0.4.4", | ||
| "@loopback/repository": "^7.0.14", | ||
| "@sourceloop/chat-service": "15.0.3", | ||
| "@sourceloop/core": "17.0.3", | ||
| "@sourceloop/file-utils": "0.3.7", | ||
| "langchain": "^0.3.37", | ||
| "loopback4-authentication": "^12.2.0", | ||
| "loopback4-authorization": "^7.0.3", | ||
| "tslib": "^2.8.0", | ||
| "winston": "^3.15.0" | ||
| "@langchain/community": "^1.1.27", | ||
| "@langchain/core": "^1.1.40", | ||
| "@langchain/langgraph": "^1.2.8", | ||
| "@loopback/repository": "^8.0.11", | ||
| "@loopback/sequelize": "^0.8.8", | ||
| "@sourceloop/chat-service": "^17.0.6", | ||
| "@sourceloop/core": "^20.0.6", | ||
| "@sourceloop/file-utils": "^0.5.6", | ||
| "langchain": "^1.3.3", | ||
| "loopback4-authentication": "^13.0.4", | ||
| "loopback4-authorization": "^8.1.3", | ||
| "tslib": "^2.8.1", | ||
| "winston": "^3.19.0" | ||
| }, | ||
| "devDependencies": { | ||
| "@commitlint/cli": "^19.8.1", | ||
| "@commitlint/config-conventional": "^16.2.1", | ||
| "@commitlint/cli": "^20.5.0", | ||
| "@commitlint/config-conventional": "^20.5.0", | ||
| "@google/generative-ai": "^0.24.1", | ||
| "@istanbuljs/nyc-config-typescript": "^1.0.2", | ||
| "@langchain/anthropic": "^0.3.26", | ||
| "@langchain/aws": "^0.1.13", | ||
| "@langchain/cerebras": "^0.0.2", | ||
| "@langchain/google-genai": "^0.2.16", | ||
| "@langchain/groq": "^0.2.3", | ||
| "@langchain/ollama": "^0.2.3", | ||
| "@langchain/openai": "^0.6.11", | ||
| "@langfuse/core": "^4.4.2", | ||
| "@langfuse/langchain": "^4.4.2", | ||
| "@loopback/build": "^11.0.9", | ||
| "@loopback/eslint-config": "^15.0.5", | ||
| "@loopback/testlab": "^7.0.9", | ||
| "@langchain/anthropic": "^1.3.26", | ||
| "@langchain/aws": "^1.3.5", | ||
| "@langchain/cerebras": "^1.0.4", | ||
| "@langchain/google-genai": "^2.1.27", | ||
| "@langchain/groq": "^1.2.0", | ||
| "@langchain/ollama": "^1.2.6", | ||
| "@langchain/openai": "^1.4.4", | ||
| "@langchain/openrouter": "^0.2.2", | ||
| "@langfuse/core": "^5.1.0", | ||
| "@langfuse/langchain": "^5.1.0", | ||
| "@loopback/build": "^12.0.11", | ||
| "@loopback/eslint-config": "^16.0.1", | ||
| "@loopback/testlab": "^8.0.11", | ||
| "@semantic-release/changelog": "^6.0.3", | ||
| "@semantic-release/commit-analyzer": "^13.0.1", | ||
| "@semantic-release/git": "^10.0.1", | ||
| "@semantic-release/github": "^12.0.1", | ||
| "@semantic-release/npm": "^13.1.1", | ||
| "@semantic-release/release-notes-generator": "^14.0.3", | ||
| "@types/dotenv": "^8.2.0", | ||
| "@semantic-release/github": "^12.0.6", | ||
| "@semantic-release/npm": "^13.1.5", | ||
| "@semantic-release/release-notes-generator": "^14.1.0", | ||
| "@types/dotenv": "^8.2.3", | ||
| "@types/jsonwebtoken": "^9.0.10", | ||
| "@types/node": "^20.16.14", | ||
| "@types/node": "^25.6.0", | ||
| "commitizen": "^4.3.1", | ||
| "cz-format-extension": "1.5.0", | ||
| "cz-format-extension": "1.6.0", | ||
| "db-migrate": "^1.0.0-beta.21", | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why these are not upgraded... |
||
| "dotenv": "^16.6.1", | ||
| "eslint": "^8.57.1", | ||
| "husky": "^9.1.7", | ||
| "jsonwebtoken": "^9.0.2", | ||
| "jsonwebtoken": "^9.0.3", | ||
| "loopback-connector-sqlite3": "^3.0.0", | ||
| "mochawesome": "^7.1.3", | ||
| "pg": "^8.16.3", | ||
| "semantic-release": "^25.0.1", | ||
| "mochawesome": "^7.1.4", | ||
| "pg": "^8.20.0", | ||
| "semantic-release": "^25.0.3", | ||
| "source-map-support": "^0.5.21", | ||
| "ts-node": "^10.9.2", | ||
| "typescript": "^5.6.3" | ||
|
|
@@ -186,7 +195,7 @@ | |
| "jws": "3.2.3", | ||
| "node-forge": "1.4.0", | ||
| "validator": "13.15.22", | ||
| "axios": "1.13.6", | ||
| "axios": "1.15.0", | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. caret missing
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this is inside overrides |
||
| "fast-xml-parser": "5.5.8", | ||
| "simple-git": "3.33.0", | ||
| "flatted": "3.4.2", | ||
|
|
@@ -197,6 +206,12 @@ | |
| "tar": "7.5.12", | ||
| "minimatch": "10.2.4", | ||
| "undici": "6.24.1", | ||
| "@loopback/context": { | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why these overrides are needed ? |
||
| "uuid": "^9.0.1" | ||
| }, | ||
| "@sourceloop/file-utils": { | ||
| "@loopback/context": "7.0.14" | ||
| }, | ||
| "swagger-stats": { | ||
| "send": "^1.1.0" | ||
| }, | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| export * from './llms'; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| export * from './openrouter.provider'; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| import {Provider} from '@loopback/core'; | ||
| import {ChatOpenRouter} from '@langchain/openrouter'; | ||
| import {LLMProvider} from '../../../../types'; | ||
| import {OpenRouterInstanceConfig} from '../types'; | ||
|
|
||
| export class OpenRouter implements Provider<LLMProvider> { | ||
| static createInstance(config: OpenRouterInstanceConfig): ChatOpenRouter { | ||
| return new ChatOpenRouter({ | ||
| model: config.model, | ||
| ...config.config, | ||
| }); | ||
| } | ||
| value(): LLMProvider { | ||
| if (!process.env.OPENROUTER_MODEL || !process.env.OPENROUTER_API_KEY) { | ||
| throw new Error( | ||
| 'OPENROUTER_MODEL and OPENROUTER_API_KEY environment variables must be set.', | ||
| ); | ||
| } | ||
| return OpenRouter.createInstance({ | ||
| model: process.env.OPENROUTER_MODEL, | ||
| config: { | ||
| apiKey: process.env.OPENROUTER_API_KEY, | ||
| temperature: Number.parseFloat( | ||
| process.env.OPENROUTER_TEMPERATURE ?? '0', | ||
| ), | ||
| baseURL: process.env.OPENROUTER_BASE_URL, | ||
| }, | ||
| }); | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| import {ChatOpenRouterInput} from '@langchain/openrouter'; | ||
|
|
||
| export type OpenRouterInstanceConfig = { | ||
| model: string; | ||
| config: Omit<ChatOpenRouterInput, 'model'>; | ||
| }; |
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.
caret is missing here as well