Repeat
RepeatingExtractor for repeated extraction with aggregation.
Classes:
| Name | Description |
|---|---|
RepeatingExtractor |
Runs extraction |
RepeatingExtractor(aggregator, n=3, return_as_list=None, **kwargs)
Extractor that repeats extraction multiple times and aggregates results per key.
This extractor calls the base extraction function multiple times (n times) on the same input text and aggregates the structured outputs.
Attributes:
| Name | Type | Description |
|---|---|---|
aggregator |
Aggregator function to use for aggregating results |
|
n |
Number of repetitions (default: 3) |
|
return_as_list |
List of field names to return as lists of all extracted values (default: None) |
|
default_kwargs |
Additional keyword arguments passed to the base extraction function. |
Source code in src/kibad_llm/extractors/repeat.py
27 28 29 30 31 32 33 34 35 36 37 38 39 | |
__call__(*args, **kwargs)
Process singular text in multiple passes without chat history.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
*args
|
Any
|
Are forwarded unchanged:
|
()
|
Other Parameters:
| Name | Type | Description |
|---|---|---|
* |
Any
|
Refer to |
Returns:
| Type | Description |
|---|---|
dict[str, Any]
|
Dict with the key |
dict[str, Any]
|
Additionally there can be lists for fields at the keys |
Source code in src/kibad_llm/extractors/repeat.py
41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 | |