""" _config.py — receipts kit stub. The scripts in this folder were originally run with a vault-internal _config module that wires up provider clients (xAI, Gemini), handles proxy-routed API keys, and provides shared helpers for retry, bootstrap CIs, and result formatting. This file replaces that module with a documented stub. Importing it will succeed; calling any of the functions below will raise NotImplementedError with a pointer to the docstring describing what the function did. To reproduce the experiments end-to-end, replace each NotImplementedError body with a call to your own provider's SDK. What the original module does is reconstructible from the function signatures and the call sites in the script files. Nothing here changes the regex-based number-matching logic, which runs without any of the API helpers. """ GENERATOR_MODEL = "grok-4-1-fast" """xAI generator model used for sub-experiments 1, 2, 4, 5.""" def _stub(name, summary): raise NotImplementedError( f"_config.{name} is a stub. {summary} " f"Replace with a call to your provider's SDK to reproduce." ) def get_xai_client(): """Return an xAI client. Original used a proxy-routed wrapper around the OpenAI SDK pointed at the xAI base URL with the XAI_API_KEY environment variable. """ _stub("get_xai_client", "Original returned an OpenAI-compatible client with " "base_url=https://api.x.ai/v1 and api_key=os.environ['XAI_API_KEY'].") def get_gemini_client(): """Return a Gemini client. Original used google.genai with the GEMINI_API_KEY environment variable. """ _stub("get_gemini_client", "Original returned a google.genai.Client(api_key=" "os.environ['GEMINI_API_KEY']).") def get_generator_client(model=None): """Pair a generator model string with the matching provider client. Original returned (client, model) and dispatched on model family. """ _stub("get_generator_client", "Original returned (client, model). Dispatched 'grok-*' to " "xAI, 'gemini-*' to Gemini, 'gpt-*' to OpenAI.") def call_generator(client, model, messages, max_retries=5, **kwargs): """Send a chat-completion request with provider-specific kwargs and retry on transient failure. Returns the response text. """ _stub("call_generator", "Original wrapped client.chat.completions.create (xAI/OpenAI) " "or client.models.generate_content (Gemini) with retry.") def gemini_evaluate(prompt, model=None, temperature=0.0, max_tokens=2048, **kwargs): """Single-prompt Gemini evaluation. Returns the response text in text mode (NOT response_mime_type='application/json' — that path is broken in google.genai as of 2026-03; parse JSON from text yourself). """ _stub("gemini_evaluate", "Original returned response.text from " "gemini_client.models.generate_content with " "config={'temperature': temperature, 'max_output_tokens': max_tokens}.") def format_results(findings, evaluator=None, generator=None, **kwargs): """Wrap experiment findings with metadata (timestamp, generator model, evaluator model, API call counts) before saving to JSON. """ import time return { "evaluator_model": evaluator, "generator_model": generator, "api_failures": 0, "api_calls": 0, "timestamp": time.time(), "findings": findings, }