Skip to content

PromptTypeConvertible

Base classes

Name Children Inherits
Protocol
typing
Base class for protocol classes.

⋔ Inheritance diagram

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

🛈 DocStrings

Bases: Protocol

Protocol for types that can be converted to prompts.

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

    @classmethod
    def __prompt_type__(cls) -> str | Awaitable[str]: ...

:fa-brands-github: Show source on GitHub