Skip to content

Standardize models_anthropic() credentials handling to match other providers#917

Merged
hadley merged 3 commits intotidyverse:mainfrom
jcrodriguez1989:refactor/standardize-models-anthropic-credentials
May 4, 2026
Merged

Standardize models_anthropic() credentials handling to match other providers#917
hadley merged 3 commits intotidyverse:mainfrom
jcrodriguez1989:refactor/standardize-models-anthropic-credentials

Conversation

@jcrodriguez1989
Copy link
Copy Markdown
Contributor

Summary

Refactors models_claude() and models_anthropic() to use the same credential handling pattern as the other models_* functions (models_openai(), models_google_gemini(), etc.).

Changes

  • Added credentials = NULL parameter to function signature
  • Changed api_key parameter default from anthropic_key() to NULL
  • Used as_credentials() helper for consistent credential resolution

@hadley
Copy link
Copy Markdown
Member

hadley commented Jan 22, 2026

This makes me wonder if it's worth extracting out credentials_anthropic() to reduce the duplication still further. (And similarly for for the other providers)

@hadley hadley merged commit 1fafb00 into tidyverse:main May 4, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants