mirror of
https://github.com/microsoft/agent-framework.git
synced 2026-06-16 21:04:09 +08:00
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:
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(
|
||||
|
||||
Reference in New Issue
Block a user