The supported model

Model and context length for Qianfan API support:

Qianfan Models

PlatformModel IdentifierNotes
QfanQfan/ERNIE-Bot
QfanQfan/ERNIE-Bot-4.0
QfanQfan/ERNIE-Bot-8K
QfanQfan/ERNIE-Bot-turbo
from openai import OpenAI

client = OpenAI(
    api_key = "Own API key",
    base_url = "https://api.zgiai.com/v1"
)

chat_completion = client.chat.completions.create(
    messages=[
        {
            "role": "user",
            "content": "Who are you?",
        }
    ],
    model="Qfan/ERNIE-Bot",
)
print(chat_completion.choices[0].message.content)

Was this page helpful?