Skip to main content

Synchronous Usage

from mistralai.client import MistralClient
import dokumetry

mistral = MistralClient(
  api_key="YOUR_MISTRAL_API_KEY"
)

# Pass the above `mistral` object along with your Doku Ingester URL and API key and this will make sure that all Anthropic calls are automatically tracked.
dokumetry.init(llm=mistral, doku_url="YOUR_DOKU_INGESTER_URL", api_key="YOUR_DOKU_TOKEN")

response = mistral.chat(
  model="mistral-small-latest",
  messages=[ChatMessage(role="user", content="Guide to Monitor my LLM Applications")],
)
print(response)

Asynchronous usage

import asyncio
from mistralai.client import AsyncMistralClient
import dokumetry

mistral = AsyncMistralClient(
  api_key="YOUR_MISTRAL_API_KEY"
)

# Pass the above `mistral` object along with your Doku Ingester URL and API key and this will make sure that all Anthropic calls are automatically tracked.
dokumetry.init(llm=mistral, doku_url="YOUR_DOKU_INGESTER_URL", api_key="YOUR_DOKU_TOKEN")

async def main() -> None:
  response = mistral.chat(
    model="mistral-small-latest",
    messages=[ChatMessage(role="user", content="Guide to Monitor my LLM Applications")],
  )
  print(message)

asyncio.run(main())