From 0a0ffb43cff7e2745bcf4c336760e56c4745eff8 Mon Sep 17 00:00:00 2001 From: Ryan Lamb <4955475+kinyoklion@users.noreply.github.com> Date: Thu, 23 Jan 2025 15:20:02 -0800 Subject: [PATCH] fix: Correct documentation for AI config function. --- packages/sdk/server-ai/src/api/LDAIClient.ts | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/packages/sdk/server-ai/src/api/LDAIClient.ts b/packages/sdk/server-ai/src/api/LDAIClient.ts index 43dbab3b2..4561cbc9b 100644 --- a/packages/sdk/server-ai/src/api/LDAIClient.ts +++ b/packages/sdk/server-ai/src/api/LDAIClient.ts @@ -8,22 +8,21 @@ import { LDAIConfig, LDAIDefaults } from './config/LDAIConfig'; export interface LDAIClient { /** * Retrieves and processes an AI configuration based on the provided key, LaunchDarkly context, - * and variables. This includes the model configuration and the processed prompts. + * and variables. This includes the model configuration and the processed messages. * * @param key The key of the AI configuration. * @param context The LaunchDarkly context object that contains relevant information about the * current environment, user, or session. This context may influence how the configuration is * processed or personalized. + * @param defaultValue A fallback value containing model configuration and messages. This will + * be used if the configuration is not available from launchdarkly. * @param variables A map of key-value pairs representing dynamic variables to be injected into - * the prompt template. The keys correspond to placeholders within the template, and the values + * the message templates. The keys correspond to placeholders within the template, and the values * are the corresponding replacements. - * @param defaultValue A fallback value containing model configuration and prompts. This will - * be used if the configurationuration is not available from launchdarkly. * - * @returns The AI configurationuration including a processed prompt after all variables have been - * substituted in the stored prompt template. This will also include a `tracker` used to track - * the state of the AI operation. If the configuration cannot be accessed from LaunchDarkly, then - * the return value will include information from the defaultValue. + * @returns The AI `config`, processed `messages`, and a `tracker`. If the configuration cannot be accessed from + * LaunchDarkly, then the return value will include information from the defaultValue. The returned `tracker` should + * be used to track the state of the AI operation. * * @example * ``` @@ -34,7 +33,7 @@ export interface LDAIClient { * enabled: false, * }; * - * const result = modelConfig(key, context, defaultValue, variables); + * const result = config(key, context, defaultValue, variables); * // Output: * { * enabled: true, @@ -44,7 +43,7 @@ export interface LDAIClient { * maxTokens: 4096, * userDefinedKey: "myValue", * }, - * prompt: [ + * messages: [ * { * role: "system", * content: "You are an amazing GPT."