Class LdAiCompletionConfigDefault.Builder
Builder for constructing an LdAiCompletionConfigDefault instance, which can be passed as the default value to the AI Client's CompletionConfig(string, Context, LdAiCompletionConfigDefault, IReadOnlyDictionary<string, object>) method.
Inherited Members
Namespace: LaunchDarkly.Sdk.Server.Ai.Config
Assembly: LaunchDarkly.ServerSdk.Ai.dll
Syntax
public class LdAiCompletionConfigDefault.Builder
Methods
| Edit this page View SourceAddMessage(string, Role)
Adds a message with the given content and role. The default role is User.
Declaration
public LdAiCompletionConfigDefault.Builder AddMessage(string content, LdAiConfigTypes.Role role = Role.User)
Parameters
| Type | Name | Description |
|---|---|---|
| string | content | the content, which may contain Mustache templates |
| LdAiConfigTypes.Role | role | the role |
Returns
| Type | Description |
|---|---|
| LdAiCompletionConfigDefault.Builder | a new builder |
Build()
Builds the LdAiCompletionConfigDefault instance.
Declaration
public LdAiCompletionConfigDefault Build()
Returns
| Type | Description |
|---|---|
| LdAiCompletionConfigDefault | a new LdAiCompletionConfigDefault |
Disable()
Disables the config.
Declaration
public LdAiCompletionConfigDefault.Builder Disable()
Returns
| Type | Description |
|---|---|
| LdAiCompletionConfigDefault.Builder | the builder |
Enable()
Enables the config.
Declaration
public LdAiCompletionConfigDefault.Builder Enable()
Returns
| Type | Description |
|---|---|
| LdAiCompletionConfigDefault.Builder | the builder |
SetCustomModelParam(string, LdValue)
Sets a custom parameter for the model.
Declaration
public LdAiCompletionConfigDefault.Builder SetCustomModelParam(string name, LdValue value)
Parameters
| Type | Name | Description |
|---|---|---|
| string | name | the custom parameter name |
| LdValue | value | the custom parameter value |
Returns
| Type | Description |
|---|---|
| LdAiCompletionConfigDefault.Builder | the builder |
SetEnabled(bool)
Sets the enabled state of the config based on a boolean.
Declaration
public LdAiCompletionConfigDefault.Builder SetEnabled(bool enabled)
Parameters
| Type | Name | Description |
|---|---|---|
| bool | enabled | whether the config is enabled |
Returns
| Type | Description |
|---|---|
| LdAiCompletionConfigDefault.Builder | the builder |
SetJudgeConfiguration(JudgeConfiguration)
Sets the judge configuration for this completion config default.
Declaration
public LdAiCompletionConfigDefault.Builder SetJudgeConfiguration(LdAiConfigTypes.JudgeConfiguration config)
Parameters
| Type | Name | Description |
|---|---|---|
| LdAiConfigTypes.JudgeConfiguration | config | the judge configuration |
Returns
| Type | Description |
|---|---|
| LdAiCompletionConfigDefault.Builder | a new builder |
SetModelName(string)
Sets the model's name. By default, this will be the empty string.
Declaration
public LdAiCompletionConfigDefault.Builder SetModelName(string name)
Parameters
| Type | Name | Description |
|---|---|---|
| string | name | the model name |
Returns
| Type | Description |
|---|---|
| LdAiCompletionConfigDefault.Builder | the builder |
SetModelParam(string, LdValue)
Sets a parameter for the model.
Declaration
public LdAiCompletionConfigDefault.Builder SetModelParam(string name, LdValue value)
Parameters
| Type | Name | Description |
|---|---|---|
| string | name | the parameter name |
| LdValue | value | the parameter value |
Returns
| Type | Description |
|---|---|
| LdAiCompletionConfigDefault.Builder | the builder |
SetModelProviderName(string)
Sets the model provider's name. By default, this will be the empty string.
Declaration
public LdAiCompletionConfigDefault.Builder SetModelProviderName(string name)
Parameters
| Type | Name | Description |
|---|---|---|
| string | name | the name |
Returns
| Type | Description |
|---|---|
| LdAiCompletionConfigDefault.Builder | the builder |