mirror of
https://github.com/microsoft/agent-framework.git
synced 2026-06-16 21:04:09 +08:00
Agents + Chat Client Samples Doctsring Updates (#1028)
* agents + chat client samples doctsring updates * fixes
This commit is contained in:
committed by
GitHub
Unverified
parent
3d04517877
commit
b88143b686
@@ -0,0 +1,17 @@
|
||||
# Anthropic Examples
|
||||
|
||||
This folder contains examples demonstrating how to use Anthropic's Claude models with the Agent Framework through the OpenAI Chat Client interface.
|
||||
|
||||
## Examples
|
||||
|
||||
| File | Description |
|
||||
|------|-------------|
|
||||
| [`anthropic_with_openai_chat_client.py`](anthropic_with_openai_chat_client.py) | Demonstrates how to configure OpenAI Chat Client to use Anthropic's Claude models. Shows both streaming and non-streaming responses with tool calling capabilities. |
|
||||
|
||||
## Environment Variables
|
||||
|
||||
Set the following environment variables before running the examples:
|
||||
|
||||
- `ANTHROPIC_API_KEY`: Your Anthropic API key (get one from [Anthropic Console](https://console.anthropic.com/))
|
||||
- `ANTHROPIC_MODEL`: The Claude model to use (e.g., `claude-3-5-sonnet-20241022`, `claude-3-haiku-20240307`)
|
||||
|
||||
+2
-10
@@ -10,16 +10,8 @@ from agent_framework.openai import OpenAIChatClient
|
||||
"""
|
||||
Anthropic with OpenAI Chat Client Example
|
||||
|
||||
This sample demonstrates how to use Anthropic models through the OpenAI Chat Client by
|
||||
configuring the base URL to point to Anthropic's API. The example includes:
|
||||
|
||||
- Setting up OpenAI Chat Client with Anthropic API configuration
|
||||
- Creating an agent with tool calling capabilities (weather function)
|
||||
- Non-streaming response example to get complete results at once
|
||||
- Streaming response example to receive results as they are generated
|
||||
|
||||
This approach allows you to leverage Anthropic's Claude models while using the familiar
|
||||
OpenAI client interface, making it easy to switch between different model providers.
|
||||
This sample demonstrates using Anthropic models through OpenAI Chat Client by
|
||||
configuring the base URL to point to Anthropic's API for cross-provider compatibility.
|
||||
"""
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user