agentkit.base_node.BaseNode
- class agentkit.base_node.BaseNode(key: str, prompt: str, graph: ~agentkit.graph.Graph, query_llm: ~collections.abc.Callable, compose_prompt: ~agentkit.compose_prompt.BaseComposePrompt, after_query: ~agentkit.after_query.BaseAfterQuery | None = None, error_msg_fn: ~collections.abc.Callable[[list, str, ~agentkit.exceptions.AfterQueryError], list] = <function error_msg_default>, verbose: bool = False, token_counter: ~collections.abc.Callable | None = None)
Base class for a node in the graph.
Each node in the graph is an instance of the BaseNode class. The node is evaluated by querying the LLM with a prompt.
- query_llm
Function to query the LLM.
- Type:
Callable
- _compose_prompt
ComposePrompt object.
- Type:
- after_query
AfterQuery object.
- Type:
- error_msg_fn
Function to add error message to the prompt.
- Type:
Callable
- token_counter
Function to count tokens.
- Type:
Callable