Skip to content

midastruth/reader-ai

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Reader AI API

FastAPI service that manages lightweight in-memory documents for Reader AI prototypes.
You can create a document, retrieve it by ID, list available documents, or delete it again.

Requirements

  • Python 3.10 or newer
  • uv or another tool capable of installing pyproject.toml

Installation

uv sync

If you prefer pip, install dependencies inside a virtual environment:

python -m venv .venv
. .venv/bin/activate
pip install .

Running the app

Before starting the server, configure the Gemini API key:

cp .env.example .env
# then edit .env and replace GEMINI_API_KEY with your real key

If you prefer exporting directly, set export GEMINI_API_KEY=your_actual_key in your shell session before running the server.

uv run python main.py
# or: uvicorn main:app --reload

Now visit http://localhost:8000/docs for the interactive Swagger UI.

API overview

  • GET / – service greeting
  • GET /health – readiness probe
  • GET /documents – list stored documents
  • POST /documents – create a document (title, content)
  • GET /documents/{id} – fetch a document by UUID
  • DELETE /documents/{id} – remove a document
  • POST /ai/generate – generic Gemini prompt with optional document context
  • POST /ai/summarize – produce JSON summary plus highlights for a document or raw text
  • POST /ai/analyze – return structured reading insights (summary, structure, themes, questions)
  • POST /ai/dictionary – deliver context-aware dictionary entries for a given term
  • POST /ai/generate/stream – stream model output via Server-Sent Events

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages