Created
January 28, 2025 01:45
-
-
Save tweibley/c05731d6953e0e1916fde981fc75c67f to your computer and use it in GitHub Desktop.
An example browser-use script for deepseek-r1 hosted locally via ollama
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import asyncio | |
from browser_use import Agent | |
from browser_use.agent.views import AgentHistoryList | |
from langchain_ollama import ChatOllama | |
async def run_search(): | |
agent = Agent( | |
task=('search for browser-use and summarize the first three results on google.com (do not click or attempt to sign in)'), | |
llm=ChatOllama( | |
base_url="http://localhost:11434/", | |
model='deepseek-r1:7b', | |
), | |
tool_calling_method="json_schema", | |
use_vision=False, | |
max_failures=3, | |
max_actions_per_step=2, | |
) | |
# Execute the task | |
result = await agent.run() | |
print(result) | |
# Run the function in an event loop | |
if __name__ == "__main__": | |
import asyncio | |
asyncio.run(run_search()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment