From 91593f8a35b38848e54e59b2f2d9cff4937f9e63 Mon Sep 17 00:00:00 2001 From: nicole pardal Date: Tue, 23 Sep 2025 18:07:53 -0700 Subject: [PATCH] api key fix added --- examples/gpt-oss-browser-tool.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/examples/gpt-oss-browser-tool.py b/examples/gpt-oss-browser-tool.py index 2713dd7..7d8e345 100644 --- a/examples/gpt-oss-browser-tool.py +++ b/examples/gpt-oss-browser-tool.py @@ -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