The run() method returns an AgentHistoryList object with the complete execution history:
Copy
Ask AI
history = await agent.run()# Access useful informationhistory.urls() # List of visited URLshistory.screenshot_paths() # List of screenshot paths history.screenshots() # List of screenshots as base64 stringshistory.action_names() # Names of executed actionshistory.extracted_content() # List of extracted content from all actionshistory.errors() # List of errors (with None for steps without errors)history.model_actions() # All actions with their parametershistory.model_outputs() # All model outputs from historyhistory.last_action() # Last action in history# Analysis methodshistory.final_result() # Get the final extracted content (last step)history.is_done() # Check if agent completed successfullyhistory.is_successful() # Check if agent completed successfully (returns None if not done)history.has_errors() # Check if any errors occurredhistory.model_thoughts() # Get the agent's reasoning process (AgentBrain objects)history.action_results() # Get all ActionResult objects from historyhistory.action_history() # Get truncated action history with essential fieldshistory.number_of_steps() # Get the number of steps in the historyhistory.total_duration_seconds() # Get total duration of all steps in seconds# Structured output (when using output_model_schema)history.structured_output # Property that returns parsed structured output