Skip to content

Commit 05b186c

Browse files
authored
Merge pull request #77 from koolerjaebee/master
AI Assistant module 기능 추가 업데이트
2 parents de80201 + bee0b74 commit 05b186c

9 files changed

Lines changed: 3950 additions & 39 deletions

File tree

DESCRIPTION

Lines changed: 40 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Package: jsmodule
22
Title: 'RStudio' Addins and 'Shiny' Modules for Medical Research
3-
Version: 1.6.15
4-
Date: 2025-10-10
3+
Version: 2.0.0
4+
Date: 2025-12-05
55
Authors@R: c(
66
person("Jinseob", "Kim", email = "jinseob2kim@gmail.com", role = c("aut", "cre"), comment = c(ORCID = "0000-0002-9403-605X")),
77
person("Zarathu", role = c("cph", "fnd")),
@@ -23,49 +23,54 @@ Depends: R (>= 3.4.0)
2323
License: Apache License 2.0
2424
Encoding: UTF-8
2525
RoxygenNote: 7.3.2
26-
Imports:
27-
data.table,
28-
DT,
29-
epiDisplay,
26+
Imports:
27+
data.table,
28+
DT,
29+
epiDisplay,
3030
flextable,
31-
forestploter,
32-
geepack,
33-
GGally,
34-
ggplot2,
31+
forestploter,
32+
geepack,
33+
GGally,
34+
ggplot2,
3535
bslib,
36-
ggpubr,
37-
haven,
38-
Hmisc,
39-
jskm(>= 0.4.4),
40-
jstable(>= 1.3.8),
41-
labelled,
36+
ggpubr,
37+
haven,
38+
Hmisc,
39+
jskm(>= 0.4.4),
40+
jstable(>= 1.3.8),
41+
labelled,
4242
MatchIt(>= 3.0.0),
43-
maxstat,
44-
methods,
45-
officer,
46-
pROC,
47-
purrr,
48-
readr,
49-
readxl,
50-
rstudioapi,
51-
rvg,
43+
maxstat,
44+
methods,
45+
officer,
46+
pROC,
47+
purrr,
48+
readr,
49+
readxl,
50+
rstudioapi,
51+
rvg,
5252
scales,
53-
see,
54-
shiny,
55-
shinycustomloader,
53+
see,
54+
shiny,
55+
shinyAce,
56+
shinycustomloader,
5657
shinyjs,
57-
shinyWidgets,
58-
stats,
59-
survey,
60-
survIDINRI,
61-
survival,
62-
timeROC,
58+
shinyWidgets,
59+
stats,
60+
survey,
61+
survIDINRI,
62+
survival,
63+
timeROC,
6364
utils,
6465
ggrepel,
6566
htmltools,
6667
riskRegression,
6768
R6,
68-
svglite
69+
svglite,
70+
httr,
71+
jsonlite,
72+
openxlsx,
73+
gridExtra
6974
URL: https://jinseob2kim.github.io/jsmodule/, https://github.com/jinseob2kim/jsmodule
7075
BugReports: https://github.com/jinseob2kim/jsmodule/issues
7176
Suggests:

NAMESPACE

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ export(GEEModuleLinear)
1010
export(GEEModuleLogistic)
1111
export(GEEModuleUI)
1212
export(ROC_table)
13+
export(aiAssistant)
14+
export(aiAssistantUI)
1315
export(barServer)
1416
export(barUI)
1517
export(boxServer)
@@ -75,6 +77,7 @@ import(data.table)
7577
import(flextable)
7678
import(ggplot2)
7779
import(shiny)
80+
import(shinyjs)
7881
importFrom(DT,"%>%")
7982
importFrom(DT,DTOutput)
8083
importFrom(DT,datatable)
@@ -96,6 +99,9 @@ importFrom(data.table,setDT)
9699
importFrom(data.table,setkey)
97100
importFrom(data.table,setnames)
98101
importFrom(epiDisplay,tableGlm)
102+
importFrom(flextable,autofit)
103+
importFrom(flextable,body_add_flextable)
104+
importFrom(flextable,flextable)
99105
importFrom(forestploter,forest)
100106
importFrom(forestploter,forest_theme)
101107
importFrom(geepack,geeglm)
@@ -112,12 +118,18 @@ importFrom(ggpubr,ggscatter)
112118
importFrom(ggpubr,stat_compare_means)
113119
importFrom(ggrepel,geom_label_repel)
114120
importFrom(ggrepel,geom_text_repel)
121+
importFrom(gridExtra,grid.arrange)
115122
importFrom(haven,read_dta)
116123
importFrom(haven,read_sas)
117124
importFrom(haven,read_sav)
118125
importFrom(htmltools,includeCSS)
126+
importFrom(httr,POST)
127+
importFrom(httr,add_headers)
128+
importFrom(httr,content)
119129
importFrom(jskm,jskm)
120130
importFrom(jskm,svyjskm)
131+
importFrom(jsonlite,fromJSON)
132+
importFrom(jsonlite,toJSON)
121133
importFrom(jstable,CreateTableOneJS)
122134
importFrom(jstable,TableSubgroupMultiCox)
123135
importFrom(jstable,TableSubgroupMultiGLM)
@@ -134,7 +146,9 @@ importFrom(methods,is)
134146
importFrom(officer,add_slide)
135147
importFrom(officer,ph_location)
136148
importFrom(officer,ph_with)
149+
importFrom(officer,read_docx)
137150
importFrom(officer,read_pptx)
151+
importFrom(openxlsx,write.xlsx)
138152
importFrom(pROC,ci.auc)
139153
importFrom(pROC,coords)
140154
importFrom(pROC,ggroc)
@@ -146,12 +160,17 @@ importFrom(readr,guess_encoding)
146160
importFrom(readxl,read_excel)
147161
importFrom(riskRegression,Score)
148162
importFrom(rstudioapi,getActiveDocumentContext)
163+
importFrom(rstudioapi,isAvailable)
164+
importFrom(rstudioapi,showPrompt)
149165
importFrom(rvg,dml)
150166
importFrom(scales,label_pvalue)
151167
importFrom(see,theme_modern)
152168
importFrom(shiny,need)
153169
importFrom(shiny,validate)
170+
importFrom(shinyWidgets,actionBttn)
154171
importFrom(shinyWidgets,dropdownButton)
172+
importFrom(shinyWidgets,noUiSliderInput)
173+
importFrom(shinyWidgets,pickerInput)
155174
importFrom(shinyWidgets,tooltipOptions)
156175
importFrom(shinycustomloader,withLoader)
157176
importFrom(shinyjs,click)

NEWS.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
# jsmodule 2.0.0
2+
## New Features
3+
- Introduced the `jsmodule AI Assistant`, which connects to Anthropic, OpenAI, and Google LLMs so you can generate analyses, scripts, and export-ready visuals without leaving the app.
4+
- The assistant automatically leverages context captured in `Data Manager`, enabling follow-up questions that reference earlier tables or plots.
5+
- Prompts never include row-level data, and the execution sandbox blocks dangerous calls, preventing direct data exposure and prompt-injection attacks.
6+
7+
## Update
8+
- Unified AI configuration panel with provider picker, API-key validation, and automatic model discovery for each provider.
9+
- Model-aware code generation with integrated editing, execution, and copy-to-clipboard shortcuts plus toast confirmations.
10+
- Conversation history with live rendering of user/assistant messages, downloadable transcripts, and per-session token/cost tracking.
11+
- Result viewers for tables, plots, and flextables, including export options to PPTX, Word, Excel, and TXT.
12+
- Contextual helper actions (error-to-prompt conversion, code summary, save chat) to streamline iterative AI-assisted analysis.
13+
14+
115
# jsmodule 1.6.15
216
## Refactor
317
- Introduced `DataManager` R6 class to streamline data loading and preprocessing across Shiny modules, reducing code duplication.

0 commit comments

Comments
 (0)