2.0.6
Prompt
Package: flyte.extras
Simple prompt record with built-in token estimation.
This is a convenience type for common LLM use cases. For richer
prompt types (e.g. with system messages, metadata), define your own
dataclass implementing :class:TokenEstimator.
Attributes: text: The prompt text.
class Prompt(
text: str,
)| Parameter | Type | Description |
|---|---|---|
text |
str |
Methods
| Method | Description |
|---|---|
estimate_tokens() |
Rough token estimate (~4 chars per token). |
estimate_tokens()
def estimate_tokens()Rough token estimate (~4 chars per token).