Skip to content

Add support for authenticating with gargle to chat_gemini() - #320

Merged
hadley merged 1 commit into
mainfrom
gargle-support-for-gemini
Feb 17, 2025
Merged

Add support for authenticating with gargle to chat_gemini()#320
hadley merged 1 commit into
mainfrom
gargle-support-for-gemini

Conversation

@atheriel

Copy link
Copy Markdown
Collaborator

This commit expands chat_gemini() to support non-API key authentication, very similar to what we've done for other cloud providers.

As a bonus I threw in viewer-based credential support for Connect.

I don't have an environment to test this out yet, so this is mostly conjectural.

Closes #317.

This commit expands `chat_gemini()` to support non-API key
authentication, very similar to what we've done for other cloud
providers.

As a bonus I threw in viewer-based credential support for Connect.

I don't have an environment to test this out yet, so this is mostly
conjectural.

Closes #317.

Signed-off-by: Aaron Jacobs <aaron.jacobs@posit.co>
Comment thread R/provider-gemini.R
if (nchar(provider@api_key)) {
req <- req_headers_redacted(req, "x-goog-api-key" = provider@api_key)
} else {
# TODO: Can use req_headers_redacted() when !!! is supported.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually once we bump to the next version of httr2, req_headers() will auto-redact Authorization.

@hadley
hadley merged commit 236376b into main Feb 17, 2025
@hadley
hadley deleted the gargle-support-for-gemini branch February 17, 2025 17:49
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.

Support for Service Account (from Google Vertex AI) to access Gemini services

2 participants