haive.core.graph.branches ========================= .. py:module:: haive.core.graph.branches .. autoapi-nested-parse:: Branch system for dynamic routing based on state values. Submodules ---------- .. toctree:: :maxdepth: 1 /autoapi/haive/core/graph/branches/branch/index /autoapi/haive/core/graph/branches/dynamic/index /autoapi/haive/core/graph/branches/send_mapping/index /autoapi/haive/core/graph/branches/types/index /autoapi/haive/core/graph/branches/utils/index Functions --------- .. autoapisummary:: haive.core.graph.branches.chain haive.core.graph.branches.conditional haive.core.graph.branches.create_from_send_function haive.core.graph.branches.from_function haive.core.graph.branches.key_equals haive.core.graph.branches.key_exists haive.core.graph.branches.message_contains haive.core.graph.branches.send_mapper Package Contents ---------------- .. py:function:: chain(*branches, default = 'END') Chain multiple branches together, evaluating them in sequence. .. py:function:: conditional(condition, if_true, if_false, default = 'END') Create a Branch with conditional evaluation. .. py:function:: create_from_send_function(mapper_function) Create a Send mapper branch from a function that returns Send objects. .. py:function:: from_function(function, destinations = None, default = 'END') Create a Branch from a function. .. py:function:: key_equals(key, value, true_dest = 'continue', false_dest = 'END') Create a Branch that checks if a key equals a value. .. py:function:: key_exists(key, true_dest = 'continue', false_dest = 'END') Create a Branch that checks if a key exists in the state. .. py:function:: message_contains(text, true_dest = 'continue', false_dest = 'END', message_key = 'messages') Create a Branch that checks if the last message contains specific text. .. py:function:: send_mapper(function = None, mappings = None, generators = None) Create a Branch that generates Send objects.