@launchdarkly/server-sdk-ai 0.17.1 → 0.18.1

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/dist/index.d.cts CHANGED
@@ -383,6 +383,21 @@ interface LDProviderConfig {
383
383
  */
384
384
  name: string;
385
385
  }
386
+ /**
387
+ * Configuration for a single tool entry in the root-level tools map.
388
+ * Separate from model.parameters.tools[] which is the LLM-passable array.
389
+ */
390
+ interface LDTool {
391
+ name: string;
392
+ description?: string;
393
+ type?: string;
394
+ parameters?: {
395
+ [index: string]: unknown;
396
+ };
397
+ customParameters?: {
398
+ [index: string]: unknown;
399
+ };
400
+ }
386
401
  /**
387
402
  * Configuration for a single judge attachment.
388
403
  */
@@ -448,6 +463,12 @@ interface LDAIAgentConfigDefault extends LDAIConfigDefault {
448
463
  * References judge AI Configs that should evaluate this AI Config.
449
464
  */
450
465
  judgeConfiguration?: LDJudgeConfiguration;
466
+ /**
467
+ * Root-level tools map keyed by tool name. Distinct from model.parameters.tools[].
468
+ */
469
+ tools?: {
470
+ [toolName: string]: LDTool;
471
+ };
451
472
  }
452
473
  /**
453
474
  * Default Completion AI Config (default mode).
@@ -462,6 +483,12 @@ interface LDAICompletionConfigDefault extends LDAIConfigDefault {
462
483
  * References judge AI Configs that should evaluate this AI Config.
463
484
  */
464
485
  judgeConfiguration?: LDJudgeConfiguration;
486
+ /**
487
+ * Root-level tools map keyed by tool name. Distinct from model.parameters.tools[].
488
+ */
489
+ tools?: {
490
+ [toolName: string]: LDTool;
491
+ };
465
492
  }
466
493
  /**
467
494
  * Default Judge-specific AI Config with required evaluation metric key.
@@ -500,6 +527,12 @@ interface LDAIAgentConfig extends LDAIConfig {
500
527
  * References judge AI Configs that should evaluate this AI Config.
501
528
  */
502
529
  judgeConfiguration?: LDJudgeConfiguration;
530
+ /**
531
+ * Root-level tools map keyed by tool name. Distinct from model.parameters.tools[].
532
+ */
533
+ tools?: {
534
+ [toolName: string]: LDTool;
535
+ };
503
536
  }
504
537
  /**
505
538
  * Completion AI Config (default mode).
@@ -514,6 +547,12 @@ interface LDAICompletionConfig extends LDAIConfig {
514
547
  * References judge AI Configs that should evaluate this AI Config.
515
548
  */
516
549
  judgeConfiguration?: LDJudgeConfiguration;
550
+ /**
551
+ * Root-level tools map keyed by tool name. Distinct from model.parameters.tools[].
552
+ */
553
+ tools?: {
554
+ [toolName: string]: LDTool;
555
+ };
517
556
  }
518
557
  /**
519
558
  * Judge-specific AI Config with required evaluation metric key.
@@ -1474,4 +1513,4 @@ declare class LDGraphTrackerImpl implements LDGraphTracker {
1474
1513
  declare function initAi(ldClient: LDClientMin): LDAIClient;
1475
1514
  type LDLogger = common.LDLogger;
1476
1515
 
1477
- export { AIProvider, AIProviderFactory, AgentGraphDefinition, AgentGraphNode, type ChatResponse, Judge, type LDAIAgentConfig, type LDAIAgentConfigDefault, type LDAIAgentRequestConfig, type LDAIClient, type LDAICompletionConfig, type LDAICompletionConfigDefault, type LDAIConfig, type LDAIConfigDefault, type LDAIConfigDefaultKind, type LDAIConfigKind, type LDAIConfigMode, type LDAIConfigTracker, type LDAIJudgeConfig, type LDAIJudgeConfigDefault, type LDAIMetrics, type LDAgentGraphFlagValue, LDFeedbackKind, type LDGraphEdge, type LDGraphMetricSummary, type LDGraphTrackData, type LDGraphTracker, LDGraphTrackerImpl, type LDJudge, type LDJudgeConfiguration, type LDJudgeResult, type LDLogger, type LDMessage, type LDModelConfig, type LDProviderConfig, type LDTokenUsage, SUPPORTED_AI_PROVIDERS, type StructuredResponse, type SupportedAIProvider, TrackedChat, type TraversalFn, createBedrockTokenUsage, createOpenAiUsage, createVercelAISDKTokenUsage, initAi };
1516
+ export { AIProvider, AIProviderFactory, AgentGraphDefinition, AgentGraphNode, type ChatResponse, Judge, type LDAIAgentConfig, type LDAIAgentConfigDefault, type LDAIAgentRequestConfig, type LDAIClient, type LDAICompletionConfig, type LDAICompletionConfigDefault, type LDAIConfig, type LDAIConfigDefault, type LDAIConfigDefaultKind, type LDAIConfigKind, type LDAIConfigMode, type LDAIConfigTracker, type LDAIJudgeConfig, type LDAIJudgeConfigDefault, type LDAIMetrics, type LDAgentGraphFlagValue, LDFeedbackKind, type LDGraphEdge, type LDGraphMetricSummary, type LDGraphTrackData, type LDGraphTracker, LDGraphTrackerImpl, type LDJudge, type LDJudgeConfiguration, type LDJudgeResult, type LDLogger, type LDMessage, type LDModelConfig, type LDProviderConfig, type LDTokenUsage, type LDTool, SUPPORTED_AI_PROVIDERS, type StructuredResponse, type SupportedAIProvider, TrackedChat, type TraversalFn, createBedrockTokenUsage, createOpenAiUsage, createVercelAISDKTokenUsage, initAi };
package/dist/index.d.ts CHANGED
@@ -383,6 +383,21 @@ interface LDProviderConfig {
383
383
  */
