query
Function
Implements knowledge graph-based QA.
Prototype
def query(text, llm_config, *args, **kwargs)
Parameters
Parameter |
Data Type |
Required/Optional |
Description |
|---|---|---|---|
text |
String |
Required |
Original question. The value range is (0, 1000 × 1000]. |
llm_config |
LLMParameterConfig |
Optional |
Parameters for calling an LLM. Change the default value of temperature to 0.5 and that of top_p to 0.95. For details about other parameters, see LLMParameterConfig. |
args |
List |
Optional |
Inherits the signature of its parent class method, which is not used here. |
kwargs |
Dict |
Optional |
Inherits the signature of its parent class method, which is not used here. |
Return Value
Data Type |
Description |
|---|---|
Dict |
Model answer in the format of {'query': "who is Teutberga's parents?", 'result': "Teutberga's parents are Bosonid Boso the Elder and an unknown mother."}. |
Parent topic: GraphRagText2TextChain