A full-stack chat application combining OpenAI-powered agents (Python backend) with a SvelteKit frontend for real-time streaming conversations.
This project provides a modern chat interface that connects to an AI agent backend, supporting real-time streaming responses. The architecture consists of:
agent_svelte/
├── agents-python/ # Python backend with OpenAI agent
│ ├── agents_app.py # FastAPI server with streaming endpoint
│ ├── requirements.txt # Python dependencies
│ └── tests/ # Backend tests
├── sveltekit/ # SvelteKit frontend (to be created)
└── docs/ # Documentation
├── PRD.md # Product requirements
├── TASK.md # Implementation tasks
└── *.md # Technical documentation
Navigate to the Python backend:
cd agents-python
Create a virtual environment:
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
Install dependencies:
pip install -r requirements.txt
Create a .env
file with your OpenAI API key:
OPENAI_API_KEY=your_api_key_here
Run the FastAPI server:
uvicorn agents_app:app --reload
The API will be available at http://localhost:8000
Test the agent directly from command line:
python agents_app.py "Your prompt here"
/api/agent/stream
- Stream agent responses{"input": "user message"}
or {"messages": [...]}
The SvelteKit frontend is planned but not yet implemented. See docs/TASK.md for implementation status.
cd agents-python
python -m pytest tests/
MIT