feat(vector-stores): add Databricks provider to TypeScript OSS SDK (#5824)
Co-authored-by: kartik-mem0 <kartik.labhshetwar@mem0.ai>
This commit is contained in:
@@ -522,6 +522,34 @@ describe("ConfigManager", () => {
|
||||
expect(cfg.embedder.config).not.toHaveProperty("embedding_dims");
|
||||
});
|
||||
});
|
||||
|
||||
describe("mergeConfig - vector store provider normalization", () => {
|
||||
const baseLlm = { provider: "openai", config: { apiKey: "test-key" } };
|
||||
const baseEmbedder = { provider: "openai", config: { apiKey: "test-key" } };
|
||||
|
||||
it.each(["Memory", "DATABRICKS", "QdRaNt"])(
|
||||
"lowercases the vector store provider %p",
|
||||
(provider) => {
|
||||
const config = ConfigManager.mergeConfig({
|
||||
embedder: baseEmbedder,
|
||||
vectorStore: { provider, config: { collectionName: "test" } },
|
||||
llm: baseLlm,
|
||||
});
|
||||
|
||||
expect(config.vectorStore.provider).toBe(provider.toLowerCase());
|
||||
},
|
||||
);
|
||||
|
||||
it("still falls back to the default provider when none is given", () => {
|
||||
const config = ConfigManager.mergeConfig({
|
||||
embedder: baseEmbedder,
|
||||
vectorStore: { config: { collectionName: "test" } } as any,
|
||||
llm: baseLlm,
|
||||
});
|
||||
|
||||
expect(config.vectorStore.provider).toBe("memory");
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
// ─────────────────────────────────────────────────────────────────────────
|
||||
|
||||
@@ -183,6 +183,11 @@ jest.mock("../src/vector_stores/pgvector", () => ({
|
||||
.fn()
|
||||
.mockImplementation((config) => ({ type: "pgvector", config })),
|
||||
}));
|
||||
jest.mock("../src/vector_stores/databricks", () => ({
|
||||
DatabricksVectorStore: jest
|
||||
.fn()
|
||||
.mockImplementation((config) => ({ type: "databricks", config })),
|
||||
}));
|
||||
jest.mock("../src/vector_stores/neptune_analytics", () => ({
|
||||
NeptuneAnalyticsVectorStore: jest.fn().mockImplementation((config) => ({
|
||||
type: "neptune-analytics",
|
||||
@@ -346,6 +351,7 @@ describe("VectorStoreFactory", () => {
|
||||
["vectorize"],
|
||||
["azure-ai-search"],
|
||||
["pgvector"],
|
||||
["databricks"],
|
||||
["neptune"],
|
||||
["neptune-analytics"],
|
||||
["upstash_vector"],
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user