Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions packages/ai-providers/server-ai-langchain/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,10 @@
"author": "LaunchDarkly",
"license": "Apache-2.0",
"dependencies": {
"@langchain/core": ">=0.2.21 <0.3.0",
"@launchdarkly/server-sdk-ai": "^0.12.1",
"langchain": "^0.2.11"
"@launchdarkly/server-sdk-ai": "^0.12.1"
},
"devDependencies": {
"@launchdarkly/js-server-sdk-common": "2.16.2",
"@langchain/core": "^0.3.0",
"@trivago/prettier-plugin-sort-imports": "^4.1.1",
"@types/jest": "^29.5.3",
"@typescript-eslint/eslint-plugin": "^6.20.0",
Expand All @@ -45,11 +43,13 @@
"eslint-plugin-jest": "^27.6.3",
"eslint-plugin-prettier": "^5.0.0",
"jest": "^29.6.1",
"langchain": "^0.3.0",
"prettier": "^3.0.0",
"ts-jest": "^29.1.1",
"typescript": "5.1.6"
},
"peerDependencies": {
"@launchdarkly/js-server-sdk-common": "2.x"
"@langchain/core": "^0.2.0 || ^0.3.0",
"langchain": "^0.2.0 || ^0.3.0"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Mismatched Dependency Versions Cause Compatibility Issues

devDependencies specify newer versions (openai v6, langchain v0.3.0) than peerDependencies require (openai v4, langchain v0.2.0). This means the code is developed and tested against different major/minor versions than consumers are expected to provide, which could lead to runtime failures or compatibility issues due to breaking changes.

Additional Locations (1)

Fix in Cursor Fix in Web

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't seem accurate. It looks like this is mixing up the results of multiple package.json files in this pr as this one doesn't use open ai. The issues have been addressed in the other files.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cursor review

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ import { BaseChatModel } from '@langchain/core/language_models/chat_models';
import { AIMessage, HumanMessage, SystemMessage } from '@langchain/core/messages';
import { initChatModel } from 'langchain/chat_models/universal';

import { LDLogger } from '@launchdarkly/js-server-sdk-common';
import {
AIProvider,
ChatResponse,
LDAIConfig,
LDAIMetrics,
LDLogger,
LDMessage,
LDTokenUsage,
} from '@launchdarkly/server-sdk-ai';
Expand Down
6 changes: 3 additions & 3 deletions packages/ai-providers/server-ai-openai/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@
"author": "LaunchDarkly",
"license": "Apache-2.0",
"dependencies": {
"@launchdarkly/server-sdk-ai": "^0.12.1",
"openai": "^4.0.0"
"@launchdarkly/server-sdk-ai": "^0.12.1"
},
"devDependencies": {
"@launchdarkly/js-server-sdk-common": "2.16.2",
Expand All @@ -44,11 +43,12 @@
"eslint-plugin-jest": "^27.6.3",
"eslint-plugin-prettier": "^5.0.0",
"jest": "^29.6.1",
"openai": "^6.0.0",
"prettier": "^3.0.0",
"ts-jest": "^29.1.1",
"typescript": "5.1.6"
},
"peerDependencies": {
"@launchdarkly/js-server-sdk-common": "2.x"
"openai": "^4.0.0"
}
}
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { OpenAI } from 'openai';

import { LDLogger } from '@launchdarkly/js-server-sdk-common';
import {
AIProvider,
ChatResponse,
LDAIConfig,
LDAIMetrics,
LDLogger,
LDMessage,
LDTokenUsage,
} from '@launchdarkly/server-sdk-ai';
Expand Down
16 changes: 5 additions & 11 deletions packages/ai-providers/server-ai-vercel/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,28 +27,21 @@
"author": "LaunchDarkly",
"license": "Apache-2.0",
"dependencies": {
"@ai-sdk/provider": "^2.0.0",
"@launchdarkly/server-sdk-ai": "^0.12.1",
"ai": "^5.0.0"
},
"optionalDependencies": {
"@ai-sdk/anthropic": "^2.0.0",
"@ai-sdk/cohere": "^2.0.0",
"@ai-sdk/google": "^2.0.0",
"@ai-sdk/mistral": "^2.0.0",
"@ai-sdk/openai": "^2.0.0"
"@launchdarkly/server-sdk-ai": "^0.12.1"
},
"devDependencies": {
"@ai-sdk/anthropic": "^2.0.0",
"@ai-sdk/cohere": "^2.0.0",
"@ai-sdk/google": "^2.0.0",
"@ai-sdk/mistral": "^2.0.0",
"@ai-sdk/openai": "^2.0.0",
"@ai-sdk/provider": "^2.0.0",
"@launchdarkly/js-server-sdk-common": "2.16.2",
"@trivago/prettier-plugin-sort-imports": "^4.1.1",
"@types/jest": "^29.5.3",
"@typescript-eslint/eslint-plugin": "^6.20.0",
"@typescript-eslint/parser": "^6.20.0",
"ai": "^5.0.0",
"eslint": "^8.45.0",
"eslint-config-airbnb-base": "^15.0.0",
"eslint-config-airbnb-typescript": "^17.1.0",
Expand All @@ -62,6 +55,7 @@
"typescript": "5.1.6"
},
"peerDependencies": {
"@launchdarkly/js-server-sdk-common": "2.x"
"@ai-sdk/provider": "^2.0.0",
"ai": "^4.0.0 || ^5.0.0"
}
}
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { LanguageModelV2 } from '@ai-sdk/provider';
import { generateText } from 'ai';

import { LDLogger } from '@launchdarkly/js-server-sdk-common';
import {
AIProvider,
ChatResponse,
LDAIConfig,
LDAIMetrics,
LDLogger,
LDMessage,
LDTokenUsage,
} from '@launchdarkly/server-sdk-ai';
Expand Down Expand Up @@ -136,7 +136,7 @@
switch (providerName) {
case 'openai':
try {
const { openai } = await import('@ai-sdk/openai');

Check failure on line 139 in packages/ai-providers/server-ai-vercel/src/VercelProvider.ts

View workflow job for this annotation

GitHub Actions / build-test-vercel-provider

'@ai-sdk/openai' should be listed in the project's dependencies, not devDependencies
return openai(modelName);
} catch (error) {
throw new Error(`Failed to load @ai-sdk/openai: ${error}`);
Expand Down
2 changes: 2 additions & 0 deletions packages/sdk/server-ai/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,6 @@ export function initAi(ldClient: LDClientMin): LDAIClient {
return new LDAIClientImpl(ldClient);
}

export { LDLogger } from '@launchdarkly/js-server-sdk-common';

export * from './api';
Loading