Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
OPENAI_API_KEY=
ANTHROPIC_API_KEY=
GEMINI_API_KEY=
TONGYI_API_KEY=

# Set to false to disable anonymized telemetry
ANONYMIZED_TELEMETRY=false
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

<div align="center">
<h2>Tell your MacBook what to do, and it's done—across ANY app.</h2>
Created by <a href="https://x.com/OfirOzeri">Ofir Ozeri </a>♥️ migrated in collaboration with <a href="https://x.com/mamagnus00">Magnus</a> and <a href="https://x.com/gregpr07">Gregor</a><br>
Created by <a href="https://x.com/OfirOzeri">Ofir Ozeri </a>♥️ migrated in collaboration with <a href="https://x.com/mamagnus00">Magnus</a> and <a href="https://x.com/gregpr07">Gregor</a><br>
</div>
<br>

Expand All @@ -37,7 +37,7 @@ Clone first
git clone https://github.com/browser-use/macOS-use.git && cd macOS-use
```

Don't forget API key <br>Supported providers: [OAI](https://platform.openai.com/docs/quickstart), [Anthropic](https://docs.anthropic.com/en/api/admin-api/apikeys/get-api-key) or [Gemini](https://ai.google.dev/gemini-api/docs/api-key) (deepseek R1 coming soon!)
Don't forget API key <br>Supported providers: [OAI](https://platform.openai.com/docs/quickstart), [Anthropic](https://docs.anthropic.com/en/api/admin-api/apikeys/get-api-key), [Gemini](https://ai.google.dev/gemini-api/docs/api-key) or [Tongyi Qwen](https://www.alibabacloud.com/en/product/modelstudio) (deepseek R1 coming soon!)

<br> At the moment, macOS-use works best with OAI or Anthropic API, tho Gemini is free. it works great two, just not as reliably. <br>

Expand Down
15 changes: 11 additions & 4 deletions examples/try.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,26 +18,33 @@
def set_llm(llm_provider:str = None):
if not llm_provider:
raise ValueError("No llm provider was set")

if llm_provider == "OAI":
try:
api_key = os.getenv('OPENAI_API_KEY')
except Exception as e:
print(f"Error while getting API key: {e}")
api_key = None
return ChatOpenAI(model='gpt-4o', api_key=SecretStr(api_key))

if llm_provider == "google":
try:
api_key = os.getenv('GEMINI_API_KEY')
except Exception as e:
print(f"Error while getting API key: {e}")
api_key = None
return ChatGoogleGenerativeAI(model='gemini-2.0-flash-exp', api_key=SecretStr(api_key))

if llm_provider == 'qwen':
try:
api_key = os.getenv('TONGYI_API_KEY')
except Exception as e:
print(f"Error while getting API key: {e}")
api_key = None
return ChatOpenAI(base_url='https://dashscope-intl.aliyuncs.com/compatible-mode/v1', model='qwen-plus', api_key=SecretStr(api_key))

llm = set_llm('google')
llm = set_llm('OAI')

# llm = set_llm('qwen')

controller = Controller()
task = input("Hi there! What can I do for you today? ")
Expand Down