Documentation
¶
Index ¶
- Constants
- 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) WithReasoningEffort(effort string) Config
- func (mc Config) WithReasoningEffortHigh() Config
- func (mc Config) WithReasoningEffortLow() Config
- func (mc Config) WithReasoningEffortMedium() Config
- func (mc Config) WithReasoningEffortMinimal() Config
- func (mc Config) WithReasoningEffortNone() Config
- func (mc Config) WithReasoningEffortXHigh() 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 ¶
const ( ReasoningEffortNone = "none" ReasoningEffortMinimal = "minimal" ReasoningEffortLow = "low" ReasoningEffortMedium = "medium" ReasoningEffortHigh = "high" ReasoningEffortXHigh = "xhigh" )
Reasoning effort constants
The reasoning_effort parameter allows you to control the depth of reasoning the model applies when generating responses. Higher levels of reasoning effort can lead to more thoughtful and accurate answers, especially for complex queries. From the OpenAI documentation: Constrains effort on reasoning for [reasoning models](https://platform.openai.com/docs/guides/reasoning). Currently supported values are `none`, `minimal`, `low`, `medium`, `high`, and `xhigh`. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response.
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
ReasoningEffort *string
}
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) WithReasoningEffort ¶ added in v1.0.7
WithReasoningEffort sets the reasoning effort parameter Supported values are: none, minimal, low, medium, high, and xhigh
func (Config) WithReasoningEffortHigh ¶ added in v1.0.7
WithReasoningEffortHigh sets reasoning effort to high
func (Config) WithReasoningEffortLow ¶ added in v1.0.7
WithReasoningEffortLow sets reasoning effort to low
func (Config) WithReasoningEffortMedium ¶ added in v1.0.7
WithReasoningEffortMedium sets reasoning effort to medium
func (Config) WithReasoningEffortMinimal ¶ added in v1.0.7
WithReasoningEffortMinimal sets reasoning effort to minimal
func (Config) WithReasoningEffortNone ¶ added in v1.0.7
WithReasoningEffortNone sets reasoning effort to none
func (Config) WithReasoningEffortXHigh ¶ added in v1.0.7
WithReasoningEffortXHigh sets reasoning effort to xhigh
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