***
title: LLM Actions
position: 0
deprecated: false
hidden: false
metadata:
robots: index
-------------
# Overview
LLM Actions in Agent Studio provide built-in capabilities to leverage large language model (LLM) functionalities directly within your **[Compound Actions](/agent-studio/actions/compound-actions)** and **[Conversational Processes](/agent-studio/conversation-process)**. These actions enable tasks such as summarization, reasoning, classification, data extraction, and content generation, allowing you to build workflows without custom integrations.
This documentation focuses on two key LLM Actions: `generate_text_action` and `generate_structured_value_action`. These actions are designed to help you process unstructured data, generate insights, and structure outputs efficiently.
# generate\_text\_action
### Description
The `generate_text_action` invokes an LLM to produce free-form text output based on user-provided input. This action is ideal for tasks requiring natural language generation, such as summarizing documents, generating responses, or performing step-by-step reasoning.
Use this action when you need unstructured text results, like drafting emails, explaining concepts, or brainstorming ideas.
### Input Parameters
| Field | Type | Required | Description |
| :----------------- | :------- | :------------------- | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `system_prompt` | `string` | :x: | Defines the model's behavior or instructions. For example, "Act as a helpful assistant that summarizes technical articles." |
| `user_input` | `string` | :white\_check\_mark: | The primary context or query for the LLM to process. |
| `model` | `string` | :x: | Specifies the LLM model to use. See the Model Reference for available options. Defaults to `gpt-4o-mini-2024-07-18` |
| `temperature` | `number` | :x: | Control the randomness of the output. Higher values will make the output more random, while lower values will make it more focused and deterministic |
| `reasoning_effort` | `string` | :x: | Optional reasoning effort argument. Can be set to one of "minimal" (only `gpt-5` models), `"low"`, `"medium"`, or `"high"`. Must be left empty for non-reasoning models such as `gpt-4.1`. |
### Output
| Field | Type | Description |
| :----------------- | :------- | :------------------------------- |
| `generated_output` | `string` | The LLM-generated text response. |
### Usage Examples
Here are practical examples demonstrating various LLM abilities. Each includes a sample request schema for integration into a Compound Action.
#### Example 1: Text Summarization
Summarize a lengthy article or user query into a concise overview.
```yaml YAML - Compound Action
- action:
action_name: mw.generate_text_action
input_args:
system_prompt: '''Summarize the following text in 3-5 bullet points, focusing on key takeaways.'''
user_input: data.article_content # e.g., a long blog post fetched from an API
model: '''gpt-4o-mini'''
temperature: 0.7
output_key: summary_output
```
```yaml Conversational Process
system_prompt: '''Summarize the following text in 3-5 bullet points, focusing on key takeaways.'''
user_input: data.article_content # e.g., a long blog post fetched from an API
model: '''gpt-4o-mini'''
temperature: 0.7
```
#### Example 2: Content Generation
Generate creative or instructional content, such as drafting a user email.
```yaml YAML - Compound Action
- action:
action_name: mw.generate_text_action
input_args:
system_prompt: '''Write a professional email response based on the user's complaint.'''
user_input: data.user_complaint # e.g., "My order is delayed by two weeks."
output_key: email_draft
```
```yaml Conversational Process
system_prompt: '''Write a professional email response based on the user's complaint.'''
user_input: data.user_complaint # e.g., "My order is delayed by two weeks."
```
#### Example 3: Step-by-Step Reasoning
Guide the LLM through logical reasoning for problem-solving.
```yaml YAML - Compound Action
- action:
action_name: mw.generate_text_action
input_args:
system_prompt: '''Solve the problem step by step, explaining your reasoning.'''
user_input: '''What is the next number in the sequence: 2, 4, 8, 16?'''
reasoning_effort: '''high'''
model: '''gpt-5-2025-08-07'''
output_key: reasoning_output
```
```yaml Conversational Process
system_prompt: '''Solve the problem step by step, explaining your reasoning.'''
user_input: '''What is the next number in the sequence: 2, 4, 8, 16?'''
reasoning_effort: '''high'''
model: '''gpt-5-2025-08-07'''
```
***
# generate\_structured\_value\_action
### Description
The `generate_structured_value_action` calls an LLM to extract or generate data in a predefined structured format (JSON schema). This is particularly useful for classification, entity extraction, or transforming unstructured input into queryable data.
Apply this action for tasks where output consistency is critical, such as tagging content, extracting key-value pairs, or categorizing user inputs.
### Input Parameters
| Field | Type | Required | Description |
| :-------------------------- | :------- | :------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `payload` | `object` | :white\_check\_mark: | The data or text to analyze. |
| `output_schema` | `object` | :white\_check\_mark: | JSON Schema defining the expected output structure. |
| `system_prompt` | `string` | :x: | Defines the model's behavior or instructions. For example, "Act as a helpful assistant that summarizes technical articles." |
| `model` | `string` | :x: | Specifies the LLM model to use. Defaults to `"gpt-4o-mini-2024-07-18"`. IMPORTANT: This action is only compatible with `gpt-4o-mini-2024-07-18` and later and `gpt-4o-2024-08-06` and later. |
| `strict` | `string` | :x: | Enforces schema adherence. Defaults to `false`; Can either be `true`or `false` |
| `output_schema_name` | `string` | :x: | LLM-facing name for the schema (defaults to `extracted_value`) |
| `output_schema_description` | `string` | :x: | Description of the schema for the LLM. |
| `reasoning_effort` | `string` | :x: | Optional reasoning effort argument. Can be set to one of "minimal" (only `gpt-5` models), `"low"`, `"medium"`, or `"high"`. Must be left empty for non-reasoning models such as `gpt-4.1`. |
| Model | Capabilities | OpenAI Direct | Azure OpenAI | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Context | Max Output | Reasoning Effort | Live Search | US | EU | US | EU | CA | AU | Gov | |
| gpt-5.2-2025-12-11 | 400K | 128K | ✓ | — | ✓ | ✓ | ✓ | — | — | — | — |
| gpt-5.2 | 400K | 128K | ✓ | — | ✓ | ✓ | — | — | — | — | — |
| gpt-5.1-2025-11-13 | 400K | 128K | ✓ | — | ✓ | ✓ | ✓ | ✓ | — | — | ✓ |
| gpt-5.1-chat-latest | 400K | 128K | ✓ | — | ✓ | ✓ | — | — | — | — | — |
| gpt-5.1 | 400K | 128K | ✓ | — | ✓ | ✓ | — | — | — | — | — |
| gpt-5-2025-08-07 | 400K | 128K | ✓ | — | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| gpt-5 | 400K | 128K | ✓ | — | ✓ | ✓ | — | — | — | — | — |
| gpt-5-mini-2025-08-07 | 400K | 128K | ✓ | — | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| gpt-5-mini | 400K | 128K | ✓ | — | ✓ | ✓ | — | — | — | — | — |
| gpt-5-nano-2025-08-07 | 400K | 128K | ✓ | — | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| gpt-5-nano | 400K | 128K | ✓ | — | ✓ | ✓ | — | — | — | — | — |
| o4-mini-2025-04-16 | 200K | 100K | ✓ | — | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| o4-mini | 1M | 100K | ✓ | — | ✓ | ✓ | — | — | — | — | — |
| gpt-4.1-2025-04-14 | 1M | 32K | — | — | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| gpt-4.1 | 1M | 32K | — | — | ✓ | ✓ | — | — | — | — | — |
| gpt-4.1-mini-2025-04-14 | 1M | 32K | — | — | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| gpt-4.1-mini | 1M | 32K | — | — | ✓ | ✓ | — | — | — | — | — |
| gpt-4.1-nano-2025-04-14 | 1M | 32K | — | — | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| gpt-4.1-nano | 1M | 32K | — | — | ✓ | ✓ | — | — | — | — | — |
| o3-2025-04-16 | 200K | 100K | — | — | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| o3 | 200K | 100K | — | — | ✓ | ✓ | — | — | — | — | — |
| o3-mini-2025-01-31 | 200K | 100K | — | — | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| o3-mini | 200K | 100K | — | — | ✓ | ✓ | — | — | — | — | — |
| o1-2024-12-17 | 200K | 100K | — | — | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| o1 | 200K | 100K | — | — | ✓ | ✓ | — | — | — | — | — |
| gpt-4o-2024-11-20 | 128K | 16K | — | — | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| gpt-4o | 128K | 16K | — | — | ✓ | ✓ | — | — | — | — | — |
| gpt-4o-mini-2024-07-18 | 128K | 16K | — | — | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| gpt-4o-mini | 128K | 16K | — | — | ✓ | ✓ | — | — | — | — | — |
| gpt-4o-search-preview | 128K | 16K | — | ✓ | ✓ | ✓ | — | — | — | — | — |