【价值5K】基于openai的人工智障Telegram Bot开源了

59次阅读

共计 1627 个字符,预计需要花费 5 分钟才能阅读完成。

内容最后由 小学生 于 2022-12-19 23:01 编辑 在线体验:https://t.me/zhizhangaibot 消耗的是我账号中 18 美元的赠金,不回复了就是被坛友们 CAO SI 了自己替换 api 安装依赖设置权限直接运行即可 import openaiimport telegramfrom telegram.ext import Updater, CommandHandler, MessageHandler, Filters# Replace "TOKEN" with your own Telegram API tokenupdater = Updater(" 你的 API", use_context=True)# Replace "API_KEY" with your own OpenAI API keyopenai.api_key = " 你的 API"def start(update, context):    context.bot.send_message(chat_id=update.effective_chat.id, text=" 我亲自部署,亲自回复!")def chat(update, context):    # Get the user\’s message    message = update.message.text    # Use the OpenAI API to generate a response using ChatGPT    response = openai.Completion.create(        engine="text-davinci-003",        prompt=message,        max_tokens=1024   ).get("choices")[0].get("text")    # Send the response back to the user    context.bot.send_message(chat_id=update.effective_chat.id, text=response)updater.dispatcher.add_handler(CommandHandler("start", start))updater.dispatcher.add_handler(MessageHandler(Filters.text, chat))updater.start_polling()updater.idle() 复制代码 小学生 2022-12-19 22:55 2 重启下,我放到 screen 里,要体验的等 2 分钟再试 cangshui 2022-12-19 22:56 3 来个机器人搭建教程 agou888 2022-12-19 22:58 4 今天又赚了 5000 华盛顿 2022-12-19 22:58 5 用 API 访问的就不是目前大火的智能 AI  chatGPT,只是几年前发布的一个对话机器人,没啥意义 jzelynn 2022-12-19 23:07 6 今天又赚了 5000 GSDP 2022-12-19 23:07 7 你是懂 5K 的 xinuu 2022-12-19 23:18 8 今天又赚了 5000 Corei7 2022-12-19 23:39 9@ecs 你怎么看?这个值 5K 吗?楼主是不是也是 5K 狗啊? 静香 2022-12-19 23:44 10 我这日 PV 几十 w 的 站 那价值是不是要超过 5K 了?https://chatgpt.sbaliyun.com/ Corei7 2022-12-19 23:51 11 静香 发表于 2022-12-19 23:44 我这日 PV 几十 w 的 站 那价值是不是要超过 5K 了 https://chatgpt.sbaliyun.com/ 老板,好像短路了 静香 2022-12-19 23:55 12Corei7 发表于 2022-12-19 23:51 老板,好像短路了谁跑路了?把他艾特出来 把证据放出来 我去收拾他 huaheshang 2022-12-19 23:59 1318 美元能问答多少字或者可以问多少个问题,看 Reddit 上老外说,一个问答就消耗几美分,真费钱

正文完
 0