Skip to content

Commit 978dfa9

Browse files
authored
fix: Update default typings to include enabled. (#680)
BEGIN_COMMIT_OVERRIDE fix: Update default typings to include enabled. feat: Include temperature and maxTokens in LDModelConfig. END_COMMIT_OVERRIDE
1 parent a7d6b99 commit 978dfa9

File tree

2 files changed

+22
-2
lines changed

2 files changed

+22
-2
lines changed

packages/sdk/server-ai/src/api/LDAIClient.ts

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,18 @@ import { LDContext } from '@launchdarkly/js-server-sdk-common';
33
import { LDAIConfig, LDGenerationConfig } from './config/LDAIConfig';
44

55
/**
6-
* Interface for performing AI operations using LaunchDarkly.
6+
* Interface for default model configuration.
77
*/
8+
export interface LDAIDefaults extends LDGenerationConfig {
9+
/**
10+
* Whether the configuration is enabled.
11+
*/
12+
enabled?: boolean;
13+
}
814

15+
/**
16+
* Interface for performing AI operations using LaunchDarkly.
17+
*/
918
export interface LDAIClient {
1019
/**
1120
* Parses and interpolates a template string with the provided variables.
@@ -68,7 +77,7 @@ export interface LDAIClient {
6877
* }
6978
* ```
7079
*/
71-
modelConfig<TDefault extends LDGenerationConfig>(
80+
modelConfig<TDefault extends LDAIDefaults>(
7281
key: string,
7382
context: LDContext,
7483
defaultValue: TDefault,

packages/sdk/server-ai/src/api/config/LDAIConfig.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,17 @@ export interface LDModelConfig {
99
*/
1010
modelId?: string;
1111

12+
/**
13+
* Tuning parameter for randomness versus determinism. Exact effect will be determined by the
14+
* model.
15+
*/
16+
temperature?: number;
17+
18+
/**
19+
* The maximum number of tokens.
20+
*/
21+
maxTokens?: number;
22+
1223
/**
1324
* And additional model specific information.
1425
*/

0 commit comments

Comments
 (0)