@launchdarkly/server-sdk-ai 0.19.1 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +67 -0
- package/README.md +13 -16
- package/dist/index.cjs +617 -478
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +680 -443
- package/dist/index.d.ts +680 -443
- package/dist/index.js +613 -473
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,72 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [1.0.0](https://github.com/launchdarkly/js-core/compare/server-sdk-ai-v0.20.0...server-sdk-ai-v1.0.0) (2026-05-19)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### ⚠ BREAKING CHANGES
|
|
7
|
+
|
|
8
|
+
* Remove bedrock-specific tracker method ([#1385](https://github.com/launchdarkly/js-core/issues/1385))
|
|
9
|
+
* Remove `LDAIClient.agent` — use `LDAIClient.agentConfig` instead
|
|
10
|
+
* Remove `LDAIClient.agents` — use `LDAIClient.agentConfigs` instead
|
|
11
|
+
* Remove `LDAIClient.createChat` — use `LDAIClient.createModel` instead
|
|
12
|
+
* Remove `LDAIClient.initChat` — use `LDAIClient.createModel` instead
|
|
13
|
+
* Remove `ChatResponse` type and the `api/chat` module — use `RunnerResult` from `api/model` instead
|
|
14
|
+
* Change `Judge.evaluateMessages` parameter type from `ChatResponse` to `RunnerResult` (method retained per AI SDK spec Requirement 1.1.3)
|
|
15
|
+
* Remove `evaluationMetricKeys` (plural) field from `LDAIJudgeConfig` and `LDAIJudgeConfigDefault` — use `evaluationMetricKey` (singular) instead
|
|
16
|
+
* Remove `LDAIConfigTracker.trackOpenAIMetrics` — use `tracker.trackMetricsOf(getAIMetricsFromResponse, fn)` from `@launchdarkly/server-sdk-ai-openai` instead
|
|
17
|
+
* Remove `LDAIConfigTracker.trackVercelAISDKGenerateTextMetrics` — use `tracker.trackMetricsOf(getAIMetricsFromResponse, fn)` from `@launchdarkly/server-sdk-ai-vercel` instead
|
|
18
|
+
* Remove `createOpenAiUsage` helper — use `getAIMetricsFromResponse` from `@launchdarkly/server-sdk-ai-openai` instead
|
|
19
|
+
* Remove `createVercelAISDKTokenUsage` helper — use `getAIMetricsFromResponse` from `@launchdarkly/server-sdk-ai-vercel` instead
|
|
20
|
+
* Remove `LDAIClient.config` — use `LDAIClient.completionConfig` instead
|
|
21
|
+
|
|
22
|
+
### Features
|
|
23
|
+
|
|
24
|
+
* Change `Judge.evaluateMessages` parameter type from `ChatResponse` to `RunnerResult` (method retained per AI SDK spec Requirement 1.1.3) ([86951b0](https://github.com/launchdarkly/js-core/commit/86951b0f66eed3f374d06c40e858dca04a837fda))
|
|
25
|
+
* Remove `ChatResponse` type and the `api/chat` module — use `RunnerResult` from `api/model` instead ([86951b0](https://github.com/launchdarkly/js-core/commit/86951b0f66eed3f374d06c40e858dca04a837fda))
|
|
26
|
+
* Remove `createOpenAiUsage` helper — use `getAIMetricsFromResponse` from `@launchdarkly/server-sdk-ai-openai` instead ([86951b0](https://github.com/launchdarkly/js-core/commit/86951b0f66eed3f374d06c40e858dca04a837fda))
|
|
27
|
+
* Remove `createVercelAISDKTokenUsage` helper — use `getAIMetricsFromResponse` from `@launchdarkly/server-sdk-ai-vercel` instead ([86951b0](https://github.com/launchdarkly/js-core/commit/86951b0f66eed3f374d06c40e858dca04a837fda))
|
|
28
|
+
* Remove `evaluationMetricKeys` (plural) field from `LDAIJudgeConfig` and `LDAIJudgeConfigDefault` — use `evaluationMetricKey` (singular) instead ([86951b0](https://github.com/launchdarkly/js-core/commit/86951b0f66eed3f374d06c40e858dca04a837fda))
|
|
29
|
+
* Remove `LDAIClient.agent` — use `LDAIClient.agentConfig` instead ([86951b0](https://github.com/launchdarkly/js-core/commit/86951b0f66eed3f374d06c40e858dca04a837fda))
|
|
30
|
+
* Remove `LDAIClient.agents` — use `LDAIClient.agentConfigs` instead ([86951b0](https://github.com/launchdarkly/js-core/commit/86951b0f66eed3f374d06c40e858dca04a837fda))
|
|
31
|
+
* Remove `LDAIClient.config` — use `LDAIClient.completionConfig` instead ([86951b0](https://github.com/launchdarkly/js-core/commit/86951b0f66eed3f374d06c40e858dca04a837fda))
|
|
32
|
+
* Remove `LDAIClient.createChat` — use `LDAIClient.createModel` instead ([86951b0](https://github.com/launchdarkly/js-core/commit/86951b0f66eed3f374d06c40e858dca04a837fda))
|
|
33
|
+
* Remove `LDAIClient.initChat` — use `LDAIClient.createModel` instead ([86951b0](https://github.com/launchdarkly/js-core/commit/86951b0f66eed3f374d06c40e858dca04a837fda))
|
|
34
|
+
* Remove `LDAIConfigTracker.trackOpenAIMetrics` — use `tracker.trackMetricsOf(getAIMetricsFromResponse, fn)` from `@launchdarkly/server-sdk-ai-openai` instead ([86951b0](https://github.com/launchdarkly/js-core/commit/86951b0f66eed3f374d06c40e858dca04a837fda))
|
|
35
|
+
* Remove `LDAIConfigTracker.trackVercelAISDKGenerateTextMetrics` — use `tracker.trackMetricsOf(getAIMetricsFromResponse, fn)` from `@launchdarkly/server-sdk-ai-vercel` instead ([86951b0](https://github.com/launchdarkly/js-core/commit/86951b0f66eed3f374d06c40e858dca04a837fda))
|
|
36
|
+
* Remove bedrock-specific tracker method ([#1385](https://github.com/launchdarkly/js-core/issues/1385)) ([f7dbee8](https://github.com/launchdarkly/js-core/commit/f7dbee806a15e8b9d5a6b7b49a461e16e5e757fe))
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
### Bug Fixes
|
|
40
|
+
|
|
41
|
+
* Make judge runners non-multi-turn ([#1383](https://github.com/launchdarkly/js-core/issues/1383)) ([3d8f488](https://github.com/launchdarkly/js-core/commit/3d8f488354a5ed590859c7fe96429a2ab9f79c01))
|
|
42
|
+
* Move ManagedAgentGraph alongside other managed types ([#1384](https://github.com/launchdarkly/js-core/issues/1384)) ([22dd76d](https://github.com/launchdarkly/js-core/commit/22dd76d61a830d7ad37ae0136b59d1971973b424))
|
|
43
|
+
|
|
44
|
+
## [0.20.0](https://github.com/launchdarkly/js-core/compare/server-sdk-ai-v0.19.1...server-sdk-ai-v0.20.0) (2026-05-07)
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
### ⚠ BREAKING CHANGES
|
|
48
|
+
|
|
49
|
+
* Rename LDAIMetrics.usage and LDAIGraphMetrics.usage to .tokens ([#1366](https://github.com/launchdarkly/js-core/issues/1366))
|
|
50
|
+
* Remove AIProvider deprecated methods and create*/init* aliases (AIC-2388) ([#1363](https://github.com/launchdarkly/js-core/issues/1363))
|
|
51
|
+
* Build judge input as string and strip legacy judge config messages ([#1364](https://github.com/launchdarkly/js-core/issues/1364))
|
|
52
|
+
* Use LDAIGraphMetricSummary for graph metric summary ([#1362](https://github.com/launchdarkly/js-core/issues/1362))
|
|
53
|
+
|
|
54
|
+
### Features
|
|
55
|
+
|
|
56
|
+
* add Evaluator class for judge orchestration ([#1331](https://github.com/launchdarkly/js-core/issues/1331)) ([54faa69](https://github.com/launchdarkly/js-core/commit/54faa69aa28333f92d943de79307611fc05e2cbe))
|
|
57
|
+
* add ManagedAgent with evaluations support ([#1334](https://github.com/launchdarkly/js-core/issues/1334)) ([7f09c46](https://github.com/launchdarkly/js-core/commit/7f09c46cdec808ce9ebeb6487e6a2fa4fc817cbc))
|
|
58
|
+
* add ManagedGraphResult, GraphMetricSummary, and ManagedAgentGraph ([#1335](https://github.com/launchdarkly/js-core/issues/1335)) ([09fa1db](https://github.com/launchdarkly/js-core/commit/09fa1dbb134ea43ab8664b5e7903eb85883a0ac2))
|
|
59
|
+
* introduce ManagedResult, RunnerResult, and LDAIMetricSummary ([#1332](https://github.com/launchdarkly/js-core/issues/1332)) ([5040122](https://github.com/launchdarkly/js-core/commit/5040122a5c6de88691820f02528550b983a14e58))
|
|
60
|
+
* Remove AIProvider deprecated methods and create*/init* aliases (AIC-2388) ([#1363](https://github.com/launchdarkly/js-core/issues/1363)) ([ad66314](https://github.com/launchdarkly/js-core/commit/ad66314e403b83976987c54da9c6c70308c25078))
|
|
61
|
+
* Rename LDAIMetrics.usage and LDAIGraphMetrics.usage to .tokens ([#1366](https://github.com/launchdarkly/js-core/issues/1366)) ([ff932b7](https://github.com/launchdarkly/js-core/commit/ff932b74c10307519dc9f913a4330a5b7d79438d))
|
|
62
|
+
* Replace OpenAIProvider with Runner protocol implementation (AIC-2388) ([#1337](https://github.com/launchdarkly/js-core/issues/1337)) ([e32a955](https://github.com/launchdarkly/js-core/commit/e32a955c583db1bc382e2e0f3f459d459bc35984))
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
### Bug Fixes
|
|
66
|
+
|
|
67
|
+
* Build judge input as string and strip legacy judge config messages ([#1364](https://github.com/launchdarkly/js-core/issues/1364)) ([c90034b](https://github.com/launchdarkly/js-core/commit/c90034b58a3b75d92269e7c485f38f1266208f08))
|
|
68
|
+
* Use LDAIGraphMetricSummary for graph metric summary ([#1362](https://github.com/launchdarkly/js-core/issues/1362)) ([76a4bf2](https://github.com/launchdarkly/js-core/commit/76a4bf278999c81b27ce1aa29a3c1cb42e113fbc))
|
|
69
|
+
|
|
3
70
|
## [0.19.1](https://github.com/launchdarkly/js-core/compare/server-sdk-ai-v0.19.0...server-sdk-ai-v0.19.1) (2026-05-06)
|
|
4
71
|
|
|
5
72
|
|
package/README.md
CHANGED
|
@@ -79,37 +79,34 @@ if (aiConfig.enabled) {
|
|
|
79
79
|
}
|
|
80
80
|
```
|
|
81
81
|
|
|
82
|
-
##
|
|
82
|
+
## ManagedModel for Tracked Model Invocations
|
|
83
83
|
|
|
84
|
-
`
|
|
84
|
+
`ManagedModel` provides a high-level interface for invoking AI models with automatic metrics tracking and judge evaluation:
|
|
85
85
|
|
|
86
86
|
- Automatically configures models based on AI configuration
|
|
87
|
-
- Maintains conversation history across multiple interactions
|
|
88
87
|
- Automatically tracks token usage, latency, and success rates
|
|
88
|
+
- Runs configured judges asynchronously and reports their results
|
|
89
89
|
- Works with any supported AI provider (see [AI Providers](https://github.com/launchdarkly/js-core#ai-providers) for available packages)
|
|
90
90
|
|
|
91
|
-
### Using
|
|
91
|
+
### Using ManagedModel
|
|
92
92
|
|
|
93
93
|
```typescript
|
|
94
94
|
// Use the same defaultConfig from the retrieval section above
|
|
95
|
-
const
|
|
95
|
+
const model = await aiClient.createModel(
|
|
96
96
|
'customer-support-chat',
|
|
97
97
|
context,
|
|
98
98
|
defaultConfig,
|
|
99
99
|
{ customerName: 'John' }
|
|
100
100
|
);
|
|
101
101
|
|
|
102
|
-
if (
|
|
103
|
-
//
|
|
104
|
-
const
|
|
105
|
-
console.log(
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
// Access conversation history
|
|
111
|
-
const messages = chat.getMessages();
|
|
112
|
-
console.log(`Conversation has ${messages.length} messages`);
|
|
102
|
+
if (model) {
|
|
103
|
+
// Metrics are automatically tracked by run()
|
|
104
|
+
const result = await model.run('I need help with my order');
|
|
105
|
+
console.log(result.content);
|
|
106
|
+
|
|
107
|
+
// Judge evaluations run asynchronously; await if you need their results
|
|
108
|
+
const evals = await result.evaluations;
|
|
109
|
+
console.log('Judge results:', evals);
|
|
113
110
|
}
|
|
114
111
|
```
|
|
115
112
|
|