@@ -8,22 +8,21 @@ import { LDAIConfig, LDAIDefaults } from './config/LDAIConfig';
88export interface LDAIClient {
99 /**
1010 * Retrieves and processes an AI configuration based on the provided key, LaunchDarkly context,
11- * and variables. This includes the model configuration and the processed prompts .
11+ * and variables. This includes the model configuration and the customized messages .
1212 *
1313 * @param key The key of the AI configuration.
1414 * @param context The LaunchDarkly context object that contains relevant information about the
1515 * current environment, user, or session. This context may influence how the configuration is
1616 * processed or personalized.
17+ * @param defaultValue A fallback value containing model configuration and messages. This will
18+ * be used if the configuration is not available from LaunchDarkly.
1719 * @param variables A map of key-value pairs representing dynamic variables to be injected into
18- * the prompt template . The keys correspond to placeholders within the template, and the values
20+ * the message content . The keys correspond to placeholders within the template, and the values
1921 * are the corresponding replacements.
20- * @param defaultValue A fallback value containing model configuration and prompts. This will
21- * be used if the configurationuration is not available from launchdarkly.
2222 *
23- * @returns The AI configurationuration including a processed prompt after all variables have been
24- * substituted in the stored prompt template. This will also include a `tracker` used to track
25- * the state of the AI operation. If the configuration cannot be accessed from LaunchDarkly, then
26- * the return value will include information from the defaultValue.
23+ * @returns The AI `config`, customized `messages`, and a `tracker`. If the configuration cannot be accessed from
24+ * LaunchDarkly, then the return value will include information from the `defaultValue`. The returned `tracker` can
25+ * be used to track AI operation metrics (latency, token usage, etc.).
2726 *
2827 * @example
2928 * ```
@@ -34,7 +33,7 @@ export interface LDAIClient {
3433 * enabled: false,
3534 * };
3635 *
37- * const result = modelConfig (key, context, defaultValue, variables);
36+ * const result = config (key, context, defaultValue, variables);
3837 * // Output:
3938 * {
4039 * enabled: true,
@@ -44,7 +43,7 @@ export interface LDAIClient {
4443 * maxTokens: 4096,
4544 * userDefinedKey: "myValue",
4645 * },
47- * prompt : [
46+ * messages : [
4847 * {
4948 * role: "system",
5049 * content: "You are an amazing GPT."
0 commit comments