基于 OpenAI Agents SDK 的 Telegram 天气机器人
一个使用 OpenAI Agents SDK 和 MCP 协议的 Telegram 机器人,提供实时天气信息。
快速入门
-
克隆仓库: git clone https://github.com/esakrissa/agents-sdk-telegram.git cd agents-sdk-telegram
-
创建并激活虚拟环境: python -m venv venv source venv/bin/activate # Windows 使用 venv\Scripts\activate
-
安装依赖: pip install -r requirements.txt
-
在项目根目录创建 .env 文件,并填入以下内容: TELEGRAM_BOT_TOKEN=your_bot_token_here OPENAI_API_KEY=your_openai_api_key_here
-
启动机器人: python main.py
使用方法
直接发送消息询问任意城市的天气,例如: what's the weather in Ubud?