| from dataclasses import dataclass | |
| class PromptTemplate: | |
| """ | |
| A dataclass representing the content of a prompt template. | |
| This class holds the raw text content for different components of a prompt, | |
| such as system instructions, user input, and partial assistant responses. | |
| Attributes: | |
| name (str): The name of the prompt template. | |
| system_prompt (str | None): The content of the system prompt, if any. | |
| user_prompt (str | None): The content of the user prompt, if any. | |
| partial_assistant_prompt (str | None): The content of a partial assistant prompt, if any. | |
| At least one of system_prompt or user_prompt should be non-None for a valid template. | |
| """ | |
| name: str | |
| system_prompt: str | None = None | |
| user_prompt: str | None = None | |
| partial_assistant_prompt: str | None = None | |