支持的模型
通义千问 API支持的模型和上下文长度:
通义千问 模型
平台 | 模式标识符 | 备注 |
---|---|---|
Qianwen | qwen-turbo | |
Qianwen | qwen-plus | |
Qianwen | qwen-max-1201 | |
Qianwen | qwen-max-longcontext | |
Qianwen | Qwen/Qwen1.5-0.5B-Chat | |
Qianwen | Qwen/Qwen1.5-1.8B-Chat | |
Qianwen | Qwen/Qwen1.5-4B-Chat | |
Qianwen | Qwen/Qwen1.5-7B-Chat | |
Qianwen | Qwen/Qwen1.5-14B-Chat | |
Qianwen | Qwen/Qwen1.5-72B-Chat |
from openai import OpenAI
client = OpenAI(
api_key = "自己的API key",
base_url = "https://api.fe8.cn/v1"
)
chat_completion = client.chat.completions.create(
messages=[
{
"role": "user",
"content": "你是谁,用中文回答",
}
],
model="qwen-turbo",
)
print(chat_completion.choices[0].message.content)