FilePrompt
Base classes¶
| Name | Children | Inherits |
|---|---|---|
| BasePrompt llmling.prompts.models Base class for all prompts. |
â‹” Inheritance diagram¶
graph TD
4061657138["models.FilePrompt"]
3854555607["models.BasePrompt"]
3879467795["main.BaseModel"]
2751680898["builtins.object"]
3854555607 --> 4061657138
3879467795 --> 3854555607
2751680898 --> 3879467795
🛈 DocStrings¶
Bases: BasePrompt
Prompt loaded from a file.
This type of prompt loads its content from a file, allowing for longer or more complex prompts to be managed in separate files. The file content is loaded and parsed according to the specified format.
Source code in src/llmling/prompts/models.py
fmt
class-attribute
instance-attribute
¶
Format of the file content (text, markdown, or jinja2 template).
path
instance-attribute
¶
Path to the file containing the prompt content.
type
class-attribute
instance-attribute
¶
Discriminator field identifying this as a file-based prompt.
watch
class-attribute
instance-attribute
¶
Whether to watch the file for changes and reload automatically.
format
async
¶
format(arguments: dict[str, Any] | None = None) -> list[PromptMessage]
Format the file content with arguments.