Skip to main content

Parameters

Functions

Run the agent and print the response. Parameters:
  • message (Optional[Union[List, Dict, str, Message]]): The message to send to the agent
  • session_id (Optional[str]): Session ID to use
  • user_id (Optional[str]): User ID to use
  • messages (Optional[List[Union[Dict, Message]]]): List of additional messages to use
  • audio (Optional[Sequence[Audio]]): Audio files to include
  • images (Optional[Sequence[Image]]): Image files to include
  • videos (Optional[Sequence[Video]]): Video files to include
  • files (Optional[Sequence[File]]): Files to include
  • stream (Optional[bool]): Whether to stream the response
  • stream_intermediate_steps (bool): Whether to stream intermediate steps
  • markdown (bool): Whether to format output as markdown
  • show_message (bool): Whether to show the message
  • show_reasoning (bool): Whether to show reasoning
  • show_full_reasoning (bool): Whether to show full reasoning
  • console (Optional[Any]): Console to use for output
  • knowledge_filters (Optional[Dict[str, Any]]): Knowledge filters to apply

run

Run the agent. Parameters:
  • message (Optional[Union[str, List, Dict, Message]]): The message to send to the agent
  • stream (Optional[bool]): Whether to stream the response
  • user_id (Optional[str]): User ID to use
  • session_id (Optional[str]): Session ID to use
  • audio (Optional[Sequence[Audio]]): Audio files to include
  • images (Optional[Sequence[Image]]): Image files to include
  • videos (Optional[Sequence[Video]]): Video files to include
  • files (Optional[Sequence[File]]): Files to include
  • messages (Optional[Sequence[Union[Dict, Message]]]): List of additional messages to use
  • stream_intermediate_steps (Optional[bool]): Whether to stream intermediate steps
  • retries (Optional[int]): Number of retries to attempt
  • knowledge_filters (Optional[Dict[str, Any]]): Knowledge filters to apply
Returns:
  • Union[RunResponse, Iterator[RunResponseEvent]]: Either a RunResponse or an iterator of RunResponseEvents, depending on the stream parameter

aprint_response

Run the agent and print the response asynchronously. Parameters:
  • message (Optional[Union[List, Dict, str, Message]]): The message to send to the agent
  • session_id (Optional[str]): Session ID to use
  • user_id (Optional[str]): User ID to use
  • messages (Optional[List[Union[Dict, Message]]]): List of additional messages to use
  • audio (Optional[Sequence[Audio]]): Audio files to include
  • images (Optional[Sequence[Image]]): Image files to include
  • videos (Optional[Sequence[Video]]): Video files to include
  • files (Optional[Sequence[File]]): Files to include
  • stream (Optional[bool]): Whether to stream the response
  • stream_intermediate_steps (bool): Whether to stream intermediate steps
  • markdown (bool): Whether to format output as markdown
  • show_message (bool): Whether to show the message
  • show_reasoning (bool): Whether to show reasoning
  • show_full_reasoning (bool): Whether to show full reasoning
  • console (Optional[Any]): Console to use for output
  • knowledge_filters (Optional[Dict[str, Any]]): Knowledge filters to apply

arun

Run the agent asynchronously. Parameters:
  • message (Optional[Union[str, List, Dict, Message]]): The message to send to the agent
  • stream (Optional[bool]): Whether to stream the response
  • user_id (Optional[str]): User ID to use
  • session_id (Optional[str]): Session ID to use
  • audio (Optional[Sequence[Audio]]): Audio files to include
  • images (Optional[Sequence[Image]]): Image files to include
  • videos (Optional[Sequence[Video]]): Video files to include
  • files (Optional[Sequence[File]]): Files to include
  • messages (Optional[Sequence[Union[Dict, Message]]]): List of additional messages to use
  • stream_intermediate_steps (Optional[bool]): Whether to stream intermediate steps
  • retries (Optional[int]): Number of retries to attempt
  • knowledge_filters (Optional[Dict[str, Any]]): Knowledge filters to apply
Returns:
  • Union[RunResponse, AsyncIterator[RunResponseEvent]]: Either a RunResponse or an iterator of RunResponseEvents, depending on the stream parameter

continue_run

Continue a run. Parameters:
  • run_response (Optional[RunResponse]): The run response to continue
  • run_id (Optional[str]): The run ID to continue
  • updated_tools (Optional[List[ToolExecution]]): Updated tools to use, required if the run is resumed using run_id
  • stream (Optional[bool]): Whether to stream the response
  • stream_intermediate_steps (Optional[bool]): Whether to stream intermediate steps
  • user_id (Optional[str]): User ID to use
  • session_id (Optional[str]): Session ID to use
  • retries (Optional[int]): Number of retries to attempt
  • knowledge_filters (Optional[Dict[str, Any]]): Knowledge filters to apply
Returns:
  • Union[RunResponse, Iterator[RunResponseEvent]]: Either a RunResponse or an iterator of RunResponseEvents, depending on the stream parameter

acontinue_run

Continue a run asynchronously. Parameters:
  • run_response (Optional[RunResponse]): The run response to continue
  • run_id (Optional[str]): The run ID to continue
  • updated_tools (Optional[List[ToolExecution]]): Updated tools to use, required if the run is resumed using run_id
  • stream (Optional[bool]): Whether to stream the response
  • stream_intermediate_steps (Optional[bool]): Whether to stream intermediate steps
  • user_id (Optional[str]): User ID to use
  • session_id (Optional[str]): Session ID to use
  • retries (Optional[int]): Number of retries to attempt
  • knowledge_filters (Optional[Dict[str, Any]]): Knowledge filters to apply
Returns:
  • Union[RunResponse, AsyncIterator[RunResponseEvent]]: Either a RunResponse or an iterator of RunResponseEvents, depending on the stream parameter

get_session_summary

Get the session summary for the given session ID and user ID. Parameters:
  • session_id (Optional[str]): Session ID to use (if not provided, the current session is used)
  • user_id (Optional[str]): User ID to use (if not provided, the current user is used)
Returns:
  • Optional[SessionSummary]: The session summary

get_user_memories

Get the user memories for the given user ID. Parameters:
  • user_id (Optional[str]): User ID to use (if not provided, the current user is used)
Returns:
  • Optional[List[UserMemory]]: The user memories

add_tool

Add a tool to the agent. Parameters:
  • tool (Union[Toolkit, Callable, Function, Dict]): The tool to add

set_tools

Replace the tools of the agent. Parameters:
  • tools (List[Union[Toolkit, Callable, Function, Dict]]): The tools to set