Skip to contents

Stores API keys and preferences for the current R session in an internal package environment. For persistence across sessions, use pc_save_config() to write values to your .Renviron file.

Usage

pc_configure(
  email = NULL,
  scopus_key = NULL,
  scopus_insttoken = NULL,
  llm_key = NULL,
  llm_provider = "anthropic",
  llm_base_url = NULL,
  embed_key = NULL,
  embed_provider = NULL,
  .overwrite = TRUE
)

Arguments

email

Character. Your email address, used as a courtesy identifier for OpenAlex and Crossref requests (polite pool). If NULL, falls back to PUBCLASSIFY_EMAIL.

scopus_key

Character. Elsevier Scopus API key. If NULL, falls back to the SCOPUS_API_KEY environment variable.

scopus_insttoken

Character. Elsevier institutional token, used alongside scopus_key to authenticate off-campus COMPLETE view access. If NULL, falls back to the SCOPUS_INSTTOKEN environment variable. Keep this value confidential — do not commit it to version control.

llm_key

Character. API key for the LLM provider used by pc_classify(). If NULL, falls back to the provider-specific environment variable (e.g. ANTHROPIC_API_KEY).

llm_provider

Character. LLM provider name passed to ellmer (e.g. "anthropic", "openai"). Default "anthropic".

llm_base_url

Character. Base URL for an OpenAI-compatible API endpoint. Use this when calling a non-standard provider (e.g. a local model server or a third-party OpenAI-compatible service). If NULL, the provider's default endpoint is used. Falls back to the PUBCLASSIFY_LLM_BASE_URL environment variable.

embed_key

Character. API key for the embedding provider used when use_embeddings = TRUE in pc_classify(). If NULL, falls back to the provider-specific environment variable.

embed_provider

Character. Embedding provider name (e.g. "openai", "cohere").

.overwrite

Logical. If FALSE, existing session values are not replaced. Default TRUE.

Value

Invisibly returns the current configuration as a named list, with key values masked.

Examples

if (FALSE) { # \dontrun{
pc_configure(
  scopus_key   = "my-scopus-key",
  email        = "me@example.com",
  llm_provider = "anthropic"
)
} # }