Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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
27 changes: 23 additions & 4 deletions packages/ai-providers/server-ai-langchain/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,33 @@
"type": "git",
"url": "https://github.com/launchdarkly/js-core.git"
},
"main": "dist/index.js",
"types": "dist/index.d.ts",
"type": "commonjs",
"main": "./dist/index.cjs",
"module": "./dist/index.js",
"types": "./dist/index.d.ts",
"type": "module",
"exports": {
".": {
"require": {
"types": "./dist/index.d.cts",
"default": "./dist/index.cjs"
},
"import": {
"types": "./dist/index.d.ts",
"default": "./dist/index.js"
}
}
},
"scripts": {
"build": "npx tsc",
"build": "tsup-node",
"lint": "npx eslint . --ext .ts",
"prettier": "prettier --write '**/*.@(js|ts|tsx|json|css)' --ignore-path ../../../.prettierignore",
"lint:fix": "yarn run lint --fix",
"check": "yarn prettier && yarn lint && yarn build && yarn test",
"test": "jest"
},
"files": [
"dist"
],
"keywords": [
"launchdarkly",
"ai",
Expand All @@ -27,6 +43,7 @@
"author": "LaunchDarkly",
"license": "Apache-2.0",
"devDependencies": {
"@langchain/community": "^0.3.0",
"@langchain/core": "^0.3.0",
"@launchdarkly/server-sdk-ai": "^0.14.1",
"@trivago/prettier-plugin-sort-imports": "^4.1.1",
Expand All @@ -44,9 +61,11 @@
"langchain": "^0.3.0",
"prettier": "^3.0.0",
"ts-jest": "^29.1.1",
"tsup": "^8.5.1",
"typescript": "5.1.6"
},
"peerDependencies": {
"@langchain/community": "^0.2.0 || ^0.3.0",
Copy link
Contributor Author

@jsonbailey jsonbailey Nov 19, 2025

Choose a reason for hiding this comment

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

The community packages are nested (@langchain/community/chat_models/fireworks vs @langchain/aws) which causes runtime compile errors in Next.js when trying to load our langchain package. It's possible when we upgrade to langchain v1 this issue might go away but I was not able to get it to load without this additional dependency, even if it is not being used.

"@langchain/core": "^0.2.0 || ^0.3.0",
"@launchdarkly/server-sdk-ai": "^0.14.0",
"langchain": "^0.2.0 || ^0.3.0"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": "./tsconfig.json",
"include": ["/**/*.ts"],
"include": ["**/*.ts", "**/*.js"],
"exclude": ["node_modules"]
}
2 changes: 1 addition & 1 deletion packages/ai-providers/server-ai-langchain/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"compilerOptions": {
"target": "ES2020",
"module": "CommonJS",
"module": "ES2020",
"lib": ["ES2020"],
"moduleResolution": "node",
"esModuleInterop": true,
Expand Down
14 changes: 14 additions & 0 deletions packages/ai-providers/server-ai-langchain/tsup.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// It is a dev dependency and the linter doesn't understand.
// eslint-disable-next-line import/no-extraneous-dependencies
import { defineConfig } from 'tsup';

export default defineConfig({
entry: {
index: 'src/index.ts',
},
format: ['esm', 'cjs'],
splitting: false,
sourcemap: true,
clean: true,
dts: true,
});
25 changes: 21 additions & 4 deletions packages/ai-providers/server-ai-openai/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,33 @@
"type": "git",
"url": "https://github.com/launchdarkly/js-core.git"
},
"main": "dist/index.js",
"types": "dist/index.d.ts",
"type": "commonjs",
"main": "./dist/index.cjs",
"module": "./dist/index.js",
"types": "./dist/index.d.ts",
"type": "module",
"exports": {
".": {
"require": {
"types": "./dist/index.d.cts",
"default": "./dist/index.cjs"
},
"import": {
"types": "./dist/index.d.ts",
"default": "./dist/index.js"
}
}
},
"scripts": {
"build": "npx tsc",
"build": "tsup-node",
"lint": "npx eslint . --ext .ts",
"prettier": "prettier --write '**/*.@(js|ts|tsx|json|css)' --ignore-path ../../../.prettierignore",
"lint:fix": "yarn run lint --fix",
"check": "yarn prettier && yarn lint && yarn build && yarn test",
"test": "jest"
},
"files": [
"dist"
],
"keywords": [
"launchdarkly",
"ai",
Expand All @@ -44,6 +60,7 @@
"openai": "^6.0.0",
"prettier": "^3.0.0",
"ts-jest": "^29.1.1",
"tsup": "^8.5.1",
"typescript": "5.1.6"
},
"peerDependencies": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": "./tsconfig.json",
"include": ["/**/*.ts"],
"include": ["**/*.ts", "**/*.js"],
"exclude": ["node_modules"]
}
2 changes: 1 addition & 1 deletion packages/ai-providers/server-ai-openai/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"compilerOptions": {
"target": "ES2020",
"module": "CommonJS",
"module": "ES2020",
"lib": ["ES2020"],
"moduleResolution": "node",
"esModuleInterop": true,
Expand Down
14 changes: 14 additions & 0 deletions packages/ai-providers/server-ai-openai/tsup.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// It is a dev dependency and the linter doesn't understand.
// eslint-disable-next-line import/no-extraneous-dependencies
import { defineConfig } from 'tsup';

export default defineConfig({
entry: {
index: 'src/index.ts',
},
format: ['esm', 'cjs'],
splitting: false,
sourcemap: true,
clean: true,
dts: true,
});
25 changes: 21 additions & 4 deletions packages/ai-providers/server-ai-vercel/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,33 @@
"type": "git",
"url": "https://github.com/launchdarkly/js-core.git"
},
"main": "dist/index.js",
"types": "dist/index.d.ts",
"type": "commonjs",
"main": "./dist/index.cjs",
"module": "./dist/index.js",
"types": "./dist/index.d.ts",
"type": "module",
"exports": {
".": {
"require": {
"types": "./dist/index.d.cts",
"default": "./dist/index.cjs"
},
"import": {
"types": "./dist/index.d.ts",
"default": "./dist/index.js"
}
}
},
"scripts": {
"build": "npx tsc",
"build": "tsup-node",
"lint": "npx eslint . --ext .ts",
"prettier": "prettier --write '**/*.@(js|ts|tsx|json|css)' --ignore-path ../../../.prettierignore",
"lint:fix": "yarn run lint --fix",
"check": "yarn prettier && yarn lint && yarn build && yarn test",
"test": "jest"
},
"files": [
"dist"
],
"keywords": [
"launchdarkly",
"ai",
Expand Down Expand Up @@ -48,6 +64,7 @@
"jest": "^29.6.1",
"prettier": "^3.0.0",
"ts-jest": "^29.1.1",
"tsup": "^8.5.1",
"typescript": "5.1.6"
},
"peerDependencies": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": "./tsconfig.json",
"include": ["/**/*.ts"],
"include": ["**/*.ts", "**/*.js"],
"exclude": ["node_modules"]
}
2 changes: 1 addition & 1 deletion packages/ai-providers/server-ai-vercel/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"compilerOptions": {
"target": "ES2020",
"module": "CommonJS",
"module": "ES2020",
"lib": ["ES2020"],
"moduleResolution": "node",
"esModuleInterop": true,
Expand Down
14 changes: 14 additions & 0 deletions packages/ai-providers/server-ai-vercel/tsup.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// It is a dev dependency and the linter doesn't understand.
// eslint-disable-next-line import/no-extraneous-dependencies
import { defineConfig } from 'tsup';

export default defineConfig({
entry: {
index: 'src/index.ts',
},
format: ['esm', 'cjs'],
splitting: false,
sourcemap: true,
clean: true,
dts: true,
});
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { LDContext } from '@launchdarkly/js-server-sdk-common';

import { name as aiSdkName, version as aiSdkVersion } from '../package.json';
import { LDFeedbackKind } from '../src/api/metrics';
import { LDAIConfigTrackerImpl } from '../src/LDAIConfigTrackerImpl';
import { LDClientMin } from '../src/LDClientMin';
import { aiSdkName, aiSdkVersion } from '../src/sdkInfo';

const mockTrack = jest.fn();
const mockVariation = jest.fn();
Expand Down
25 changes: 21 additions & 4 deletions packages/sdk/server-ai/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,33 @@
"type": "git",
"url": "https://github.com/launchdarkly/js-core.git"
},
"main": "dist/src/index.js",
"types": "dist/src/index.d.ts",
"type": "commonjs",
"main": "./dist/index.cjs",
"module": "./dist/index.js",
"types": "./dist/index.d.ts",
"type": "module",
"exports": {
".": {
"require": {
"types": "./dist/index.d.cts",
"default": "./dist/index.cjs"
},
"import": {
"types": "./dist/index.d.ts",
"default": "./dist/index.js"
}
}
},
"scripts": {
"build": "npx tsc",
"build": "tsup-node",
"lint": "npx eslint . --ext .ts",
"prettier": "prettier --write '**/*.@(js|ts|tsx|json|css)' --ignore-path ../../../.prettierignore",
"lint:fix": "yarn run lint --fix",
"check": "yarn prettier && yarn lint && yarn build && yarn test",
"test": "jest"
},
"files": [
"dist"
],
"keywords": [
"launchdarkly",
"ai",
Expand Down Expand Up @@ -45,6 +61,7 @@
"jest": "^29.6.1",
"prettier": "^3.0.0",
"ts-jest": "^29.1.1",
"tsup": "^8.5.1",
"typescript": "5.1.6"
},
"peerDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/sdk/server-ai/src/LDAIClientImpl.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as Mustache from 'mustache';
import Mustache from 'mustache';

import { LDContext, LDLogger } from '@launchdarkly/js-server-sdk-common';

Expand Down
2 changes: 1 addition & 1 deletion packages/sdk/server-ai/src/LDAIConfigTrackerImpl.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { LDContext } from '@launchdarkly/js-server-sdk-common';

import { name as aiSdkName, version as aiSdkVersion } from '../package.json';
import { LDAIConfigTracker } from './api/config';
import { LDAIMetricSummary } from './api/config/LDAIConfigTracker';
import { EvalScore, JudgeResponse } from './api/judge/types';
Expand All @@ -13,6 +12,7 @@ import {
LDTokenUsage,
} from './api/metrics';
import { LDClientMin } from './LDClientMin';
import { aiSdkName, aiSdkVersion } from './sdkInfo';

export class LDAIConfigTrackerImpl implements LDAIConfigTracker {
private _trackedMetrics: LDAIMetricSummary = {};
Expand Down
2 changes: 1 addition & 1 deletion packages/sdk/server-ai/src/api/judge/Judge.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as Mustache from 'mustache';
import Mustache from 'mustache';

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

Expand Down
Loading
Loading