mirror of
https://github.com/csunny/DB-GPT.git
synced 2025-09-08 04:23:35 +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:
@@ -5,7 +5,7 @@ together.
|
||||
"""
|
||||
|
||||
import dataclasses
|
||||
from typing import Any, Dict, List, Optional
|
||||
from typing import Any, Dict, List, Optional, Tuple
|
||||
|
||||
from .base import Resource, ResourceParameters, ResourceType
|
||||
|
||||
@@ -55,11 +55,12 @@ class ResourcePack(Resource[PackResourceParameters]):
|
||||
question: Optional[str] = None,
|
||||
resource_name: Optional[str] = None,
|
||||
**kwargs,
|
||||
) -> str:
|
||||
) -> Tuple[str, Optional[Dict]]:
|
||||
"""Get the prompt."""
|
||||
prompt_list = []
|
||||
info_map = {}
|
||||
for name, resource in self._resources.items():
|
||||
prompt = await resource.get_prompt(
|
||||
prompt, resource_reference = await resource.get_prompt(
|
||||
lang=lang,
|
||||
prompt_type=prompt_type,
|
||||
question=question,
|
||||
@@ -67,7 +68,9 @@ class ResourcePack(Resource[PackResourceParameters]):
|
||||
**kwargs,
|
||||
)
|
||||
prompt_list.append(prompt)
|
||||
return self._prompt_separator.join(prompt_list)
|
||||
if resource_reference is not None:
|
||||
info_map.update(resource_reference)
|
||||
return self._prompt_separator.join(prompt_list), info_map
|
||||
|
||||
def append(self, resource: Resource, overwrite: bool = False):
|
||||
"""Append a resource to the pack."""
|
||||
|
Reference in New Issue
Block a user