Update change_relationship.py

pull/998/head
2829798842 2025-05-28 19:16:06 +08:00 committed by GitHub
parent b80c8a27c1
commit 0a4aef114d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 7 additions and 7 deletions

View File

@ -8,13 +8,13 @@ logger = get_logger("relationship_tool")
class RelationshipTool(BaseTool):
name = "change_relationship"
description = "根据收到的文本和回复内容,修改与特定用户的关系值,当你回复了别人的消息,你可以使用这个工具"
description = "Modify relationship value with specific user based on received text and reply content, you can use this tool when you reply to someone's message"
parameters = {
"type": "object",
"properties": {
"text": {"type": "string", "description": "收到的文本"},
"changed_value": {"type": "number", "description": "变更值"},
"reason": {"type": "string", "description": "变更原因"},
"text": {"type": "string", "description": "Received text"},
"changed_value": {"type": "number", "description": "Change value"},
"reason": {"type": "string", "description": "Reason for change"},
},
"required": ["text", "changed_value", "reason"],
}
@ -34,8 +34,8 @@ class RelationshipTool(BaseTool):
changed_value = function_args.get("changed_value")
reason = function_args.get("reason")
return {"content": f"因为你刚刚因为{reason},所以你和发[{text}]这条消息的人的关系值变化为{changed_value}"}
return {"content": f"Because you just {reason}, your relationship value with the person who sent [{text}] has changed by {changed_value}"}
except Exception as e:
logger.error(f"修改关系值时发生错误: {str(e)}")
return {"content": f"修改关系值失败: {str(e)}"}
logger.error(f"Error occurred while modifying relationship value: {str(e)}")
return {"content": f"Failed to modify relationship value: {str(e)}"}