Skip to content

Commit 7d91ea8

Browse files
committed
Commenting improvements.
1 parent 817d4f0 commit 7d91ea8

File tree

1 file changed

+15
-7
lines changed

1 file changed

+15
-7
lines changed

packages/sdk/ai/src/index.ts

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,20 +19,28 @@ export interface AIClient {
1919
interpolateTemplate(template: string, variables: Record<string, unknown>): string;
2020

2121
/**
22-
* Retrieves and processes a prompt template based on the provided key, LaunchDarkly context, and variables.
22+
* Retrieves and processes a prompt template based on the provided key, LaunchDarkly context, and
23+
* variables.
2324
*
24-
* @param key - A unique identifier for the prompt template. This key is used to fetch the correct prompt from storage or configuration.
25-
* @param context - The LaunchDarkly context object that contains relevant information about the current environment, user, or session. This context may influence how the prompt is processed or personalized.
26-
* @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 are the corresponding replacements.
27-
* @param defaultValue - A fallback value to be used if the prompt template associated with the key is not found or if any errors occur during processing.
25+
* @param key - A unique identifier for the prompt template. This key is used to fetch the correct
26+
* prompt from storage or configuration.
27+
* @param context - The LaunchDarkly context object that contains relevant information about the
28+
* current environment, user, or session. This context may influence how the prompt is processed
29+
* or personalized.
30+
* @param variables - A map of key-value pairs representing dynamic variables to be injected into
31+
* the prompt template. The keys correspond to placeholders within the template, and the values
32+
* are the corresponding replacements.
33+
* @param defaultValue - A fallback value to be used if the prompt template associated with the
34+
* key is not found or if any errors occur during processing.
2835
*
29-
* @returns The processed prompt after all variables have been substituted in the stored prompt template. If the prompt cannot be retrieved or processed, the `defaultValue` is returned.
36+
* @returns The processed prompt after all variables have been substituted in the stored prompt
37+
* template. If the prompt cannot be retrieved or processed, the `defaultValue` is returned.
3038
*
3139
* @example
3240
* ```
3341
* const key = "welcome_prompt";
3442
* const context = {...};
35-
* const variables = {username: 'john};
43+
* const variables = {username: 'john'};
3644
* const defaultValue = {};
3745
*
3846
* const result = modelConfig(key, context, defaultValue, variables);

0 commit comments

Comments
 (0)