From 439d23c29c15c2644874a37b82fb8a56859d88a0 Mon Sep 17 00:00:00 2001 From: yhjun1026 <460342015@qq.com> Date: Mon, 24 Jul 2023 14:53:34 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E6=B8=85=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pilot/openapi/api_v1/api_v1.py | 1 + pilot/openapi/api_v1/api_view_model.py | 1 + pilot/scene/base.py | 8 +++++++- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/pilot/openapi/api_v1/api_v1.py b/pilot/openapi/api_v1/api_v1.py index b2e5a34fb..ddded45ef 100644 --- a/pilot/openapi/api_v1/api_v1.py +++ b/pilot/openapi/api_v1/api_v1.py @@ -151,6 +151,7 @@ async def dialogue_scenes(): scene_name=scene.scene_name(), scene_describe=scene.describe(), param_title=",".join(scene.param_types()), + show_disable=scene.show_disable(), ) scene_vos.append(scene_vo) return Result.succ(scene_vos) diff --git a/pilot/openapi/api_v1/api_view_model.py b/pilot/openapi/api_v1/api_view_model.py index f504e1e76..f4c0de53e 100644 --- a/pilot/openapi/api_v1/api_view_model.py +++ b/pilot/openapi/api_v1/api_view_model.py @@ -28,6 +28,7 @@ class ChatSceneVo(BaseModel): scene_name: str = Field(..., description="chat_scene name show for user") scene_describe: str = Field("", description="chat_scene describe ") param_title: str = Field("", description="chat_scene required parameter title") + show_disable: bool = Field(False, description="chat_scene show disable") class ConversationVo(BaseModel): diff --git a/pilot/scene/base.py b/pilot/scene/base.py index 02acaccdd..7af1d0701 100644 --- a/pilot/scene/base.py +++ b/pilot/scene/base.py @@ -3,12 +3,13 @@ from typing import List class Scene: - def __init__(self, code, name, describe, param_types: List = [], is_inner: bool = False): + def __init__(self, code, name, describe, param_types: List = [], is_inner: bool = False, show_disable=False): self.code = code self.name = name self.describe = describe self.param_types = param_types self.is_inner = is_inner + self.show_disable = show_disable class ChatScene(Enum): @@ -29,6 +30,8 @@ class ChatScene(Enum): "Plugin", "Use tools through dialogue to accomplish your goals.", ["Plugin Select"], + False, + True ) ChatDefaultKnowledge = Scene( "chat_default_knowledge", @@ -82,3 +85,6 @@ class ChatScene(Enum): def param_types(self): return self._value_.param_types + + def show_disable(self): + return self._value_.show_disable \ No newline at end of file