Skip to content

Open-source Python library for AI browser agents, plus Browser Use Cloud: stealth browsers and a hosted agent API.

Support QwQ-32b

vonjackustc1b7fa09ccf61
diff --git a/browser_use/agent/service.py b/browser_use/agent/service.py
index 50947781f..005236cf6 100644
--- a/browser_use/agent/service.py
+++ b/browser_use/agent/service.py
@@ -527,6 +527,13 @@ class Agent(Generic[Context]):
structured_llm = self.llm.with_structured_output(self.AgentOutput, include_raw=True, method=self.tool_calling_method)
response: dict[str, Any] = await structured_llm.ainvoke(input_messages) # type: ignore
parsed: AgentOutput | None = response['parsed']
+ if not parsed:
+ try:
+ parsed_json = extract_json_from_model_output(response["raw"].content)
+ parsed = self.AgentOutput(**parsed_json)
+ except:
+ logger.warning(f'Failed to parse model output: {response["raw"].content} {str(e)}')
+ raise ValueError('Could not parse response.')
if parsed is None:
raise ValueError('Could not parse response.')