mirror of
https://github.com/csunny/DB-GPT.git
synced 2025-09-11 13:58:58 +00:00
fix: vis-chart is conflict (#1920)
This commit is contained in:
@@ -184,7 +184,7 @@ execution succeeded,
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
```agent-plans
|
||||
[{"name": "What is the name and age of the user with age less than 18", "num": 1, "status": "complete", "agent": "Human", "markdown": "```agent-messages\n[{\"sender\": \"DataScientist\", \"receiver\": \"Human\", \"model\": \"gpt-3.5-turbo\", \"markdown\": \"```vis-chart\\n{\\\"sql\\\": \\\"SELECT name, age FROM user WHERE age < 18\\\", \\\"type\\\": \\\"response_table\\\", \\\"title\\\": \\\"\\\", \\\"describe\\\": \\\"I have selected a response_table to display the names and ages of users with an age less than 18. The SQL query retrieves the name and age columns from the user table where the age is less than 18.\\\", \\\"data\\\": [{\\\"name\\\": \\\"Tom\\\", \\\"age\\\": 10}, {\\\"name\\\": \\\"Jerry\\\", \\\"age\\\": 16}]}\\n```\"}]\n```"}]
|
||||
[{"name": "What is the name and age of the user with age less than 18", "num": 1, "status": "complete", "agent": "Human", "markdown": "```agent-messages\n[{\"sender\": \"DataScientist\", \"receiver\": \"Human\", \"model\": \"gpt-3.5-turbo\", \"markdown\": \"```vis-db-chart\\n{\\\"sql\\\": \\\"SELECT name, age FROM user WHERE age < 18\\\", \\\"type\\\": \\\"response_table\\\", \\\"title\\\": \\\"\\\", \\\"describe\\\": \\\"I have selected a response_table to display the names and ages of users with an age less than 18. The SQL query retrieves the name and age columns from the user table where the age is less than 18.\\\", \\\"data\\\": [{\\\"name\\\": \\\"Tom\\\", \\\"age\\\": 10}, {\\\"name\\\": \\\"Jerry\\\", \\\"age\\\": 16}]}\\n```\"}]\n```"}]
|
||||
```
|
||||
``````
|
||||
|
||||
@@ -197,7 +197,7 @@ Let's parse the result from above output, we just focus on the last part
|
||||
"num": 1,
|
||||
"status": "complete",
|
||||
"agent": "Human",
|
||||
"markdown": "```agent-messages\n[{\"sender\": \"DataScientist\", \"receiver\": \"Human\", \"model\": \"gpt-3.5-turbo\", \"markdown\": \"```vis-chart\\n{\\\"sql\\\": \\\"SELECT name, age FROM user WHERE age < 18\\\", \\\"type\\\": \\\"response_table\\\", \\\"title\\\": \\\"\\\", \\\"describe\\\": \\\"I have selected a response_table to display the names and ages of users with an age less than 18. The SQL query retrieves the name and age columns from the user table where the age is less than 18.\\\", \\\"data\\\": [{\\\"name\\\": \\\"Tom\\\", \\\"age\\\": 10}, {\\\"name\\\": \\\"Jerry\\\", \\\"age\\\": 16}]}\\n```\"}]\n```"
|
||||
"markdown": "```agent-messages\n[{\"sender\": \"DataScientist\", \"receiver\": \"Human\", \"model\": \"gpt-3.5-turbo\", \"markdown\": \"```vis-db-chart\\n{\\\"sql\\\": \\\"SELECT name, age FROM user WHERE age < 18\\\", \\\"type\\\": \\\"response_table\\\", \\\"title\\\": \\\"\\\", \\\"describe\\\": \\\"I have selected a response_table to display the names and ages of users with an age less than 18. The SQL query retrieves the name and age columns from the user table where the age is less than 18.\\\", \\\"data\\\": [{\\\"name\\\": \\\"Tom\\\", \\\"age\\\": 10}, {\\\"name\\\": \\\"Jerry\\\", \\\"age\\\": 16}]}\\n```\"}]\n```"
|
||||
}
|
||||
]
|
||||
```
|
||||
|
@@ -321,7 +321,7 @@ AutoPlanChatManager (to User)-[]:
|
||||
Pass(None)
|
||||
>>>>>>>>AutoPlanChatManager Action report:
|
||||
execution succeeded,
|
||||
```vis-chart
|
||||
```vis-db-chart
|
||||
{"sql": "SELECT student_id, student_name, course_name, credit, AVG(score) AS average_score, COUNT(score) AS total_scores, MAX(score) AS highest_score, MIN(score) AS lowest_score, SUM(score) AS total_score, AVG(semester) AS average_semester FROM (SELECT s.student_id, s.student_name, c.course_name, c.credit, sc.score, sc.semester FROM students s JOIN scores sc ON s.student_id = sc.student_id JOIN courses c ON sc.course_id = c.course_id) GROUP BY student_id, course_name", "type": "response_table", "title": "", "describe": "The SQL query provided will generate a table with the analyzed data including average score, total scores, highest score, lowest score, total score, and average semester for each student in each course. This table can be further used for visualization purposes to represent student scores from different dimensions effectively.", "data": [{"student_id": 1, "student_name": "Zhang San", "course_name": "Data Structures", "credit": 4.0, "average_score": 85.0, "total_scores": 1, "highest_score": 85, "lowest_score": 85, "total_score": 85, "average_semester": 0.0}, {"student_id": 1, "student_name": "Zhang San", "course_name": "Introduction to Computer Science", "credit": 3.0, "average_score": 90.0, "total_scores": 1, "highest_score": 90, "lowest_score": 90, "total_score": 90, "average_semester": 0.0}, {"student_id": 2, "student_name": "Li Si", "course_name": "Data Structures", "credit": 4.0, "average_score": 90.0, "total_scores": 1, "highest_score": 90, "lowest_score": 90, "total_score": 90, "average_semester": 0.0}, {"student_id": 2, "student_name": "Li Si", "course_name": "Introduction to Computer Science", "credit": 3.0, "average_score": 88.0, "total_scores": 1, "highest_score": 88, "lowest_score": 88, "total_score": 88, "average_semester": 0.0}, {"student_id": 3, "student_name": "Wang Wu", "course_name": "Advanced Physics", "credit": 3.0, "average_score": 92.0, "total_scores": 1, "highest_score": 92, "lowest_score": 92, "total_score": 92, "average_semester": 0.0}, {"student_id": 3, "student_name": "Wang Wu", "course_name": "Linear Algebra", "credit": 4.0, "average_score": 85.0, "total_scores": 1, "highest_score": 85, "lowest_score": 85, "total_score": 85, "average_semester": 0.0}, {"student_id": 4, "student_name": "Zhao Liu", "course_name": "Advanced Physics", "credit": 3.0, "average_score": 88.0, "total_scores": 1, "highest_score": 88, "lowest_score": 88, "total_score": 88, "average_semester": 0.0}, {"student_id": 4, "student_name": "Zhao Liu", "course_name": "Linear Algebra", "credit": 4.0, "average_score": 86.0, "total_scores": 1, "highest_score": 86, "lowest_score": 86, "total_score": 86, "average_semester": 0.0}, {"student_id": 5, "student_name": "Zhou Qi", "course_name": "Data Structures", "credit": 4.0, "average_score": 87.0, "total_scores": 1, "highest_score": 87, "lowest_score": 87, "total_score": 87, "average_semester": 0.0}, {"student_id": 5, "student_name": "Zhou Qi", "course_name": "Introduction to Computer Science", "credit": 3.0, "average_score": 90.0, "total_scores": 1, "highest_score": 90, "lowest_score": 90, "total_score": 90, "average_semester": 0.0}]}
|
||||
```
|
||||
|
||||
|
@@ -48,12 +48,7 @@ const codeComponents = {
|
||||
*/
|
||||
code: withDefaultChartCode({
|
||||
languageRenderers: {
|
||||
"agent-plans": ({
|
||||
node,
|
||||
className,
|
||||
children,
|
||||
style,
|
||||
}) => {
|
||||
"agent-plans": ({ node, className, children, style }) => {
|
||||
const content = String(children);
|
||||
/**
|
||||
* @description
|
||||
@@ -70,12 +65,7 @@ const codeComponents = {
|
||||
return <CodePreview language={lang} code={content} />;
|
||||
}
|
||||
},
|
||||
"agent-messages": ({
|
||||
node,
|
||||
className,
|
||||
children,
|
||||
style,
|
||||
}) => {
|
||||
"agent-messages": ({ node, className, children, style }) => {
|
||||
const content = String(children);
|
||||
const lang = className?.replace("language-", "") || "javascript";
|
||||
try {
|
||||
@@ -87,12 +77,7 @@ const codeComponents = {
|
||||
return <CodePreview language={lang} code={content} />;
|
||||
}
|
||||
},
|
||||
"vis-convert-error": ({
|
||||
node,
|
||||
className,
|
||||
children,
|
||||
style,
|
||||
}) => {
|
||||
"vis-convert-error": ({ node, className, children, style }) => {
|
||||
const content = String(children);
|
||||
const lang = className?.replace("language-", "") || "javascript";
|
||||
try {
|
||||
@@ -104,12 +89,7 @@ const codeComponents = {
|
||||
return <CodePreview language={lang} code={content} />;
|
||||
}
|
||||
},
|
||||
"vis-dashboard": ({
|
||||
node,
|
||||
className,
|
||||
children,
|
||||
style,
|
||||
}) => {
|
||||
"vis-dashboard": ({ node, className, children, style }) => {
|
||||
const content = String(children);
|
||||
const lang = className?.replace("language-", "") || "javascript";
|
||||
try {
|
||||
@@ -121,7 +101,7 @@ const codeComponents = {
|
||||
return <CodePreview language={lang} code={content} />;
|
||||
}
|
||||
},
|
||||
"vis-chart": ({ node, className, children, style }) => {
|
||||
"vis-db-chart": ({ node, className, children, style }) => {
|
||||
const content = String(children);
|
||||
const lang = className?.replace("language-", "") || "javascript";
|
||||
try {
|
||||
@@ -133,12 +113,7 @@ const codeComponents = {
|
||||
return <CodePreview language={lang} code={content} />;
|
||||
}
|
||||
},
|
||||
"vis-plugin": ({
|
||||
node,
|
||||
className,
|
||||
children,
|
||||
style,
|
||||
}) => {
|
||||
"vis-plugin": ({ node, className, children, style }) => {
|
||||
const content = String(children);
|
||||
const lang = className?.replace("language-", "") || "javascript";
|
||||
try {
|
||||
@@ -163,13 +138,7 @@ const codeComponents = {
|
||||
return <CodePreview language={lang} code={content} />;
|
||||
}
|
||||
},
|
||||
"vis-app-link": ({
|
||||
node,
|
||||
className,
|
||||
children,
|
||||
style,
|
||||
...props
|
||||
}) => {
|
||||
"vis-app-link": ({ node, className, children, style, ...props }) => {
|
||||
const content = String(children);
|
||||
const lang = className?.replace("language-", "") || "javascript";
|
||||
try {
|
||||
@@ -181,13 +150,7 @@ const codeComponents = {
|
||||
return <CodePreview language={lang} code={content} />;
|
||||
}
|
||||
},
|
||||
"vis-api-response": ({
|
||||
node,
|
||||
className,
|
||||
children,
|
||||
style,
|
||||
...props
|
||||
}) => {
|
||||
"vis-api-response": ({ node, className, children, style, ...props }) => {
|
||||
const content = String(children);
|
||||
const lang = className?.replace("language-", "") || "javascript";
|
||||
try {
|
||||
@@ -201,11 +164,9 @@ const codeComponents = {
|
||||
},
|
||||
},
|
||||
defaultRenderer({ node, className, children, style, ...props }) {
|
||||
|
||||
const content = String(children);
|
||||
const lang = className?.replace("language-", "") || "";
|
||||
const { context, matchValues } = matchCustomeTagValues(content);
|
||||
|
||||
|
||||
console.log(111, { node, className, children, style, ...props }, lang);
|
||||
return (
|
||||
|
Reference in New Issue
Block a user