1 Star 1 Fork 0

niann/easy-help

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
requestAI.py 515 Bytes
一键复制 编辑 原始数据 按行查看 历史
年年 提交于 2024-02-03 19:57 +08:00 . version1.0
from http import HTTPStatus
import dashscope,config
key = config.get_key()
if key != None:
dashscope.api_key=key
def get_key():
return key
'''
@author
询问ai
'''
def help(str):
response = dashscope.Generation.call(
model=dashscope.Generation.Models.qwen_turbo,
prompt='用中文跟我交流:{}'.format(str)
)
if response.status_code == HTTPStatus.OK:
return response.output.text # The output text
else:
return response.message # The error message.
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Python
1
https://gitee.com/coding_niann/easy-help.git
git@gitee.com:coding_niann/easy-help.git
coding_niann
easy-help
easy-help
master

搜索帮助