Code Monkey home page Code Monkey logo

poe-telegram-chatbot's Introduction

Poe-Telegram-Chatbot

这是一个使用 Python 和 Telegram Bot API 构建的聊天机器人,它利用了 Poe API 提供的 AI 模型进行纯文字对话。(暂不支持上传图片,文件)

功能特点

  • 支持与 GPT-4 和 Claude-3-Opus 模型进行对话
  • 可以保持对话上下文,实现连续对话
  • 提供命令切换不同的 AI 模型
  • 支持 Docker 容器化部署

安装与运行

前置要求

  • Python 3.9 (经过测试)
  • Poe API 密钥
  • Telegram Bot Token (通过 BotFather 获取)

本地运行

  1. 克隆此仓库:
git clone https://github.com/Timmy-web/Poe-Telegram-Chatbot.git
cd Poe-Telegram-Chatbot
  1. 安装依赖:
pip install -r requirements.txt
  1. 设置环境变量:
export TELEGRAM_BOT_TOKEN="your_telegram_bot_token"
export POE_API_KEY="your_poe_api_key"
  1. 运行 bot:
python bot.py

Docker 运行

运行 Docker 容器:

docker run -d --name poebot \
  -e TELEGRAM_BOT_TOKEN="your_telegram_bot_token" \
  -e POE_API_KEY="your_poe_api_key" \
  ghcr.io/timmy-web/poe-bot

或者使用 docker-compose:

docker-compose up -d

注意将 your_telegram_bot_token 和 your_poe_api_key 替换为你自己的 Token 和 API 密钥。

使用方法

  • /start - 开始与机器人对话
  • /new - 开始一个新的对话,清空上下文
  • /gpt4 - 切换到 GPT-4 模型
  • /claude3 - 切换到 Claude-3-Opus 模型

直接在聊天界面输入问题,机器人就会自动回复。

poe-telegram-chatbot's People

Contributors

timmy-web avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.