mirror of
https://github.com/ollama/ollama-python.git
synced 2026-09-09 12:39:55 +00:00
api key fix added
This commit is contained in:
@@ -10,7 +10,9 @@ from ollama import Client
|
|||||||
|
|
||||||
def main() -> None:
|
def main() -> None:
|
||||||
api_key = os.getenv('OLLAMA_API_KEY')
|
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)
|
browser = Browser(initial_state=None, client=client)
|
||||||
|
|
||||||
# Tool schemas
|
# Tool schemas
|
||||||
|
|||||||
Reference in New Issue
Block a user