From 443292b8b8228193a707b1ae7bc43221cd5764c4 Mon Sep 17 00:00:00 2001 From: Nuvindu Date: Tue, 2 Sep 2025 11:12:54 +0530 Subject: [PATCH] Update docs with the latest changes --- README.md | 8 +++----- ballerina/README.md | 8 +++----- ballerina/vector_store.bal | 1 + 3 files changed, 7 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index c73adb2..64253e9 100644 --- a/README.md +++ b/README.md @@ -71,9 +71,7 @@ ai:VectorStore vectorStore = check new weaviate:VectorStore( config = { collectionName: "add-collection-name" }, - auth = { - token: "add-access-token" - } + apiKey = "mock-token" ); ``` @@ -83,7 +81,7 @@ ai:VectorStore vectorStore = check new weaviate:VectorStore( ai:Error? result = vectorStore.add( [ { - id: uuid:createRandomUuid(), + id: "1", embedding: [1.0, 2.0, 3.0], chunk: { 'type: "text", @@ -98,7 +96,7 @@ ai:Error? result = vectorStore.add( The Ballerina Weaviate vector store module provides practical examples illustrating usage in various scenarios. Explore these [examples](https://github.com/ballerina-platform/module-ballerinax-ai.weaviate/tree/main/examples). -1. [Book Recommendation System](https://github.com/ballerina-platform/module-ballerinax-ai.weaviate/tree/main/examples/book-recommendation-system) +1. [Book recommendation system](https://github.com/ballerina-platform/module-ballerinax-ai.weaviate/tree/main/examples/book-recommendation-system) This example shows how to use Weaviate vector store APIs to implement a book recommendation system that stores book embeddings and queries them to find similar books based on vector similarity and metadata filtering. ## Issues and projects diff --git a/ballerina/README.md b/ballerina/README.md index b4c0c92..7f8c451 100644 --- a/ballerina/README.md +++ b/ballerina/README.md @@ -66,9 +66,7 @@ ai:VectorStore vectorStore = check new weaviate:VectorStore( config = { collectionName: "add-collection-name" }, - auth = { - token: "add-access-token" - } + apiKey = "mock-token" ); ``` @@ -78,7 +76,7 @@ ai:VectorStore vectorStore = check new weaviate:VectorStore( ai:Error? result = vectorStore.add( [ { - id: uuid:createRandomUuid(), + id: "1", embedding: [1.0, 2.0, 3.0], chunk: { 'type: "text", @@ -93,5 +91,5 @@ ai:Error? result = vectorStore.add( The Ballerina Weaviate vector store module provides practical examples illustrating usage in various scenarios. Explore these [examples](https://github.com/ballerina-platform/module-ballerinax-ai.weaviate/tree/main/examples). -1. [Book Recommendation System](https://github.com/ballerina-platform/module-ballerinax-ai.weaviate/tree/main/examples/book-recommendation-system) +1. [Book recommendation system](https://github.com/ballerina-platform/module-ballerinax-ai.weaviate/tree/main/examples/book-recommendation-system) This example shows how to use Weaviate vector store APIs to implement a book recommendation system that stores book embeddings and queries them to find similar books based on vector similarity and metadata filtering. diff --git a/ballerina/vector_store.bal b/ballerina/vector_store.bal index 9838b84..a93fade 100644 --- a/ballerina/vector_store.bal +++ b/ballerina/vector_store.bal @@ -34,6 +34,7 @@ public isolated class VectorStore { # Initializes the Weaviate vector store with the given configuration. # # + serviceUrl - The URL of the Weaviate service + # + apiKey - The API key for the Weaviate service # + config - The configurations containing collection name, topK, and chunk field name # + httpConfig - The HTTP configuration for the Weaviate client connection # + return - An `ai:Error` if the initialization fails, otherwise returns `()`