TeoBot is a FastAPI‑powered service that turns any natural‑language question into a two‑step, JSON‑structured answer:
- It suggests a presentation framework (metaphors, examples, analogies).
- It returns the final answer following that framework.
- Two‑step GPT‑4O process for structured, bite‑sized explanations
- Dynamic Pydantic model generation for schema‑validated JSON
- FastAPI endpoint for easy integration
- Optional Docker configuration for containerized deployment
- Python 3.10+
- OpenAI API Key
- MongoDB URI
- (Optional) Pinecone API Key for embeddings
- Clone the repo
- Create a virtual env and install dependencies
python -m venv .venv source .venv/bin/activate pip install --upgrade pip pip install -r requirements.txt
uvicorn src.main:app --reload --host 0.0.0.0 --port 8000The API is now available at http://localhost:8000.
Build and run with:
docker build -t teobot .
docker run -e OPENAI_API_KEY -e MONGODB_URI -p 80:80 teobotPOST your question to /execute:
curl -X POST http://localhost:8000/execute \
-H "Content-Type: application/json" \
-d '{"question":"¿Cómo funciona la fotosíntesis?"}'We welcome community contributions. If you wish to contribute to TeoBot, please follow these steps:
- Fork the repository.
- Create a new branch:
git checkout -b feature/YourFeature. - Make your changes:
git commit -m 'Add new feature'. - Push the branch:
git push origin feature/YourFeature. - Open a Pull Request.
This project is licensed under the MIT License. For more details, refer to the LICENSE file.