分类目录归档:Chat

[ Python使用通义千问 ]


在python中使用通义千问-阿里云

官方api

api-key管理页面

注册

pip install dashscope

配置环境变量

export DASHSCOPE_API_KEY=YOUR_DASHSCOPE_API_KEY

运行

import random
from http import HTTPStatus
import dashscope


dashscope.api_key = "sk-4607ca0bb63d4646b8aeaca909091a9f"

def call_with_messages():
    messages = [{&qu

< Read more >