MCPcopy Create free account
hub / github.com/appleboy/CodeGPT / WithTemperature

Function WithTemperature

provider/openai/options.go:110–117  ·  view source on GitHub ↗

WithTemperature returns a new Option that sets the temperature for the client configuration. What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic.

(val float32)

Source from the content-addressed store, hash-verified

108// Higher values like 0.8 will make the output more random,
109// while lower values like 0.2 will make it more focused and deterministic.
110func WithTemperature(val float32) Option {
111 if val <= 0 {
112 val = defaultTemperature
113 }
114 return optionFunc(func(c *config) {
115 c.temperature = val
116 })
117}
118
119// WithProvider returns a new Option that sets the provider for the client configuration.
120func WithProvider(val core.Platform) Option {

Callers 1

NewOpenAIFunction · 0.92

Calls 1

optionFuncFuncType · 0.70

Tested by

no test coverage detected