mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-21 19:15:47 +00:00
refactor: dedupe pi model discovery record helper
This commit is contained in:
parent
5c9ec970b8
commit
bd2798ec5f
1 changed files with 1 additions and 4 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue