@launchdarkly/server-sdk-ai 0.19.1 → 0.20.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 CHANGED
@@ -1,5 +1,31 @@
1
1
  # Changelog
2
2
 
3
+ ## [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)
4
+
5
+
6
+ ### ⚠ BREAKING CHANGES
7
+
8
+ * Rename LDAIMetrics.usage and LDAIGraphMetrics.usage to .tokens ([#1366](https://github.com/launchdarkly/js-core/issues/1366))
9
+ * Remove AIProvider deprecated methods and create*/init* aliases (AIC-2388) ([#1363](https://github.com/launchdarkly/js-core/issues/1363))
10
+ * Build judge input as string and strip legacy judge config messages ([#1364](https://github.com/launchdarkly/js-core/issues/1364))
11
+ * Use LDAIGraphMetricSummary for graph metric summary ([#1362](https://github.com/launchdarkly/js-core/issues/1362))
12
+
13
+ ### Features
14
+
15
+ * add Evaluator class for judge orchestration ([#1331](https://github.com/launchdarkly/js-core/issues/1331)) ([54faa69](https://github.com/launchdarkly/js-core/commit/54faa69aa28333f92d943de79307611fc05e2cbe))
16
+ * add ManagedAgent with evaluations support ([#1334](https://github.com/launchdarkly/js-core/issues/1334)) ([7f09c46](https://github.com/launchdarkly/js-core/commit/7f09c46cdec808ce9ebeb6487e6a2fa4fc817cbc))
17
+ * add ManagedGraphResult, GraphMetricSummary, and ManagedAgentGraph ([#1335](https://github.com/launchdarkly/js-core/issues/1335)) ([09fa1db](https://github.com/launchdarkly/js-core/commit/09fa1dbb134ea43ab8664b5e7903eb85883a0ac2))
18
+ * introduce ManagedResult, RunnerResult, and LDAIMetricSummary ([#1332](https://github.com/launchdarkly/js-core/issues/1332)) ([5040122](https://github.com/launchdarkly/js-core/commit/5040122a5c6de88691820f02528550b983a14e58))
19
+ * 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))
20
+ * 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))
21
+ * 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))
22
+
23
+
24
+ ### Bug Fixes
25
+
26
+ * 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))
27
+ * Use LDAIGraphMetricSummary for graph metric summary ([#1362](https://github.com/launchdarkly/js-core/issues/1362)) ([76a4bf2](https://github.com/launchdarkly/js-core/commit/76a4bf278999c81b27ce1aa29a3c1cb42e113fbc))
28
+
3
29
  ## [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
30
 
5
31
 
package/README.md CHANGED
@@ -79,37 +79,34 @@ if (aiConfig.enabled) {
79
79
  }
80
80
  ```
81
81
 
82
- ## TrackedChat for Conversational AI
82
+ ## ManagedModel for Tracked Model Invocations
83
83
 
84
- `TrackedChat` provides a high-level interface for conversational AI with automatic conversation management and metrics tracking:
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 TrackedChat
91
+ ### Using ManagedModel
92
92
 
93
93
  ```typescript
94
94
  // Use the same defaultConfig from the retrieval section above
95
- const chat = await aiClient.createChat(
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 (chat) {
103
- // Simple conversation flow - metrics are automatically tracked by invoke()
104
- const response1 = await chat.invoke('I need help with my order');
105
- console.log(response1.message.content);
106
-
107
- const response2 = await chat.invoke("What's the status?");
108
- console.log(response2.message.content);
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