Skip to content

dminch/topot

Repository files navigation

Topot

Telegram bot for extracting daily steps from fitness app screenshots using OpenAI vision.

Setup

# Install dependencies
uv sync

# Configure environment
cp .env.example .env
# Add your OPENAI_API_KEY and TELEGRAM_BOT_TOKEN to .env

# Install pre-commit hooks
uv run pre-commit install

Development

# Run tests
uv run pytest

# Format code
uv run black src/ tests/ evals/
uv run ruff check src/ tests/ evals/ --fix

# Run evaluations (requires real screenshots and API key)
uv run pytest evals/ -m eval -v -s

Usage

from topot.llm import OpenAIClient, load_prompt

client = OpenAIClient()
prompt = load_prompt("extract_daily_steps")

result = client.extract_steps_from_image(
    image_url="data:image/jpeg;base64,...",
    prompt=prompt
)

print(f"Steps: {result.answer}")

Evaluation

Add screenshots to evals/screenshots/, update evals/expected_results.yaml, then run:

uv run pytest evals/ -m eval -v -s

Eval tests are excluded from regular test runs and pre-commit hooks.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages