Skip to content

BasePromptProtocol

Base classes

Name Children Inherits
Protocol
typing
Base class for protocol classes.

⋔ Inheritance diagram

graph TD
  1657784204["llmling_types.BasePromptProtocol"]
  1073422405["typing.Protocol"]
  3481597255["typing.Generic"]
  2751680898["builtins.object"]
  1073422405 --> 1657784204
  3481597255 --> 1073422405
  2751680898 --> 3481597255

🛈 DocStrings

Bases: Protocol

Protocol for base prompt interface.

Source code in src/toprompt/llmling_types.py
@runtime_checkable
class BasePromptProtocol(Protocol):
    """Protocol for base prompt interface."""

    messages: Sequence[PromptMessage]

    def get_messages(self) -> Sequence[PromptMessage]: ...

    def validate_arguments(self, provided: dict[str, Any]) -> None: ...

    async def format(
        self,
        arguments: dict[str, Any] | None = None,
    ) -> Sequence[PromptMessage]: ...

:fa-brands-github: Show source on GitHub