You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* 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.
23
24
*
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.
28
35
*
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.
30
38
*
31
39
* @example
32
40
* ```
33
41
* const key = "welcome_prompt";
34
42
* const context = {...};
35
-
* const variables = {username: 'john};
43
+
* const variables = {username: 'john'};
36
44
* const defaultValue = {};
37
45
*
38
46
* const result = modelConfig(key, context, defaultValue, variables);
0 commit comments