Skip to main content

ToolResult

Special result type for tools that can return images along with text. This class is used by ChatAgent to detect when a tool returns visual content that should be included in the conversation context.

init

Initialize a tool result. Parameters:
  • text (str): The text description or result of the tool operation.
  • images (Optional[List[str]]): List of base64-encoded images to include in the conversation context. Images should be encoded as “data:image/{format};base64,{data}” format.

str

Return the text representation of the result.

repr

Return a detailed representation of the result.