demo_mistral.py
Run the Example
1
Set up your virtual environment
2
Install dependencies
3
Export environment variables
4
Run the example
Save the code above as
demo_mistral.py, then run:Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Run Mistral Large through Azure AI Foundry with a single prompt.
"""
Azure Demo Mistral
==================
Cookbook example for `azure/ai_foundry/demo_mistral.py`.
"""
from agno.agent import Agent, RunOutput # noqa
from agno.models.azure import AzureAIFoundry
# ---------------------------------------------------------------------------
# Create Agent
# ---------------------------------------------------------------------------
agent = Agent(model=AzureAIFoundry(id="Mistral-Large-2411"), 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
Set up your virtual environment
uv venv --python 3.12
source .venv/bin/activate
uv venv --python 3.12
.venv\Scripts\activate
Install dependencies
uv pip install -U agno aiohttp azure-ai-inference
Export environment variables
export AZURE_API_KEY="your_azure_api_key_here"
export AZURE_ENDPOINT="your_azure_endpoint_here"
$Env:AZURE_API_KEY="your_azure_api_key_here"
$Env:AZURE_ENDPOINT="your_azure_endpoint_here"
Run the example
demo_mistral.py, then run:python demo_mistral.py
Was this page helpful?