Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -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 <https://platform.openai.com/docs/api-reference/audio>) 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
Expand Down
6 changes: 6 additions & 0 deletions R/internal_whisper.R
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 1 addition & 3 deletions R/set_stt_base.R
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
5 changes: 2 additions & 3 deletions R/set_stt_key.R
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
8 changes: 8 additions & 0 deletions man/clear_native_whisper_cache.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -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()

}
4 changes: 1 addition & 3 deletions man/set_stt_base.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -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")

}
5 changes: 2 additions & 3 deletions man/set_stt_key.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -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")

}