Tune the temperature
Temperature is a configurable parameter that controls the randomness of the text output generated by the /summarize
and /generate
endpoints . This parameter ranges from 0 to 1, inclusive, and the default value is 0.2. A higher value generates more creative text, while a lower value produces more deterministic text output.
Common use cases include:
- Writers: Choose a higher temperature when seeking inspiration or a lower temperature for factual or technical writing.
- Marketing professionals: Choose a higher temperature to generate more unique and eye-catching content.
- Educators and students: Choose a lower temperature for summarizing educational content or a higher temperature for more engaging results.
- Law enforcement and security: Choose a lower temperature for generating factual reports, such as creating detailed and accurate police reports based on video evidence or drafting documents where precision is important.
- Meeting facilitators: Choose a lower temperature for taking accurate and concise meeting minutes. This setting helps capture key points, decisions, and action items.
The examples below are specific to using the /generate
endpoint. However, the principles demonstrated are similar when using the /summarize
endpoint.
Prerequisites
- You’re familiar with the concepts that are described on the Platform overview page.
- You’ve already created an index, and the Pegasus video understanding engine is enabled for this index.
- You’ve uploaded a video, and the platform has finished indexing it.
Example
The example code below demonstrates setting the value of the temperature
parameter to 0.1 in the body of the request for this video: Tim Urban: Inside the mind of a master procrastinator | TED. This results in a more deterministic result than the default settings.
The result should look similar to the following one:
Setting the temperature
parameter to 0.9 would result in a more creative response, similar to the following one:
Using the default value for the temperature
parameter would result in a response similar to the following one: