OpenAI Chat Completions Agent
Overview
The OpenAI Chat Completions Agent Snap accepts input containing an initial request contents, a list of tools, and parameters to invoke an Agent execution loop. The Snap handles the call to the OpenAI Chat Completions, consumes the result and call tools, then collect them accordingly until the model has no more tools to call.
Learn more about the Agent Snap in this developer blog.

Read-type Snap
Snap views
| View | Description | Examples of upstream and downstream Snaps |
|---|---|---|
| Input | This Snap has one document input view, typically carrying the input message for the OpenAI model. | |
| Output | This Snap has exactly two document output views. The first one outputs the full response from the model. The second one outputs the list of tools to call. It includes a JSON argument, whose value is a JSON object derived from converting the string-formatted argument of the model's response tool call. | |
| Error |
Error handling is a generic way to handle errors without losing data or failing the Snap execution. You can handle the errors that the Snap might encounter when running the pipeline by choosing one of the following options from the When errors occur list under the Views tab. The available options are:
Learn more about Error handling in Pipelines. |
|
Snap settings
- Expression icon (
): Allows using JavaScript syntax to access SnapLogic Expressions to set field values dynamically (if enabled). If disabled, you can provide a static value. Learn more.
- SnapGPT (
): Generates SnapLogic Expressions based on natural language using SnapGPT. Learn more.
- Suggestion icon (
): Populates a list of values dynamically based on your Snap configuration. You can select only one attribute at a time using the icon. Type into the field if it supports a comma-separated list of values.
- Upload
: Uploads files. Learn more.
| Field / Field set | Type | Description |
|---|---|---|
| Label | String |
Required. Specify a unique name for the Snap. Modify this to be more appropriate, especially if more than one of the same Snaps is in the pipeline. Default value: OpenAI Chat Completions Agent Example: Invoke gpt-4 model for sentiment analysis |
| Visualize agent flow | String |
Launch the Agent Visualizer UI. Default value: N/A |
| Model name | String/Expression/ Suggestion | Required. Specify the name of the OpenAI model you want to use, such as gpt-4o or gpt-4o-mini. Default value: N/A Example: gpt-4o |
| Message payload | String/Expression | Required. Enter the message payload that will be processed by the model. This payload typically includes input messages in JSON format. The message is an array passed from the input document and obtained through an expression.
Important:
Here are the typical scenarios of how the tool calling Snap
processes different types of message lists in the input document:
Default value: N/A Example: $inputMessage |
| Tool payload | String/Expression | Required. Enter the tool payload that defines the tools (name, description, parameters, etc.) the model can choose to call. Note: The model cannot directly call tools. It can only suggest, based on the tool definition, which tools are required to respond to the user's original prompt. The actual tool invocation is the user's responsibility. Default value: N/A Example: $specifiedTools |
| Output Handling | Checkbox/Expression | Select to store the output. Default value: Deselected. |
| Store | Checkbox/Expression |
Indicate whether to store or not store the output of the chat completion request. Default status: Deselected |
| Agent execution configuration |
Modify the limitation of the Agent execution. |
|
| Iteration limit | Integer/Expression |
Required. The maximum iterations an agent should run. Default: 10 Example: 10 |
| Monitor tool calls | Checkbox |
Monitor tool call parameters in pipeline statistics. Default status: Selected |
| Pool size | Integer/Expression |
Required. The number of threads for parallel tool execution. Default value:1 Example: 1 |
| Reuse tool pipeline | Checkbox |
Reuse the tool pipeline for tool execution. Default status: Deselected |
| Advanced tool configuration |
Modify the tool call settings to guide the model responses and optimize output processing. |
|
| Tool choice | Dropdown list/Expression |
Controls which (if any) tool is called by the model.
Example: AUTO |
| Function name | String/Expression |
Required. The name of the function to force the model to call. Default value: N/A Example: get_weather |
| Parallel tool call | Checkbox/Expression |
Select this checkbox to enable parallel tool calling. Default status: Selected |
| Model parameters | Configure the parameters to tune the model runtime. | |
| Reasoning effort | Dropdown list/Expression | Select the level of constraint for a reasoning model. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response.
Enabled if the mode is a reasoning model or an expression. Default value: medium |
| Maximum tokens | Integer/Expression |
Specify the maximum number of tokens to be used to generate the chat completions result, including tokens used for reasoning. If left blank, the default value of the endpoint is used. Default value: N/A Example: 50 |
| Temperature | Decimal/Expression |
Specify the sampling temperature to use a decimal value between 0 and 1. If left blank, the default value of the endpoint is used. Default value: N/A Example: 0.2 |
| Top P | Decimal/Expression |
Specify the nucleus sampling value, a decimal value between 0 and 1. If left blank, the default value of the endpoint is used. Default value: N/A Example: 0.2 |
| Stop sequences | String/Expression |
Specify a sequence of texts or tokens to stop the model from generating further output. Learn more. Note:
Default value: N/A Example: pay, ["amazing"], ["September", "paycheck"] |
| Advanced prompt configuration | Configure the prompt settings to guide the model responses and optimize output processing. | |
| Structured outputs | String/Expression |
Enter the schema or expression to ensures that the model always returns outputs that match your defined JSON Schema. Default value: N/A Example: $response_format.json_schema Important:
Only the following models support structured outputs for JSON mode:
|
| JSON mode | Checkbox/Expression | Select this checkbox to enable the model to generate strings that can be parsed into valid JSON objects.
The output includes the json_output field that contains the parsed JSON object, encapsulating the data. |
| Snap execution | Dropdown list |
Choose one of the three modes in
which the Snap executes. Available options are:
Default value: Validate & Execute Example: Execute only |