GenerateAnswerNodeKLevel
Overviewβ
GenerateAnswerNodeKLevel
is a node responsible for compressing the input tokens and storing the document in a vector database for retrieval. Relevant chunks are stored in the state. It allows scraping of big documents without exceeding the token limit of the language model.
Attributesβ
llm_model
: An instance of a language model client, configured for generating answers.verbose
(bool): A flag indicating whether to show print statements during execution.
Argsβ
input
(str): Boolean expression defining the input keys needed from the state.output
(List[str]): List of output keys to be updated in the state.node_config
(dict): Additional configuration for the node.node_name
(str): The unique identifier name for the node, defaulting to "GANLK".
Exampleβ
generate_answer_node = GenerateAnswerNodeKLevel(
input="vectorial_db",
output=["answer"],
node_config={
"llm_model": llm_model_instance,
"embedder_model": embedder_model_instance,
"verbose": True,
"force": False,
"script_creator": False,
"is_md_scraper": False,
"additional_info": "Additional information"
}
)