Skip to main content
The ConversimpleAgent provides several callback methods that you can override in your agent class to react to different events during a conversation.

Callback Methods

on_conversation_started(conversation_id: str)

Called when a new conversation starts.
str
required
The unique identifier for the started conversation.

on_conversation_ended(conversation_id: str)

Called when a conversation ends.
str
required
The unique identifier for the ended conversation.

on_tool_called(tool_call)

Called when the platform requests your agent to execute a tool.
conversimple.tools.ToolCall
required
An object containing details about the tool call, including call_id, tool_name, arguments, and conversation_id.

on_tool_completed(call_id: str, result: Any)

Called after a tool execution has successfully completed and its result has been sent to the platform.
str
required
The unique identifier of the tool call.
Any
required
The result returned by the executed tool.

on_error(error_type: str, message: str, details: dict)

Called when an error occurs within the agent or is reported by the platform.
str
required
The type of error (e.g., connection_error, tool_execution_error).
str
required
A descriptive error message.
dict
required
A dictionary containing additional error details.

on_config_update(config: Dict[str, Any])

Called when the agent receives a configuration update from the platform.
Dict[str, Any]
required
A dictionary containing the updated configuration.