Getting Started
Prerequisites
- Python 3.9+
- Redis (for Celery broker/backend defaults)
- Optional: MongoDB (journal persistence)
- Optional: MinIO/S3-compatible storage (artifact archive)
Install
pip install -e .
For tests and local development:
pip install -e .[dev]
pip install -r requirements.txt
First Local Workflow
import asyncio
from lingo import phrase
from lingo.celery import CeleryLanguage
lang = CeleryLanguage(execution_mode="local")
@lang.verb
def normalize(text: str) -> str:
return " ".join(text.split()).lower()
@lang.verb
def ingest(text: str) -> dict:
return {"tokens": text.split(), "count": len(text.split())}
job = asyncio.run(lang.say(phrase("normalize")(" Hello World ").then("ingest")))
print(job.code)
print(job.result(block=True))
Run a Worker (Distributed Mode)
lingo launch examples.fastapi.worker1:lang worker -l info
Run Conversation Tests
lingo test examples/fastapi/worker1.py
Build and View Docs
mkdocs build
mkdocs serve
Open http://127.0.0.1:8000/.