代码清理

This commit is contained in:
yhjun1026
2023-07-24 13:57:10 +08:00
parent 602c0b7361
commit cbd22a4b88
2 changed files with 8 additions and 15 deletions

View File

@@ -52,7 +52,7 @@ class BaseChat(ABC):
chat_scene: str = None chat_scene: str = None
llm_model: Any = None llm_model: Any = None
# By default, keep the last two rounds of conversation records as the context # By default, keep the last two rounds of conversation records as the context
chat_retention_rounds: int = 1 chat_retention_rounds: int = 0
class Config: class Config:
"""Configuration for this pydantic object.""" """Configuration for this pydantic object."""

View File

@@ -1,5 +1,4 @@
import json import json
import importlib
from pilot.prompts.prompt_new import PromptTemplate from pilot.prompts.prompt_new import PromptTemplate
from pilot.configs.config import Config from pilot.configs.config import Config
from pilot.scene.base import ChatScene from pilot.scene.base import ChatScene
@@ -8,30 +7,24 @@ from pilot.common.schema import SeparatorStyle
CFG = Config() CFG = Config()
PROMPT_SCENE_DEFINE = None PROMPT_SCENE_DEFINE = "You are a data analysis expert, please provide a professional data analysis solution"
_DEFAULT_TEMPLATE = """ _DEFAULT_TEMPLATE = """
You are a {dialect} data analysis expert, please provide a professional data analysis solution according to the following situations According to the following table structure definition:
According to the structure definition in the following tables:
{table_info} {table_info}
Provide professional data analysis to support the goal: Provide professional data analysis to support users' goals:
{input} {input}
Provide multi-dimensional analysis as much as possible according to the target requirements, no less than 4 and no more than 8 dimensions. Provide at least 4 and at most 8 dimensions of analysis according to user goals.
The data columns of the analysis output should not exceed 4, do not use column pay_status in SQL where condition. The output data of the analysis cannot exceed 4 columns, and do not use columns such as pay_status in the SQL where condition for data filtering.
According to the characteristics of the analyzed data, choose the most suitable one from the charts provided below for display, chart type: According to the characteristics of the analyzed data, choose the most suitable one from the charts provided below for data display, chart type:
{supported_chat_type} {supported_chat_type}
Pay attention to the length of the output content of the analysis result, do not exceed 4000tokens Pay attention to the length of the output content of the analysis result, do not exceed 4000tokens
Give the correct {dialect} analysis SQL (don't use unprovided values such as 'paid'), analysis title, display method and summary of brief analysis thinking, and respond in the following json format:
According to the characteristics of the analyzed data, choose the best one from the charts provided below to display, use different types of charts as much as possiblechart types:
{supported_chat_type}
Give {dialect} data analysis SQLDo not use unprovided field value ), analysis title, display method and analytical thinking,respond in the following json format:
{response} {response}
Ensure the response is correct json and can be parsed by Python json.loads Ensure the response is correct json and can be parsed by Python json.loads
""" """
RESPONSE_FORMAT = [ RESPONSE_FORMAT = [