Determining the randomness and creativity of generated responses using the temperature parameter
Temperature is likely to be one of the least understood parameters. Overall, it controls the creativity or randomness of text generations. The higher the temperature, the more diverse and creative the results will be – even for the same input. In practice, the temperature is set based on the use case. Applications where consistent and standard generations are needed should use a very low temperature, whereas solutions that require creative approaches should opt for higher temperatures.
In this recipe, we will learn about the temperature parameter, observing how it can be used to influence the text generations produced by the OpenAI API.
How to do it…
- In Postman, enter the following for the endpoint: https://api.openai.com/v1/chat/completions. In the request body, type in the following, and then click Send. Our prompt is
Explain gravity in one sentence
. Note that...