From 0a6f3fc649b37e273a501302c1dd645a5e9a18ac Mon Sep 17 00:00:00 2001 From: "A.J. Shulman" Date: Mon, 12 May 2025 11:49:49 -0400 Subject: Added example --- .../nodes/chatbot/tools/DocumentMetadataTool.ts | 197 ++++++++++++++++++++- 1 file changed, 196 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/client/views/nodes/chatbot/tools/DocumentMetadataTool.ts b/src/client/views/nodes/chatbot/tools/DocumentMetadataTool.ts index 405949c1e..b4c21f6e3 100644 --- a/src/client/views/nodes/chatbot/tools/DocumentMetadataTool.ts +++ b/src/client/views/nodes/chatbot/tools/DocumentMetadataTool.ts @@ -96,7 +96,202 @@ Example: To change document height, disable auto-height and set height in a sing {... inputs: { action: "edit", documentId: "doc123", fieldEdits: [ { fieldName: "layout_autoHeight", fieldValue: false }, { fieldName: "height", fieldValue: 300 } -]}}`; +]}} + + +Here is a detailed example: + + + + Create a flow-chart of neurotransmitter release at a synapse, and place a notes box directly underneath that explains each step. + + + + + + I will create a DiagramBox containing a Mermaid flow-chart. After that, I'll make a notes document, read the diagram’s metadata, and then move the notes so it lines up beneath the chart. + + documentMetadata + + + + ***Action rules omitted*** + + + + + Creating a DiagramBox with a Mermaid chart of neurotransmitter release. + + create + Synaptic Release Flowchart + graph TD; A(Vesicle docks)-->B(Ca²⁺ influx); B-->C(Vesicle fuses); C-->D(Neurotransmitter released) + diagram + + + + + + + + Document created successfully. + Document ID: 9f2c43c8-0a16-4c12-987b-b813d2f7b1ee + Type: diagram + Title: "Synaptic Release Flowchart" + + The document has been created with default dimensions and positioning. + … + Full metadata for the created document: + { /* huge JSON omitted for brevity */ } + + + + + + + + I will create a plain-text notes document that summarises the diagram’s steps. + + documentMetadata + + + + ***Action rules omitted*** + + + + + Creating a text document for explanatory notes. + + create + Synaptic Release – Notes + This diagram shows vesicle docking, calcium-triggered fusion, and neurotransmitter release into the synaptic cleft. + note + + + + + + + + Document created successfully. + Document ID: c8e3f4b9-7d2e-462a-a444-61e8e9ff0c7f + Type: note + Title: "Synaptic Release – Notes" + … + Full metadata for the created document: + { /* huge JSON omitted for brevity */ } + + + + + + + + I'll fetch the diagram’s width, height, and position so I can align the notes box underneath it. + + documentMetadata + + + + ***Action rules omitted*** + + + + + Getting metadata for the diagram document. + + get + 9f2c43c8-0a16-4c12-987b-b813d2f7b1ee + + + + + + + + { + "x": 100, + "y": 100, + "width": 600, + "height": 300, + "layout_autoWidth": false, + "layout_autoHeight": false + } + + + + + + + + The diagram ends at y = 100 + 300 = 400. + I’ll move the notes to x = 100, y = 420 (a 20-px gap) and expand its width to 600 px. + + documentMetadata + + + + ***Action rules omitted*** + + + + + Editing the notes document’s position and size. + + edit + c8e3f4b9-7d2e-462a-a444-61e8e9ff0c7f + [ + {"fieldName":"layout_autoWidth","fieldValue":false}, + {"fieldName":"width","fieldValue":600}, + {"fieldName":"x","fieldValue":100}, + {"fieldName":"y","fieldValue":420} + ] + + + + + + + + Successfully edited 4 fields on document c8e3f4b9-7d2e-462a-a444-61e8e9ff0c7f. + New position: (x:100, y:420) Width:600 + + + + + + + + Both documents are now created and perfectly aligned; I can summarise the result. + + + + A **DiagramBox** depicting neurotransmitter release was created at **(100 px, 100 px)**, sized **600 × 300 px**. + + + A **notes document** was then resized to **600 px** wide and moved to **(100 px, 420 px)**—20 px below the diagram—to keep the explanation directly beneath the visualization. + + + This layout ensures viewers can read the synopsis while referring to the flow-chart above. + + + + + + + Would you like to tweak the diagram’s styling (e.g., colours or fonts)? + Should I link external references or papers in the notes? + Do you want similar diagrams for other neural processes? + + + The assistant used **DocumentMetadataTool** four times: + 1) **create** DiagramBox → 2) **create** notes document → 3) **get** diagram metadata → 4) **edit** notes position/size. + This demonstrates creating, inspecting, and aligning documents within a Freeform view. + + + + +`; // Extensive usage guidelines for the tool const citationRules = `USAGE GUIDELINES: -- cgit v1.2.3-70-g09d2