File size: 853 Bytes
3b993c4
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
from dataclasses import dataclass


@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