mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-26 19:24:27 +00:00
13 lines
403 B
Python
13 lines
403 B
Python
import os
|
|
|
|
from mistralai.client import MistralClient
|
|
from mistralai.models.chat_completion import ChatMessage
|
|
|
|
client = MistralClient(api_key="sk-1234", endpoint="http://0.0.0.0:4000")
|
|
chat_response = client.chat(
|
|
model="mistral-small-latest",
|
|
messages=[
|
|
{"role": "user", "content": "this is a test request, write a short poem"}
|
|
],
|
|
)
|
|
print(chat_response.choices[0].message.content)
|