Files
DB-GPT/pilot/scene/chat_knowledge/inner_db_summary/out_parser.py
2023-06-01 15:32:01 +08:00

23 lines
611 B
Python

import json
import re
from abc import ABC, abstractmethod
from typing import Dict, NamedTuple
import pandas as pd
from pilot.utils import build_logger
from pilot.out_parser.base import BaseOutputParser, T
from pilot.configs.model_config import LOGDIR
logger = build_logger("webserver", LOGDIR + "DbChatOutputParser.log")
class NormalChatOutputParser(BaseOutputParser):
def parse_prompt_response(self, model_out_text) -> T:
return model_out_text
def parse_view_response(self, ai_text, data) -> str:
return ai_text["table"]
def get_format_instructions(self) -> str:
pass