mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-14 10:41:23 +00:00
refactor: dedupe pi model discovery record helper
This commit is contained in:
@@ -15,6 +15,7 @@ import {
|
||||
resolveProviderSyntheticAuthWithPlugin,
|
||||
} from "../plugins/provider-runtime.js";
|
||||
import type { ProviderRuntimeModel } from "../plugins/types.js";
|
||||
import { isRecord } from "../utils.js";
|
||||
import { ensureAuthProfileStore } from "./auth-profiles.js";
|
||||
import { resolveProviderEnvApiKeyCandidates } from "./model-auth-env-vars.js";
|
||||
import { resolveEnvApiKey } from "./model-auth-env.js";
|
||||
@@ -54,10 +55,6 @@ function createInMemoryAuthStorageBackend(
|
||||
};
|
||||
}
|
||||
|
||||
function isRecord(value: unknown): value is Record<string, unknown> {
|
||||
return typeof value === "object" && value !== null && !Array.isArray(value);
|
||||
}
|
||||
|
||||
function normalizeRegistryModel<T>(value: T, agentDir: string): T {
|
||||
if (!isRecord(value)) {
|
||||
return value;
|
||||
|
||||
Reference in New Issue
Block a user