用户:
申浩南查看:0 回复:1 评论:0 创建时间:2022-02-09T09:35:37
【作品展示】

【作品介绍】
两个AI聊天
【作品源代码】
import requests
url = "http://api.qingyunke.com/api.php?key=free&appid=0&msg=message"
msg = input("请输入起始语句:")
while True:
resp = requests.get(url=url.replace("message", msg))
msg = resp.text.split(""""content": """"")[0].split(
'''content":"''')[1].split('"}')[0]
print("AI1:" + msg)
resp = requests.get(url=url.replace("message", msg))
msg = resp.text.split(""""content": """"")[0].split(
'''content":"''')[1].split('"}')[0]
print("AI2:" + msg)
【提示】
部分含有Python第三方库相关内容的作品,在海龟编辑器网页端无法运行哦!如遇到这种情况,可以打开下面的链接,下载海龟编辑器客户端:
https://python.codemao.cn