-
Notifications
You must be signed in to change notification settings - Fork 6.6k
feat: add plan agent & model agent #5577
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
* feat: Add relevant functions related to agent invocation, including plan parsing, state management and tool invocation * Refactor agent call logic and utilities - Simplified the `runAgentCall` function by removing unnecessary complexity and restructuring the flow for better readability and maintainability. - Introduced helper functions to create tools from tool nodes and to prepare agent messages, enhancing modularity. - Removed the `utils.ts` file as its functions were integrated into the main logic, streamlining the codebase. - Updated the dispatch logic in `index.ts` to utilize the new helper functions and improve clarity. - Adjusted the handling of interactive modes and tool calls to ensure proper response formatting and error handling. * refactor: clean up the processing logic of the interactive mode and remove the unused tool creation functions * feat: add relevant constants for proxy configuration and update the proxy call logic * refactor: remove unused configuration variables from workflow properties * refactor: remove unused configuration variables from dispatchRunAgents props * fix: build error * refactor: update FlowNodeTypeEnum values and consolidate utility functions * refactor: simplify conditional checks in tool call and reasoning handlers * feat: add default agent prompt for improved response handling * refactor: rename directory with agent->tool, agentCall->agnet * refactor: rename dispatchRunAgents to dispatchRunAgent for consistency * refactor: rename toolCall to tools for consistency in FlowNodeTypeEnum * refactor: rename agents to toolCall for consistency in nodeTypes mapping * refactor: remove unused runtimeEdges parameter from dispatchRunAgent * refactor: update runAgentCall and dispatchRunAgent to use structured requestProps and workflowProps * refactor: streamline requestProps and handleToolResponse in runAgentCall and dispatchRunAgent * refactor: restructure RunAgentCallProps and update requestProps to requestParams for clarity * refactor: enhance interactiveEntryToolParams handling in runAgentCall for improved response management * refactor: flatten RunAgentCallProps structure and update dispatchRunAgent to use direct properties * fix: correct initialization of interactiveResponse in runAgentCall
Preview sandbox Image:
|
Preview mcp_server Image:
|
Preview fastgpt Image:
|
c121914yu
reviewed
Sep 3, 2025
return { | ||
response: '', | ||
usages: [], | ||
isEnd: true | ||
}; | ||
} else if (toolId === SubAppIds.plan) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TODO: 看下这里是不是应该放到 agentCall 里
… and parameters fix: update error handling in transferModelAgent and transferPlanAgent to return error messages refactor: simplify isEndSign assignment in runAgentCall
3197b97
to
cd63b98
Compare
…xt and rename default prompt variable
… and parameters fix: update error handling in transferModelAgent and transferPlanAgent to return error messages refactor: simplify isEndSign assignment in runAgentCall
cb99a7d
to
0f90716
Compare
c121914yu
approved these changes
Sep 8, 2025
@@ -181,6 +181,11 @@ export enum NodeInputKeyEnum { | |||
aiChatResponseFormat = 'aiChatResponseFormat', | |||
aiChatJsonSchema = 'aiChatJsonSchema', | |||
|
|||
// agent |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TODO: 待确认输入
TestGru AssignmentSummary
Tip You can |
c121914yu
approved these changes
Sep 8, 2025
c121914yu
added a commit
that referenced
this pull request
Sep 8, 2025
* refactor: agent call (#5572) * feat: Add relevant functions related to agent invocation, including plan parsing, state management and tool invocation * Refactor agent call logic and utilities - Simplified the `runAgentCall` function by removing unnecessary complexity and restructuring the flow for better readability and maintainability. - Introduced helper functions to create tools from tool nodes and to prepare agent messages, enhancing modularity. - Removed the `utils.ts` file as its functions were integrated into the main logic, streamlining the codebase. - Updated the dispatch logic in `index.ts` to utilize the new helper functions and improve clarity. - Adjusted the handling of interactive modes and tool calls to ensure proper response formatting and error handling. * refactor: clean up the processing logic of the interactive mode and remove the unused tool creation functions * feat: add relevant constants for proxy configuration and update the proxy call logic * refactor: remove unused configuration variables from workflow properties * refactor: remove unused configuration variables from dispatchRunAgents props * fix: build error * refactor: update FlowNodeTypeEnum values and consolidate utility functions * refactor: simplify conditional checks in tool call and reasoning handlers * feat: add default agent prompt for improved response handling * refactor: rename directory with agent->tool, agentCall->agnet * refactor: rename dispatchRunAgents to dispatchRunAgent for consistency * refactor: rename toolCall to tools for consistency in FlowNodeTypeEnum * refactor: rename agents to toolCall for consistency in nodeTypes mapping * refactor: remove unused runtimeEdges parameter from dispatchRunAgent * refactor: update runAgentCall and dispatchRunAgent to use structured requestProps and workflowProps * refactor: streamline requestProps and handleToolResponse in runAgentCall and dispatchRunAgent * refactor: restructure RunAgentCallProps and update requestProps to requestParams for clarity * refactor: enhance interactiveEntryToolParams handling in runAgentCall for improved response management * refactor: flatten RunAgentCallProps structure and update dispatchRunAgent to use direct properties * fix: correct initialization of interactiveResponse in runAgentCall * agent call code * fix: agent call stop sign * feat: add plan agent tools and default generated prompts * feat: add model agent tools and related functions * chore: rename enum value * fix: optimize isEndSign assignment and update default plan prompt format * fix: update transferPlanAgent to use histories instead of sharedContext and rename default prompt variable * fix: update transferPlanAgent to use ChatItemType and adapt message structure * feat: add ModelAgentTool and PlanAgentTool with detailed descriptions and parameters fix: update error handling in transferModelAgent and transferPlanAgent to return error messages refactor: simplify isEndSign assignment in runAgentCall * feat: enhance agent call handling and response processing with context support * feat: refactor agent prompts and add utility functions for system prompt parsing * feat: add plan agent tools and default generated prompts * feat: add model agent tools and related functions * chore: rename enum value * fix: optimize isEndSign assignment and update default plan prompt format * fix: update transferPlanAgent to use histories instead of sharedContext and rename default prompt variable * fix: update transferPlanAgent to use ChatItemType and adapt message structure * feat: add ModelAgentTool and PlanAgentTool with detailed descriptions and parameters fix: update error handling in transferModelAgent and transferPlanAgent to return error messages refactor: simplify isEndSign assignment in runAgentCall * feat: enhance agent call handling and response processing with context support * feat: refactor agent prompts and add utility functions for system prompt parsing * feat: add AskAgentTool to support the interactive questioning function * Update request.ts --------- Co-authored-by: archer <545436317@qq.com>
c121914yu
added a commit
that referenced
this pull request
Sep 9, 2025
* refactor: agent call (#5572) * feat: Add relevant functions related to agent invocation, including plan parsing, state management and tool invocation * Refactor agent call logic and utilities - Simplified the `runAgentCall` function by removing unnecessary complexity and restructuring the flow for better readability and maintainability. - Introduced helper functions to create tools from tool nodes and to prepare agent messages, enhancing modularity. - Removed the `utils.ts` file as its functions were integrated into the main logic, streamlining the codebase. - Updated the dispatch logic in `index.ts` to utilize the new helper functions and improve clarity. - Adjusted the handling of interactive modes and tool calls to ensure proper response formatting and error handling. * refactor: clean up the processing logic of the interactive mode and remove the unused tool creation functions * feat: add relevant constants for proxy configuration and update the proxy call logic * refactor: remove unused configuration variables from workflow properties * refactor: remove unused configuration variables from dispatchRunAgents props * fix: build error * refactor: update FlowNodeTypeEnum values and consolidate utility functions * refactor: simplify conditional checks in tool call and reasoning handlers * feat: add default agent prompt for improved response handling * refactor: rename directory with agent->tool, agentCall->agnet * refactor: rename dispatchRunAgents to dispatchRunAgent for consistency * refactor: rename toolCall to tools for consistency in FlowNodeTypeEnum * refactor: rename agents to toolCall for consistency in nodeTypes mapping * refactor: remove unused runtimeEdges parameter from dispatchRunAgent * refactor: update runAgentCall and dispatchRunAgent to use structured requestProps and workflowProps * refactor: streamline requestProps and handleToolResponse in runAgentCall and dispatchRunAgent * refactor: restructure RunAgentCallProps and update requestProps to requestParams for clarity * refactor: enhance interactiveEntryToolParams handling in runAgentCall for improved response management * refactor: flatten RunAgentCallProps structure and update dispatchRunAgent to use direct properties * fix: correct initialization of interactiveResponse in runAgentCall * agent call code * fix: agent call stop sign * feat: add plan agent tools and default generated prompts * feat: add model agent tools and related functions * chore: rename enum value * fix: optimize isEndSign assignment and update default plan prompt format * fix: update transferPlanAgent to use histories instead of sharedContext and rename default prompt variable * fix: update transferPlanAgent to use ChatItemType and adapt message structure * feat: add ModelAgentTool and PlanAgentTool with detailed descriptions and parameters fix: update error handling in transferModelAgent and transferPlanAgent to return error messages refactor: simplify isEndSign assignment in runAgentCall * feat: enhance agent call handling and response processing with context support * feat: refactor agent prompts and add utility functions for system prompt parsing * feat: add plan agent tools and default generated prompts * feat: add model agent tools and related functions * chore: rename enum value * fix: optimize isEndSign assignment and update default plan prompt format * fix: update transferPlanAgent to use histories instead of sharedContext and rename default prompt variable * fix: update transferPlanAgent to use ChatItemType and adapt message structure * feat: add ModelAgentTool and PlanAgentTool with detailed descriptions and parameters fix: update error handling in transferModelAgent and transferPlanAgent to return error messages refactor: simplify isEndSign assignment in runAgentCall * feat: enhance agent call handling and response processing with context support * feat: refactor agent prompts and add utility functions for system prompt parsing * feat: add AskAgentTool to support the interactive questioning function * Update request.ts --------- Co-authored-by: archer <545436317@qq.com>
c121914yu
added a commit
that referenced
this pull request
Sep 9, 2025
* refactor: agent call (#5572) * feat: Add relevant functions related to agent invocation, including plan parsing, state management and tool invocation * Refactor agent call logic and utilities - Simplified the `runAgentCall` function by removing unnecessary complexity and restructuring the flow for better readability and maintainability. - Introduced helper functions to create tools from tool nodes and to prepare agent messages, enhancing modularity. - Removed the `utils.ts` file as its functions were integrated into the main logic, streamlining the codebase. - Updated the dispatch logic in `index.ts` to utilize the new helper functions and improve clarity. - Adjusted the handling of interactive modes and tool calls to ensure proper response formatting and error handling. * refactor: clean up the processing logic of the interactive mode and remove the unused tool creation functions * feat: add relevant constants for proxy configuration and update the proxy call logic * refactor: remove unused configuration variables from workflow properties * refactor: remove unused configuration variables from dispatchRunAgents props * fix: build error * refactor: update FlowNodeTypeEnum values and consolidate utility functions * refactor: simplify conditional checks in tool call and reasoning handlers * feat: add default agent prompt for improved response handling * refactor: rename directory with agent->tool, agentCall->agnet * refactor: rename dispatchRunAgents to dispatchRunAgent for consistency * refactor: rename toolCall to tools for consistency in FlowNodeTypeEnum * refactor: rename agents to toolCall for consistency in nodeTypes mapping * refactor: remove unused runtimeEdges parameter from dispatchRunAgent * refactor: update runAgentCall and dispatchRunAgent to use structured requestProps and workflowProps * refactor: streamline requestProps and handleToolResponse in runAgentCall and dispatchRunAgent * refactor: restructure RunAgentCallProps and update requestProps to requestParams for clarity * refactor: enhance interactiveEntryToolParams handling in runAgentCall for improved response management * refactor: flatten RunAgentCallProps structure and update dispatchRunAgent to use direct properties * fix: correct initialization of interactiveResponse in runAgentCall * agent call code * fix: agent call stop sign * feat: add plan agent tools and default generated prompts * feat: add model agent tools and related functions * chore: rename enum value * fix: optimize isEndSign assignment and update default plan prompt format * fix: update transferPlanAgent to use histories instead of sharedContext and rename default prompt variable * fix: update transferPlanAgent to use ChatItemType and adapt message structure * feat: add ModelAgentTool and PlanAgentTool with detailed descriptions and parameters fix: update error handling in transferModelAgent and transferPlanAgent to return error messages refactor: simplify isEndSign assignment in runAgentCall * feat: enhance agent call handling and response processing with context support * feat: refactor agent prompts and add utility functions for system prompt parsing * feat: add plan agent tools and default generated prompts * feat: add model agent tools and related functions * chore: rename enum value * fix: optimize isEndSign assignment and update default plan prompt format * fix: update transferPlanAgent to use histories instead of sharedContext and rename default prompt variable * fix: update transferPlanAgent to use ChatItemType and adapt message structure * feat: add ModelAgentTool and PlanAgentTool with detailed descriptions and parameters fix: update error handling in transferModelAgent and transferPlanAgent to return error messages refactor: simplify isEndSign assignment in runAgentCall * feat: enhance agent call handling and response processing with context support * feat: refactor agent prompts and add utility functions for system prompt parsing * feat: add AskAgentTool to support the interactive questioning function * Update request.ts --------- Co-authored-by: archer <545436317@qq.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.