mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-12 17:51:22 +00:00
refactor: dedupe embeddings error formatter
This commit is contained in:
@@ -3,6 +3,7 @@ import type { IncomingMessage, ServerResponse } from "node:http";
|
||||
import { resolveAgentDir } from "../agents/agent-scope.js";
|
||||
import { resolveMemorySearchConfig } from "../agents/memory-search.js";
|
||||
import { loadConfig } from "../config/config.js";
|
||||
import { formatErrorMessage } from "../infra/errors.js";
|
||||
import { logWarn } from "../logger.js";
|
||||
import {
|
||||
getMemoryEmbeddingProvider,
|
||||
@@ -85,10 +86,6 @@ function validateInputTexts(texts: string[]): string | undefined {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
function formatErrorMessage(err: unknown): string {
|
||||
return err instanceof Error ? err.message : String(err);
|
||||
}
|
||||
|
||||
function resolveAutoExplicitProviders(cfg: ReturnType<typeof loadConfig>): Set<string> {
|
||||
return new Set(
|
||||
listMemoryEmbeddingProviders(cfg)
|
||||
|
||||
Reference in New Issue
Block a user