WithMaxTokens returns a new Option that sets the max tokens for the client configuration. The maximum number of tokens to generate in the chat completion. The total length of input tokens and generated tokens is limited by the model's context length.
(val int)
| 95 | // The maximum number of tokens to generate in the chat completion. |
| 96 | // The total length of input tokens and generated tokens is limited by the model's context length. |
| 97 | func WithMaxTokens(val int) Option { |
| 98 | if val <= 0 { |
| 99 | val = defaultMaxTokens |
| 100 | } |
| 101 | return optionFunc(func(c *config) { |
| 102 | c.maxTokens = val |
| 103 | }) |
| 104 | } |
| 105 | |
| 106 | // WithTemperature returns a new Option that sets the temperature for the client configuration. |
| 107 | // What sampling temperature to use, between 0 and 2. |
no test coverage detected