Clients take a flow's id or key: one resolver in the SDK, id first, explicit id:/key:, a warning for reads and a refusal for changes when a name means two flows, deleted flows found by their last key; sync creates by POST, retries a create race through the drift checks and reports the id; MCP gets create_flow and resolves every flow argument with the caller's token; displays show flow_name; an engine from before ids is named as such
This commit is contained in:
@@ -34,9 +34,13 @@ operate flows through the tools; they are the same API the editor uses, so \
|
||||
anything you save appears in the editor at once.
|
||||
|
||||
How to work:
|
||||
- A flow has an id and a key, its `name`, which also prefixes its messages. \
|
||||
Tools take either; write id:<x> or key:<x> when a tool says the name could \
|
||||
mean two flows.
|
||||
- Read before you write: get_flow before save_flow, and pass back the version \
|
||||
you read. On a version conflict, read again and reapply the change.
|
||||
- save_flow writes a draft, and validate_flow tells you whether it is sound. \
|
||||
- create_flow makes a new flow and save_flow changes one; both write a draft, \
|
||||
and validate_flow tells you whether it is sound. \
|
||||
Publish only when the user asks for the change to go live; otherwise leave \
|
||||
the draft for review in the editor and say so.
|
||||
- list_node_types gives the node types and their parameters; get_node_source \
|
||||
@@ -45,7 +49,7 @@ shows how a Python node is written before you write one.
|
||||
use lists, `inline code` and fenced code blocks where they help, and no \
|
||||
tables, images or HTML.
|
||||
|
||||
The flow document `save_flow` takes, as a JSON schema:
|
||||
The flow document `create_flow` and `save_flow` take, as a JSON schema:
|
||||
"""
|
||||
|
||||
# ponytail: a tool's answer is replayed on every later round of the
|
||||
@@ -57,7 +61,10 @@ _RESULT_LIMIT = 20_000
|
||||
def system_prompt(flow: str | None) -> str:
|
||||
prompt = _SYSTEM + json.dumps(FlowDef.model_json_schema())
|
||||
if flow:
|
||||
prompt += f"\n\nThe user is looking at the flow named {flow!r}."
|
||||
prompt += (
|
||||
f"\n\nThe user is looking at the flow with the id {flow!r}. Name it "
|
||||
f"to the tools as id:{flow}."
|
||||
)
|
||||
return prompt
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user