mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-08 06:51:23 +00:00
refactor(core): dedupe shared config and runtime helpers
This commit is contained in:
@@ -3,25 +3,17 @@ import os from "node:os";
|
||||
import path from "node:path";
|
||||
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
|
||||
import { getMemorySearchManager, type MemoryIndexManager } from "./index.js";
|
||||
import { createOpenAIEmbeddingProviderMock } from "./test-embeddings-mock.js";
|
||||
|
||||
const embedBatch = vi.fn(async () => []);
|
||||
const embedQuery = vi.fn(async () => [0.2, 0.2, 0.2]);
|
||||
|
||||
vi.mock("./embeddings.js", () => ({
|
||||
createEmbeddingProvider: async () => ({
|
||||
requestedProvider: "openai",
|
||||
provider: {
|
||||
id: "openai",
|
||||
model: "text-embedding-3-small",
|
||||
createEmbeddingProvider: async () =>
|
||||
createOpenAIEmbeddingProviderMock({
|
||||
embedQuery,
|
||||
embedBatch,
|
||||
},
|
||||
openAi: {
|
||||
baseUrl: "https://api.openai.com/v1",
|
||||
headers: { Authorization: "Bearer test", "Content-Type": "application/json" },
|
||||
model: "text-embedding-3-small",
|
||||
},
|
||||
}),
|
||||
}),
|
||||
}));
|
||||
|
||||
describe("memory search async sync", () => {
|
||||
|
||||
Reference in New Issue
Block a user