NeurochainAI Basic API Integration for Telegram
detail.loadingPreview
Integrates NeurochainAI's text and image generation APIs with a Telegram bot.
About This Workflow
This workflow enables a Telegram bot to interact with NeurochainAI's generative AI models. Users can send prompts via Telegram, and the bot will process them using NeurochainAI's APIs to generate text or images, sending the results back to the user. The workflow includes error handling and status updates.
Key Features
- Telegram Bot Integration: Receives user messages and sends responses via Telegram.
- Text Generation: Uses the NeurochainAI text generation API for AI-powered text responses.
- Image Generation: Utilizes the NeurochainAI image generation API (Flux) to create images from prompts.
- Prompt Preprocessing: Cleans user prompts by removing specific prefixes (e.g.,
/flux). - Error Handling: Manages API errors and provides informative messages to the user.
- Status Indicators: Sends typing indicators and progress messages.
How To Use
-
Set up a Telegram Bot:
- Use BotFather to create a new Telegram bot and obtain its API token.
- Add the bot token to the
Telegram Triggerand allTelegramnodes in the workflow credentials.
-
Obtain NeurochainAI API Key:
- Log in to your NeurochainAI dashboard.
- Generate an API Key from the Inference As Service section.
- Replace
YOUR-API-KEY-HEREin theNeurochainAI - REST APIandNeurochainAI - Fluxnodes with your actual API key.
-
Configure Models:
- In the
NeurochainAI - REST APInode, set themodelparameter to your desired text generation model (e.g.,Meta-Llama-3.1-8B-Instruct-Q6_K.gguf). - In the
NeurochainAI - Fluxnode, set themodelparameter to your desired image generation model (e.g.,flux1-schnell-gguf).
- In the
-
Workflow Logic:
- The
Telegram Triggernode listens for incoming messages. - The
Switchnode routes messages based on prefixes (/flux,@NCNAI_BOT) or chat type (private). - For
/fluxcommands, theCode1node cleans the prompt, and theNeurochainAI - Fluxnode is called to generate an image. - For other text-based messages (routed through
TYPING - ACTION), theNeurochainAI - REST APInode generates a text response. - The
Telegram1node sends the generated image with a caption, whileAI Responsesends text responses. - Error handling nodes (
Telegram3,Telegram6,No response,Prompt too short) inform the user of issues. - The workflow also includes nodes to delete temporary messages (e.g., typing indicators) for a cleaner user experience.
- The
Apps Used
Workflow JSON
{
"id": "3c610849-eb57-4c46-ae91-1c21150dcf99",
"name": "NeurochainAI Basic API Integration for Telegram",
"nodes": 6,
"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: 3c610849-eb57...
About the Author
Free n8n Workflows Official
System Admin
The official repository for verified enterprise-grade workflows.
Statistics
Related Workflows
Discover more workflows you might like
Telegram AI Langchain Bot with DALL-E 3 Image Generation
An n8n workflow that acts as a Telegram bot, powered by Langchain, for AI chat interactions and image generation using DALL-E 3.
Visa Requirement Checker
A workflow to check visa requirements based on user input, leveraging Langchain, Cohere embeddings, Weaviate vector store, and Anthropic LLM.
Telegram OCR Bot with Mistral AI
Automated OCR for image and PDF files sent via Telegram, powered by Mistral AI.