Open-source Python library for AI browser agents, plus Browser Use Cloud: stealth browsers and a hosted agent API.
Python ai-agentsai-toolsbrowser-agentbrowser-automationbrowser-usecdpcloud-browsercomputer-useheadless-browserllmmcpplaywrightpythonremote-browserstealth-browserweb-automationweb-scraping
llm_response
Magnus Müller035617e22848
diff --git a/browser_use/agent/service.py b/browser_use/agent/service.pyindex df61bf137..bb315c48e 100644--- a/browser_use/agent/service.py+++ b/browser_use/agent/service.py@@ -1335,6 +1335,9 @@ class Agent(Generic[Context, AgentStructuredOutput]):urls_visited=self.history.urls(),steps=self.state.n_steps,total_input_tokens=token_summary.prompt_tokens,+ total_output_tokens=token_summary.completion_tokens,+ prompt_cached_tokens=token_summary.prompt_cached_tokens,+ total_tokens=token_summary.total_tokens,total_duration_seconds=self.history.total_duration_seconds(),success=self.history.is_successful(),final_result_response=final_result_str,diff --git a/browser_use/code_use/service.py b/browser_use/code_use/service.pyindex 4edcf4a98..53830bf0e 100644--- a/browser_use/code_use/service.py+++ b/browser_use/code_use/service.py@@ -1166,10 +1166,10 @@ __code_exec_coro__ = __code_exec__()action_history_data: list[list[dict[str, Any]] | None] = []for step in self.complete_history:# Extract code from model_output if available (type-safe access)- if step.model_output and step.model_output.model_output:- code = step.model_output.model_output+ if step.model_output and step.model_output.full_response:+ code = step.model_output.full_response# Represent each code cell as a simple action entry- action_history_data.append([{'code_cell': True, 'code_length': len(code)}])+ action_history_data.append([{'llm_response': code}])else:action_history_data.append(None)@@ -1214,6 +1214,9 @@ __code_exec_coro__ = __code_exec__()urls_visited=urls_visited,steps=len(self.complete_history),total_input_tokens=token_summary.prompt_tokens,+ total_output_tokens=token_summary.completion_tokens,+ prompt_cached_tokens=token_summary.prompt_cached_tokens,+ total_tokens=token_summary.total_tokens,total_duration_seconds=sum(step.metadata.duration_seconds for step in self.complete_history if step.metadata),success=self_reported_success,final_result_response=final_result_str,diff --git a/browser_use/telemetry/views.py b/browser_use/telemetry/views.pyindex 10089773c..f925ffa53 100644--- a/browser_use/telemetry/views.py+++ b/browser_use/telemetry/views.py@@ -41,6 +41,9 @@ class AgentTelemetryEvent(BaseTelemetryEvent):# end detailssteps: inttotal_input_tokens: int+ total_output_tokens: int+ prompt_cached_tokens: int+ total_tokens: inttotal_duration_seconds: floatsuccess: bool | Nonefinal_result_response: str | None