Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Have a debugging story for credentials #287

Open
atheriel opened this issue Jan 30, 2025 · 3 comments
Open

Have a debugging story for credentials #287

atheriel opened this issue Jan 30, 2025 · 3 comments

Comments

@atheriel
Copy link
Collaborator

Now that we do so much magic internally to get ambient credentials, I wonder if we need better ways to surface (and/or debug) what credentials have been selected to users.

Something like the following:

> chat <- chat_snowflake()
## Using model = "llama3.1-70b".
## Using key-pair authentication.

or

> chat <- chat_databricks()
## Using machine-to-machine (M2M) credentials.

or

> chat <- chat_azure()
## Using Azure service principal credentials.

Of course, that might be annoying if we print it every time; I know that gargle at least has a "verbosity" setting that turns on debug messages for the credential source. The internal API could be:

set_auth_source <- function(src) {
  if (!getOption("ellmer_auth_debug", FALSE)) {
    return()
  }
  cli::cli_inform("Using {.field {src}}.")
}
@atheriel
Copy link
Collaborator Author

Note that this won't work all that well for cases where we outsource finding credentials, e.g. with paws.common.

@hadley
Copy link
Member

hadley commented Feb 2, 2025

I wonder if we should consider an optional dependency on logger (or log4r) so we could log this info to a stream that the user could optionally enabled.

@mladencucak
Copy link

I would support some kind of logging...never properly used in many years of R but now log every step in Python because many things can go wrong as all providers constantly change things and there is a lot of instability on the provider side.

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

No branches or pull requests

3 participants