diff --git a/.Rbuildignore b/.Rbuildignore index 4743b1b..40e023b 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -1,6 +1,6 @@ ^renv$ ^renv\.lock$ -^ubep\.gpt\.Rproj$ +^gpteasyr\.Rproj$ ^\.Rproj\.user$ ^README\.Rmd$ ^LICENSE\.md$ diff --git a/.github/workflows/test-coverage.yaml b/.github/workflows/test-coverage.yaml index 24edcd9..b687d0c 100644 --- a/.github/workflows/test-coverage.yaml +++ b/.github/workflows/test-coverage.yaml @@ -55,4 +55,4 @@ jobs: uses: codecov/codecov-action@v4.0.1 with: token: ${{ secrets.CODECOV_TOKEN }} - slug: UBESP-DCTV/ubep.gpt + slug: CorradoLanera/gpteasyr diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md index 162a999..ebdafe2 100644 --- a/CODE_OF_CONDUCT.md +++ b/CODE_OF_CONDUCT.md @@ -59,7 +59,7 @@ representative at an online or offline event. ## Enforcement Instances of abusive, harassing, or otherwise unacceptable behavior may be -reported to the community leaders responsible for enforcement at Corrado.Lanera@ubep.unipd.it. +reported to the community leaders responsible for enforcement at Corrado.Lanera@gmail.com. All complaints will be reviewed and investigated promptly and fairly. All community leaders are obligated to respect the privacy and security of the diff --git a/DESCRIPTION b/DESCRIPTION index d042c28..d29d4b1 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,14 +1,14 @@ -Package: ubep.gpt +Package: gpteasyr Title: A basic and simple interface to OpenAI’s GPT API -Version: 0.2.9 +Version: 0.3.0 Authors@R: - person("Corrado", "Lanera", , "corrado.lanera@ubep.unipd.it", role = c("aut", "cre"), + person("Corrado", "Lanera", , "corrado.lanera@gmail.com", role = c("aut", "cre"), comment = c(ORCID = "0000-0002-0520-7428")) -Description: The goal of 'ubep.gpt' is to provide a basic and simple interface to OpenAI's GPT API (and other compatible APIs). The package is also designed to work with (i.e., to query on) dataframes/tibbles, and to simplify the process of querying the API. +Description: The goal of 'gpteasyr' is to provide a basic and simple interface to OpenAI's GPT API (and other compatible APIs). The package is also designed to work with (i.e., to query on) dataframes/tibbles, and to simplify the process of querying the API. License: MIT + file LICENSE -URL: https://github.com/UBESP-DCTV/ubep.gpt, - https://ubesp-dctv.github.io/ubep.gpt/ -BugReports: https://github.com/UBESP-DCTV/ubep.gpt/issues +URL: https://github.com/CorradoLanera/gpteasyr, + https://CorradoLanera.github.io/gpteasyr/ +BugReports: https://github.com/CorradoLanera/gpteasyr/issues Imports: httr, jsonlite, diff --git a/NEWS.md b/NEWS.md index 943025a..c437ff2 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,26 +1,30 @@ -# ubep.gpt 0.2.9 +# gpteasyr 0.3.0 + +* Changed name and repo to 'CorradoLanera/gpteasyr'. + +# gpteasyr 0.2.9 * Added `setup_py` function to setup python backend. * update `README` -# ubep.gpt 0.2.8 +# gpteasyr 0.2.8 * Added `use_py` argument to `gpt_query`, `gpt_query_on_column`, and `get_completion_from_messages` -# ubep.gpt 0.2.7 +# gpteasyr 0.2.7 * Added `closing` argument to `compose_usr_prompt`, `compose_prompt`, and `create_usr_data_prompter` functions, to allow add text at the very end of the prompt, i.e., after the embedded text. -# ubep.gpt 0.2.5 +# gpteasyr 0.2.5 * Added seed argument to `gpt_query`, `gpt_query_on_column`, and `get_completion_from_messages` functions. -# ubep.gpt 0.2.4 +# gpteasyr 0.2.4 * Now `create_usr_data_prompter` can accept a custom delimiter. * Default delimiter changed from four quotes (`""""`) to three quotes (`"""`). -# ubep.gpt 0.2.3 +# gpteasyr 0.2.3 * `stream = FALSE` hard coded (for the moment) on `get_completion_from_messages`. * column name for results in `gpt_query_on_columns` is now customizable. @@ -29,27 +33,27 @@ with a single column only (when `add = FALSE`). * Add progress bar to `gpt_query_on_column` functions. -# ubep.gpt 0.2.2 +# gpteasyr 0.2.2 * hot-fix old calls to `match.arg(model)` in `gpt_query` and `gpt_query_on_column` functions. -# ubep.gpt 0.2.1 +# gpteasyr 0.2.1 * Add option to return NA when the API returns an error; this apply on `gpt_query` and `gpt_query_on_column` functions only (i.e., not to the base `get_completion_from_messages` function). -# ubep.gpt 0.2.0 +# gpteasyr 0.2.0 * Removed dependency from `{openai}` in favor of `{httr}` and `{jsonlite}` directly * Now queries can be made to personalized endpoints. * create_usr_data_prompter now works with empty characters (treated as NULL). * Now compose_prompt_api correctly manage empty prompts. -# ubep.gpt 0.1.1 +# gpteasyr 0.1.1 * 100% coverage passed * Activated all tests on CI -# ubep.gpt 0.1.0 +# gpteasyr 0.1.0 * All functions tested. * Prompt compositors (i.e., `compose_prompt`, `compose_usr_prompt`, `compose_sys_prompt`, and `create_usr_data_prompter`) now always return a character vector (possibly of length 0). diff --git a/R/get_completion_from_messages.R b/R/get_completion_from_messages.R index 2d75055..d58bd88 100644 --- a/R/get_completion_from_messages.R +++ b/R/get_completion_from_messages.R @@ -33,6 +33,7 @@ #' tokens used for the request (`prompt_tokens`), answer #' (`completion_tokens`), and overall (`total_tokens`, the sum of the #' other two) +#' #' @export #' #' @examples diff --git a/R/ubep.gpt-package.R b/R/gpteasyr-package.R similarity index 100% rename from R/ubep.gpt-package.R rename to R/gpteasyr-package.R diff --git a/R/query_gpt_on_column.R b/R/query_gpt_on_column.R index f09f0c1..f355b27 100644 --- a/R/query_gpt_on_column.R +++ b/R/query_gpt_on_column.R @@ -92,7 +92,7 @@ query_gpt_on_column <- function( usr_data_prompter <- create_usr_data_prompter( usr_prompt = usr_prompt, closing = closing -) + ) gpt_answers <- db[[text_column]] |> purrr::map(\(txt) { diff --git a/R/setup_py.R b/R/setup_py.R index e260ab0..647e93f 100644 --- a/R/setup_py.R +++ b/R/setup_py.R @@ -16,7 +16,7 @@ #' #' @examples #' if (FALSE) { -#' library(ubep.gpt) +#' library(gpteasyr) #' setup_py() #' #' prompt <- compose_prompt_api( @@ -35,9 +35,9 @@ setup_py <- function(venv_name = "r-gpt-venv", ask = interactive()) { if ( (!ask) || - usethis::ui_yeah( - "Do you want to setup a ({venv_name}) python environment?" - ) + usethis::ui_yeah( + "Do you want to setup a ({venv_name}) python environment?" + ) ) { reticulate::virtualenv_create(venv_name, packages = "openai") reticulate::use_virtualenv(venv_name, required = TRUE) diff --git a/R/zzz.R b/R/zzz.R index 6344698..d6d1b1e 100644 --- a/R/zzz.R +++ b/R/zzz.R @@ -1,12 +1,12 @@ .onAttach <- function(...) { - packageStartupMessage("Wellcome to ubep.gpt!") + packageStartupMessage("Wellcome to `{gpteasyr}`!") if (Sys.getenv("OPENAI_API_KEY") == "") { packageStartupMessage( "OPENAI_API_KEY environment variable is not set.\n" ) packageStartupMessage( - "it is required to use OpenAI APIs with `ubep.gpt`.\n" + "it is required to use OpenAI APIs with `{gpteasyr}`.\n" ) packageStartupMessage( "To set the OPENAI_API_KEY environment variable, @@ -18,11 +18,11 @@ Never share your API key with others. Keep it safe and secure. If you need an API key, you can generate it in the OpenAI-API website - (https://platform.openai.com/api-keys). - Remind to assign it to the correct project - (i.e., NOT to the 'default' one). + (https://platform.openai.com/api-keys), or contact your 'GPT's admin'. + Remind to generate it within the correct (your) project! + (I.e., usually, NOT to the 'default' one.) If you need to be added to the organization and/or to a project, - please, contact your project's referent.\n\n" + please, contact your GPT's admin.\n\n" ) packageStartupMessage( @@ -34,7 +34,7 @@ "The OPENAI_API_KEY environment variable is set\n" ) packageStartupMessage( - "You are ready to use the package `ubep.gpt`.\n" + "You are ready to use the package `{gpteasyr}`.\n" ) packageStartupMessage( "Just, double check if the key is the correct one.\n\n" @@ -44,16 +44,18 @@ Keep it safe and secure. If you think that your API key was compromised, you can regenerate it in the OpenAI-API website - (https://platform.openai.com/api-keys).\n\n" + (https://platform.openai.com/api-keys), or contacting your GPT's admin. + \n" ) - packageStartupMessage("Enjoy the package!\n") + packageStartupMessage("Enjoy GPT with `{gpteasyr}`!\n") } packageStartupMessage( - "If you like to use the python backend (working only for GPT's OpenAI requests!),\n", - "setup the environmen first by executing:\n", - usethis::ui_code("setup_py()"), "(default virtual environment name is 'r-gpt-venv').\n", - "If you need to change the default name, run:\n", + "If you like to use the Python backend + (working for GPT's OpenAI requests only!),\n", + "setup its environment first by executing:\n", + usethis::ui_code("setup_py()"), " + (default virtual environment name is 'r-gpt-venv').\n", + "If you prefer to use a name different from the default one, run:\n", usethis::ui_code("setup_py(\"\")") ) - } diff --git a/README.Rmd b/README.Rmd index 8c0fbfe..c41c147 100644 --- a/README.Rmd +++ b/README.Rmd @@ -13,22 +13,22 @@ knitr::opts_chunk$set( ) ``` -# ubep.gpt +# gpteasyr [![Lifecycle: experimental](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://lifecycle.r-lib.org/articles/stages.html#experimental) -[![Codecov test coverage](https://codecov.io/gh/UBESP-DCTV/ubep.gpt/branch/main/graph/badge.svg)](https://app.codecov.io/gh/UBESP-DCTV/ubep.gpt?branch=main) -[![R-CMD-check](https://github.com/UBESP-DCTV/ubep.gpt/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/UBESP-DCTV/ubep.gpt/actions/workflows/R-CMD-check.yaml) +[![Codecov test coverage](https://codecov.io/gh/CorradoLanera/gpteasyr/branch/main/graph/badge.svg)](https://app.codecov.io/gh/CorradoLanera/gpteasyr?branch=main) +[![R-CMD-check](https://github.com/CorradoLanera/gpteasyr/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/CorradoLanera/gpteasyr/actions/workflows/R-CMD-check.yaml) -The goal of `{ubep.gpt}` is to provide a basic/simple interface to OpenAI's GPT API. The package is designed to work with dataframes/tibbles and to simplify the process of querying the API. +The goal of `{gpteasyr}` is to provide a basic/simple interface to OpenAI's GPT API. The package is designed to work with dataframes/tibbles and to simplify the process of querying the API. ## Installation -You can install the development version of `{ubep.gpt}` like so: +You can install the development version of `{gpteasyr}` like so: ``` r -remotes::install_github("UBESP-DCTV/ubep.gpt") +remotes::install_github("CorradoLanera/gpteasyr") ``` ## Basic example @@ -42,7 +42,7 @@ To use the function you need to compose a prompt. You can use (but it is not nec Once you have queried the API, you can extract the content of the response using the `get_content` function. You can also extract the tokens of the prompt and the response using the `get_tokens` function. ```{r} -library(ubep.gpt) +library(gpteasyr) prompt <- compose_prompt_api( sys_prompt = "You are the assistant of a university professor.", usr_prompt = "Tell me about the last course you provided." @@ -295,5 +295,5 @@ cat(res) ## Code of Conduct -Please note that the ubep.gpt project is released with a [Contributor Code of Conduct](https://contributor-covenant.org/version/2/1/CODE_OF_CONDUCT.html). By contributing to this project, you agree to abide by its terms. +Please note that the gpteasyr project is released with a [Contributor Code of Conduct](https://contributor-covenant.org/version/2/1/CODE_OF_CONDUCT.html). By contributing to this project, you agree to abide by its terms. diff --git a/README.md b/README.md index 7eaf857..a947817 100644 --- a/README.md +++ b/README.md @@ -1,27 +1,27 @@ -# ubep.gpt +# gpteasyr [![Lifecycle: experimental](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://lifecycle.r-lib.org/articles/stages.html#experimental) [![Codecov test -coverage](https://codecov.io/gh/UBESP-DCTV/ubep.gpt/branch/main/graph/badge.svg)](https://app.codecov.io/gh/UBESP-DCTV/ubep.gpt?branch=main) -[![R-CMD-check](https://github.com/UBESP-DCTV/ubep.gpt/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/UBESP-DCTV/ubep.gpt/actions/workflows/R-CMD-check.yaml) +coverage](https://codecov.io/gh/CorradoLanera/gpteasyr/branch/main/graph/badge.svg)](https://app.codecov.io/gh/CorradoLanera/gpteasyr?branch=main) +[![R-CMD-check](https://github.com/CorradoLanera/gpteasyr/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/CorradoLanera/gpteasyr/actions/workflows/R-CMD-check.yaml) -The goal of `{ubep.gpt}` is to provide a basic/simple interface to +The goal of `{gpteasyr}` is to provide a basic/simple interface to OpenAI’s GPT API. The package is designed to work with dataframes/tibbles and to simplify the process of querying the API. ## Installation -You can install the development version of `{ubep.gpt}` like so: +You can install the development version of `{gpteasyr}` like so: ``` r -remotes::install_github("UBESP-DCTV/ubep.gpt") +remotes::install_github("CorradoLanera/gpteasyr") ``` ## Basic example @@ -49,10 +49,10 @@ response using the `get_content` function. You can also extract the tokens of the prompt and the response using the `get_tokens` function. ``` r -library(ubep.gpt) -#> Wellcome to ubep.gpt! +library(gpteasyr) +#> Wellcome to gpteasyr! #> The OPENAI_API_KEY environment variable is set -#> You are ready to use the package `ubep.gpt`. +#> You are ready to use the package `gpteasyr`. #> Just, double check if the key is the correct one. #> REMIND: Never share your API key with others. #> Keep it safe and secure. @@ -95,40 +95,40 @@ res <- query_gpt( ) #> ℹ Total tries: 1. #> ℹ Prompt token used: 29. -#> ℹ Response token used: 68. -#> ℹ Total token used: 97. +#> ℹ Response token used: 91. +#> ℹ Total token used: 120. str(res) #> List of 7 -#> $ id : chr "chatcmpl-9QB5XJc6EMtdXz7nEwh2oRSHQ7vaI" +#> $ id : chr "chatcmpl-9RKY0lxKiWocZTzRHJWCtPTcaH2w9" #> $ object : chr "chat.completion" -#> $ created : int 1716026179 +#> $ created : int 1716300868 #> $ model : chr "gpt-3.5-turbo-0125" #> $ choices :'data.frame': 1 obs. of 5 variables: #> ..$ index : int 0 #> ..$ logprobs : logi NA #> ..$ finish_reason : chr "stop" #> ..$ message.role : chr "assistant" -#> ..$ message.content: chr "Of course! The last course provided focused on the principles of psychology. Topics covered included perception"| __truncated__ +#> ..$ message.content: chr "The last course I provided was an undergraduate seminar on \"Advanced Topics in Linguistics.\" The course focus"| __truncated__ #> $ usage :List of 3 #> ..$ prompt_tokens : int 29 -#> ..$ completion_tokens: int 68 -#> ..$ total_tokens : int 97 +#> ..$ completion_tokens: int 91 +#> ..$ total_tokens : int 120 #> $ system_fingerprint: NULL get_content(res) -#> [1] "Of course! The last course provided focused on the principles of psychology. Topics covered included perception, motivation, emotion, memory, and various theories of personality. Students analyzed real-life case studies and conducted their own research projects to apply their learning. Overall, it was an engaging and informative course that truly delved into the fascinating world of psychology." +#> [1] "The last course I provided was an undergraduate seminar on \"Advanced Topics in Linguistics.\" The course focused on the contemporary theories and research findings in areas such as syntax, semantics, phonetics, and psycholinguistics. The students were actively engaged in discussing and analyzing research papers, and they also had the opportunity to conduct their own research projects throughout the semester. Overall, it was a stimulating and rewarding experience for both the students and myself as the instructor." # for a well formatted output on R, use `cat()` get_content(res) |> cat() -#> Of course! The last course provided focused on the principles of psychology. Topics covered included perception, motivation, emotion, memory, and various theories of personality. Students analyzed real-life case studies and conducted their own research projects to apply their learning. Overall, it was an engaging and informative course that truly delved into the fascinating world of psychology. +#> The last course I provided was an undergraduate seminar on "Advanced Topics in Linguistics." The course focused on the contemporary theories and research findings in areas such as syntax, semantics, phonetics, and psycholinguistics. The students were actively engaged in discussing and analyzing research papers, and they also had the opportunity to conduct their own research projects throughout the semester. Overall, it was a stimulating and rewarding experience for both the students and myself as the instructor. get_tokens(res) -#> [1] 97 +#> [1] 120 get_tokens(res, "prompt") #> [1] 29 get_tokens(res, "all") #> prompt_tokens completion_tokens total_tokens -#> 29 68 97 +#> 29 91 120 ``` ## Easy prompt-assisted creation @@ -182,7 +182,7 @@ cat(usr_prompt) compose_prompt_api(sys_prompt, usr_prompt) |> query_gpt() |> get_content() -#> [1] "Nel - oscura" +#> [1] "Nel - step-by-step" ``` ## Querying a column of a dataframe @@ -311,6 +311,8 @@ for (i in seq_len(n)) { } tick(pb, paste("Row", i, "of", n)) } +#> +#> evaluated: Row 6 of 7 [========================>----] 86% in 2s [ETA: 0s]evaluated: Row 7 of 7 [=============================] 100% in 3s [ETA: 0s] db #> txt @@ -448,7 +450,7 @@ res <- query_gpt( get_content() cat(res) -#> The last course I provided was an advanced seminar on environmental sustainability in urban planning. The course covered topics such as green infrastructure, sustainable transportation, and climate change adaptation strategies in urban areas. Students engaged in discussions, group projects, and case studies to explore real-world applications of sustainable urban planning principles. Overall, it was a very engaging and informative course that challenged students to think critically about how cities can become more environmentally sustainable. +#> The last course I provided was an advanced seminar on environmental sustainability in urban planning. The course covered topics such as green infrastructure, sustainable transportation, and climate change adaptation strategies in urban areas. Students engaged in discussions, group projects, and case studies to explore real-world applications of sustainable urban planning principles. Overall, it was a very engaging and informative course that challenged students to think critically about the intersection of environmental sustainability and urban development. ``` ### Personalized server’s endpoint @@ -479,7 +481,7 @@ cat(res) ## Code of Conduct -Please note that the ubep.gpt project is released with a [Contributor +Please note that the gpteasyr project is released with a [Contributor Code of Conduct](https://contributor-covenant.org/version/2/1/CODE_OF_CONDUCT.html). By contributing to this project, you agree to abide by its terms. diff --git a/_pkgdown.yml b/_pkgdown.yml index 02a42f9..83bdbdd 100644 --- a/_pkgdown.yml +++ b/_pkgdown.yml @@ -1,4 +1,4 @@ -url: https://ubesp-dctv.github.io/ubep.gpt/ +url: https://CorradoLanera.github.io/gpteasyr/ template: bootstrap: 5 diff --git a/dev/00-setup.R b/dev/00-setup.R index 61f7da1..365a2df 100644 --- a/dev/00-setup.R +++ b/dev/00-setup.R @@ -6,12 +6,12 @@ usethis::use_news_md() usethis::use_lifecycle() usethis::use_lifecycle_badge("experimental") usethis::use_mit_license("CorradoLanera") -usethis::use_code_of_conduct("Corrado.Lanera@ubep.unipd.it") +usethis::use_code_of_conduct("Corrado.Lanera@gmail.com") usethis::use_spell_check() usethis::use_git() usethis::git_vaccinate() -usethis::use_github(organisation = "UBESP-DCTV", protocol = "ssh") -usethis::use_coverage(repo_spec = "UBESP-DCTV/ubep.gpt") +usethis::use_github(organisation = "CorradoLanera", protocol = "ssh") +usethis::use_coverage(repo_spec = "CorradoLanera/gpteasyr") usethis::use_github_action("test-coverage", badge = TRUE) usethis::use_github_action("check-standard", badge = TRUE) diff --git a/ubep.gpt.Rproj b/gpteasyr.Rproj similarity index 100% rename from ubep.gpt.Rproj rename to gpteasyr.Rproj diff --git a/man/gpteasyr-package.Rd b/man/gpteasyr-package.Rd new file mode 100644 index 0000000..2b17b99 --- /dev/null +++ b/man/gpteasyr-package.Rd @@ -0,0 +1,24 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/gpteasyr-package.R +\docType{package} +\name{gpteasyr-package} +\alias{gpteasyr} +\alias{gpteasyr-package} +\title{gpteasyr: A basic and simple interface to OpenAI’s GPT API} +\description{ +The goal of 'gpteasyr' is to provide a basic and simple interface to OpenAI's GPT API (and other compatible APIs). The package is also designed to work with (i.e., to query on) dataframes/tibbles, and to simplify the process of querying the API. +} +\seealso{ +Useful links: +\itemize{ + \item \url{https://github.com/CorradoLanera/gpteasyr} + \item \url{https://CorradoLanera.github.io/gpteasyr/} + \item Report bugs at \url{https://github.com/CorradoLanera/gpteasyr/issues} +} + +} +\author{ +\strong{Maintainer}: Corrado Lanera \email{corrado.lanera@gmail.com} (\href{https://orcid.org/0000-0002-0520-7428}{ORCID}) + +} +\keyword{internal} diff --git a/man/setup_py.Rd b/man/setup_py.Rd index 4d49de2..bf8e37b 100644 --- a/man/setup_py.Rd +++ b/man/setup_py.Rd @@ -23,7 +23,7 @@ package in it. } \examples{ if (FALSE) { - library(ubep.gpt) + library(gpteasyr) setup_py() prompt <- compose_prompt_api( diff --git a/man/ubep.gpt-package.Rd b/man/ubep.gpt-package.Rd deleted file mode 100644 index 9511f68..0000000 --- a/man/ubep.gpt-package.Rd +++ /dev/null @@ -1,24 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/ubep.gpt-package.R -\docType{package} -\name{ubep.gpt-package} -\alias{ubep.gpt} -\alias{ubep.gpt-package} -\title{ubep.gpt: A basic and simple interface to OpenAI’s GPT API} -\description{ -The goal of 'ubep.gpt' is to provide a basic and simple interface to OpenAI's GPT API (and other compatible APIs). The package is also designed to work with (i.e., to query on) dataframes/tibbles, and to simplify the process of querying the API. -} -\seealso{ -Useful links: -\itemize{ - \item \url{https://github.com/UBESP-DCTV/ubep.gpt} - \item \url{https://ubesp-dctv.github.io/ubep.gpt/} - \item Report bugs at \url{https://github.com/UBESP-DCTV/ubep.gpt/issues} -} - -} -\author{ -\strong{Maintainer}: Corrado Lanera \email{corrado.lanera@ubep.unipd.it} (\href{https://orcid.org/0000-0002-0520-7428}{ORCID}) - -} -\keyword{internal} diff --git a/tests/testthat.R b/tests/testthat.R index 50c9ef0..c31c0b1 100644 --- a/tests/testthat.R +++ b/tests/testthat.R @@ -7,6 +7,6 @@ # * https://testthat.r-lib.org/articles/special-files.html library(testthat) -library(ubep.gpt) |> suppressPackageStartupMessages() +library(gpteasyr) |> suppressPackageStartupMessages() -test_check("ubep.gpt") +test_check("gpteasyr") diff --git a/tests/testthat/test-zzz.R b/tests/testthat/test-zzz.R index 5537b09..64ee2f0 100644 --- a/tests/testthat/test-zzz.R +++ b/tests/testthat/test-zzz.R @@ -2,11 +2,11 @@ test_that("zzz works on empty API_KEY", { withr::local_envvar( list(OPENAI_API_KEY = "") ) - expect_message(ubep.gpt:::.onAttach(), regexp = "is not set") |> + expect_message(gpteasyr:::.onAttach(), regexp = "is not set") |> suppressMessages() expect_silent( - suppressPackageStartupMessages(ubep.gpt:::.onAttach()) + suppressPackageStartupMessages(gpteasyr:::.onAttach()) ) }) @@ -14,10 +14,10 @@ test_that("zzz works with API_KEY set", { withr::local_envvar( list(OPENAI_API_KEY = "sk-8aZp") ) - expect_message(ubep.gpt:::.onAttach(), regexp = "is set") |> + expect_message(gpteasyr:::.onAttach(), regexp = "is set") |> suppressMessages() expect_silent( - suppressPackageStartupMessages(ubep.gpt:::.onAttach()) + suppressPackageStartupMessages(gpteasyr:::.onAttach()) ) })