Python: samples: add api_key for Ollama sample usage (#1240)

* samples: add api_key for Ollama sample usage

* Update python/samples/getting_started/agents/ollama/ollama_with_openai_chat_client.py

Co-authored-by: Dmytro Struk <13853051+dmytrostruk@users.noreply.github.com>

* fix: update Ollama API key to an unused constant

---------

Co-authored-by: Dmytro Struk <13853051+dmytrostruk@users.noreply.github.com>
This commit is contained in:
Mars Wang
2025-10-08 16:45:24 -04:00
committed by GitHub
Unverified
parent 7e891fab39
commit 3d31a4a204
@@ -33,6 +33,7 @@ async def non_streaming_example() -> None:
print("=== Non-streaming Response Example ===")
agent = OpenAIChatClient(
api_key="ollama", # Just a placeholder, Ollama doesn't require API key
base_url=os.getenv("OLLAMA_ENDPOINT"),
model_id=os.getenv("OLLAMA_MODEL"),
).create_agent(
@@ -52,6 +53,7 @@ async def streaming_example() -> None:
print("=== Streaming Response Example ===")
agent = OpenAIChatClient(
api_key="ollama", # Just a placeholder, Ollama doesn't require API key
base_url=os.getenv("OLLAMA_ENDPOINT"),
model_id=os.getenv("OLLAMA_MODEL"),
).create_agent(