feat(ts-sdk): add AWS Neptune Analytics vector store (#5797)
Co-authored-by: kartik-mem0 <kartik.labhshetwar@mem0.ai>
This commit is contained in:
@@ -183,6 +183,12 @@ jest.mock("../src/vector_stores/pgvector", () => ({
|
||||
.fn()
|
||||
.mockImplementation((config) => ({ type: "pgvector", config })),
|
||||
}));
|
||||
jest.mock("../src/vector_stores/neptune_analytics", () => ({
|
||||
NeptuneAnalyticsVectorStore: jest.fn().mockImplementation((config) => ({
|
||||
type: "neptune-analytics",
|
||||
config,
|
||||
})),
|
||||
}));
|
||||
jest.mock("../src/vector_stores/upstash_vector", () => ({
|
||||
UpstashVector: jest
|
||||
.fn()
|
||||
@@ -340,6 +346,8 @@ describe("VectorStoreFactory", () => {
|
||||
["vectorize"],
|
||||
["azure-ai-search"],
|
||||
["pgvector"],
|
||||
["neptune"],
|
||||
["neptune-analytics"],
|
||||
["upstash_vector"],
|
||||
["azure_mysql"],
|
||||
["cassandra"],
|
||||
@@ -351,6 +359,30 @@ describe("VectorStoreFactory", () => {
|
||||
expect(result.config).toBe(dummyVSConfig);
|
||||
});
|
||||
|
||||
test("passes Neptune endpoint URI config through the factory", () => {
|
||||
const config = {
|
||||
collectionName: "test",
|
||||
dimension: 4,
|
||||
endpoint: "neptune-graph://g-1234567890",
|
||||
region: "us-east-1",
|
||||
};
|
||||
const store = VectorStoreFactory.create("neptune", config) as any;
|
||||
|
||||
expect(store.config).toEqual(config);
|
||||
});
|
||||
|
||||
test("keeps neptune-analytics as a compatibility alias", () => {
|
||||
const config = {
|
||||
collectionName: "test",
|
||||
dimension: 4,
|
||||
endpoint: "neptune-graph://g-1234567890",
|
||||
region: "us-east-1",
|
||||
};
|
||||
const store = VectorStoreFactory.create("neptune-analytics", config) as any;
|
||||
|
||||
expect(store.config).toEqual(config);
|
||||
});
|
||||
|
||||
test("throws for unsupported provider", () => {
|
||||
expect(() =>
|
||||
VectorStoreFactory.create("nonexistent", dummyVSConfig),
|
||||
|
||||
Reference in New Issue
Block a user