mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-04-29 19:06:24 +02:00
feat: add DedupHITLToolCallsMiddleware to prevent duplicate tool calls
- Introduced DedupHITLToolCallsMiddleware to prevent duplicate HITL tool calls within a single LLM response, ensuring only the first occurrence of each tool call is retained. - Updated the create_surfsense_deep_agent function to include the new middleware, enhancing the efficiency of tool interactions. - Added a new middleware file for better organization and maintainability of the codebase.
This commit is contained in:
parent
744ad1fa79
commit
ff6514a99f
13 changed files with 97 additions and 51 deletions
|
|
@ -64,11 +64,6 @@ def create_delete_linear_issue_tool(
|
|||
- If status is "not_found", inform the user conversationally using the exact message
|
||||
provided. Do NOT treat this as an error. Simply relay the message and ask the user
|
||||
to verify the issue title or identifier, or check if it has been indexed.
|
||||
- ONLY call this tool ONCE per user request. The system automatically picks the
|
||||
most relevant match when multiple issues share the same title. The user will
|
||||
see the exact issue details in the approval card and can reject if it is not
|
||||
the right one. Do NOT call this tool multiple times for the same issue reference.
|
||||
|
||||
Examples:
|
||||
- "Delete the 'Fix login bug' Linear issue"
|
||||
- "Archive ENG-42"
|
||||
|
|
|
|||
|
|
@ -78,10 +78,6 @@ def create_update_linear_issue_tool(
|
|||
- If status is "not_found", inform the user conversationally using the exact message
|
||||
provided. Do NOT treat this as an error. Simply relay the message and ask the user
|
||||
to verify the issue title or identifier, or check if it has been indexed.
|
||||
- ONLY call this tool ONCE per user request. The system automatically picks the
|
||||
most relevant match when multiple issues share the same title. The user will
|
||||
see the exact issue details in the approval card and can reject if it is not
|
||||
the right one. Do NOT call this tool multiple times for the same issue reference.
|
||||
|
||||
Examples:
|
||||
- "Mark the 'Fix login bug' issue as done"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue