thunc()
think + function

Call an LLM like a typed Python function.

pip install thunc
Claude · OpenAI · local models · 0 dependencies
urgency.py
@thunc.function
def urgency(ticket: str) -> int:
    """Rate urgency, 1 to 5."""
    ...

urgency("I was charged twice!")
# -> 4  # a checked int