Agentic Workflows
Overview
Agentic workflows enable the model to make multiple sequential tool calls for complex multi-step reasoning. The model autonomously decides which tools to use, chains them together, and iterates until it has sufficient information to answer the question.
Getting started
Enable the model to make multiple sequential tool calls:
Example interaction
How agentic behavior works
The model autonomously:
- Decides which tools to use based on the question
- Chains multiple tools together (e.g., get employee info → lookup location details)
- Iterates until it has sufficient information to answer
- Handles complex multi-step reasoning automatically
This is achieved by running a loop that continues making requests as long as the model is calling tools.
API reference
Request
The LLM Gateway accepts POST requests to https://llm-gateway.assemblyai.com/v1/chat/completions
with the following parameters:
Request parameters
Message object
Tool object
Tool choice object
The tool_choice
parameter can be:
"none"
- The model will not call any tools"auto"
- The model can choose whether to call tools- An object with
type: "function"
and afunction.name
to force calling a specific function
Response
The API returns a JSON response. In agentic workflows, the model may make multiple tool calls before providing a final answer.
First response (tool call)
Subsequent response (another tool call)
After adding the function result to conversation history:
Final response (answer)
After all tool calls are complete:
Response fields
Tool call object
When the model wants to call a tool, the response includes a tool_calls
array:
Error response
If an error occurs, the API returns an error response: