Skip to contents

Overrides the API key, model and/or base URL used by the equivalent-mutant detection workflow. Values set here take precedence over a .openai_config file and over environment variables. Arguments left NULL are unchanged.

Usage

set_openai_config(
  api_key = NULL,
  model = NULL,
  base_url = NULL,
  max_parallel_requests = NULL
)

Arguments

api_key

API key string.

model

Model name (e.g. "gpt-4").

base_url

Base URL of an OpenAI-compatible Chat Completions API, such as "https://api.openai.com/v1" or another provider endpoint.

max_parallel_requests

Maximum number of equivalence-detection API requests to run concurrently. Use this to stay under a provider's per-key parallel-request limit (exceeding it returns HTTP 429). NA (the default) imposes no cap beyond the run's own cores.

Value

Invisibly, the resulting configuration (see get_openai_config()).

Examples

set_openai_config(model = "gpt-4o-mini")
get_openai_config()$model
#> [1] "gpt-4o-mini"
reset_openai_config()