Custom
CustomQueryEngine #
Bases: BaseModel
, BaseQueryEngine
Custom query engine.
Subclasses can define additional attributes as Pydantic fields.
Subclasses must implement the custom_query
method, which takes a query string
and returns either a Response object or a string as output.
They can optionally implement the acustom_query
method for async support.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
callback_manager
|
CallbackManager
|
|
<llama_index.core.callbacks.base.CallbackManager object at 0x7ca3b3d91ac0>
|
Source code in llama-index-core/llama_index/core/query_engine/custom.py
16 17 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 67 68 69 70 71 72 73 74 75 76 |
|
custom_query
abstractmethod
#
custom_query(query_str: str) -> STR_OR_RESPONSE_TYPE
Run a custom query.
Source code in llama-index-core/llama_index/core/query_engine/custom.py
63 64 65 |
|
acustom_query
async
#
acustom_query(query_str: str) -> STR_OR_RESPONSE_TYPE
Run a custom query asynchronously.
Source code in llama-index-core/llama_index/core/query_engine/custom.py
67 68 69 70 |
|