pyrit.prompt_converter.RangeSelectionStrategy#
- class RangeSelectionStrategy(*, start_proportion: float = 0.0, end_proportion: float = 1.0)[source]#
Bases:
TextSelectionStrategySelects text based on proportional start and end positions.
- __init__(*, start_proportion: float = 0.0, end_proportion: float = 1.0) None[source]#
Initializes the range 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 range selection strategy.
select_range(*, text)Selects a range based on proportional positions.