mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-10 16:50:42 +00:00
12 lines
373 B
TypeScript
12 lines
373 B
TypeScript
import fs from "node:fs/promises";
|
|
import path from "node:path";
|
|
import { resolveDefaultAgentDir } from "./agent-scope.js";
|
|
|
|
export async function readGeneratedModelsJson<T>(
|
|
agentDir = resolveDefaultAgentDir({}),
|
|
): Promise<T> {
|
|
const modelPath = path.join(agentDir, "models.json");
|
|
const raw = await fs.readFile(modelPath, "utf8");
|
|
return JSON.parse(raw) as T;
|
|
}
|