repositories
loading repo index
repositories
loading repo index
repository
loading code, commits, and activity
public Clawd ADK gateway launch mirror
stars
latest
clone command
git clone gitlawb://did:key:z6Mkq5mY...iFZ5/my-project-publ...git clone gitlawb://did:key:z6Mkq5mY.../my-project-publ...2fa351d6docs: add automaton and perps launch sources16d ago| #1 | /// <reference types="jest" /> |
| #2 | import { VectorStoreFactory } from "../src/utils/factory"; |
| #3 | import { AzureAISearch } from "../src/vector_stores/azure_ai_search"; |
| #4 | |
| #5 | describe("VectorStoreFactory", () => { |
| #6 | describe("create", () => { |
| #7 | it("should create Azure AI Search vector store", () => { |
| #8 | const config = { |
| #9 | collectionName: "test-memories", |
| #10 | serviceName: "test-service", |
| #11 | apiKey: "test-api-key", |
| #12 | embeddingModelDims: 1536, |
| #13 | compressionType: "none" as const, |
| #14 | useFloat16: false, |
| #15 | hybridSearch: false, |
| #16 | vectorFilterMode: "preFilter" as const, |
| #17 | }; |
| #18 | |
| #19 | const vectorStore = VectorStoreFactory.create("azure-ai-search", config); |
| #20 | |
| #21 | expect(vectorStore).toBeInstanceOf(AzureAISearch); |
| #22 | }); |
| #23 | |
| #24 | it("should create memory vector store", () => { |
| #25 | const config = { |
| #26 | collectionName: "test-memories", |
| #27 | dimension: 1536, |
| #28 | }; |
| #29 | |
| #30 | const vectorStore = VectorStoreFactory.create("memory", config); |
| #31 | |
| #32 | expect(vectorStore).toBeDefined(); |
| #33 | expect(vectorStore.constructor.name).toBe("MemoryVectorStore"); |
| #34 | }); |
| #35 | |
| #36 | it("should throw error for unsupported provider", () => { |
| #37 | const config = {}; |
| #38 | |
| #39 | expect(() => { |
| #40 | VectorStoreFactory.create("unsupported-provider", config); |
| #41 | }).toThrow("Unsupported vector store provider: unsupported-provider"); |
| #42 | }); |
| #43 | }); |
| #44 | }); |
| #45 |