Skip to main content
AzureAIFoundry uses the retired azure-ai-inference SDK. Microsoft retired this SDK on May 30, 2026 and directs model inference to the OpenAI SDK. Use this page only for a classic deployment while you follow Microsoft’s Foundry migration guide.

Code

tool_use.py

Usage

1

Set up your virtual environment

2

Create the model deployment

In your classic Foundry project, deploy Cohere Command A with the deployment name Cohere-command-a. If you choose another deployment name, pass that exact name to AzureAIFoundry(id=...).
3

Set your API key

4

Install dependencies

5

Run Agent

Save the code above as tool_use.py, then run: