Automatisation / test.py
FreudArthur's picture
Refactor project structure and update configurations for n8n automation
a63e449
Raw History Blame Contribute Delete
523 Bytes
from mistralai.client import Mistral
import os
from dotenv import load_dotenv
load_dotenv()
with Mistral(
api_key=os.getenv("MISTRAL_API_KEY", ""),
) as mistral:
res = mistral.chat.complete(model="mistral-large-latest", messages=[
{
"role": "user",
"content": "Who is the best French painter? Answer in one short sentence.\nWhat is the most powerful AI today",
},
], stream=False, response_format={
"type": "text",
})
# Handle response
print(res)