agentkit.after_query
Classes
Base class for after query postprocessing. |
|
Class for after query postprocessing of Json objects. |
- class agentkit.after_query.BaseAfterQuery
Base class for after query postprocessing.
Each after query instance performs postprocessing after the LLM query.
- node
The Node object that this after-query instance is associated with.
- Type:
- post_process()
Post process the result of the LLM query.
This method can be overridden by the derived class to perform postprocessing.
- set_node(node)
Set the node for the after query.
This function will be called automatically upon initialization of a SimpleDBNode
- Parameters:
node (SimpleDBNode) – Node object.
- class agentkit.after_query.JsonAfterQuery
Class for after query postprocessing of Json objects.
- parse_json()
Parse the result of the LLM query.
This method parses self.node.result (str) and returns the parsed Json object. The method checks the length of the parsed Json object, and if the Json object contains the required keys.
- Raises:
AfterQueryError – If the answer is invalid.
- Returns:
List of Json objects, where the last Json object is the answer.
- Return type: