pyrit.prompt_converter.PositionSelectionStrategy#
- class PositionSelectionStrategy(*, start_proportion: float, end_proportion: float)[source]#
Bases:
TextSelectionStrategySelects text based on proportional start and end positions.
- __init__(*, start_proportion: float, end_proportion: float) None[source]#
Initializes the position selection strategy.
- Parameters:
- Raises:
ValueError – If proportions are not between 0.0 and 1.0, or start >= end.
Methods
__init__(*, start_proportion, end_proportion)Initializes the position selection strategy.
select_range(*, text)Selects a range based on the relative position in the text.