Interface ILdAiClient
Represents the interface of the AI client, useful for mocking.
Namespace: LaunchDarkly.Sdk.Server.Ai.Interfaces
Assembly: LaunchDarkly.ServerSdk.Ai.dll
Syntax
public interface ILdAiClient
Methods
| Edit this page View SourceModelConfig(string, Context, LdAiConfig, IReadOnlyDictionary<string, object>)
Retrieves a LaunchDarkly AI config identified by the given key. The return value is an ILdAiConfigTracker, which makes the configuration available and provides convenience methods for generating events related to model usage.
Any variables provided will be interpolated into the prompt's messages. Additionally, the current LaunchDarkly context will be available as 'ldctx' within a prompt message.
Declaration
ILdAiConfigTracker ModelConfig(string key, Context context, LdAiConfig defaultValue, IReadOnlyDictionary<string, object> variables = null)
Parameters
Type | Name | Description |
---|---|---|
string | key | the AI config key |
Context | context | the context |
LdAiConfig | defaultValue | the default config, if unable to retrieve from LaunchDarkly |
IReadOnlyDictionary<string, object> | variables | the list of variables used when interpolating the prompt |
Returns
Type | Description |
---|---|
ILdAiConfigTracker | an AI config tracker |