Skip to content

peteknowsai/agent_svelte

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Agent Svelte

A full-stack chat application combining OpenAI-powered agents (Python backend) with a SvelteKit frontend for real-time streaming conversations.

Overview

This project provides a modern chat interface that connects to an AI agent backend, supporting real-time streaming responses. The architecture consists of:

  • Backend: Python FastAPI server using OpenAI Agents SDK
  • Frontend: SvelteKit application with Vercel AI SDK (planned)
  • Features: Real-time streaming, responsive design, error handling

Project Structure

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

Getting Started

Backend Setup

  1. Navigate to the Python backend:

    cd agents-python
  2. Create a virtual environment:

    python -m venv venv
    source venv/bin/activate  # On Windows: venv\Scripts\activate
  3. Install dependencies:

    pip install -r requirements.txt
  4. Create a .env file with your OpenAI API key:

    OPENAI_API_KEY=your_api_key_here
    
  5. Run the FastAPI server:

    uvicorn agents_app:app --reload

    The API will be available at http://localhost:8000

CLI Testing

Test the agent directly from command line:

python agents_app.py "Your prompt here"

API Endpoints

  • POST /api/agent/stream - Stream agent responses
    • Request body: {"input": "user message"} or {"messages": [...]}
    • Response: Server-sent events stream

Frontend Setup

The SvelteKit frontend is planned but not yet implemented. See docs/TASK.md for implementation status.

Development

Running Tests

cd agents-python
python -m pytest tests/

Documentation

Tech Stack

  • Backend: Python, FastAPI, OpenAI Agents SDK
  • Frontend (planned): SvelteKit v5, Vercel AI SDK, Tailwind CSS + DaisyUI
  • Real-time: Server-sent events for streaming responses

Contributing

  1. Check the task list for current progress
  2. Follow existing code patterns and conventions
  3. Run tests before submitting changes
  4. Update documentation as needed

License

MIT

About

Full-stack chat app with OpenAI agents backend and SvelteKit frontend

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages