mirror of
https://github.com/csunny/DB-GPT.git
synced 2025-09-14 13:40:54 +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:
@@ -125,8 +125,8 @@ async def query(
|
||||
)
|
||||
async def dialogue_new(
|
||||
chat_mode: str = "chat_normal",
|
||||
app_code: str = None,
|
||||
user_name: str = None,
|
||||
# TODO remove user id
|
||||
user_id: str = None,
|
||||
sys_code: str = None,
|
||||
):
|
||||
@@ -136,6 +136,7 @@ async def dialogue_new(
|
||||
user_input="",
|
||||
conv_uid=str(unique_id),
|
||||
chat_mode=chat_mode,
|
||||
app_code=app_code,
|
||||
user_name=user_name,
|
||||
sys_code=sys_code,
|
||||
)
|
||||
@@ -157,6 +158,24 @@ async def delete(con_uid: str, service: Service = Depends(get_service)):
|
||||
return Result.succ(None)
|
||||
|
||||
|
||||
@router.post(
|
||||
"/clear",
|
||||
dependencies=[Depends(check_api_key)],
|
||||
)
|
||||
async def clear(
|
||||
con_uid: str,
|
||||
service: Service = Depends(get_service),
|
||||
):
|
||||
"""Clear a Conversation entity
|
||||
|
||||
Args:
|
||||
con_uid (str): The conversation UID
|
||||
service (Service): The service
|
||||
"""
|
||||
service.clear(ServeRequest(conv_uid=con_uid))
|
||||
return Result.succ(None)
|
||||
|
||||
|
||||
@router.post(
|
||||
"/query_page",
|
||||
response_model=Result[PaginationResult[ServerResponse]],
|
||||
|
@@ -74,6 +74,13 @@ class ServerResponse(BaseModel):
|
||||
"chat_normal",
|
||||
],
|
||||
)
|
||||
app_code: Optional[str] = Field(
|
||||
default=None,
|
||||
description="The chat app code.",
|
||||
examples=[
|
||||
"app_code_xxx",
|
||||
],
|
||||
)
|
||||
select_param: Optional[str] = Field(
|
||||
default=None,
|
||||
description="The select param.",
|
||||
@@ -149,6 +156,14 @@ class MessageVo(BaseModel):
|
||||
],
|
||||
)
|
||||
|
||||
feedback: Optional[Dict] = Field(
|
||||
default={},
|
||||
description="feedback info",
|
||||
examples=[
|
||||
"{}",
|
||||
],
|
||||
)
|
||||
|
||||
def to_dict(self, **kwargs) -> Dict[str, Any]:
|
||||
"""Convert the model to a dictionary"""
|
||||
return model_to_dict(self, **kwargs)
|
||||
|
Reference in New Issue
Block a user