lezzljd2.png

{lamp/}
限时特惠: 腾讯云服务器 1年92、3年只要388 !做个智能机器人啥的~
入口: https://url.cn/B4K9jWu0
lfbxvl5d.png
import requests

def chatgpt_bot(msg='hello'):
    '''
    (URL失效)
    接口来自: https://chat.bujj.org/
    网站源码: https://github.com/ddiu8081/chatgpt-demo
    '''
    url = 'https://chatgpt.ddiu.me/api/generate'
    data = {"messages":[{"role":"user","content":msg}]}
    headers = {
        'Content-Type': 'text/plain;charset=UTF-8'
    }
    proxies = {
        'http': 'http://127.0.0.1:7890',
        'https': 'http://127.0.0.1:7890'
    }
    resp = requests.post(url=url, json=data, headers=headers, proxies=proxies)
    resp.encoding = 'utf-8'
    return resp.text.strip()

def chatgpt_bot2(msg='hello'):
    url = f'https://v1.apigpt.cn/?q={msg}&apitype=sql'
    resp = requests.get(url=url)
    resp.encoding = 'utf-8'
    return resp.json()['ChatGPT_Answer'].strip()

def chatgpt_bot3(msg='hello'):
    url = 'https://api.caonm.net/api/ai/o.php?msg=' + msg
    resp = requests.get(url=url)
    resp.encoding = 'utf-8'
    return resp.json()['Output'].strip()

def chatgpt_bot4(msg='hello'):
    '''响应非常慢'''
    url = f'https://v1.welm.cc/?q={msg}&apitype=sql'
    resp = requests.get(url=url)
    resp.encoding = 'utf-8'
    return resp.json()['Welm_Answer'].strip()

def chatgpt_bot5(msg='hello'):
    token = 'sk-76f1c7a8cbfb2854a5ca5ac0ec6ebcecAPIGPT-v2'
    url = f'https://v2.apigpt.cn?q={msg}&key={token}&id=123456&conversationId=123456&token=123456'
    resp = requests.get(url=url)
    resp.encoding = 'utf-8'
    return resp.json()['text'].strip()

def chatgpt_bot6(msg='hello'):
    url = 'https://open-gpt.app/api/generate'
    data = {"userInput":msg,"id":"clezxas4j0000mn0863j0lw7h","userKey":""}
    resp = requests.post(url=url, json=data)
    resp.encoding = 'utf-8'
    return resp.text.strip()


def chatgpt_bot7(msg='hello'):
    url = 'https://ai117.com/'
    data = {"msg":msg,"token":"","style":"0"}
    resp = requests.post(url=url, json=data)
    resp.encoding = 'utf-8'
    return resp.json()['data'][1].strip().replace("(如未显示完全,请填写APIKEY获取完整消息)", "")

def chatgpt_bot8(msg='hello'):
    url = 'https://askai.ws/api/chatgpt/ask'
    data = {"type":"text","keepChat":false,"question":msg}
    resp = requests.post(url=url, json=data)
    resp.encoding = 'utf-8'
    return resp.text.strip()
  
print(chatgpt_bot2('你好'))
print(chatgpt_bot3('你好'))


标签:python, QQ机器人, 工具, ChatGPT

1 条评论

  1. 15448 15448

    {!{data:image/webp;base64,UklGRjAWAABXRUJQVlA4WAoAAAAQAAAADQEAKwEAQUxQSE0VAAAB8Mf/v6Il27bNbnd3EmKgu92662a3uy2Cga2EXbux75udBza22GIQNiZ2B427u4pdKGUHzmvz91trZtasWdv8d0SERNtWwlY62GnGNnkXmiD4CVINGVu4dzlJZ5uA9X9ry0DhYtB3WhKTFfsFOTH+d3096JaE5U/RTiskr5CgxiaZauen1dHTgxrXsfhA7QKfAEMlQZn1qky3t9Oc9fMg3y4sPVozq4BjkrCsnuLE9XGldPNgDhb+2UEjnZC4HJLArJrixLmRRXXSP/g71t1FG1lfAH0lsZnLZNoEeoQGFNRFffN4rPqsNnEb0WIhCc9KTXmjMBHslkcH7Y5HsOapmuiFlEkitIrjz9AP0nd2z65CuvbkjLivibyIDFSElrumXqJPfNj4Z2bWwv2R3t6alH0DcikjsNVt1i36ROKq9oxlxwBhmkgEikgitT8WxdInnixrzZK2SGpjLTwCbMu/kU2fdWnFA/rE3cXN2Cm+CezTQhzgKgyY3l3rn9MnIuc1ZoQ7UllGA4+BWsJCa8W69R194uas+uw+DtLAa2CUJGrrvueDwuo2m0Gq8UUCc2v8kTpI4rbf3EJ+0CdO9cmokTwfgW7qOQ70Eh8au5r+hxW+vryeNpXRwBj17AQ8JdFbrsEnFHps7xIamA/4qWc9MFKyA1ZghEILFdBZNSOA/epZCYyX7IPVXnCfXv3MqqGOduimVc8a4IxkN8wjRGHPYWghFVQBXqlnIXBBsiNWfl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