BlackHC/llm-strategy
A Python decorator library that connects strongly-typed Python interfaces and dataclasses to LLMs, using type annotations as prompts and converting LLM responses back to Python types.

The library implements the Strategy Pattern using LLMs by adding an llm_strategy decorator that forwards method calls to an LLM and converts responses back into Python dataclasses. It extracts data schemas from type annotations to send to the LLM for interpretation. The package uses doc strings, type hints, and method signatures as prompts for the LLM, enabling developers to define abstract interfaces that are automatically implemented by an LLM backend.