Kids Story Generator is a Python application that creates short, child-friendly stories from a user-provided word. The app is designed for Ethiopian children and currently supports story generation in Amharic and Afan Oromo, with Amharic as the default language.
# Ethiopian Story Generator
Ethiopian Story Generator is a Python application that creates short, child-friendly stories from a user-provided word. The app is designed for Ethiopian children and currently supports story generation in Amharic and Afan Oromo, with Amharic as the default language.
The interface is built with Gradio, and model access is handled through OpenRouter via LangChain.
## Features
- Generate a story from a single input word
- Support for Amharic and Afan Oromo
- Default language set to Amharic
- Story prompting tailored for children ages 5 to 10
- Browser-based interface powered by Gradio
- OpenRouter model integration through LangChain
## How It Works
The application accepts:
- A word to inspire the story
- A language selection
It then formats a prompt, sends that prompt to the configured OpenRouter model, and returns the generated story in the web interface.
## Tech Stack
- Python 3.12+
- Gradio
- LangChain
- LangChain OpenRouter integration
- python-dotenv
## Project Structure
- `story-generator.py`: main application, prompt template, story generation logic, and Gradio UI
- `pyproject.toml`: project metadata and dependencies
- `README.md`: project documentation
## Requirements
Before running the application, make sure you have:
- Python 3.12 or later
- A valid OpenRouter API key
- A valid OpenRouter chat or instruct model
## Installation
1. Install dependencies:
```bash
uv sync
```
2. Create a `.env` file in the project root:
```dotenv
OPENROUTER_API_KEY=your_openrouter_api_key
MODEL_NAME=your_openrouter_chat_model
```
## Model Configuration
Use a normal chat or instruct model from OpenRouter.
Do not use safety-classification or moderation models for story generation. For example, a model such as `nvidia/nemotron-3.5-content-safety:free` will return a safety label instead of story text.
Choose a model intended for text generation or conversational responses.
## Running the App
Start the application with:
```bash
uv …