feat: Add Telegram bot integration and .env configuration

This commit is contained in:
uxname committed 2025-05-24 16:55:42 +03:00
1 parent e9320e438f
commit 4b672efa41
6 files changed
+222 -58

No files matched your search

+65 -5
View File
@@ -1,15 +1,75 @@
# ai-pipelines
# AI Pipelines with Telegram Bot
To install dependencies:
This project provides a framework for creating and executing AI-powered pipelines, with a Telegram bot interface for easy interaction.
## Features
- Execute AI-powered pipelines using OpenAI's models
- Integration with Model Context Protocol (MCP) tools
- Telegram bot interface for easy interaction
- Support for dynamic prompts and variables
## Prerequisites
- Node.js and Bun installed
- OpenAI API key
- Telegram Bot Token (get it from [@BotFather](https://t.me/botfather))
## Setup
1. Clone the repository
2. Install dependencies:
```bash
bun install
```
To run:
3. Copy `.env.example` to `.env` and fill in your credentials:
```bash
bun run index.ts
cp .env.example .env
```
This project was created using `bun init` in bun v1.2.14. [Bun](https://bun.sh) is a fast all-in-one JavaScript runtime.
4. Edit the `.env` file and add your:
- `OPENAI_API_KEY` - Your OpenAI API key
- `TELEGRAM_BOT_TOKEN` - Your Telegram bot token from @BotFather
- `MCP_SERVER_URL` - (Optional) MCP server URL (defaults to Santiment's MCP server)
## Running the Bot
Start the bot with:
```bash
bun start
```
Or in development mode with auto-reload:
```bash
bun --watch src/main.ts
```
## Using the Bot
1. Find your bot on Telegram using the username you set with @BotFather
2. Start a chat with the bot
3. Send any message to the bot, and it will process it through the AI pipeline
4. The bot will respond with the AI's analysis or action
## Project Structure
- `src/bot/` - Telegram bot implementation
- `src/models/` - Data models and interfaces
- `src/pipelines/` - Pipeline execution logic
- `src/services/` - External service integrations
- `src/main.ts` - Application entry point
## Development
- Run linter: `bun run lint`
- Run type checking: `bun run ts:check`
- Run both: `bun run check`
## License
MIT