Skip to content

Commit 7877e11

Browse files
committed
fix: Update default typings to include enabled.
1 parent a7d6b99 commit 7877e11

File tree

2 files changed

+19
-2
lines changed

2 files changed

+19
-2
lines changed

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

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,16 @@ import { LDContext } from '@launchdarkly/js-server-sdk-common';
22

33
import { LDAIConfig, LDGenerationConfig } from './config/LDAIConfig';
44

5+
export interface LDAIDefaults extends LDGenerationConfig {
6+
/**
7+
* Whether the configuration is enabled.
8+
*/
9+
enabled?: boolean;
10+
}
11+
512
/**
613
* Interface for performing AI operations using LaunchDarkly.
714
*/
8-
915
export interface LDAIClient {
1016
/**
1117
* Parses and interpolates a template string with the provided variables.
@@ -68,7 +74,7 @@ export interface LDAIClient {
6874
* }
6975
* ```
7076
*/
71-
modelConfig<TDefault extends LDGenerationConfig>(
77+
modelConfig<TDefault extends LDAIDefaults>(
7278
key: string,
7379
context: LDContext,
7480
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)