dynamic_context
Add Edge
Connect two nodes of a conversation graph. Use when adding one new path
the agent may take between two existing nodes. condition is the label the
model chooses by. Refused (422, reasons) when another
edge leaving the same node already carries it (compared trimmed, case-insensitively):
two branches with one label is a branch the model can never take, and it is never
stored.
This is the agent graph. A flow's steps are connected with add_flow_edge.
path Parameters
graph_idAdd Edge › Request Body
source_node_idtarget_node_idconditionAdd Edge › Responses
Successful Response
conditionidsource_node_idtarget_node_idAdd Node
Add a node to a conversation graph. Use when adding one new situation to a
graph that already exists; use replace_draft_graph to write a whole
designed graph at once instead.
A node is one place the conversation can be: its own context for the model, and its
own tools. name is what a person calls the node in the editor and in history — set
it when a graph has more than a few nodes; the model never reads it, so it is not
where behaviour goes. instructions are. Refused (422, reasons) when tool_ids
would offer a tool name the agent already has, globally or on another node.
path Parameters
graph_idAdd Node › Responses
Update Node
Change a node's name, instructions, position, or tools. Use when editing
one existing node; only the fields sent change. name is what a person
calls the node; the model never reads it, and null clears it.
instructions is for what the agent should say
and how it should behave in this situation — never a business fact, which is a record
in a collection, and never a procedure, which is a flow. tool_ids is where a tool
reaches the agent in one
situation: instance ids from create_tool (a flow registered as a tool
included), the query_/get_/write_ tools a collection created, or a
published custom tool's tool_id. For a tool the agent should have in every
node, or one that runs before or after the conversation, use edit_draft. Refused
(422, reasons) when tool_ids would offer a tool name the agent already has. This
edits the draft's graph; nothing takes traffic until publish_version.
path Parameters
graph_idnode_id