Index
BaseNodePostprocessor #
Bases: ChainableMixin
, BaseComponent
, DispatcherSpanMixin
, ABC
Parameters:
Name | Type | Description | Default |
---|---|---|---|
callback_manager
|
CallbackManager
|
Callback manager that handles callbacks for events within LlamaIndex. The callback manager provides a way to call handlers on event starts/ends. Additionally, the callback manager traces the current stack of events. It does this by using a few key attributes. - trace_stack - The current stack of events that have not ended yet. When an event ends, it's removed from the stack. Since this is a contextvar, it is unique to each thread/task. - trace_map - A mapping of event ids to their children events. On the start of events, the bottom of the trace stack is used as the current parent event for the trace map. - trace_id - A simple name for the current trace, usually denoting the entrypoint (query, index_construction, insert, etc.) Args: handlers (List[BaseCallbackHandler]): list of handlers to use. Usage: with callback_manager.event(CBEventType.QUERY) as event: event.on_start(payload={key, val}) ... event.on_end(payload={key, val}) |
<dynamic>
|
Source code in llama-index-core/llama_index/core/postprocessor/types.py
18 19 20 21 22 23 24 25 26 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 |
|
postprocess_nodes #
postprocess_nodes(nodes: List[NodeWithScore], query_bundle: Optional[QueryBundle] = None, query_str: Optional[str] = None) -> List[NodeWithScore]
Postprocess nodes.
Source code in llama-index-core/llama_index/core/postprocessor/types.py
41 42 43 44 45 46 47 48 49 50 51 52 53 54 |
|