Class LdAiConfig.Builder
Builder for constructing an LdAiConfig instance, which can be passed as the default value to the AI Client's ModelConfig(string, Context, LdAiConfig, IReadOnlyDictionary<string, object>) method.
Inherited Members
Namespace: LaunchDarkly.Sdk.Server.Ai.Config
Assembly: LaunchDarkly.ServerSdk.Ai.dll
Syntax
public class LdAiConfig.Builder
Methods
| Edit this page View SourceAddPromptMessage(string, Role)
Adds a prompt message with the given content and role. The default role is User.
Declaration
public LdAiConfig.Builder AddPromptMessage(string content, Role role = Role.User)
Parameters
Type | Name | Description |
---|---|---|
string | content | the content, which may contain Mustache templates |
Role | role | the role |
Returns
Type | Description |
---|---|
LdAiConfig.Builder | a new builder |
Build()
Builds the LdAiConfig instance.
Declaration
public LdAiConfig Build()
Returns
Type | Description |
---|---|
LdAiConfig | a new LdAiConfig |
Disable()
Disables the config.
Declaration
public LdAiConfig.Builder Disable()
Returns
Type | Description |
---|---|
LdAiConfig.Builder | the builder |
Enable()
Enables the config.
Declaration
public LdAiConfig.Builder Enable()
Returns
Type | Description |
---|---|
LdAiConfig.Builder | the builder |
SetEnabled(bool)
Sets the enabled state of the config based on a boolean.
Declaration
public LdAiConfig.Builder SetEnabled(bool enabled)
Parameters
Type | Name | Description |
---|---|---|
bool | enabled | whether the config is enabled |
Returns
Type | Description |
---|---|
LdAiConfig.Builder | the builder |
SetModelParam(string, object)
Sets a parameter for the model. The value may be any object.
Declaration
public LdAiConfig.Builder SetModelParam(string name, object value)
Parameters
Type | Name | Description |
---|---|---|
string | name | the parameter name |
object | value | the parameter value |
Returns
Type | Description |
---|---|
LdAiConfig.Builder | the builder |