1 Star 0 Fork 0

keying1/python研发智能团队AI

加入 Gitee
与超过 1400万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
test_dashscope.py 655 Bytes
一键复制 编辑 原始数据 按行查看 历史
keying1 提交于 2025-12-11 14:53 +08:00 . python智能体
# 直接使用dashscope库测试qianwen-max模型
import os
from dashscope import Generation
# 设置API密钥
os.environ['DASHSCOPE_API_KEY'] = 'sk-b46215cad03b4879a45db02e674ee16b'
print("直接使用dashscope库测试qianwen-max模型...")
try:
# 直接使用dashscope调用qianwen-max
response = Generation.call(
model='qianwen-max',
prompt='你好,请介绍一下自己。',
max_new_tokens=100
)
print("✅ 模型调用成功!")
print("模型响应:")
print(response.output.text)
except Exception as e:
print(f"❌ 模型调用失败 - {e}")
import traceback
traceback.print_exc()
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Python
1
https://gitee.com/keying1/python.git
git@gitee.com:keying1/python.git
keying1
python
python研发智能团队AI
master

搜索帮助