File tree Expand file tree Collapse file tree
agent-framework/user-guide/agents/agent-types Expand file tree Collapse file tree Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments