feat: (0.6)New UI (#1855)

Co-authored-by: 夏姜 <wenfengjiang.jwf@digital-engine.com>
Co-authored-by: aries_ckt <916701291@qq.com>
Co-authored-by: wb-lh513319 <wb-lh513319@alibaba-inc.com>
Co-authored-by: csunny <cfqsunny@163.com>
This commit is contained in:
明天
2024-08-21 17:37:45 +08:00
committed by GitHub
parent 3fc82693ba
commit b124ecc10b
824 changed files with 93371 additions and 2515 deletions

View File

@@ -63,31 +63,6 @@ class ToolPack(ResourcePack):
typed_tools = [cast(BaseTool, t) for t in tools]
return [ToolPack(typed_tools)] # type: ignore
async def get_prompt(
self,
*,
lang: str = "en",
prompt_type: str = "default",
question: Optional[str] = None,
resource_name: Optional[str] = None,
**kwargs,
) -> str:
"""Get the prompt for the resources."""
prompt_list = []
for name, resource in self._resources.items():
prompt = await resource.get_prompt(
lang=lang,
prompt_type=prompt_type,
question=question,
resource_name=resource_name,
**kwargs,
)
prompt_list.append(prompt)
head_prompt = (
"You have access to the following APIs:" if lang == "en" else "您可以使用以下API"
)
return head_prompt + "\n" + self._prompt_separator.join(prompt_list)
def add_command(
self,
command_label: str,