mirror of
https://github.com/agentscope-ai/ReMe.git
synced 2026-09-06 08:16:00 +00:00
24 lines
836 B
Python
24 lines
836 B
Python
from experiencemaker.tool.base_tool import BaseTool, TOOL_REGISTRY
|
|
|
|
|
|
class TerminateTool(BaseTool):
|
|
name: str = "terminate"
|
|
description: str = "If you can answer the user's question based on the context, be sure to use the **terminate** tool."
|
|
parameters: dict = {
|
|
"type": "object",
|
|
"properties": {
|
|
"status": {
|
|
"type": "string",
|
|
"description": "Please determine whether the user's question has been completed. (success / failure)",
|
|
"enum": ["success", "failure"],
|
|
}
|
|
},
|
|
"required": ["status"],
|
|
}
|
|
|
|
def execute(self, status: str):
|
|
self.success = status in ["success", "failure"]
|
|
return f"The interaction has been completed with status: {status}"
|
|
|
|
|
|
TOOL_REGISTRY.register(TerminateTool, "terminate")
|