> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.twelvelabs.io/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.twelvelabs.io/_mcp/server.

# Tune the temperature

> Control the randomness of the output. Balance creativity and determinism.

The examples in this guide use videos, but the parameter and the guidance apply to image analysis as well.

Temperature is a configurable parameter that controls the randomness of the text output generated by the platform . 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.

# Prerequisites

* You've already uploaded a video and created an asset. For details, see the [Analyze videos](/v1.3/docs/guides/analyze-videos) guide.

# 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](https://www.youtube.com/watch?v=arj7oStGLkU). This results in a more deterministic result than the default settings.

**`Python`**

```python Python
from twelvelabs import TwelveLabs
from twelvelabs.types import VideoContext_AssetId, AnalyzePromptV2

client = TwelveLabs(api_key="<YOUR_API_KEY>")

res = client.analyze(
  model_name="pegasus1.6",
  video=VideoContext_AssetId(asset_id="<YOUR_ASSET_ID>"),
  prompt_v_2=AnalyzePromptV2(
      input_text="I want to generate a description for my video with the following format: Title of the video, followed by a summary in 2-3 sentences, highlighting the main topic, key events, and concluding remarks.",
  ),
  temperature=0.1,
)
print(f"Generated text: {res.data}")
```

**`Node.js`**

```javascript Node.js
import { TwelveLabs } from 'twelvelabs-js';

const client = new TwelveLabs({ apiKey: '<YOUR_API_KEY>'});

const text = await client.analyze({
  modelName: "pegasus1.6",
  video: { type: "asset_id", assetId: "<YOUR_ASSET_ID>" },
  promptV2: {
    inputText: "I want to generate a description for my video with the following format: Title of the video, followed by a summary, highlighting the main topic, key events, and concluding remarks.",
  },
  temperature: 0.1,
});
console.log(`Generated text: ${text.data}`);
```

Below are the three responses, with **bold** representing content that appears across all three, and *italics* denoting content that is unique to each response or contradicts the others.

#### Temperature 0.2 (default)

*Title: TEDx Talk - The Art of Procrastination*\\

*Summary:* In this **TEDx talk**, **the speaker** *delves into* **the topic of procrastination**, *sharing insights into the origins of this human behavior and its psychological implications*. **The speaker uses** *vivid storytelling, humor, and relatable examples* to **engage the audience and encourage them to** *reevaluate their relationship with* **procrastination**. *The talk concludes with a call to action for viewers to recognize the role of* **the "instant gratification monkey"** *in their lives and take steps towards overcoming their procrastination habits*.\
*The video opens with the speaker sharing his personal experience of procrastination, starting from his college days when he had to write a 90-page thesis. He describes how he came up with a plan to spread the work out evenly, but ended up procrastinating and having to write the entire thesis in just a few days before the deadline.* **The speaker** *then discusses the concept of short-term and long-term procrastination, explaining how the latter can be more insidious as it often goes unnoticed and can lead to significant regret over missed opportunities*.\
**The speaker** *then introduces the idea of* **the "instant gratification monkey,"** \*which is the part of our brain that seeks pleasure and avoids pain in the present moment. He shares that this monkey can cause us to delay important tasks and instead engage in activities that provide immediate satisfaction, such as browsing social media or watching TV. However,\***the speaker emphasizes** *that this behavior can lead to feelings of guilt, anxiety, and regret in the long term*.\
*To illustrate the concept further, the speaker uses the analogy of a life calendar, emphasizing that each week of a 90-year life represents only one box.* He **encourages** *viewers* to *think about what they are truly procrastinating on and to* **be aware of the instant gratification monkey**, *as everyone experiences it to some degree*. **The speaker** *concludes his talk by thanking the audience for their attention and* **encouraging them to start addressing their procrastination** *habits sooner rather than later*.\
Throughout the talk, **the speaker uses** *body language, facial expressions, and* **hand gestures** to **engage the audience** *and emphasize key points*. He also **uses visual aids**, *such as the life calendar and* **a blank grid**, *to illustrate his concepts*. **The audience is attentively listening and responding positively to the speaker's message**, *as evidenced by their nodding and applause*. *Overall, this TEDx talk provides valuable insights into the psychology of procrastination and offers practical advice for overcoming it.*

#### Temperature 0.1

*Title: TEDx Speaker Delivers an Inspiring Talk on Innovation and Creativity*

*Summary:* In this **TEDx** *video*, **a speaker delivers an engaging and** *inspiring* **talk on the topics of** *innovation and creativity*. **The speaker**, *dressed in a black shirt*, **uses hand gestures and a** *remote control* **to navigate through his presentation** *slides*, which include **a blank grid** and *a TED logo*. Throughout the talk, **the speaker emphasizes the importance of** *embracing creativity and innovation in various aspects of life*. He **encourages the audience to** *stay* **aware of their** *own tendencies towards* **procrastination and the instant gratification monkey**, and to **start addressing their procrastination** *tasks* **as soon as possible**. **The audience is attentively listening and responding positively to the speaker's message**, and *the video concludes with the speaker smiling and acknowledging their applause*.

*Main Topics:* *1. The importance of creativity and innovation* *2. Overcoming procrastination and the instant gratification monkey*

*Key Events:* *1.* **The speaker uses hand gestures and a** *remote control* **to navigate through his presentation** *slides* *2. He emphasizes the importance of embracing creativity and innovation* *3.* **The speaker encourages the audience to** *stay***aware of their** *own* **procrastination** *tendencies* *4. He concludes the talk by acknowledging the audience's applause*

*Concluding Remarks:* *The speaker's inspiring talk on innovation and creativity encourages the audience to embrace these concepts in their own lives and to* **be aware of** *their tendencies towards* **procrastination**. *By staying focused and addressing tasks as soon as possible, individuals can make significant progress and achieve their goals. The video concludes with the speaker's positive and uplifting message, leaving the audience feeling motivated and inspired.*

#### Temperature 0.9

In the *provided video clips*, there are *several* **TED Talks** *occurring*, each featuring **a speaker delivering engaging and***thought-provoking* **presentations**. *The first talk, titled 'TED: Ideas Worth Spreading', showcases a speaker presenting on the importance of the spread of ideas and their impact on the world.* He **uses visual aids** *such as graphs and charts to emphasize his points*.\
*Next, in a talk titled 'The 5 Day Startup', a speaker delivers a presentation on starting a business within a five-day period. He highlights key steps and considerations involved in launching a successful venture.*\
*Another talk, named 'The Art of Public Speaking', focuses on the topic of effective communication through public speaking. The speaker encourages the audience to understand and harness the power of storytelling and persuasive language in their presentations. In this clip, the speaker's dynamic and expressive presentation style is evident.*\
*Finally, in a talk titled 'Easy and Fun', a speaker discusses the importance of balance between work and play, emphasizing that it is essential to prioritize both.* **The speaker uses** *various* **visual aids**, *including a monkey and a ship's wheel, to illustrate the points*.\
*All the speakers in these talks are passionate and knowledgeable on their respective topics, ensuring an insightful and captivating delivery. The videos are well produced, with clear visuals and audio, further enhancing the audience's experience.*