Skip to content

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

Example for qwen

magmueller37ec112716ec
diff --git a/examples/qwen.py b/examples/qwen.py
new file mode 100644
index 000000000..1db213127
--- /dev/null
+++ b/examples/qwen.py
@@ -0,0 +1,31 @@
+import asyncio
+import os
+
+from langchain_ollama import ChatOllama
+
+from browser_use import Agent
+
+
+async def run_search():
+ agent = Agent(
+ task=(
+ '1. Go to https://www.reddit.com/r/LocalLLaMA'
+ "2. Search for 'browser use' in the search bar"
+ '3. Click search'
+ '4. Call done'
+ ),
+ llm=ChatOllama(
+ # model='qwen2.5:32b-instruct-q4_K_M',
+ # model='qwen2.5:14b',
+ model='qwen2.5:latest',
+ num_ctx=128000,
+ ),
+ max_actions_per_step=1,
+ tool_call_in_content=False,
+ )
+
+ await agent.run()
+
+
+if __name__ == '__main__':
+ asyncio.run(run_search())