384
384
  name: string;
385
385
  }
386
+ /**
387
+ * Configuration for a single tool entry in the root-level tools map.
388
+ * Separate from model.parameters.tools[] which is the LLM-passable array.
389
+ */
390
+ interface LDTool {
391
+ name: string;
392
+ description?: string;
393
+ type?: string;
394
+ parameters?: {
395
+ [index: string]: unknown;
396
+ };
397
+ customParameters?: {
398
+ [index: string]: unknown;
399
+ };
400
+ }
386
401
  /**
387
402
  * Configuration for a single judge attachment.
388
403
  */
@@ -448,6 +463,12 @@ interface LDAIAgentConfigDefault extends LDAIConfigDefault {
448
463
  * References judge AI Configs that should evaluate this AI Config.
449
464
  */
450
465
  judgeConfiguration?: LDJudgeConfiguration;
466
+ /**
467
+ * Root-level tools map keyed by tool name. Distinct from model.parameters.tools[].
468
+ */
469
+ tools?: {
470
+ [toolName: string]: LDTool;
471
+ };
451
472
  }
452
473
  /**
453
474
  * Default Completion AI Config (default mode).
@@ -462,6 +483,12 @@ interface LDAICompletionConfigDefault extends LDAIConfigDefault {
462
483
  * References judge AI Configs that should evaluate this AI Config.
463
484
  */
464
485
  judgeConfiguration?: LDJudgeConfiguration;
486
+ /**
487
+ * Root-level tools map keyed by tool name. Distinct from model.parameters.tools[].
488
+ */
489
+ tools?: {
490
+ [toolName: string]: LDTool;
491
+ };
465
492
  }
466
493
  /**
467
494
  * Default Judge-specific AI Config with required evaluation metric key.
@@ -500,6 +527,12 @@ interface LDAIAgentConfig extends LDAIConfig {
500
527
  * References judge AI Configs that should evaluate this AI Config.
501
528
  */
502
529
  judgeConfiguration?: LDJudgeConfiguration;
530
+ /**
531
+ * Root-level tools map keyed by tool name. Distinct from model.parameters.tools[].
532
+ */
533
+ tools?: {
534
+ [toolName: string]: LDTool;
535
+ };
503
536
  }
504
537
  /**
505
538
  * Completion AI Config (default mode).
@@ -514,6 +547,12 @@ interface LDAICompletionConfig extends LDAIConfig {
514
547
  * References judge AI Configs that should evaluate this AI Config.
515
548
  */
516
549
  judgeConfiguration?: LDJudgeConfiguration;
550
+ /**
551
+ * Root-level tools map keyed by tool name. Distinct from model.parameters.tools[].
552
+ */
553
+ tools?: {
554
+ [toolName: string]: LDTool;
555
+ };
517
556
  }
