Skip to content

Signature

gepa.proposer.reflective_mutation.base.Signature() dataclass

Attributes

prompt_template: str class-attribute

input_keys: list[str] class-attribute

output_keys: list[str] class-attribute

Functions

prompt_renderer(input_dict: Mapping[str, Any]) -> str classmethod

Source code in gepa/proposer/reflective_mutation/base.py
@classmethod
def prompt_renderer(cls, input_dict: Mapping[str, Any]) -> str:
    raise NotImplementedError

output_extractor(lm_out: str) -> dict[str, str] classmethod

Source code in gepa/proposer/reflective_mutation/base.py
@classmethod
def output_extractor(cls, lm_out: str) -> dict[str, str]:
    raise NotImplementedError

run(lm: LanguageModel, input_dict: Mapping[str, Any]) -> dict[str, str] classmethod

Source code in gepa/proposer/reflective_mutation/base.py
@classmethod
def run(cls, lm: LanguageModel, input_dict: Mapping[str, Any]) -> dict[str, str]:
    full_prompt = cls.prompt_renderer(input_dict)
    lm_out = lm(full_prompt).strip()
    return cls.output_extractor(lm_out)