WeightedPrompt
Bases: BaseModel
Represents a prompt with an associated weight.
This class is used to define a text prompt with a corresponding numerical weight, indicating the significance or influence of the prompt in a given context, such as in image generation or text processing tasks.
Attributes:
Name | Type | Description |
---|---|---|
text |
str
|
The textual content of the prompt. |
weight |
float
|
A numerical weight associated with the prompt. Defaults to 1. The weight must be greater than or equal to 0. |
Methods:
Name | Description |
---|---|
__repr__ |
Returns a string representation of the WeightedPrompt instance, formatted as 'weight*(text)'. |