Files
openclaw/src/agents/models-config.test-utils.ts
2026-02-23 05:45:54 +00:00

10 lines
349 B
TypeScript

import fs from "node:fs/promises";
import path from "node:path";
import { resolveOpenClawAgentDir } from "./agent-paths.js";
export async function readGeneratedModelsJson<T>(): Promise<T> {
const modelPath = path.join(resolveOpenClawAgentDir(), "models.json");
const raw = await fs.readFile(modelPath, "utf8");
return JSON.parse(raw) as T;
}