Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
P
poc-api
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
poc
poc-api
Commits
75bca6fb
Commit
75bca6fb
authored
Aug 22, 2025
by
alex yao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix[智能问数]: csv对话
parent
33fbbe6e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
26 deletions
+9
-26
AiBiServiceImpl.java
...java/cn/com/poc/ai_bi/aggregate/impl/AiBiServiceImpl.java
+9
-26
No files found.
src/main/java/cn/com/poc/ai_bi/aggregate/impl/AiBiServiceImpl.java
View file @
75bca6fb
...
...
@@ -286,26 +286,8 @@ public class AiBiServiceImpl implements AiBiService {
echartJSONObject
.
put
(
"sql_result"
,
dbChainResult
.
getSqlResult
());
echartJSONObject
.
put
(
"question"
,
input
);
AbstractFunctionResult
<
String
>
functionResult
=
eChartGenerateFunction
.
doFunction
(
echartJSONObject
.
toJSONString
(),
null
,
null
,
null
);
//输出EChart
if
(
functionResult
!=
null
&&
StringUtils
.
isNotBlank
(
functionResult
.
getFunctionResult
()))
{
JSONObject
jsonObject
=
JSONObject
.
parseObject
(
functionResult
.
getFunctionResult
());
if
(!
jsonObject
.
containsKey
(
"skip"
))
{
ToolFunction
toolFunction
=
new
ToolFunction
();
toolFunction
.
setName
(
"echart_function"
);
toolFunction
.
setResult
(
functionResult
.
getFunctionResult
());
toolFunction
.
setDisplayFormat
(
"json"
);
toolFunction
.
setArguments
(
null
);
result
=
new
LargeModelDemandResult
();
result
.
setCode
(
"0"
);
result
.
setFunction
(
toolFunction
);
result
.
setDbChainResult
(
null
);
result
.
setKnowledgeContentResult
(
null
);
String
toolFunctionJson
=
JsonUtils
.
serialize
(
result
);
sseUtil
.
send
(
toolFunctionJson
);
functionRecord
=
toolFunctionJson
;
}
}
String
eChartOption
=
functionResult
.
getFunctionResult
();
functionRecord
=
outputECharts
(
eChartOption
,
sseUtil
,
functionRecord
);
}
}
else
if
(
StringUtils
.
isNotBlank
(
fileUrl
))
{
CSVChainResponse
csvChainResponse
=
new
CSVChainResponse
();
...
...
@@ -313,12 +295,13 @@ public class AiBiServiceImpl implements AiBiService {
csvChainResponse
.
setContext
(
null
);
csvChainResponse
.
setFilePath
(
fileUrl
);
csvChainResult
=
chainService
.
csvChain
(
csvChainResponse
);
if
(
csvChainResult
!=
null
)
{
String
[]
csvRes
=
JsonUtils
.
deSerialize
(
csvChainResult
.
getResult
(),
String
[].
class
);
if
(
ArrayUtils
.
isNotEmpty
(
csvRes
))
{
if
(
StringUtils
.
isNotBlank
(
csvChainResult
.
getResult
()))
{
JSONObject
echartJSONObject
=
new
JSONObject
();
echartJSONObject
.
put
(
"sql"
,
null
);
echartJSONObject
.
put
(
"sql_result"
,
csv
Res
.
toString
());
echartJSONObject
.
put
(
"sql"
,
StringUtils
.
EMPTY
);
echartJSONObject
.
put
(
"sql_result"
,
csv
ChainResult
.
getResult
());
echartJSONObject
.
put
(
"question"
,
input
);
AbstractFunctionResult
<
String
>
functionResult
=
eChartGenerateFunction
.
doFunction
(
echartJSONObject
.
toJSONString
(),
null
,
null
,
null
);
String
eChartOption
=
functionResult
.
getFunctionResult
();
...
...
@@ -367,9 +350,9 @@ public class AiBiServiceImpl implements AiBiService {
}
private
String
outputECharts
(
String
eChartOption
,
SSEUtil
sseUtil
,
String
functionRecord
)
throws
IOException
{
private
String
outputECharts
(
String
eChartOption
,
SSEUtil
sseUtil
,
String
functionRecord
)
throws
IOException
{
//输出EChart
if
(
eChartOption
!=
null
)
{
if
(
eChartOption
!=
null
&&
StringUtils
.
isNotBlank
(
eChartOption
)
)
{
JSONObject
jsonObject
=
JSONObject
.
parseObject
(
eChartOption
);
if
(!
jsonObject
.
containsKey
(
"skip"
))
{
ToolFunction
toolFunction
=
new
ToolFunction
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment