The supported model
Model and context length for Qianfan API support:
Qianfan Models
Platform | Model Identifier | Notes |
---|---|---|
Qfan | Qfan/ERNIE-Bot | |
Qfan | Qfan/ERNIE-Bot-4.0 | |
Qfan | Qfan/ERNIE-Bot-8K | |
Qfan | Qfan/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)