fix ask human problem

This commit is contained in:
garylin2099 2024-06-13 15:14:34 +08:00
parent 1f9a66ea60
commit f0df3144d6

View file

@ -3,7 +3,7 @@ from __future__ import annotations
import inspect
import json
import traceback
from typing import Literal, Tuple
from typing import Callable, Literal, Tuple
from pydantic import model_validator
@ -42,7 +42,7 @@ class RoleZero(Role):
# Tools
tools: list[str] = [] # Use special symbol ["<all>"] to indicate use of all registered tools
tool_recommender: ToolRecommender = None
tool_execution_map: dict[str, callable] = {}
tool_execution_map: dict[str, Callable] = {}
special_tool_commands: list[str] = ["Plan.finish_current_task", "end"]
# Equipped with three basic tools by default for optional use
editor: Editor = Editor()
@ -247,7 +247,7 @@ class RoleZero(Role):
if not isinstance(self.rc.env, MGXEnv):
return "Not in MGXEnv, command will not be executed."
return await self.rc.env.get_human_input(question, sent_from=self)
return await self.rc.env.ask_human(question, sent_from=self)
async def reply_to_human(self, content: str) -> str:
"""Reply to human user with the content provided. Use this when you have a clear answer or solution to the user's question."""