experiment(confidence-engine): route UI journey provider centrally

This commit is contained in:
2026-09-07 09:35:53 +01:00
parent 642a969b18
commit bb3082d633
15 changed files with 158 additions and 17 deletions
+7
View File
@@ -1,5 +1,6 @@
import { z } from "zod";
import { reconstructionV2Schema } from "../reconstruction/schema.js";
import { isOpenAIUiJourneyExperiment, OPENAI_TERRA_MODEL } from "../config.js";
/**
* Provider abstraction — the app calls getProvider() which returns an object
@@ -9,9 +10,15 @@ import { reconstructionV2Schema } from "../reconstruction/schema.js";
*/
export function getProvider() {
if (isOpenAIUiJourneyExperiment()) return createOpenAIReconstructionProvider();
return new OllamaLlmProvider();
}
/** Server-owned model resolution for the configured application provider. */
export function getProviderModelName() {
return isOpenAIUiJourneyExperiment() ? OPENAI_TERRA_MODEL : process.env.OLLAMA_MODEL ?? null;
}
/**
* Experiment-only construction seam. Production provider selection remains Ollama.
* @param {{ apiKey?: string, fetchImpl?: typeof fetch }} [options]