diff options
Diffstat (limited to 'internal/llm/provider.go')
| -rw-r--r-- | internal/llm/provider.go | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/internal/llm/provider.go b/internal/llm/provider.go index 847ea60..f3170ef 100644 --- a/internal/llm/provider.go +++ b/internal/llm/provider.go @@ -56,9 +56,16 @@ type Options struct { // RequestOption mutates Options. type RequestOption func(*Options) -func WithModel(model string) RequestOption { return func(o *Options) { o.Model = model } } +// WithModel sets the model name for a request. +func WithModel(model string) RequestOption { return func(o *Options) { o.Model = model } } + +// WithTemperature sets the sampling temperature for a request. func WithTemperature(t float64) RequestOption { return func(o *Options) { o.Temperature = t } } -func WithMaxTokens(n int) RequestOption { return func(o *Options) { o.MaxTokens = n } } + +// WithMaxTokens sets the maximum number of tokens to generate. +func WithMaxTokens(n int) RequestOption { return func(o *Options) { o.MaxTokens = n } } + +// WithStop sets custom stop sequences for a request. func WithStop(stop ...string) RequestOption { return func(o *Options) { o.Stop = append([]string{}, stop...) } } |
