Spaces:
Runtime error
Runtime error
Download test.py from FreudArthur/Automatisation: direct link, hf CLI and curl.
- Browser
- Download file 523 Bytes
-
https://huggingface.co/spaces/FreudArthur/Automatisation/resolve/main/test.py
- Command line
-
hf download hf://spaces/FreudArthur/Automatisation/test.py
-
curl -L -o test.py https://huggingface.co/spaces/FreudArthur/Automatisation/resolve/main/test.py
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) | |