mirror of
https://github.com/csunny/DB-GPT.git
synced 2025-09-07 20:10:08 +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:
@@ -4,6 +4,8 @@ from .base import Vis # noqa: F401
|
||||
from .client import vis_client # noqa: F401
|
||||
from .tags.vis_agent_message import VisAgentMessages # noqa: F401
|
||||
from .tags.vis_agent_plans import VisAgentPlans # noqa: F401
|
||||
from .tags.vis_api_response import VisApiResponse # noqa: F401
|
||||
from .tags.vis_app_link import VisAppLink # noqa: F401
|
||||
from .tags.vis_chart import VisChart # noqa: F401
|
||||
from .tags.vis_code import VisCode # noqa: F401
|
||||
from .tags.vis_dashboard import VisDashboard # noqa: F401
|
||||
@@ -18,4 +20,6 @@ __ALL__ = [
|
||||
"VisCode",
|
||||
"VisDashboard",
|
||||
"VisPlugin",
|
||||
"VisAppLink",
|
||||
"VisApiResponse",
|
||||
]
|
||||
|
@@ -4,6 +4,8 @@ from typing import Dict, Type
|
||||
from .base import Vis
|
||||
from .tags.vis_agent_message import VisAgentMessages
|
||||
from .tags.vis_agent_plans import VisAgentPlans
|
||||
from .tags.vis_api_response import VisApiResponse
|
||||
from .tags.vis_app_link import VisAppLink
|
||||
from .tags.vis_chart import VisChart
|
||||
from .tags.vis_code import VisCode
|
||||
from .tags.vis_dashboard import VisDashboard
|
||||
@@ -40,3 +42,5 @@ vis_client.register(VisDashboard)
|
||||
vis_client.register(VisAgentPlans)
|
||||
vis_client.register(VisAgentMessages)
|
||||
vis_client.register(VisPlugin)
|
||||
vis_client.register(VisAppLink)
|
||||
vis_client.register(VisApiResponse)
|
||||
|
@@ -1,11 +1,11 @@
|
||||
"""Protocol module for agent messages vis tag."""
|
||||
"""Vis Agent Messages."""
|
||||
from ..base import Vis
|
||||
|
||||
|
||||
class VisAgentMessages(Vis):
|
||||
"""Agent Messages Vis Protocol."""
|
||||
"""Vis Agent Messages."""
|
||||
|
||||
@classmethod
|
||||
def vis_tag(cls) -> str:
|
||||
"""Return the tag name of the vis protocol module."""
|
||||
def vis_tag(cls):
|
||||
"""Vis tag name."""
|
||||
return "agent-messages"
|
||||
|
@@ -1,11 +1,15 @@
|
||||
"""Agent Plans Vis Protocol."""
|
||||
"""Viss Agent Plans."""
|
||||
from ..base import Vis
|
||||
|
||||
|
||||
class VisAgentPlans(Vis):
|
||||
"""Agent Plans Vis Protocol."""
|
||||
"""VisAgentPlans."""
|
||||
|
||||
@classmethod
|
||||
def vis_tag(cls) -> str:
|
||||
"""Return the tag name of the vis protocol module."""
|
||||
def vis_tag(cls):
|
||||
"""Vis tag name.
|
||||
|
||||
Returns:
|
||||
str: The tag name associated with the visualization.
|
||||
"""
|
||||
return "agent-plans"
|
||||
|
12
dbgpt/vis/tags/vis_api_response.py
Normal file
12
dbgpt/vis/tags/vis_api_response.py
Normal file
@@ -0,0 +1,12 @@
|
||||
"""Vis Api Response."""
|
||||
|
||||
from ..base import Vis
|
||||
|
||||
|
||||
class VisApiResponse(Vis):
|
||||
"""Vis Api Response."""
|
||||
|
||||
@classmethod
|
||||
def vis_tag(cls):
|
||||
"""Vis Api Response."""
|
||||
return "vis-api-response"
|
12
dbgpt/vis/tags/vis_app_link.py
Normal file
12
dbgpt/vis/tags/vis_app_link.py
Normal file
@@ -0,0 +1,12 @@
|
||||
"""Vis App Link."""
|
||||
|
||||
from ..base import Vis
|
||||
|
||||
|
||||
class VisAppLink(Vis):
|
||||
"""Vis App Link."""
|
||||
|
||||
@classmethod
|
||||
def vis_tag(cls):
|
||||
"""Vis App Link."""
|
||||
return "vis-app-link"
|
@@ -1,11 +1,12 @@
|
||||
"""Code visualization protocol."""
|
||||
"""Vis Code."""
|
||||
|
||||
from ..base import Vis
|
||||
|
||||
|
||||
class VisCode(Vis):
|
||||
"""Protocol for visualizing code."""
|
||||
"""Vis Code."""
|
||||
|
||||
@classmethod
|
||||
def vis_tag(cls) -> str:
|
||||
"""Return the tag name of the vis protocol module."""
|
||||
def vis_tag(cls):
|
||||
"""Vis Code."""
|
||||
return "vis-code"
|
||||
|
@@ -13,8 +13,8 @@ class VisDashboard(Vis):
|
||||
|
||||
async def generate_param(self, **kwargs) -> Optional[Dict[str, Any]]:
|
||||
"""Generate the parameters required by the vis protocol."""
|
||||
charts = kwargs.get("charts", None)
|
||||
title = kwargs.get("title", None)
|
||||
charts: Optional[dict] = kwargs.get("charts", None)
|
||||
title: Optional[str] = kwargs.get("title", None)
|
||||
if not charts:
|
||||
raise ValueError(
|
||||
f"Parameter information is missing and {self.vis_tag} protocol "
|
||||
@@ -55,6 +55,6 @@ class VisDashboard(Vis):
|
||||
return dashboard_param
|
||||
|
||||
@classmethod
|
||||
def vis_tag(cls) -> str:
|
||||
"""Return the tag name of the vis protocol."""
|
||||
def vis_tag(cls):
|
||||
"""Vis Dashboard."""
|
||||
return "vis-dashboard"
|
||||
|
@@ -1,12 +1,11 @@
|
||||
"""Agent Plans Vis Protocol."""
|
||||
|
||||
"""VisDbgptsFlow."""
|
||||
from ..base import Vis
|
||||
|
||||
|
||||
class VisDbgptsFlow(Vis):
|
||||
"""DBGPts Flow Vis Protocol."""
|
||||
"""VisDbgptsFlow."""
|
||||
|
||||
@classmethod
|
||||
def vis_tag(cls) -> str:
|
||||
"""Return the tag name of the vis protocol module."""
|
||||
def vis_tag(cls):
|
||||
"""VIS Flow."""
|
||||
return "dbgpts-flow"
|
||||
|
@@ -1,12 +1,11 @@
|
||||
"""Visualize the result of the DBGPts flow."""
|
||||
|
||||
"""VisDbgptsFlowResult."""
|
||||
from ..base import Vis
|
||||
|
||||
|
||||
class VisDbgptsFlowResult(Vis):
|
||||
"""Protocol for visualizing the result of the DBGPts flow."""
|
||||
"""VisDbgptsFlowResult."""
|
||||
|
||||
@classmethod
|
||||
def vis_tag(cls) -> str:
|
||||
"""Return the tag name of the vis protocol module."""
|
||||
"""VisDbgptsFlowResult."""
|
||||
return "dbgpts-result"
|
||||
|
@@ -1,11 +1,12 @@
|
||||
"""Visualize plugins."""
|
||||
"""Vis Plugin."""
|
||||
|
||||
from ..base import Vis
|
||||
|
||||
|
||||
class VisPlugin(Vis):
|
||||
"""Protocol for visualizing plugins."""
|
||||
"""Vis Plugin."""
|
||||
|
||||
@classmethod
|
||||
def vis_tag(cls) -> str:
|
||||
"""Return the tag name of the vis protocol module."""
|
||||
def vis_tag(cls):
|
||||
"""Vis Plugin."""
|
||||
return "vis-plugin"
|
||||
|
Reference in New Issue
Block a user