Skip to content

Commit

Permalink
address CRAN reviewer comments
Browse files Browse the repository at this point in the history
  • Loading branch information
dylanpieper committed Oct 9, 2024
1 parent 663745d commit d6d5007
Show file tree
Hide file tree
Showing 8 changed files with 98 additions and 82 deletions.
5 changes: 2 additions & 3 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,17 @@ Title: Batch Process LLM Text Completions Using a Data Frame
Version: 0.1.0
Authors@R: person("Dylan", "Pieper", email = "[email protected]", role = c("aut", "cre", "cph"))
Maintainer: Dylan Pieper <[email protected]>
Description: Batch process large language model (LLM) text completions using data frame rows, with support for OpenAI's GPT, Anthropic's Claude, and Google's Gemini. Includes features such as local storage, metadata logging, API rate limiting delays, and a Shiny App Addin.
Description: Batch process large language model (LLM) text completions using data frame rows, with support for OpenAI's 'GPT' (<https://chat.openai.com>), Anthropic's 'Claude' (<https://claude.ai>), and Google's 'Gemini' (<https://gemini.google.com>). Includes features such as local storage, metadata logging, API rate limiting delays, and a 'shiny' app addin.
License: MIT + file LICENSE
Encoding: UTF-8
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.3.1
RoxygenNote: 7.3.2
URL: https://github.com/dylanpieper/batchLLM
BugReports: https://github.com/dylanpieper/batchLLM/issues
Imports:
openai,
gemini.R,
rlang,
utils,
stats,
digest,
dplyr,
Expand Down
2 changes: 0 additions & 2 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -94,5 +94,3 @@ importFrom(stats,runif)
importFrom(stats,setNames)
importFrom(tools,file_ext)
importFrom(tools,file_path_sans_ext)
importFrom(utils,setTxtProgressBar)
importFrom(utils,txtProgressBar)
124 changes: 61 additions & 63 deletions R/batchLLM.R

Large diffs are not rendered by default.

8 changes: 5 additions & 3 deletions R/batchLLM_shiny.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
#' @description This function provides a user interface using Shiny to interact with
#' the `batchLLM` package. It allows users to configure and execute batch processing
#' through an interactive dashboard.
#'
#' @return No return value. Launches a Shiny Gadget that allows users to interact with the `batchLLM` package.
#'
#' @importFrom shiny fluidPage fluidRow column titlePanel tabPanel tabsetPanel
#' @importFrom shiny conditionalPanel HTML sidebarLayout sidebarPanel mainPanel
Expand Down Expand Up @@ -190,8 +192,8 @@ batchLLM_shiny <- function() {
justified = TRUE
),
radioGroupButtons(
inputId = "extract_XML",
label = labelWithInfo("XML Extract:", "Requests a response in XML tags and removes unwanted text and preamble. May produce an unintended XML structure in longer responses."),
inputId = "sanitize",
label = labelWithInfo("Sanitize Output:", "Requests a response in XML tags and removes unwanted text (e.g., preamble) and all punctuation. May produce an unintended XML structure in longer responses."),
choices = c("False" = "FALSE", "True" = "TRUE"),
selected = "FALSE",
justified = TRUE
Expand Down Expand Up @@ -560,7 +562,7 @@ batchLLM_shiny <- function() {
prompt = input$prompt,
batch_delay = input$toggle_delay,
batch_size = input$batch_size,
extract_XML = as.logical(input$extract_XML),
sanitize = as.logical(input$sanitize),
model = config$model,
temperature = config$temperature,
max_tokens = config$max_tokens,
Expand Down
20 changes: 17 additions & 3 deletions cran-comments.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
## R CMD check results
## Resubmission (10/09/2024)

0 errors | 0 warnings | 0 notes
This is a resubmission. In this version I have:

* This is a new release.
- Written package names, software names, and API names in single quotes in the title and description fields as requested. For example: 'GPT', 'Claude', 'Gemini', 'shiny'. Also ensured that package names are case-sensitive where applicable.

- Provided links to the web services/APIs/LLMs used in the DESCRIPTION file. The links are now formatted correctly with angle brackets for auto-linking (e.g., `<https://chat.openai.com>`).

- Added `\value` tags to the `.Rd` files for exported methods, including documentation of the structure and meaning of the output. For functions that do not return a value, I have used the format `\value{No return value.}` as suggested for `man/batchLLM_shiny.Rd`.

- Removed `cat()` as a method to write to the console. Where necessary, I have replaced `cat()` calls with `message()`, `warning()`, or `stop()` as appropriate in `R/batchLLM.R`.

All feedback has been addressed, and I have made the necessary adjustments for resubmission.

## R CMD check results (10/05/2024)

0 errors \| 0 warnings \| 0 notes

- This is a new release.
10 changes: 5 additions & 5 deletions man/batchLLM.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions man/batchLLM_shiny.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 5 additions & 3 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ beliefs <- lapply(llm_configs, function(config) {
max_tokens = 100,
batch_size = 10,
batch_delay = "1min",
case_convert = "lower"
case_convert = "lower",
sanitize = TRUE
)
})[[length(llm_configs)]]

Expand All @@ -66,7 +67,7 @@ print(beliefs)
## 🤖 Supported LLMs

| LLM | Models |
|---------------|---------------------------------------------------------|
|---------------------|---------------------------------------------------|
| [OpenAI](https://github.com/irudnyts/openai) | gpt-4, gpt-4o, gpt-4o-mini, gpt-4-turbo, gpt-3.5-turbo |
| [Anthropic](https://github.com/yrvelez/claudeR) | claude-3-5-sonnet-20240620, claude-3-opus-20240229, claude-3-sonnet-20240229, claude-3-haiku-20240307, claude-2.1, claude-2.0 |
| [Google](https://github.com/jhk0530/gemini.R) | 1.5-pro, 1.5-flash, 1.0-pro |
Expand All @@ -82,6 +83,7 @@ print(beliefs)
- Sentiment analysis
- Thematic analysis
- Classification
- Re-factoring
- Labeling or tagging
- Language translation

Expand All @@ -102,7 +104,7 @@ This project is licensed under the [MIT License](LICENSE.md).

## 👨‍💻 Developer's Note

My work on a complex classification problem inspired me to create this tool. I faced the challenge of categorizing thousands of unique offense descriptions in court data, and later, I tested the functionality to classify drug metabolites in toxicology data. The original function evolved significantly, and today, it powers this Shiny app designed to streamline and scale the use of LLMs across various datasets. I hope this tool proves as valuable to you as it has in my own projects.
My work on a complex classification problem inspired me to create this tool. I was challenged with categorizing thousands of unique offense descriptions in court data, and later, I tested the functionality to classify drug metabolites to their drug categories in toxicology data. The original function evolved significantly, and today, it powers this Shiny app designed to streamline and scale the use of LLMs across various datasets. I hope this tool proves as valuable to you as it has in my own projects.

## 🔗 Links

Expand Down

0 comments on commit d6d5007

Please sign in to comment.