A Signature is a typed contract between a module and a Language Model (LM). It defines named input fields, named output fields, and instructions. This declarative approach allows the framework to handle prompt construction, output parsing, and type validation automatically.
Key Concept: A Signature is a class, not an instance. When you define or create a signature, you are working with a new type (a dynamically-created Pydantic BaseModel subclass). Operations like prepend, with_instructions, or delete do not mutate the existing signature; instead, they return a new Signature class.