This project generates blog content in multiple languages using a language model pipeline built with LangChain and FastAPI.
The system:
- Accepts a topic and optional target language
- Generates a blog title and content
- Routes the content for translation if a specific language is requested
- Supports Arabic and French translations
- Dynamic content generation based on user topic input
- Multilingual support with translation nodes
- Conditional routing to select translation path
- REST API endpoint to generate blogs
- Graph-based workflow for modularity and scalability
POST /blogs
{
"topic": "Agentic AI"
}{
"topic": "Agentic AI",
"language": "Arabic"
}{
"data": {
"title": "Exploring Agentic AI",
"content": "..."
}
}- Topic only → Generate blog in default language
- Topic + Language → Generate blog then translate
- Graph nodes:
title_creation→ Generates blog titlecontent_generation→ Produces blog contentroute→ Decides translation patharabic_translation/french_translation→ Translates to target language
- FastAPI for API endpoints
- LangChain for LLM workflow
- Graph-based pipeline for modular execution
- Groq LLM as the language model backend
- Python-dotenv for environment management
