Overview
Multi-turn conversations allow you to maintain context across multiple exchanges by including conversation history in your API requests. This enables the model to understand and reference previous messages, creating natural, coherent dialogues.Why use multi-turn conversations?
With conversation history, you can:- Ask follow-up questions - Ask “What’s the population?” and the model knows you’re referring to Paris from the previous message
- Build on previous responses - Request clarifications, expansions, or corrections without repeating context
- Create interactive experiences - Build chatbots, assistants, and conversational interfaces that feel natural
How it works
Each API request includes an array of previous messages. The model uses this history to understand context and maintain coherence across the conversation:Getting started
Maintain context by including conversation history:- Python
- JavaScript
Message types
When building conversation history, you can use the following message types:- user - Messages from the user
- assistant - Messages from the AI model
- system - System instructions or context
API reference
Request
The LLM Gateway accepts POST requests tohttps://llm-gateway.assemblyai.com/v1/chat/completions with the following parameters: