haive.agents.chain.declarative_chain ==================================== .. py:module:: haive.agents.chain.declarative_chain .. autoapi-nested-parse:: Declarative chain building for complex agent workflows. Provides declarative specification and building of complex agent chains with branching, loops, and conditional execution. Classes ------- .. autoapisummary:: haive.agents.chain.declarative_chain.BranchSpec haive.agents.chain.declarative_chain.ChainBuilder haive.agents.chain.declarative_chain.ChainSpec haive.agents.chain.declarative_chain.DeclarativeChainAgent haive.agents.chain.declarative_chain.LoopSpec haive.agents.chain.declarative_chain.NodeSpec haive.agents.chain.declarative_chain.SequenceSpec Functions --------- .. autoapisummary:: haive.agents.chain.declarative_chain.complex_rag Module Contents --------------- .. py:class:: BranchSpec Specification for conditional branching. .. py:class:: ChainBuilder(name) Builder for creating declarative chains. Init . :param name: [TODO: Add description] .. py:method:: add_branch(from_node, condition, branches, default = None) Add conditional branching. .. py:method:: add_loop(start_node, end_node, condition, max_iterations = 10) Add a loop. .. py:method:: add_node(name, node, node_type = 'agent') Add a node to the chain. .. py:method:: add_sequence(*nodes) Add a sequence of nodes. .. py:method:: build() Build the final chain agent. .. py:class:: ChainSpec Complete specification for a declarative chain. .. py:class:: DeclarativeChainAgent(name, chain_spec) Agent that executes a declaratively defined chain. Init . :param name: [TODO: Add description] :param chain_spec: [TODO: Add description] .. py:method:: arun(input_data) :async: Execute the chain asynchronously. .. py:method:: run(input_data) Execute the chain. .. py:class:: LoopSpec Specification for loops in the chain. .. py:class:: NodeSpec Specification for a single node in a chain. .. py:class:: SequenceSpec Specification for a sequence of nodes. .. py:function:: complex_rag(*args, **kwargs) Create a complex RAG chain using declarative building.