Documentation
¶
Index ¶
- func Bool(v bool) *bool
- func ConvertToOpenAIModelConfig(modelConfig Config) openai.ChatCompletionNewParams
- func Float(v float64) *float64
- func Float64(v float64) *float64
- func GetModelsList(ctx context.Context, modelRunnerEndpoint string) ([]string, error)
- func Int(v int64) *int64
- func Int64(v int64) *int64
- func IsModelAvailable(ctx context.Context, modelRunnerEndpoint, modelID string) bool
- func String(v string) *string
- type Config
- func (mc Config) WithFrequencyPenalty(penalty float64) Config
- func (mc Config) WithMaxTokens(maxTokens int64) Config
- func (mc Config) WithMinP(minP float64) Config
- func (mc Config) WithN(n int64) Config
- func (mc Config) WithParallelToolCalls(parallel bool) Config
- func (mc Config) WithPresencePenalty(penalty float64) Config
- func (mc Config) WithRepeatPenalty(penalty float64) Config
- func (mc Config) WithSeed(seed int64) Config
- func (mc Config) WithStop(stop ...string) Config
- func (mc Config) WithTemperature(temp float64) Config
- func (mc Config) WithToolChoice(toolChoice openai.ChatCompletionToolChoiceOptionUnionParam) Config
- func (mc Config) WithToolChoiceAuto() Config
- func (mc Config) WithToolChoiceFunction(functionName string) Config
- func (mc Config) WithTools(tools []openai.ChatCompletionToolUnionParam) Config
- func (mc Config) WithTopK(topK int64) Config
- func (mc Config) WithTopP(topP float64) Config
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConvertToOpenAIModelConfig ¶
func ConvertToOpenAIModelConfig(modelConfig Config) openai.ChatCompletionNewParams
func GetModelsList ¶
func IsModelAvailable ¶
Types ¶
type Config ¶
type Config struct {
Name string
Temperature *float64
TopP *float64
TopK *int64
MinP *float64
MaxTokens *int64
FrequencyPenalty *float64
PresencePenalty *float64
RepeatPenalty *float64
Seed *int64
Stop []string
N *int64
ToolChoice *openai.ChatCompletionToolChoiceOptionUnionParam
ParallelToolCalls *bool
Tools []openai.ChatCompletionToolUnionParam
}
Config represents model configuration parameters
func (Config) WithFrequencyPenalty ¶
WithFrequencyPenalty sets the frequency_penalty parameter
func (Config) WithMaxTokens ¶
WithMaxTokens sets the max_tokens parameter
func (Config) WithParallelToolCalls ¶
WithParallelToolCalls sets whether to allow parallel tool calls
func (Config) WithPresencePenalty ¶
WithPresencePenalty sets the presence_penalty parameter
func (Config) WithRepeatPenalty ¶
WithRepeatPenalty sets the repeat_penalty parameter
func (Config) WithTemperature ¶
WithTemperature sets the temperature parameter
func (Config) WithToolChoice ¶
func (mc Config) WithToolChoice(toolChoice openai.ChatCompletionToolChoiceOptionUnionParam) Config
WithToolChoice sets the tool choice parameter
func (Config) WithToolChoiceAuto ¶
WithToolChoiceAuto sets tool choice to "auto" - the model decides whether to use tools
func (Config) WithToolChoiceFunction ¶
WithToolChoiceFunction forces the model to use a specific function/tool
func (Config) WithTools ¶
func (mc Config) WithTools(tools []openai.ChatCompletionToolUnionParam) Config
WithTools sets the available tools for the model
Click to show internal directories.
Click to hide internal directories.