Skip to main content
Use Mistral models with Hypertic agent.

Installation

Install the Mistral package:
pip install hypertic[mistral]

Setup

Set your Mistral API key as an environment variable:
export MISTRAL_API_KEY=...

Initialize Model

Create a Mistral model instance:
from hypertic.models import MistralAI

model = MistralAI(
    model="mistral-large-latest",
    api_key="your-api-key",
)

Use with Agent

Pass the model to your agent:
from hypertic.agents import Agent
from hypertic.models import MistralAI
import os

model = MistralAI(
    model="mistral-large-latest",
    api_key=os.getenv("MISTRAL_API_KEY"),
)
agent = Agent(
    model=model,
    tools=[get_weather],
)

response = agent.run("What's the weather in SF?")
print(response.content)

Configuration Options

Supported parameters for Mistral models:
from hypertic.models import MistralAI
import os

model = MistralAI(
    model="mistral-large-latest",
    api_key=os.getenv("MISTRAL_API_KEY"),
    temperature=0.7,
    max_tokens=1000,
)
For the full list of available models and parameters, see the Mistral API documentation.