mirror of
https://github.com/csunny/DB-GPT.git
synced 2025-09-05 11:01:09 +00:00
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:
@@ -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,
|
||||
|
Reference in New Issue
Block a user