import { completeSimple, type Api, type AssistantMessage, type Model } from "@mariozechner/pi-ai"; import { loadConfig } from "../config/config.js"; import { isTruthyEnvValue } from "../infra/env.js"; import { resolveOpenClawAgentDir } from "./agent-paths.js"; import { collectProviderApiKeys } from "./live-auth-keys.js"; import { isLiveTestEnabled } from "./live-test-helpers.js"; import { getApiKeyForModel, requireApiKey } from "./model-auth.js"; import { normalizeProviderId, parseModelRef } from "./model-selection.js"; import { ensureOpenClawModelsJson } from "./models-config.js"; import { discoverAuthStorage, discoverModels } from "./pi-model-discovery.js"; import { buildAssistantMessageWithZeroUsage } from "./stream-message-shared.js";
export function buildStableCachePrefix(tag: string, sections = 160): string { const lines = [
`Stable cache prefix for ${tag}.`, "Preserve this prefix byte-for-byte across retries.", "Return only the requested marker from the final user message.",
]; for (let index = 0; index < sections; index += 1) {
lines.push(
`Section ${index + 1}: deterministic cache prose with repeated lexical material about routing, invariants, transcript stability, prefix locality, provider usage accounting, and session affinity.`,
);
} return lines.join("\n");
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.