Skip to content

Commit 5d20500

Browse files
Merge pull request #778 from eavanvalkenburg/anthropic_foundry
add a note on how to setup with Foundry
2 parents 1963da5 + 2263848 commit 5d20500

1 file changed

Lines changed: 29 additions & 0 deletions

File tree

agent-framework/user-guide/agents/agent-types/anthropic-agent.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,35 @@ async def explicit_config_example():
9494
print(result.text)
9595
```
9696

97+
### Using Anthropic on Foundry
98+
99+
After you've setup Anthropic on Foundry, ensure you have the following environment variables set:
100+
101+
```bash
102+
ANTHROPIC_FOUNDRY_API_KEY="your-foundry-api-key"
103+
ANTHROPIC_FOUNDRY_RESOURCE="your-foundry-resource-name"
104+
```
105+
Then create the agent as follows:
106+
107+
```python
108+
from agent_framework.anthropic import AnthropicClient
109+
from anthropic import AsyncAnthropicFoundry
110+
111+
async def foundry_example():
112+
agent = AnthropicClient(
113+
anthropic_client=AsyncAnthropicFoundry()
114+
).create_agent(
115+
name="FoundryAgent",
116+
instructions="You are a helpful assistant using Anthropic on Foundry.",
117+
)
118+
119+
result = await agent.run("How do I use Anthropic on Foundry?")
120+
print(result.text)
121+
```
122+
123+
> Note:
124+
> This requires `anthropic>=0.74.0` to be installed.
125+
97126
## Agent Features
98127

99128
### Function Tools

0 commit comments

Comments
 (0)