You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Flag indicating the orchestrator should handle user input collection directly
786
+
* instead of delegating to a separate get-input tool.
787
+
* When true, the orchestrator generates a user input collection prompt directly.
788
+
*/
789
+
directUserInputCollection?:boolean;
784
790
}
785
791
```
786
792
@@ -797,6 +803,60 @@ While the orchestrator and base classes provide the workflow infrastructure, man
797
803
798
804
Rather than force every consumer to implement these common patterns, we provide them as part of the framework.
799
805
806
+
##### 5.0 Direct User Input Collection (Orchestrator-Handled)
807
+
808
+
**Purpose**: Allows the orchestrator to handle user input collection directly, eliminating the need for an intermediate tool call.
809
+
810
+
**Background**: The standard workflow for gathering user input involves two tool calls:
811
+
1. The workflow interrupts and instructs the LLM to invoke a get-input tool
812
+
2. The get-input tool returns a prompt, and the LLM gathers user input
813
+
3. The LLM returns the result to the orchestrator
814
+
815
+
This adds latency and complexity. The **direct user input collection** feature streamlines this by having the orchestrator generate the user input prompt directly.
816
+
817
+
**How It Works**:
818
+
819
+
When a workflow node needs user input, it creates an interrupt with the `directUserInputCollection` flag set to `true`:
directUserInputCollection: true, // Flag for direct handling
834
+
};
835
+
returninterrupt(mcpToolData);
836
+
```
837
+
838
+
When the orchestrator detects this flag, instead of instructing the LLM to call a separate get-input tool, it generates a user input collection prompt directly. The LLM then:
839
+
1. Presents the prompt to the user
840
+
2. Waits for user input
841
+
3. Returns the result (conforming to `{ userUtterance: ... }` schema) directly to the orchestrator
You are an input gathering assistant, responsible for explicitly requesting and gathering the
269
+
user's input for a set of unfulfilled properties.
270
+
271
+
# TASK
272
+
273
+
Your job is to provide a prompt to the user that outlines the details for a set of properties
274
+
that require the user's input. The prompt should be polite and conversational.
275
+
276
+
# CONTEXT
277
+
278
+
Here is the list of properties that require the user's input, along with their describing
279
+
metadata:
280
+
281
+
${propertiesDescription}
282
+
283
+
# INSTRUCTIONS
284
+
285
+
1. Based on the properties listed in "CONTEXT", generate a prompt that outlines the details
286
+
for each property.
287
+
2. Present the prompt to the user and instruct the user to provide their input.
288
+
3. **IMPORTANT:** YOU MUST NOW WAIT for the user to provide a follow-up response to your prompt.
289
+
1. You CANNOT PROCEED FROM THIS STEP until the user has provided THEIR OWN INPUT VALUE.
290
+
4. Follow the "Post-Input-Collection" instructions below, to return the user's
291
+
response to the orchestrator for further processing.
292
+
293
+
# Post-Input-Collection Instructions
294
+
295
+
## 1. Format the results from the user's input
296
+
297
+
The user's response data MUST be wrapped in a \`userUtterance\` property. The structure should be:
298
+
299
+
\`\`\`json
300
+
{
301
+
"userUtterance": <the user's response data here>
302
+
}
303
+
\`\`\`
304
+
305
+
For example, if the user provides values for properties like \`platform\` and \`projectName\`, the formatted result should be:
306
+
307
+
\`\`\`json
308
+
{
309
+
"userUtterance": {
310
+
"platform": "iOS",
311
+
"projectName": "MyApp"
312
+
}
313
+
}
314
+
\`\`\`
315
+
316
+
**JSON Schema for reference:**
317
+
\`\`\`json
318
+
${resultSchema}
319
+
\`\`\`
320
+
321
+
## 2. Invoke the orchestrator tool to continue the workflow
322
+
323
+
You MUST initiate the following actions to proceed with the in-progress workflow you are
324
+
participating in.
325
+
326
+
### 2.1. Invoke the \`${this.toolMetadata.toolId}\` tool
327
+
328
+
Invoke the \`${this.toolMetadata.toolId}\` tool to continue the workflow.
329
+
330
+
### 2.2 Provide input values to the tool
331
+
332
+
Provide the following input values to the \`${this.toolMetadata.toolId}\` tool:
333
+
334
+
- \`${WORKFLOW_PROPERTY_NAMES.userInput}\`: The formatted result from step 1 (an object with a \`userUtterance\` property containing the user's response data).
0 commit comments