Skip to content

Commit 371129b

Browse files
committed
Respond to manual CRAN feedback
1 parent 1b44c9b commit 371129b

19 files changed

+56
-19
lines changed

CRAN-SUBMISSION

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
Version: 0.1.0
2-
Date: 2024-12-19 22:38:38 UTC
3-
SHA: 48be76382552aec19d8461697c106c281f7863a8
2+
Date: 2024-12-20 14:50:44 UTC
3+
SHA: 9503a1f2988a0c718575c8df7bccee10a9435857

DESCRIPTION

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ Authors@R: c(
77
person("Posit Software, PBC", role = c("cph", "fnd"))
88
)
99
Description: Chat with large language models from a range of providers
10-
including 'Claude', 'OpenAI', 'Azure', 'Bedrock', and 'Google' 'Gemini'.
11-
Supports streaming, asynchronous calls, tool calling, and structured data
12-
extraction.
10+
including 'Claude' <https://claude.ai>, 'OpenAI' <https://chatgpt.com>,
11+
and more. Supports streaming, asynchronous calls, tool calling, and
12+
structured data extraction.
1313
License: MIT + file LICENSE
1414
URL: https://ellmer.tidyverse.org, https://github.com/tidyverse/ellmer
1515
BugReports: https://github.com/tidyverse/ellmer/issues

NAMESPACE

+1
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ export(contents_html)
3333
export(contents_markdown)
3434
export(contents_text)
3535
export(create_tool_def)
36+
export(has_credentials)
3637
export(interpolate)
3738
export(interpolate_file)
3839
export(live_browser)

R/chat.R

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ NULL
1515
#' but instead call [chat_openai()] or friends instead.
1616
#'
1717
#' @return A Chat object
18-
#' @examplesIf ellmer:::openai_key_exists()
18+
#' @examplesIf has_credentials("openai")
1919
#' chat <- chat_openai(echo = TRUE)
2020
#' chat$chat("Tell me a funny joke")
2121
Chat <- R6::R6Class("Chat",

R/content-image.R

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
#' the `chat()`, `stream()`, `chat_async()`, or `stream_async()` methods.
1616
#'
1717
#' @export
18-
#' @examplesIf ellmer:::openai_key_exists()
18+
#' @examplesIf has_credentials("openai")
1919
#' chat <- chat_openai(echo = TRUE)
2020
#' chat$chat(
2121
#' "What do you see in these images?",

R/provider-claude.R

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ NULL
2626
#' @param max_tokens Maximum number of tokens to generate before stopping.
2727
#' @family chatbots
2828
#' @export
29-
#' @examplesIf ellmer:::anthropic_key_exists()
29+
#' @examplesIf has_credentials("claude")
3030
#' chat <- chat_claude()
3131
#' chat$chat("Tell me three jokes about statisticians")
3232
chat_claude <- function(system_prompt = NULL,

R/provider-cortex.R

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ NULL
4444
#' @inheritParams chat_openai
4545
#' @inherit chat_openai return
4646
#' @family chatbots
47-
#' @examplesIf ellmer:::cortex_credentials_exist()
47+
#' @examplesIf has_credentials("cortex")
4848
#' chat <- chat_cortex(
4949
#' model_file = "@my_db.my_schema.my_stage/model.yaml"
5050
#' )

R/provider-openai.R

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ NULL
4343
#' @family chatbots
4444
#' @export
4545
#' @returns A [Chat] object.
46-
#' @examplesIf ellmer:::openai_key_exists()
46+
#' @examplesIf has_credentials("openai")
4747
#' chat <- chat_openai()
4848
#' chat$chat("
4949
#' What is the difference between a tibble and a data frame?

R/tools-def.R

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ NULL
2020
#' function.
2121
#' @export
2222
#' @return An S7 `ToolDef` object.
23-
#' @examplesIf ellmer:::openai_key_exists()
23+
#' @examplesIf has_credentials("openai")
2424
#'
2525
#' # First define the metadata that the model uses to figure out when to
2626
#' # call the tool

R/utils.R

+17
Original file line numberDiff line numberDiff line change
@@ -81,3 +81,20 @@ dots_named <- function(...) {
8181
x[[length(x) + 1]] <- value
8282
x
8383
}
84+
85+
#' Are credentials avaiable?
86+
#'
87+
#' Used for examples/testing.
88+
#'
89+
#' @keywords internal
90+
#' @param provider Provider name.
91+
#' @export
92+
has_credentials <- function(provider) {
93+
switch(provider,
94+
cortex = cortex_credentials_exist(),
95+
openai = openai_key_exists(),
96+
claude = anthropic_key_exists(),
97+
cli::cli_abort("Unknown model {model}.")
98+
)
99+
100+
}

cran-comments.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
This is a resubmission fixing specified issues
2+
3+
---
4+
15
## R CMD check results
26

37
0 errors | 0 warnings | 1 note

man/Chat.Rd

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/chat_claude.Rd

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/chat_cortex.Rd

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/chat_openai.Rd

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/content_image_url.Rd

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/ellmer-package.Rd

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/has_credentials.Rd

+15
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/tool.Rd

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)