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)
| 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. |
| 110 | func 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. |
| 120 | func WithProvider(val core.Platform) Option { |
no test coverage detected