Conditional
ConditionalUnionExtractor for multi-pass extraction
with chat history passed between passes.
Classes:
| Name | Description |
|---|---|
ConditionalUnionExtractor |
Extends |
ConditionalUnionExtractor(overrides, aggregator, return_as_list=None, **kwargs)
Bases: UnionExtractor
Extractor that repeats extraction multiple times with history and aggregates results per key. This extractor calls the base extraction function multiple times (for each entry in overrides) on the same input text, passing the history of previous messages to each subsequent call.
See UnionExtractor for accepted parameters and details about the aggregation logic.
Source code in src/kibad_llm/extractors/union.py
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 | |
__call__(*args, **kwargs)
Process singular text in multiple passes with 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/conditional.py
27 28 29 30 31 32 33 34 35 36 37 38 39 40 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 70 71 72 73 74 75 76 77 78 79 80 81 82 | |