Prompt
Simple prompt record with built-in token estimation.
Attributes
| Attribute | Type | Description |
|---|---|---|
| text | str | The prompt text. |
Constructor
Signature
def Prompt(
text: str
) - > null
Parameters
| Name | Type | Description |
|---|---|---|
| text | str | The prompt text to be stored. |
Methods
estimate_tokens()
@classmethod
def estimate_tokens() - > int
Rough token estimate (~4 chars per token).
Returns
| Type | Description |
|---|---|
int | The calculated approximate number of tokens based on the length of the prompt text. |