Skip to main content

Signature

The Python signature takes agent_id and intent directly as arguments — there is no options-object/string overload like the TypeScript version, and no await since Python v1 is synchronous.

Parameters

Agents appear in the dashboard’s Agents tab automatically, grouped by agentId. Use a stable, descriptive agentId (for example billing-agent) so all of an agent’s sessions are grouped together. If you omit agentId, a random ID is generated for every session and those sessions are grouped under a single “Unidentified sessions” entry. To add a display name and description to an agent, open it in the dashboard and choose “Claim / Add details”. The agentId is case-sensitive: “Billing-Agent” and “billing-agent” are treated as two different agents.

Returns

Example

newSession() / new_session() must always be awaited (TypeScript) and will throw/raise AgentReinUnavailableError if authentication with the AgentRein server fails (e.g. invalid API key, server down during token exchange). If auth succeeds but session creation fails due to a network error, an AxiosError (TypeScript) or httpx.HTTPError (Python) is thrown/raised. A session is required for subsequent wrap() and completeSession()/complete_session() calls.