from openai import OpenAI
from os import getenv
# gets API Key from environment variable LLMSTORE_API_KEY
client = OpenAI(
base_url="https://api.llmstore.ru/v1",
api_key=getenv("LLMSTORE_API_KEY"),
)
completion = client.chat.completions.create(
model="openai/gpt-4o",
# pass extra_body to access LLMSTORE-only arguments.
# extra_body={
# "models": [
# "openai/gpt-4o",
# "mistralai/mixtral-8x22b-instruct"
# ]
# },
messages=[
{
"role": "user",
"content": "Say this is a test",
},
],
)
print(completion.choices[0].message.content)