Skip to content
Discussion options

You must be logged in to vote

Ah, I can see how this might be confusing. .Renviron is read by R itself, not by Positron.

When R starts up it reads .Renviron and sets those variables in its own process environment. So Sys.getenv("ANTHROPIC_API_KEY") in the R console shows the value, and everything looks correct from inside R. But the R session is a child process that lives inside Positron, and the variables only exist there. The assistant looks for ANTHROPIC_API_KEY and ANTHROPIC_BASE_URL in Positron's own environment, which never sees .Renviron:

flowchart TB
    shell["Shell config<br/>(~/.zshenv, ~/.zprofile, ...)"]
    renviron["~/.Renviron"]

    subgraph positron["Positron"]
        assistant["Assistant<br/>loo…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@codeswitching
Comment options

Answer selected by codeswitching
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants