BasePrompt
Sub classes¶
| Name | Children | Inherits |
|---|---|---|
| StaticPrompt llmling.prompts.models Static prompt defined by message list. |
||
| DynamicPrompt llmling.prompts.models Dynamic prompt loaded from callable. |
||
| FilePrompt llmling.prompts.models Prompt loaded from a file. |
Base classes¶
| Name | Children | Inherits |
|---|---|---|
| BaseModel pydantic.main !!! abstract "Usage Documentation" |
â‹” Inheritance diagram¶
graph TD
3854555607["models.BasePrompt"]
3879467795["main.BaseModel"]
2751680898["builtins.object"]
3879467795 --> 3854555607
2751680898 --> 3879467795
🛈 DocStrings¶
Bases: BaseModel
Base class for all prompts.
Source code in src/llmling/prompts/models.py
arguments
class-attribute
instance-attribute
¶
arguments: list[PromptParameter] = Field(default_factory=list)
List of arguments that this prompt accepts.
description
instance-attribute
¶
Human-readable description of what this prompt does.
metadata
class-attribute
instance-attribute
¶
Additional metadata for storing custom prompt information.
name
class-attribute
instance-attribute
¶
Technical identifier (automatically set from config key during registration).
format
async
¶
format(arguments: dict[str, Any] | None = None) -> list[PromptMessage]
Format this prompt with given arguments.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
arguments
|
dict[str, Any] | None
|
Optional argument values |
None
|
Returns:
| Type | Description |
|---|---|
list[PromptMessage]
|
List of formatted messages |
Raises:
| Type | Description |
|---|---|
ValueError
|
If required arguments are missing |
Source code in src/llmling/prompts/models.py
get_messages
¶
get_messages() -> list[PromptMessage]
Get the messages for this prompt.
Source code in src/llmling/prompts/models.py
to_mcp_prompt
¶
Convert to MCP Prompt.
Source code in src/llmling/prompts/models.py
validate_arguments
¶
Validate that required arguments are provided.