dspy.Adapter
dspy.Adapter(callbacks: Optional[list[BaseCallback]] = None)
Bases: ABC
dspy.Adapter(callbacks: Optional[list[BaseCallback]] = None)
Bases: ABC
dspy/adapters/base.py
__call__(lm: LM, lm_kwargs: dict[str, Any], signature: Type[Signature], demos: list[dict[str, Any]], inputs: dict[str, Any]) -> list[dict[str, Any]]
dspy/adapters/base.py
format(signature: Type[Signature], demos: list[dict[str, Any]], inputs: dict[str, Any]) -> list[dict[str, Any]]
abstractmethod
format_conversation_history(signature: Type[Signature], inputs: dict[str, Any]) -> list[dict[str, Any]]
dspy/adapters/base.py
format_finetune_data(signature: Type[Signature], demos: list[dict[str, Any]], inputs: dict[str, Any], outputs: dict[str, Any]) -> dict[str, list[Any]]
format_turn(signature: Type[Signature], values, role: str, incomplete: bool = False, is_conversation_history: bool = False) -> dict[str, Any]