Deploy 2aaaddc from GitHub
Browse files- Dockerfile +5 -3
- R/bundle.R +2 -2
- R/code.R +1 -1
- R/config.R +6 -4
- R/help.R +7 -3
- README.md +2 -2
Dockerfile
CHANGED
|
@@ -16,10 +16,12 @@ RUN apt-get update && apt-get install -y \
|
|
| 16 |
|
| 17 |
WORKDIR /code
|
| 18 |
|
| 19 |
-
# Install pak, then decisions
|
| 20 |
-
# versions. The
|
|
|
|
|
|
|
| 21 |
RUN R -e "install.packages('pak', repos = 'https://cloud.r-project.org')" \
|
| 22 |
-
&& R -e "
|
| 23 |
&& R -e "pak::pak(c('shiny@1.14.0', 'mirai@2.7.1', 'dplyr@1.2.1', 'purrr@1.2.2', 'stringr@1.6.0', 'tibble@3.3.1', 'readr@2.2.0', 'jsonlite@2.0.0', 'httr2@1.2.3', 'yardstick@1.4.0', 'magick@2.9.0', 'zip@3.0.0', 'janitor@2.2.1', 'openssl@2.4.2'))" \
|
| 24 |
&& R -e "for (p in c('shiny', 'decisions', 'mirai', 'dplyr', 'purrr', 'stringr', 'tibble', 'readr', 'jsonlite', 'httr2', 'yardstick', 'magick', 'zip', 'janitor', 'openssl')) library(p, character.only = TRUE)"
|
| 25 |
|
|
|
|
| 16 |
|
| 17 |
WORKDIR /code
|
| 18 |
|
| 19 |
+
# Install pak, then decisions 0.1.0 from CRAN and the other packages at fixed
|
| 20 |
+
# versions. The CRAN snapshot of rocker/shiny:4.6.1 is from 2026-10-28, before
|
| 21 |
+
# decisions was on CRAN (2026-11-08), so decisions comes from the snapshot of
|
| 22 |
+
# 2026-11-09. The last line fails the build if any of them cannot be loaded.
|
| 23 |
RUN R -e "install.packages('pak', repos = 'https://cloud.r-project.org')" \
|
| 24 |
+
&& R -e "options(repos = c(CRAN = 'https://p3m.dev/cran/__linux__/noble/2026-11-09')); pak::pak('decisions@0.1.0')" \
|
| 25 |
&& R -e "pak::pak(c('shiny@1.14.0', 'mirai@2.7.1', 'dplyr@1.2.1', 'purrr@1.2.2', 'stringr@1.6.0', 'tibble@3.3.1', 'readr@2.2.0', 'jsonlite@2.0.0', 'httr2@1.2.3', 'yardstick@1.4.0', 'magick@2.9.0', 'zip@3.0.0', 'janitor@2.2.1', 'openssl@2.4.2'))" \
|
| 26 |
&& R -e "for (p in c('shiny', 'decisions', 'mirai', 'dplyr', 'purrr', 'stringr', 'tibble', 'readr', 'jsonlite', 'httr2', 'yardstick', 'magick', 'zip', 'janitor', 'openssl')) library(p, character.only = TRUE)"
|
| 27 |
|
R/bundle.R
CHANGED
|
@@ -37,7 +37,7 @@ bundle_readme <- function(spec, refs, name, has_data, date) {
|
|
| 37 |
"## Versions",
|
| 38 |
"",
|
| 39 |
sprintf("- App: %s", APP_VERSION),
|
| 40 |
-
sprintf("- decisions:
|
| 41 |
sprintf("- Model: %s", MODEL),
|
| 42 |
sprintf("- Date: %s", format(date)),
|
| 43 |
"",
|
|
@@ -45,7 +45,7 @@ bundle_readme <- function(spec, refs, name, has_data, date) {
|
|
| 45 |
"",
|
| 46 |
"Install the package decisions in R:",
|
| 47 |
"",
|
| 48 |
-
|
| 49 |
"",
|
| 50 |
"## Key",
|
| 51 |
"",
|
|
|
|
| 37 |
"## Versions",
|
| 38 |
"",
|
| 39 |
sprintf("- App: %s", APP_VERSION),
|
| 40 |
+
sprintf("- decisions: %s", decisions_version()),
|
| 41 |
sprintf("- Model: %s", MODEL),
|
| 42 |
sprintf("- Date: %s", format(date)),
|
| 43 |
"",
|
|
|
|
| 45 |
"",
|
| 46 |
"Install the package decisions in R:",
|
| 47 |
"",
|
| 48 |
+
paste0(" ", DECISIONS_INSTALL),
|
| 49 |
"",
|
| 50 |
"## Key",
|
| 51 |
"",
|
R/code.R
CHANGED
|
@@ -255,7 +255,7 @@ run_code <- function(spec, date = Sys.Date(), rows = NULL) {
|
|
| 255 |
if (nrow(refs) > 0) data_arg <- paste0(data_arg, ", references = references")
|
| 256 |
paste(
|
| 257 |
sprintf("# The run of the decisions Space on %s, in R. Run it with your own key.", format(date)),
|
| 258 |
-
|
| 259 |
"",
|
| 260 |
paths_comment(spec, refs),
|
| 261 |
inputs_code(spec, refs, rows),
|
|
|
|
| 255 |
if (nrow(refs) > 0) data_arg <- paste0(data_arg, ", references = references")
|
| 256 |
paste(
|
| 257 |
sprintf("# The run of the decisions Space on %s, in R. Run it with your own key.", format(date)),
|
| 258 |
+
paste("library(decisions) # install once:", DECISIONS_INSTALL),
|
| 259 |
"",
|
| 260 |
paths_comment(spec, refs),
|
| 261 |
inputs_code(spec, refs, rows),
|
R/config.R
CHANGED
|
@@ -4,8 +4,8 @@
|
|
| 4 |
# behaviour.
|
| 5 |
|
| 6 |
# Version of this app
|
| 7 |
-
APP_VERSION <- "1.0.
|
| 8 |
-
APP_DATE <- "
|
| 9 |
|
| 10 |
# Model used for every call. This is the ONLY place a model id may be written
|
| 11 |
# (tests/testthat/test-config.R enforces this).
|
|
@@ -14,8 +14,10 @@ MODEL <- "jev-1.14.0"
|
|
| 14 |
# Day of the saved runs of the two samples (their answers record MODEL)
|
| 15 |
SAVED_RUN_DATE <- "2026-10-23"
|
| 16 |
|
| 17 |
-
#
|
| 18 |
-
|
|
|
|
|
|
|
| 19 |
|
| 20 |
# Price in USD for each input token (USD 0.042 for each million tokens)
|
| 21 |
PRICE_PER_TOKEN <- 0.042 / 1e6
|
|
|
|
| 4 |
# behaviour.
|
| 5 |
|
| 6 |
# Version of this app
|
| 7 |
+
APP_VERSION <- "1.0.2"
|
| 8 |
+
APP_DATE <- "9 November 2026"
|
| 9 |
|
| 10 |
# Model used for every call. This is the ONLY place a model id may be written
|
| 11 |
# (tests/testthat/test-config.R enforces this).
|
|
|
|
| 14 |
# Day of the saved runs of the two samples (their answers record MODEL)
|
| 15 |
SAVED_RUN_DATE <- "2026-10-23"
|
| 16 |
|
| 17 |
+
# Where the decisions package of the app comes from (the Dockerfile installs
|
| 18 |
+
# 0.1.0 from CRAN), and the install line that the code, the bundle and Help give
|
| 19 |
+
DECISIONS_SOURCE <- "CRAN"
|
| 20 |
+
DECISIONS_INSTALL <- 'install.packages("decisions")'
|
| 21 |
|
| 22 |
# Price in USD for each input token (USD 0.042 for each million tokens)
|
| 23 |
PRICE_PER_TOKEN <- 0.042 / 1e6
|
R/help.R
CHANGED
|
@@ -26,9 +26,9 @@ LINKS <- list(
|
|
| 26 |
# The installed version of decisions, as "0.1.0"
|
| 27 |
package_version_text <- function() as.character(utils::packageVersion("decisions"))
|
| 28 |
|
| 29 |
-
# The version of decisions and
|
| 30 |
decisions_version <- function() {
|
| 31 |
-
sprintf("%s
|
| 32 |
}
|
| 33 |
|
| 34 |
# The help text of `key`, as one string. The text of "about" is Markdown.
|
|
@@ -49,7 +49,10 @@ help_text <- function(key) {
|
|
| 49 |
),
|
| 50 |
references_score = "A score question takes no references. References attach only to Yes / no and Choice questions.",
|
| 51 |
answers = "The answers show here after a run. A run of an unchanged sample shows its saved run, at no cost.",
|
| 52 |
-
code =
|
|
|
|
|
|
|
|
|
|
| 53 |
privacy = "Your images and texts go to TypeSafe (Jev). Do not upload confidential data.",
|
| 54 |
record = "A GitHub workflow opens this app twice a day, as a visitor does. Each visit adds a row to a public file. The visit also keeps the app awake. The table shows the last 60 visits.",
|
| 55 |
about = about_text(cfg)
|
|
@@ -131,6 +134,7 @@ about_text <- function(cfg = app_config()) {
|
|
| 131 |
cfg$version, cfg$date, decisions_version(), cfg$model
|
| 132 |
),
|
| 133 |
"",
|
|
|
|
| 134 |
"- 1.0.1: the help video (in the intro, the top bar and this page), whose player starts without the captions of YouTube (the narration is in the video) and can copy and share its link; the buttons of the top bar on one line.",
|
| 135 |
"- 1.0.0: the first public version.",
|
| 136 |
"",
|
|
|
|
| 26 |
# The installed version of decisions, as "0.1.0"
|
| 27 |
package_version_text <- function() as.character(utils::packageVersion("decisions"))
|
| 28 |
|
| 29 |
+
# The version of decisions and where it comes from, as "0.1.0 (CRAN)"
|
| 30 |
decisions_version <- function() {
|
| 31 |
+
sprintf("%s (%s)", package_version_text(), DECISIONS_SOURCE)
|
| 32 |
}
|
| 33 |
|
| 34 |
# The help text of `key`, as one string. The text of "about" is Markdown.
|
|
|
|
| 49 |
),
|
| 50 |
references_score = "A score question takes no references. References attach only to Yes / no and Choice questions.",
|
| 51 |
answers = "The answers show here after a run. A run of an unchanged sample shows its saved run, at no cost.",
|
| 52 |
+
code = sprintf(
|
| 53 |
+
"The code repeats this run: the question, the references, the model and one decide() call. Run it in your own R with your TypeSafe key in TYPESAFE_API_KEY. Install the package with %s. For your own images, read the comment on paths at the top of the code.",
|
| 54 |
+
DECISIONS_INSTALL
|
| 55 |
+
),
|
| 56 |
privacy = "Your images and texts go to TypeSafe (Jev). Do not upload confidential data.",
|
| 57 |
record = "A GitHub workflow opens this app twice a day, as a visitor does. Each visit adds a row to a public file. The visit also keeps the app awake. The table shows the last 60 visits.",
|
| 58 |
about = about_text(cfg)
|
|
|
|
| 134 |
cfg$version, cfg$date, decisions_version(), cfg$model
|
| 135 |
),
|
| 136 |
"",
|
| 137 |
+
sprintf("- 1.0.2: decisions 0.1.0 from CRAN. The R code, the bundle and Help install it with %s.", DECISIONS_INSTALL),
|
| 138 |
"- 1.0.1: the help video (in the intro, the top bar and this page), whose player starts without the captions of YouTube (the narration is in the video) and can copy and share its link; the buttons of the top bar on one line.",
|
| 139 |
"- 1.0.0: the first public version.",
|
| 140 |
"",
|
README.md
CHANGED
|
@@ -16,7 +16,7 @@ short_description: Ask Jev a question about each image or text in a set.
|
|
| 16 |
|
| 17 |
This app asks Jev a question about each image or text in a set. Jev is a decision model of TypeSafe. For each input, the app shows the answer and the probability of each answer. It also gives the R code of the run and a bundle with the setup and the answers. A visitor needs no key and no account.
|
| 18 |
|
| 19 |
-
The app uses the R package [decisions](https://github.com/fmegahed/decisions) (version 0.1.0). Two samples run at no cost: textile images and injury reports. Their answers are saved.
|
| 20 |
|
| 21 |
Open the app: <https://huggingface.co/spaces/fmegahed/decisions>
|
| 22 |
|
|
@@ -89,4 +89,4 @@ Fadel M. Megahed (Miami University) and Ying-Ju (Tessa) Chen (University of Dayt
|
|
| 89 |
If you use the package or the app, cite both:
|
| 90 |
|
| 91 |
- Megahed, F. M., & Chen, Y.-J. (2026). *decisions: Typed decisions from decision models* (R package version 0.1.0). https://github.com/fmegahed/decisions
|
| 92 |
-
- Megahed, F. M., & Chen, Y.-J. (2026). *decisions Space* (Version 1.0.
|
|
|
|
| 16 |
|
| 17 |
This app asks Jev a question about each image or text in a set. Jev is a decision model of TypeSafe. For each input, the app shows the answer and the probability of each answer. It also gives the R code of the run and a bundle with the setup and the answers. A visitor needs no key and no account.
|
| 18 |
|
| 19 |
+
The app uses the R package [decisions](https://github.com/fmegahed/decisions) (version 0.1.0, from [CRAN](https://CRAN.R-project.org/package=decisions)). Two samples run at no cost: textile images and injury reports. Their answers are saved.
|
| 20 |
|
| 21 |
Open the app: <https://huggingface.co/spaces/fmegahed/decisions>
|
| 22 |
|
|
|
|
| 89 |
If you use the package or the app, cite both:
|
| 90 |
|
| 91 |
- Megahed, F. M., & Chen, Y.-J. (2026). *decisions: Typed decisions from decision models* (R package version 0.1.0). https://github.com/fmegahed/decisions
|
| 92 |
+
- Megahed, F. M., & Chen, Y.-J. (2026). *decisions Space* (Version 1.0.2) [Web application]. Hugging Face. https://huggingface.co/spaces/fmegahed/decisions
|