chore(v0.3.0): rename fast-LLM env vars to TIMEWEB_* (match other projects)
Aligns with the user's other repos (proso) which use TIMEWEB_API_GROK / TIMEWEB_URL_GROK. Single naming convention across projects avoids the 'which env var was it for this repo' mental tax. PEPA_FAST_LLM_BASE_URL → TIMEWEB_BASE_URL PEPA_FAST_LLM_API_KEY → TIMEWEB_API_KEY PEPA_FAST_LLM_MODEL → TIMEWEB_MODEL PEPA_FAST_LLM_TIMEOUT_MS → TIMEWEB_TIMEOUT_MS Provider still works with any OpenAI-compatible endpoint — TimeWeb is the default but the variable name doesn't lock us in. Tests + docs + .env / .env.example updated. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -50,7 +50,7 @@ export async function advise({
|
||||
force = false,
|
||||
} = {}) {
|
||||
if (!isAvailable()) {
|
||||
return { ok: false, code: "not_configured", detail: "set PEPA_FAST_LLM_API_KEY", latencyMs: 0 };
|
||||
return { ok: false, code: "not_configured", detail: "set TIMEWEB_API_KEY", latencyMs: 0 };
|
||||
}
|
||||
|
||||
const now = Date.now();
|
||||
|
||||
@@ -3,9 +3,9 @@ import assert from "node:assert/strict";
|
||||
|
||||
import { advise, isAvailable, _resetForTest, __testing } from "./fast-advisor.js";
|
||||
|
||||
const API_KEY = "PEPA_FAST_LLM_API_KEY";
|
||||
const MODEL = "PEPA_FAST_LLM_MODEL";
|
||||
const BASE = "PEPA_FAST_LLM_BASE_URL";
|
||||
const API_KEY = "TIMEWEB_API_KEY";
|
||||
const MODEL = "TIMEWEB_MODEL";
|
||||
const BASE = "TIMEWEB_BASE_URL";
|
||||
|
||||
function withEnv(env, fn) {
|
||||
const prev = {};
|
||||
@@ -43,6 +43,7 @@ test("advise: not_configured without API key", async () => {
|
||||
const res = await advise({ reason: "stuck" });
|
||||
assert.equal(res.ok, false);
|
||||
assert.equal(res.code, "not_configured");
|
||||
assert.match(res.detail, /TIMEWEB_API_KEY/);
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user