How to control response randomness with temperature
The temperature parameter controls how random or deterministic the modelβs responses will be.
Range: 0 to 2
Default: 0.2
- Lower temperature β more focused, predictable answers (e.g.
0.2) - Higher temperature β more creative, varied responses (e.g.
0.8or1.0)
π Tip: For most use cases, values between 0.2 and 0.8 give good results.
How it works:
First, install the SDK:
Then use the following Python code: