What it does
- Runs an existing Run Test (configured in the Future AGI UI) in chat mode
- For each conversation, the simulator sends chat messages and calls your agent callback to get responses
- Stores transcripts + results in your Future AGI dashboard
Before you start (UI setup)
Chat simulation uses the same high-level building blocks as voice simulation, but some fields are chat-specific.- Agent Definition (Chat): Create your agent definition as
chat. Voice-only fields like phone number aren’t required for chat tests. See Agent Definition. - Personas (Chat): Persona “voice” settings (accent, background noise, speaking speed) are voice-only; for chat, focus on tone, behavior, and custom properties. See Personas.
- Scenarios (Chat): Create scenarios that represent chat conversations (dataset/workflow/script/SOP). See Scenarios.
- Run Tests: Create a Run Test that links your chat agent + scenarios. You’ll reference the Run Test name from the SDK. See Run Tests.
Requirements
- Python 3.10+
FI_API_KEYandFI_SECRET_KEYfrom Future AGI- A created Run Test (chat) in the Future AGI UI
- If your callback uses an LLM provider: the relevant provider key (e.g.
OPENAI_API_KEY,ANTHROPIC_API_KEY,GOOGLE_API_KEY, etc.)
Colab example
You can run the full notebook here: Chat Simulate Testing.ipynbInstall
Quick start (cloud chat simulation)
To run a chat simulation, you need to:- Define an
agent_callback(your chat agent) - Call
run_testfor an existing Run Test you created in the UI
Callback contract (what the SDK sends to you)
input.new_message: the latest simulator message you should respond to (treat it like “the user message”)input.messages: the conversation history so far (including that last simulator message)input.thread_id/input.execution_id: IDs you can use for logging / correlation
The 3 core SDK types (AgentInput, AgentResponse, AgentWrapper)
AgentInput: what the simulator sends to your code each turn (history + latest message).AgentResponse: optional structured return type (content + tool calls/results). You can also just return a plain string.AgentWrapper: an abstract class that provides a clean pattern if you don’t want to pass a raw function asagent_callback.
Optional: tool calling with AgentResponse
If your agent uses tools/functions, return an AgentResponse (instead of a plain string):
Where results show up
Cloud chat simulation writes results to your Future AGI dashboard. The SDK call is mainly used to:- orchestrate runs
- call your
agent_callback - stream messages back to the simulator
Troubleshooting
- ReadError / timeouts: try increasing
timeout:
- “Invalid status. Valid choices are …”: statuses are lowercase (
pending,queued,ongoing,completed,failed,analyzing,cancelled). If you see this, it’s a backend validation message surfaced in logs and you can ignore it unless runs are stuck.
Next steps
- Review the transcripts and scores in Run Tests
- Reiterate on your agent callback to improve the agent’s performance