mirror of
https://github.com/ollama/ollama-python.git
synced 2026-01-13 21:57:16 +08:00
api key fix added
This commit is contained in:
parent
2b20ec482d
commit
91593f8a35
@ -10,7 +10,9 @@ from ollama import Client
|
||||
|
||||
def main() -> None:
|
||||
api_key = os.getenv('OLLAMA_API_KEY')
|
||||
client = Client(headers={'Authorization': f'Bearer {api_key}'}) if api_key else Client()
|
||||
if not api_key:
|
||||
raise RuntimeError('OLLAMA_API_KEY is required to run this example')
|
||||
client = Client(host='https://ollama.com', headers={'Authorization': f'Bearer {api_key}'})
|
||||
browser = Browser(initial_state=None, client=client)
|
||||
|
||||
# Tool schemas
|
||||
|
||||
Loading…
Reference in New Issue
Block a user