Skip to content

Commit 38b95b1

Browse files
committed
Customization of guidance
1 parent e449101 commit 38b95b1

File tree

3 files changed

+12
-2
lines changed

3 files changed

+12
-2
lines changed

packages/mcp-workflow/src/common/metadata.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,15 @@ export interface NodeGuidanceData<TResultSchema extends z.ZodObject<z.ZodRawShap
7777
* LLM compliance with the expected structure.
7878
*/
7979
exampleOutput?: string;
80+
/**
81+
* Optional guidance for the LLM to return to the orchestrator.
82+
* When provided, this guidance will replace the default "return to orchestrator"
83+
* guidance that the orchestrator normally provides to the LLM, to return the
84+
* workflow to the orchestrator after task completion. Make sure this custom
85+
* guidance can properly return the workflow to the orchestrator, or the workflow
86+
* will likely be broken.
87+
*/
88+
returnGuidance?: (workflowStateData: WorkflowStateData) => string;
8089
}
8190

8291
/**

packages/mcp-workflow/src/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ export { type BaseGraphConfig, type WorkflowRunnableConfig } from './common/grap
6868
export {
6969
BaseNode,
7070
AbstractToolNode,
71+
UserInputExtractionNode,
7172
createGetUserInputNode,
7273
createUserInputExtractionNode,
7374
type GetUserInputNodeOptions,
@@ -78,7 +79,7 @@ export {
7879
export { CheckPropertiesFulfilledRouter } from './routers/index.js';
7980

8081
// Base Service Classes
81-
export { AbstractService } from './services/index.js';
82+
export { AbstractService, InputExtractionService } from './services/index.js';
8283

8384
// Checkpointing Infrastructure
8485
export {

packages/mcp-workflow/src/services/inputExtractionService.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ export class InputExtractionService
204204
* @param propertiesToExtract - Array of properties to extract
205205
* @returns The guidance prompt string
206206
*/
207-
private generateTaskGuidance(
207+
protected generateTaskGuidance(
208208
userUtterance: unknown,
209209
propertiesToExtract: Array<{ propertyName: string; description: string }>
210210
): string {

0 commit comments

Comments
 (0)