支持的模型

千帆 API支持的模型和上下文长度:

千帆 模型

平台模式标识符备注
QfanQfan/ERNIE-Bot
QfanQfan/ERNIE-Bot-4.0
QfanQfan/ERNIE-Bot-8K
QfanQfan/ERNIE-Bot-turbo
from openai import OpenAI

client = OpenAI(
    api_key = "自己的API key",
    base_url = "https://api.agicto.cn/v1"
)

chat_completion = client.chat.completions.create(
    messages=[
        {
            "role": "user",
            "content": "你是谁,用中文回答",
        }
    ],
    model="Qfan/ERNIE-Bot",
)
print(chat_completion.choices[0].message.content)

Was this page helpful?