models

package
v1.0.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 23, 2025 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bool added in v0.0.6

func Bool(v bool) *bool

Bool returns a pointer to the given bool value

func ConvertToOpenAIModelConfig

func ConvertToOpenAIModelConfig(modelConfig Config) openai.ChatCompletionNewParams

func Float

func Float(v float64) *float64

Helper functions to create pointers for optional parameters

func Float64 added in v0.0.6

func Float64(v float64) *float64

Float64 returns a pointer to the given float64 value

func GetModelsList

func GetModelsList(ctx context.Context, modelRunnerEndpoint string) ([]string, error)

func Int

func Int(v int64) *int64

func Int64 added in v0.0.6

func Int64(v int64) *int64

Int64 returns a pointer to the given int64 value

func IsModelAvailable

func IsModelAvailable(ctx context.Context, modelRunnerEndpoint, modelID string) bool

func String added in v0.0.6

func String(v string) *string

String returns a pointer to the given string value

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 NewConfig

func NewConfig(name string) Config

NewConfig creates a Config with just the model name

func (Config) WithFrequencyPenalty

func (mc Config) WithFrequencyPenalty(penalty float64) Config

WithFrequencyPenalty sets the frequency_penalty parameter

func (Config) WithMaxTokens

func (mc Config) WithMaxTokens(maxTokens int64) Config

WithMaxTokens sets the max_tokens parameter

func (Config) WithMinP

func (mc Config) WithMinP(minP float64) Config

WithMinP sets the min_p parameter (minimum probability threshold)

func (Config) WithN

func (mc Config) WithN(n int64) Config

WithN sets the number of completions to generate

func (Config) WithParallelToolCalls

func (mc Config) WithParallelToolCalls(parallel bool) Config

WithParallelToolCalls sets whether to allow parallel tool calls

func (Config) WithPresencePenalty

func (mc Config) WithPresencePenalty(penalty float64) Config

WithPresencePenalty sets the presence_penalty parameter

func (Config) WithRepeatPenalty

func (mc Config) WithRepeatPenalty(penalty float64) Config

WithRepeatPenalty sets the repeat_penalty parameter

func (Config) WithSeed

func (mc Config) WithSeed(seed int64) Config

WithSeed sets the seed parameter for deterministic sampling

func (Config) WithStop

func (mc Config) WithStop(stop ...string) Config

WithStop sets the stop sequences

func (Config) WithTemperature

func (mc Config) WithTemperature(temp float64) Config

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

func (mc Config) WithToolChoiceAuto() Config

WithToolChoiceAuto sets tool choice to "auto" - the model decides whether to use tools

func (Config) WithToolChoiceFunction

func (mc Config) WithToolChoiceFunction(functionName string) Config

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

func (Config) WithTopK

func (mc Config) WithTopK(topK int64) Config

WithTopK sets the top_k parameter

func (Config) WithTopP

func (mc Config) WithTopP(topP float64) Config

WithTopP sets the top_p parameter

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL