mirror of
https://github.com/csunny/DB-GPT.git
synced 2025-09-07 12:00:46 +00:00
feat(agent): Multi agents v0.1 (#1044)
Co-authored-by: qidanrui <qidanrui@gmail.com> Co-authored-by: csunny <cfqsunny@163.com> Co-authored-by: Fangyin Cheng <staneyffer@gmail.com>
This commit is contained in:
28
dbgpt/vis/base.py
Normal file
28
dbgpt/vis/base.py
Normal file
@@ -0,0 +1,28 @@
|
||||
import json
|
||||
from abc import ABC, abstractmethod
|
||||
from typing import Any, Callable, Dict, List, Literal, Optional, Tuple, Type, Union
|
||||
from dbgpt.util.json_utils import serialize
|
||||
|
||||
|
||||
class Vis:
|
||||
@abstractmethod
|
||||
async def generate_param(self, **kwargs) -> Optional[str]:
|
||||
"""
|
||||
Display corresponding content using vis protocol
|
||||
Args:
|
||||
**kwargs:
|
||||
|
||||
Returns:
|
||||
vis protocol text
|
||||
"""
|
||||
|
||||
async def disply(self, **kwargs) -> Optional[str]:
|
||||
return f"```{self.vis_tag()}\n{json.dumps(await self.generate_param(**kwargs), default=serialize, ensure_ascii=False)}\n```"
|
||||
|
||||
@classmethod
|
||||
def vis_tag(cls) -> str:
|
||||
"""
|
||||
Current vis protocol module tag name
|
||||
Returns:
|
||||
|
||||
"""
|
Reference in New Issue
Block a user