mirror of
https://github.com/csunny/DB-GPT.git
synced 2025-09-11 22:09:44 +00:00
Native data AI application framework based on AWEL+AGENT (#1152)
Co-authored-by: Fangyin Cheng <staneyffer@gmail.com> Co-authored-by: lcx01800250 <lcx01800250@alibaba-inc.com> Co-authored-by: licunxing <864255598@qq.com> Co-authored-by: Aralhi <xiaoping0501@gmail.com> Co-authored-by: xuyuan23 <643854343@qq.com> Co-authored-by: aries_ckt <916701291@qq.com> Co-authored-by: hzh97 <2976151305@qq.com>
This commit is contained in:
@@ -2,6 +2,7 @@ import json
|
||||
from abc import ABC, abstractmethod
|
||||
from typing import Dict, Type
|
||||
|
||||
from dbgpt.core.awel.flow import ResourceCategory, register_resource
|
||||
from dbgpt.core.interface.serialization import Serializable, Serializer
|
||||
|
||||
JSON_ENCODING = "utf-8"
|
||||
@@ -17,6 +18,12 @@ class JsonSerializable(Serializable, ABC):
|
||||
return json.dumps(self.to_dict(), ensure_ascii=False).encode(JSON_ENCODING)
|
||||
|
||||
|
||||
@register_resource(
|
||||
label="Json Serializer",
|
||||
name="json_serializer",
|
||||
category=ResourceCategory.SERIALIZER,
|
||||
description="The serializer for serializing data with json format.",
|
||||
)
|
||||
class JsonSerializer(Serializer):
|
||||
"""The serializer abstract class for serializing cache keys and values."""
|
||||
|
||||
|
Reference in New Issue
Block a user