> ## Documentation Index
> Fetch the complete documentation index at: https://agno-v2.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Azure Demo Cohere

> Run Cohere Command R through Azure AI Foundry with a single prompt.

```python demo_cohere.py theme={null}
"""
Azure Demo Cohere
=================

Cookbook example for `azure/ai_foundry/demo_cohere.py`.
"""

from agno.agent import Agent, RunOutput  # noqa
from agno.models.azure import AzureAIFoundry

# ---------------------------------------------------------------------------
# Create Agent
# ---------------------------------------------------------------------------

agent = Agent(model=AzureAIFoundry(id="Cohere-command-r-08-2024"), markdown=True)

# Get the response in a variable
# run: RunOutput = agent.run("Share a 2 sentence horror story")
# print(run.content)

# Print the response on the terminal
agent.print_response("Share a 2 sentence horror story")

# ---------------------------------------------------------------------------
# Run Agent
# ---------------------------------------------------------------------------

if __name__ == "__main__":
    pass
```

## Run the Example

<Snippet file="create-venv-step.mdx" />

**1. Install dependencies**

```bash theme={null}
uv pip install -U agno aiohttp azure-ai-inference
```

**2. Export environment variables**

```bash Mac/Linux theme={null}
export AZURE_API_KEY="your_azure_api_key_here"
export AZURE_ENDPOINT="your_azure_endpoint_here"
```

```bash Windows theme={null}
$Env:AZURE_API_KEY="your_azure_api_key_here"
$Env:AZURE_ENDPOINT="your_azure_endpoint_here"
```

**3. Run the example**

Save the code above as `demo_cohere.py`, then run:

```bash theme={null}
python demo_cohere.py
```

Full source: [cookbook/90\_models/azure/ai\_foundry/demo\_cohere.py](https://github.com/agno-agi/agno/blob/v3.0.4/cookbook/90_models/azure/ai_foundry/demo_cohere.py)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.