Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions packages/sdk/server-ai/src/api/LDAIClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,18 @@ import { LDContext } from '@launchdarkly/js-server-sdk-common';
import { LDAIConfig, LDGenerationConfig } from './config/LDAIConfig';

/**
* Interface for performing AI operations using LaunchDarkly.
* Interface for default model configuration.
*/
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 +77,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