518
557
  /**
519
558
  * Judge-specific AI Config with required evaluation metric key.
@@ -1474,4 +1513,4 @@ declare class LDGraphTrackerImpl implements LDGraphTracker {
1474
1513
  declare function initAi(ldClient: LDClientMin): LDAIClient;
1475
1514
  type LDLogger = common.LDLogger;
1476
1515
 
1477
- export { AIProvider, AIProviderFactory, AgentGraphDefinition, AgentGraphNode, type ChatResponse, Judge, type LDAIAgentConfig, type LDAIAgentConfigDefault, type LDAIAgentRequestConfig, type LDAIClient, type LDAICompletionConfig, type LDAICompletionConfigDefault, type LDAIConfig, type LDAIConfigDefault, type LDAIConfigDefaultKind, type LDAIConfigKind, type LDAIConfigMode, type LDAIConfigTracker, type LDAIJudgeConfig, type LDAIJudgeConfigDefault, type LDAIMetrics, type LDAgentGraphFlagValue, LDFeedbackKind, type LDGraphEdge, type LDGraphMetricSummary, type LDGraphTrackData, type LDGraphTracker, LDGraphTrackerImpl, type LDJudge, type LDJudgeConfiguration, type LDJudgeResult, type LDLogger, type LDMessage, type LDModelConfig, type LDProviderConfig, type LDTokenUsage, SUPPORTED_AI_PROVIDERS, type StructuredResponse, type SupportedAIProvider, TrackedChat, type TraversalFn, createBedrockTokenUsage, createOpenAiUsage, createVercelAISDKTokenUsage, initAi };
1516
+ export { AIProvider, AIProviderFactory, AgentGraphDefinition, AgentGraphNode, type ChatResponse, Judge, type LDAIAgentConfig, type LDAIAgentConfigDefault, type LDAIAgentRequestConfig, type LDAIClient, type LDAICompletionConfig, type LDAICompletionConfigDefault, type LDAIConfig, type LDAIConfigDefault, type LDAIConfigDefaultKind, type LDAIConfigKind, type LDAIConfigMode, type LDAIConfigTracker, type LDAIJudgeConfig, type LDAIJudgeConfigDefault, type LDAIMetrics, type LDAgentGraphFlagValue, LDFeedbackKind, type LDGraphEdge, type LDGraphMetricSummary, type LDGraphTrackData, type LDGraphTracker, LDGraphTrackerImpl, type LDJudge, type LDJudgeConfiguration, type LDJudgeResult, type LDLogger, type LDMessage, type LDModelConfig, type LDProviderConfig, type LDTokenUsage, type LDTool, SUPPORTED_AI_PROVIDERS, type StructuredResponse, type SupportedAIProvider, TrackedChat, type TraversalFn, createBedrockTokenUsage, createOpenAiUsage, createVercelAISDKTokenUsage, initAi };
package/dist/index.js CHANGED
@@ -164,6 +164,9 @@ var LDAIConfigUtils = class {
164
164
  if ("judgeConfiguration" in config && config.judgeConfiguration !== void 0) {
165
165
  flagValue.judgeConfiguration = config.judgeConfiguration;
166
166
  }
167
+ if ("tools" in config && config.tools !== void 0) {
168
+ flagValue.tools = config.tools;
169
+ }
167
170
  return flagValue;
168
171
  }
169
172
  /**
@@ -243,7 +246,8 @@ var LDAIConfigUtils = class {
243
246
  ...this._toBaseConfig(key, flagValue),
244
247
  createTracker: trackerFactory,
245
248
  messages: flagValue.messages,
246
- judgeConfiguration: flagValue.judgeConfiguration
249
+ judgeConfiguration: flagValue.judgeConfiguration,
250
+ tools: flagValue.tools
247
251
  };
248
252
  }
249
253
  /**
@@ -259,7 +263,8 @@ var LDAIConfigUtils = class {
259
263
  ...this._toBaseConfig(key, flagValue),
260
264
  createTracker: trackerFactory,
261
265
  instructions: flagValue.instructions,
262
- judgeConfiguration: flagValue.judgeConfiguration
266
+ judgeConfiguration: flagValue.judgeConfiguration,
267
+ tools: flagValue.tools
263
268
  };
264
269
  }
265
270
  /**
@@ -1288,7 +1293,7 @@ var LDGraphTrackerImpl = class _LDGraphTrackerImpl {
1288
1293
 
1289
1294
  // src/sdkInfo.ts
1290
1295
  var aiSdkName = "@launchdarkly/server-sdk-ai";
1291
- var aiSdkVersion = "0.17.1";
1296
+ var aiSdkVersion = "0.18.1";
1292
1297
  var aiSdkLanguage = "javascript";
1293
1298
 
1294
1299
  // src/LDAIClientImpl.ts