diff --git a/DESCRIPTION b/DESCRIPTION index c35b5d2..5e09eab 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -5,8 +5,9 @@ Authors@R: person("Troy", "Hernandez", email = "troy@cornball.ai", role = c("aut", "cre"), comment = c(ORCID = "0009-0005-4248-604X")) Description: A minimal-dependency R client for 'OpenAI'-compatible speech-to-text - APIs with optional local fallbacks. Supports 'OpenAI', local servers, - and the 'whisper' package for local transcription. + APIs (see ) with + optional local fallbacks. Supports 'OpenAI', local servers, and the + 'whisper' package for local transcription. License: MIT + file LICENSE Encoding: UTF-8 URL: https://github.com/cornball-ai/stt.api diff --git a/R/internal_whisper.R b/R/internal_whisper.R index 74a5151..6a32f0a 100644 --- a/R/internal_whisper.R +++ b/R/internal_whisper.R @@ -36,6 +36,12 @@ #' Removes cached native whisper models from memory. Call this to free GPU/RAM #' after batch processing is complete. #' +#' @return No return value, called for side effects (frees memory by removing +#' cached models and triggers garbage collection). +#' +#' @examples +#' clear_native_whisper_cache() +#' #' @export clear_native_whisper_cache <- function() { models <- ls(.native_whisper_cache) diff --git a/R/set_stt_base.R b/R/set_stt_base.R index fea4240..d0ca3f1 100644 --- a/R/set_stt_base.R +++ b/R/set_stt_base.R @@ -8,10 +8,8 @@ #' @return Invisibly returns the previous value. #' #' @examples -#' \dontrun{ #' set_stt_base("http://localhost:4123") -#' set_stt_base("https://api.openai.com") -#' } +#' getOption("stt.api_base") #' #' @export set_stt_base <- function(url) { diff --git a/R/set_stt_key.R b/R/set_stt_key.R index 108669c..9b68bbb 100644 --- a/R/set_stt_key.R +++ b/R/set_stt_key.R @@ -8,9 +8,8 @@ #' @return Invisibly returns the previous value. #' #' @examples -#' \dontrun{ -#' set_stt_key(Sys.getenv("OPENAI_API_KEY")) -#' } +#' set_stt_key("test-key-123") +#' getOption("stt.api_key") #' #' @export set_stt_key <- function(key) { diff --git a/man/clear_native_whisper_cache.Rd b/man/clear_native_whisper_cache.Rd index c8196f4..e42d0df 100644 --- a/man/clear_native_whisper_cache.Rd +++ b/man/clear_native_whisper_cache.Rd @@ -5,7 +5,15 @@ \usage{ clear_native_whisper_cache() } +\value{ +No return value, called for side effects (frees memory by removing + cached models and triggers garbage collection). +} \description{ Removes cached native whisper models from memory. Call this to free GPU/RAM after batch processing is complete. } +\examples{ +clear_native_whisper_cache() + +} diff --git a/man/set_stt_base.Rd b/man/set_stt_base.Rd index 95f84f8..bf7510b 100644 --- a/man/set_stt_base.Rd +++ b/man/set_stt_base.Rd @@ -16,9 +16,7 @@ Invisibly returns the previous value. Sets the base URL for OpenAI-compatible STT endpoints. } \examples{ -\dontrun{ set_stt_base("http://localhost:4123") -set_stt_base("https://api.openai.com") -} +getOption("stt.api_base") } diff --git a/man/set_stt_key.Rd b/man/set_stt_key.Rd index 96238cc..b5988fa 100644 --- a/man/set_stt_key.Rd +++ b/man/set_stt_key.Rd @@ -16,8 +16,7 @@ Sets the API key for hosted STT services (e.g., OpenAI). Local servers typically ignore this. } \examples{ -\dontrun{ -set_stt_key(Sys.getenv("OPENAI_API_KEY")) -} +set_stt_key("test-key-123") +getOption("stt.api_key") }