Session
TheSession class is the primary way to start and interact with agent sessions.
Constructor Parameters
string
required
Name of the deployed agent to interact with.
string
required
Public API key for authentication.
SessionParams
Optional parameters to configure the session.
Methods
async
Starts a new session with the specified agent.ReturnsA dictionary containing session information. If
use_daily is True, includes dailyRoom URL and dailyToken.RaisesAgentStartError: If the session fails to start due to missing API key, agent not found, agent not ready, or capacity limits.SessionParams
TheSessionParams class allows you to configure a session.
Parameters
Dict[str, Any]
default:"None"
Optional dictionary of data to pass to the agent. Must be JSON-serializable.
boolean
default:"False"
If True, creates a Daily WebRTC room for the session, enabling voice
interaction.
Dict[str, Any]
default:"None"
Optional dictionary of properties to configure the Daily room. Only used when
use_daily=True.See Daily API
documentation for
available properties.