mirror of https://github.com/kortix-ai/suna.git
still broken
This commit is contained in:
parent
33144ea3d6
commit
3e89600cce
|
@ -474,30 +474,6 @@ Ask user a question and wait for response. Use for: 1) Requesting clarification
|
||||||
This information will help me make sure the cake meets your expectations for the celebration.
|
This information will help me make sure the cake meets your expectations for the celebration.
|
||||||
</ask>
|
</ask>
|
||||||
|
|
||||||
|
|
||||||
## inform Tool Example (User CANNOT Respond):
|
|
||||||
|
|
||||||
Inform the user about progress, completion of a major step, or important context. Use this tool: 1) To provide updates between major sections of work, 2) After accomplishing significant milestones, 3) When transitioning to a new phase of work, 4) To confirm actions were completed successfully, 5) To provide context about upcoming steps. IMPORTANT: Use FREQUENTLY throughout execution to provide UI context to the user. The user CANNOT respond to this tool - they can only respond to the 'ask' tool. Use this tool to keep the user informed without requiring their input."
|
|
||||||
|
|
||||||
<!-- Use inform FREQUENTLY to provide UI context and progress updates - THE USER CANNOT RESPOND to this tool -->
|
|
||||||
<!-- The user can ONLY respond to the ask tool, not to inform -->
|
|
||||||
<!-- Examples of when to use inform: -->
|
|
||||||
<!-- 1. Completing major milestones -->
|
|
||||||
<!-- 2. Transitioning between work phases -->
|
|
||||||
<!-- 3. Confirming important actions -->
|
|
||||||
<!-- 4. Providing context about upcoming steps -->
|
|
||||||
<!-- 5. Sharing significant intermediate results -->
|
|
||||||
<!-- 6. Providing regular UI updates throughout execution -->
|
|
||||||
|
|
||||||
<inform attachments="analysis_results.csv,summary_chart.png">
|
|
||||||
I've completed the data analysis of the sales figures. Key findings include:
|
|
||||||
- Q4 sales were 28% higher than Q3
|
|
||||||
- Product line A showed the strongest performance
|
|
||||||
- Three regions missed their targets
|
|
||||||
|
|
||||||
I'll now proceed with creating the executive summary report based on these findings.
|
|
||||||
</inform>
|
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def get_system_prompt():
|
def get_system_prompt():
|
||||||
|
|
|
@ -14,76 +14,76 @@ class MessageTool(Tool):
|
||||||
|
|
||||||
# Commented out as we are just doing this via prompt as there is no need to call it as a tool
|
# Commented out as we are just doing this via prompt as there is no need to call it as a tool
|
||||||
|
|
||||||
# @openapi_schema({
|
@openapi_schema({
|
||||||
# "type": "function",
|
"type": "function",
|
||||||
# "function": {
|
"function": {
|
||||||
# "name": "ask",
|
"name": "ask",
|
||||||
# "description": "Ask user a question and wait for response. Use for: 1) Requesting clarification on ambiguous requirements, 2) Seeking confirmation before proceeding with high-impact changes, 3) Gathering additional information needed to complete a task, 4) Offering options and requesting user preference, 5) Validating assumptions when critical to task success. IMPORTANT: Use this tool only when user input is essential to proceed. Always provide clear context and options when applicable. Include relevant attachments when the question relates to specific files or resources.",
|
"description": "Ask user a question and wait for response. Use for: 1) Requesting clarification on ambiguous requirements, 2) Seeking confirmation before proceeding with high-impact changes, 3) Gathering additional information needed to complete a task, 4) Offering options and requesting user preference, 5) Validating assumptions when critical to task success. IMPORTANT: Use this tool only when user input is essential to proceed. Always provide clear context and options when applicable. Include relevant attachments when the question relates to specific files or resources.",
|
||||||
# "parameters": {
|
"parameters": {
|
||||||
# "type": "object",
|
"type": "object",
|
||||||
# "properties": {
|
"properties": {
|
||||||
# "text": {
|
"text": {
|
||||||
# "type": "string",
|
"type": "string",
|
||||||
# "description": "Question text to present to user - should be specific and clearly indicate what information you need. Include: 1) Clear question or request, 2) Context about why the input is needed, 3) Available options if applicable, 4) Impact of different choices, 5) Any relevant constraints or considerations."
|
"description": "Question text to present to user - should be specific and clearly indicate what information you need. Include: 1) Clear question or request, 2) Context about why the input is needed, 3) Available options if applicable, 4) Impact of different choices, 5) Any relevant constraints or considerations."
|
||||||
# },
|
},
|
||||||
# "attachments": {
|
"attachments": {
|
||||||
# "anyOf": [
|
"anyOf": [
|
||||||
# {"type": "string"},
|
{"type": "string"},
|
||||||
# {"items": {"type": "string"}, "type": "array"}
|
{"items": {"type": "string"}, "type": "array"}
|
||||||
# ],
|
],
|
||||||
# "description": "(Optional) List of files or URLs to attach to the question. Include when: 1) Question relates to specific files or configurations, 2) User needs to review content before answering, 3) Options or choices are documented in files, 4) Supporting evidence or context is needed. Always use relative paths to /workspace directory."
|
"description": "(Optional) List of files or URLs to attach to the question. Include when: 1) Question relates to specific files or configurations, 2) User needs to review content before answering, 3) Options or choices are documented in files, 4) Supporting evidence or context is needed. Always use relative paths to /workspace directory."
|
||||||
# }
|
}
|
||||||
# },
|
},
|
||||||
# "required": ["text"]
|
"required": ["text"]
|
||||||
# }
|
}
|
||||||
# }
|
}
|
||||||
# })
|
})
|
||||||
# @xml_schema(
|
@xml_schema(
|
||||||
# tag_name="ask",
|
tag_name="ask",
|
||||||
# mappings=[
|
mappings=[
|
||||||
# {"param_name": "text", "node_type": "content", "path": "."},
|
{"param_name": "text", "node_type": "content", "path": "."},
|
||||||
# {"param_name": "attachments", "node_type": "attribute", "path": ".", "required": False}
|
{"param_name": "attachments", "node_type": "attribute", "path": ".", "required": False}
|
||||||
# ],
|
],
|
||||||
# example='''
|
example='''
|
||||||
# Ask user a question and wait for response. Use for: 1) Requesting clarification on ambiguous requirements, 2) Seeking confirmation before proceeding with high-impact changes, 3) Gathering additional information needed to complete a task, 4) Offering options and requesting user preference, 5) Validating assumptions when critical to task success. IMPORTANT: Use this tool only when user input is essential to proceed. Always provide clear context and options when applicable. Include relevant attachments when the question relates to specific files or resources.
|
Ask user a question and wait for response. Use for: 1) Requesting clarification on ambiguous requirements, 2) Seeking confirmation before proceeding with high-impact changes, 3) Gathering additional information needed to complete a task, 4) Offering options and requesting user preference, 5) Validating assumptions when critical to task success. IMPORTANT: Use this tool only when user input is essential to proceed. Always provide clear context and options when applicable. Include relevant attachments when the question relates to specific files or resources.
|
||||||
|
|
||||||
# <!-- Use ask when you need user input to proceed -->
|
<!-- Use ask when you need user input to proceed -->
|
||||||
# <!-- Examples of when to use ask: -->
|
<!-- Examples of when to use ask: -->
|
||||||
# <!-- 1. Clarifying ambiguous requirements -->
|
<!-- 1. Clarifying ambiguous requirements -->
|
||||||
# <!-- 2. Confirming high-impact changes -->
|
<!-- 2. Confirming high-impact changes -->
|
||||||
# <!-- 3. Choosing between implementation options -->
|
<!-- 3. Choosing between implementation options -->
|
||||||
# <!-- 4. Validating critical assumptions -->
|
<!-- 4. Validating critical assumptions -->
|
||||||
# <!-- 5. Getting missing information -->
|
<!-- 5. Getting missing information -->
|
||||||
|
|
||||||
# <ask attachments="recipes/chocolate_cake.txt,photos/cake_examples.jpg">
|
<ask attachments="recipes/chocolate_cake.txt,photos/cake_examples.jpg">
|
||||||
# I'm planning to bake the chocolate cake for your birthday party. The recipe mentions "rich frosting" but doesn't specify what type. Could you clarify your preferences? For example:
|
I'm planning to bake the chocolate cake for your birthday party. The recipe mentions "rich frosting" but doesn't specify what type. Could you clarify your preferences? For example:
|
||||||
# 1. Would you prefer buttercream or cream cheese frosting?
|
1. Would you prefer buttercream or cream cheese frosting?
|
||||||
# 2. Do you want any specific flavor added to the frosting (vanilla, coffee, etc.)?
|
2. Do you want any specific flavor added to the frosting (vanilla, coffee, etc.)?
|
||||||
# 3. Should I add any decorative toppings like sprinkles or fruit?
|
3. Should I add any decorative toppings like sprinkles or fruit?
|
||||||
# 4. Do you have any dietary restrictions I should be aware of?
|
4. Do you have any dietary restrictions I should be aware of?
|
||||||
|
|
||||||
# This information will help me make sure the cake meets your expectations for the celebration.
|
This information will help me make sure the cake meets your expectations for the celebration.
|
||||||
# </ask>
|
</ask>
|
||||||
# '''
|
'''
|
||||||
# )
|
)
|
||||||
# async def ask(self, text: str, attachments: Optional[Union[str, List[str]]] = None) -> ToolResult:
|
async def ask(self, text: str, attachments: Optional[Union[str, List[str]]] = None) -> ToolResult:
|
||||||
# """Ask the user a question and wait for a response.
|
"""Ask the user a question and wait for a response.
|
||||||
|
|
||||||
# Args:
|
Args:
|
||||||
# text: The question to present to the user
|
text: The question to present to the user
|
||||||
# attachments: Optional file paths or URLs to attach to the question
|
attachments: Optional file paths or URLs to attach to the question
|
||||||
|
|
||||||
# Returns:
|
Returns:
|
||||||
# ToolResult indicating the question was successfully sent
|
ToolResult indicating the question was successfully sent
|
||||||
# """
|
"""
|
||||||
# try:
|
try:
|
||||||
# # Convert single attachment to list for consistent handling
|
# Convert single attachment to list for consistent handling
|
||||||
# if attachments and isinstance(attachments, str):
|
if attachments and isinstance(attachments, str):
|
||||||
# attachments = [attachments]
|
attachments = [attachments]
|
||||||
|
|
||||||
# return self.success_response({"status": "Awaiting user response..."})
|
return self.success_response({"status": "Awaiting user response..."})
|
||||||
# except Exception as e:
|
except Exception as e:
|
||||||
# return self.fail_response(f"Error asking user: {str(e)}")
|
return self.fail_response(f"Error asking user: {str(e)}")
|
||||||
|
|
||||||
# @openapi_schema({
|
# @openapi_schema({
|
||||||
# "type": "function",
|
# "type": "function",
|
||||||
|
|
Loading…
Reference in New Issue