Telegram AI Langchain Bot with DALL-E 3 Image Generation
detail.loadingPreview
An n8n workflow that acts as a Telegram bot, powered by Langchain, for AI chat interactions and image generation using DALL-E 3.
About This Workflow
This workflow sets up a Telegram bot that leverages Langchain to provide AI-powered chat capabilities and image generation. It listens for incoming messages, processes them with an OpenAI chat model, and can optionally use DALL-E 3 to generate images based on user requests. The bot supports conversational memory and sends responses back to the user via Telegram.
Key Features
- Telegram Integration: Connects to Telegram to receive and send messages.
- Langchain Powered: Utilizes Langchain for advanced AI interactions.
- OpenAI Chat Model: Employs
gpt-4-1106-previewfor conversational AI. - Conversational Memory: Implements window buffer memory to maintain chat context.
- DALL-E 3 Image Generation: Integrates with DALL-E 3 via an HTTP request node to create images based on prompts.
- Tool Usage: The AI Agent can call the
Draw_Dalle_imagetool to trigger image generation. - HTML Formatting: Bot responses are formatted using Telegram-supported HTML for rich text display.
- Error Handling: Includes a node to correct potential HTML escaping errors in responses.
How To Use
- Set up Telegram Bot: Configure the
Telegramnodes with your Telegram Bot Token. - Configure OpenAI: Set up your OpenAI API credentials in n8n.
- Triggering the Bot: The
Listen for incoming eventsnode starts the workflow when a message is received. - AI Chat Processing: The
AI Agentnode processes user messages using theOpenAI Chat ModelandWindow Buffer Memory. - Image Generation Trigger: If the AI determines an image is needed, it will use the
Dall-E 3 Tool. - DALL-E 3 API Call: The
Generate image in Dall-E 3node makes a direct API call to OpenAI to create the image. - Sending Images: The
Send back an imagenode sends the generated image back to the user via Telegram. - Responding to Chat: The
Telegramnode sends the AI's text response back to the user.
Apps Used
Workflow JSON
{
"id": "15d621a4-6ca8-4611-9f83-0d2b2726011d",
"name": "Telegram AI Langchain Bot with DALL-E 3 Image Generation",
"nodes": 16,
"category": "AI & Machine Learning",
"status": "active",
"version": "1.0.0"
}Note: This is a sample preview. The full workflow JSON contains node configurations, credentials placeholders, and execution logic.
Get This Workflow
ID: 15d621a4-6ca8...
About the Author
DevOps_Master_X
Infrastructure Expert
Specializing in CI/CD pipelines, Docker, and Kubernetes automations.
Statistics
Related Workflows
Discover more workflows you might like
NeurochainAI Basic API Integration for Telegram
Integrates NeurochainAI's text and image generation APIs with a Telegram bot.
Chat with Local LLMs via Ollama
Integrate and chat with your local Large Language Models using Ollama and n8n.
Visa Requirement Checker
A workflow to check visa requirements based on user input, leveraging Langchain, Cohere embeddings, Weaviate vector store, and Anthropic LLM.