Skip to main content

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_KEY and FI_SECRET_KEY from 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.ipynb

Install

Quick start (cloud chat simulation)

To run a chat simulation, you need to:
  1. Define an agent_callback (your chat agent)
  2. Call run_test for an existing Run Test you created in the UI
If you already have your own chat agent (LangChain, LlamaIndex, custom app, etc.), keep it unchanged: just wrap it in agent_callback so the simulator can call it turn-by-turn.

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 as agent_callback.
SDK class reference:
Example wrapper:

Optional: tool calling with AgentResponse

If your agent uses tools/functions, return an AgentResponse (instead of a plain string):
If you want to mock tools during a real simulation run (so you can see how your agent behaves end-to-end without calling external systems), you can stub tool outputs inside your agent_callback.

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.
Pro tip: reuse a prompt from Future AGIIf you maintain your system prompt in Future AGI, you can fetch it and use it inside your callback. For more on prompt templates and compiling variables, see Prompt Workbench Using SDK.

Next steps

  • Review the transcripts and scores in Run Tests
  • Reiterate on your agent callback to improve the agent’s performance