Skip to content

PromptConvertible

Base classes

Name Children Inherits
Protocol
typing
Base class for protocol classes.

⋔ Inheritance diagram

graph TD
  4209724495["to_prompt.PromptConvertible"]
  1073422405["typing.Protocol"]
  3481597255["typing.Generic"]
  2751680898["builtins.object"]
  1073422405 --> 4209724495
  3481597255 --> 1073422405
  2751680898 --> 3481597255

🛈 DocStrings

Bases: Protocol

Protocol for instances that can be converted to prompts.

Source code in src/toprompt/to_prompt.py
class PromptConvertible(Protocol):
    """Protocol for instances that can be converted to prompts."""

    def __prompt__(self) -> str | Awaitable[str]: ...

:fa-brands-github: Show source on GitHub