mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-16 18:57:33 +00:00
refactor: dedupe doctor x-search record helper
This commit is contained in:
parent
8010f00816
commit
ea78fb2d32
1 changed files with 2 additions and 4 deletions
|
|
@ -1,13 +1,11 @@
|
|||
import { isRecord } from "./legacy-config-record-shared.js";
|
||||
|
||||
type JsonRecord = Record<string, unknown>;
|
||||
|
||||
const XAI_PLUGIN_ID = "xai";
|
||||
const X_SEARCH_LEGACY_PATH = "tools.web.x_search";
|
||||
const XAI_WEB_SEARCH_PLUGIN_KEY_PATH = `plugins.entries.${XAI_PLUGIN_ID}.config.webSearch.apiKey`;
|
||||
|
||||
function isRecord(value: unknown): value is JsonRecord {
|
||||
return typeof value === "object" && value !== null && !Array.isArray(value);
|
||||
}
|
||||
|
||||
function cloneRecord<T extends JsonRecord | undefined>(value: T): T {
|
||||
if (!value) {
|
||||
return value;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue