Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
R
Radiant
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
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
wuzekai
Radiant
Commits
b3a1fb42
Commit
b3a1fb42
authored
Dec 04, 2025
by
wuzekai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修复了大模型不能生成表格的bug
parent
cb650634
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
2 deletions
+4
-2
quickgen_chart.R
radiant.quickgen/R/quickgen_chart.R
+1
-1
quickgen_chart_ui.R
radiant.quickgen/inst/app/tools/analysis/quickgen_chart_ui.R
+3
-1
No files found.
radiant.quickgen/R/quickgen_chart.R
View file @
b3a1fb42
...
...
@@ -43,7 +43,7 @@ build_chart_prompt <- function(user_prompt, data_call) {
〓 输出格式 〓
- 只返回可运行 R 代码,用 ```r 包裹,禁止任何解释、注释、空行。
- 代码必须强制换行:每个语句(df、library、ggplot、赋值、if/else 等)单独一行,ggplot 每个图层(+ geom_*/+ theme_*)单独一行。
- 若用户请求包含“表格”“统计汇总”“频数表”等表格需求,禁止使用
knitr::kable等会使表格字符串化的函数/包,必须输出标准表格形式
。
- 若用户请求包含“表格”“统计汇总”“频数表”等表格需求,禁止使用
knitr::kable、DT::datatable 等第三方包/函数,代码最后一行必须是用data.frame()输出
。
- 若用户请求不符合规范,一律返回空代码块(仅 ```r\n``` ),不对话。
- 当所需绘制的图中出现数据集中不存在的列或无法计算时,一律输出一张空白 ggplot,仅居中显示“无法绘制”四字,不抛出错误。
...
...
radiant.quickgen/inst/app/tools/analysis/quickgen_chart_ui.R
View file @
b3a1fb42
...
...
@@ -169,7 +169,9 @@ observeEvent(input$chart_run_code, {
}
else
if
(
is.data.frame
(
result
)
||
is.matrix
(
result
))
{
r_values
$
chart_result_type
<-
"table"
output
$
chart_result_table
<-
DT
::
renderDataTable
(
DT
::
datatable
(
result
,
options
=
list
(
scrollX
=
TRUE
,
pageLength
=
10
)))
DT
::
datatable
(
result
,
options
=
list
(
scrollX
=
TRUE
,
pageLength
=
10
)),
server
=
FALSE
)
}
else
{
r_values
$
chart_result_type
<-
"text"
output
$
chart_result_text
<-
renderText
(
capture.output
(
print
(
result
)))
...
...
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