Skip to content

Commit

Permalink
Respond to manual CRAN feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
hadley committed Dec 23, 2024
1 parent 1b44c9b commit 371129b
Show file tree
Hide file tree
Showing 19 changed files with 56 additions and 19 deletions.
4 changes: 2 additions & 2 deletions CRAN-SUBMISSION
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Version: 0.1.0
Date: 2024-12-19 22:38:38 UTC
SHA: 48be76382552aec19d8461697c106c281f7863a8
Date: 2024-12-20 14:50:44 UTC
SHA: 9503a1f2988a0c718575c8df7bccee10a9435857
6 changes: 3 additions & 3 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ Authors@R: c(
person("Posit Software, PBC", role = c("cph", "fnd"))
)
Description: Chat with large language models from a range of providers
including 'Claude', 'OpenAI', 'Azure', 'Bedrock', and 'Google' 'Gemini'.
Supports streaming, asynchronous calls, tool calling, and structured data
extraction.
including 'Claude' <https://claude.ai>, 'OpenAI' <https://chatgpt.com>,
and more. Supports streaming, asynchronous calls, tool calling, and
structured data extraction.
License: MIT + file LICENSE
URL: https://ellmer.tidyverse.org, https://github.com/tidyverse/ellmer
BugReports: https://github.com/tidyverse/ellmer/issues
Expand Down
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ export(contents_html)
export(contents_markdown)
export(contents_text)
export(create_tool_def)
export(has_credentials)
export(interpolate)
export(interpolate_file)
export(live_browser)
Expand Down
2 changes: 1 addition & 1 deletion R/chat.R
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ NULL
#' but instead call [chat_openai()] or friends instead.
#'
#' @return A Chat object
#' @examplesIf ellmer:::openai_key_exists()
#' @examplesIf has_credentials("openai")
#' chat <- chat_openai(echo = TRUE)
#' chat$chat("Tell me a funny joke")
Chat <- R6::R6Class("Chat",
Expand Down
2 changes: 1 addition & 1 deletion R/content-image.R
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#' the `chat()`, `stream()`, `chat_async()`, or `stream_async()` methods.
#'
#' @export
#' @examplesIf ellmer:::openai_key_exists()
#' @examplesIf has_credentials("openai")
#' chat <- chat_openai(echo = TRUE)
#' chat$chat(
#' "What do you see in these images?",
Expand Down
2 changes: 1 addition & 1 deletion R/provider-claude.R
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ NULL
#' @param max_tokens Maximum number of tokens to generate before stopping.
#' @family chatbots
#' @export
#' @examplesIf ellmer:::anthropic_key_exists()
#' @examplesIf has_credentials("claude")
#' chat <- chat_claude()
#' chat$chat("Tell me three jokes about statisticians")
chat_claude <- function(system_prompt = NULL,
Expand Down
2 changes: 1 addition & 1 deletion R/provider-cortex.R
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ NULL
#' @inheritParams chat_openai
#' @inherit chat_openai return
#' @family chatbots
#' @examplesIf ellmer:::cortex_credentials_exist()
#' @examplesIf has_credentials("cortex")
#' chat <- chat_cortex(
#' model_file = "@my_db.my_schema.my_stage/model.yaml"
#' )
Expand Down
2 changes: 1 addition & 1 deletion R/provider-openai.R
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ NULL
#' @family chatbots
#' @export
#' @returns A [Chat] object.
#' @examplesIf ellmer:::openai_key_exists()
#' @examplesIf has_credentials("openai")
#' chat <- chat_openai()
#' chat$chat("
#' What is the difference between a tibble and a data frame?
Expand Down
2 changes: 1 addition & 1 deletion R/tools-def.R
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ NULL
#' function.
#' @export
#' @return An S7 `ToolDef` object.
#' @examplesIf ellmer:::openai_key_exists()
#' @examplesIf has_credentials("openai")
#'
#' # First define the metadata that the model uses to figure out when to
#' # call the tool
Expand Down
17 changes: 17 additions & 0 deletions R/utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -81,3 +81,20 @@ dots_named <- function(...) {
x[[length(x) + 1]] <- value
x
}

#' Are credentials avaiable?
#'
#' Used for examples/testing.
#'
#' @keywords internal
#' @param provider Provider name.
#' @export
has_credentials <- function(provider) {
switch(provider,
cortex = cortex_credentials_exist(),
openai = openai_key_exists(),
claude = anthropic_key_exists(),
cli::cli_abort("Unknown model {model}.")
)

}
4 changes: 4 additions & 0 deletions cran-comments.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
This is a resubmission fixing specified issues

---

## R CMD check results

0 errors | 0 warnings | 1 note
Expand Down
2 changes: 1 addition & 1 deletion man/Chat.Rd

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

2 changes: 1 addition & 1 deletion man/chat_claude.Rd

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

2 changes: 1 addition & 1 deletion man/chat_cortex.Rd

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

2 changes: 1 addition & 1 deletion man/chat_openai.Rd

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

2 changes: 1 addition & 1 deletion man/content_image_url.Rd

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

4 changes: 2 additions & 2 deletions man/ellmer-package.Rd

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

15 changes: 15 additions & 0 deletions man/has_credentials.Rd

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

2 changes: 1 addition & 1 deletion man/tool.Rd

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

0 comments on commit 371129b

Please sign in to comment.