Skip to content

Commit

Permalink
fix: Update default typings to include enabled.
Browse files Browse the repository at this point in the history
  • Loading branch information
kinyoklion committed Nov 12, 2024
1 parent a7d6b99 commit 7877e11
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
10 changes: 8 additions & 2 deletions packages/sdk/server-ai/src/api/LDAIClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,16 @@ import { LDContext } from '@launchdarkly/js-server-sdk-common';

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

export interface LDAIDefaults extends LDGenerationConfig {
/**
* Whether the configuration is enabled.
*/
enabled?: boolean;
}

/**
* Interface for performing AI operations using LaunchDarkly.
*/

export interface LDAIClient {
/**
* Parses and interpolates a template string with the provided variables.
Expand Down Expand Up @@ -68,7 +74,7 @@ export interface LDAIClient {
* }
* ```
*/
modelConfig<TDefault extends LDGenerationConfig>(
modelConfig<TDefault extends LDAIDefaults>(
key: string,
context: LDContext,
defaultValue: TDefault,
Expand Down
11 changes: 11 additions & 0 deletions packages/sdk/server-ai/src/api/config/LDAIConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,17 @@ export interface LDModelConfig {
*/
modelId?: string;

/**
* Tuning parameter for randomness versus determinism. Exact effect will be determined by the
* model.
*/
temperature?: number;

/**
* The maximum number of tokens.
*/
maxTokens?: number;

/**
* And additional model specific information.
*/
Expand Down

0 comments on commit 7877e11

Please sign in to comment.