Skip to content

Commit c44d223

Browse files
Update the names and config names
1 parent c53ceee commit c44d223

File tree

2 files changed

+20
-8
lines changed

2 files changed

+20
-8
lines changed

ballerina/azure_ai_search_knowledgebase.bal

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ type IndexSchemaInfo record {
7575
};
7676

7777
# Configuration for the Azure AI Service Clients
78-
public type AzureAiSearchKnowledgeBaseClientConfiguration record {|
78+
public type AiSearchKnowledgeBaseClientConfiguration record {|
7979
# Connection configuration for the Azure AI search client that use for create search index
8080
# This configuration is only required when the `index` parameter
8181
# is provided as an `search:SearchIndex` (i.e., when the system will create the index).
@@ -88,7 +88,7 @@ public type AzureAiSearchKnowledgeBaseClientConfiguration record {|
8888
# User should create the required `indexer`, `data source` and `index` beforehand using
8989
# the util functions provided in this module.
9090
# Currently search fields only supported with `id`, `content` and `type` field names.
91-
public distinct isolated class AzureAiSearchKnowledgeBase {
91+
public distinct isolated class AiSearchKnowledgeBase {
9292
*ai:KnowledgeBase;
9393

9494
private final search:SearchIndex index;
@@ -104,7 +104,7 @@ public distinct isolated class AzureAiSearchKnowledgeBase {
104104
private final string[] vectorFieldNames;
105105
private final map<search:SearchField> allFields;
106106

107-
# Initializes a new `AzureAiSearchKnowledgeBase` instance.
107+
# Initializes a new `AiSearchKnowledgeBase` instance.
108108
#
109109
# + serviceUrl - The service URL of the Azure AI Search instance
110110
# + apiKey - The API key for authenticating with the Azure AI Search service
@@ -116,11 +116,11 @@ public distinct isolated class AzureAiSearchKnowledgeBase {
116116
# + apiVersion - The API version to use for requests.
117117
# + clientConfigurations - Additional client configurations for Azure AI Search clients
118118
# + contentFieldName - The name of the field in the index that contains the main content. Defaults to "content".
119-
# + return - An instance of `AzureAiSearchKnowledgeBase` or an `ai:Error` if initialization fails
119+
# + return - An instance of `AiSearchKnowledgeBase` or an `ai:Error` if initialization fails
120120
public isolated function init(string serviceUrl, string apiKey, string|search:SearchIndex index, ai:EmbeddingProvider embeddingModel,
121121
ai:Chunker|ai:AUTO|ai:DISABLE chunker = ai:AUTO, boolean verbose = false,
122122
string apiVersion = AI_AZURE_KNOWLEDGEBASE_API_VERSION, string contentFieldName = CONTENT_FIELD_NAME,
123-
*AzureAiSearchKnowledgeBaseClientConfiguration clientConfigurations) returns ai:Error? {
123+
*AiSearchKnowledgeBaseClientConfiguration clientConfigurations) returns ai:Error? {
124124
self.chunker = chunker;
125125
self.embeddingModel = embeddingModel;
126126
self.verbose = verbose;
@@ -518,9 +518,9 @@ public distinct isolated class AzureAiSearchKnowledgeBase {
518518
# + err - Optional error to log with additional details
519519
isolated function logIfVerboseEnable(boolean verbose, string value, 'error? err = ()) {
520520
if verbose {
521-
log:printInfo(string `[AzureAiSearchKnowledgeBase] ${value}`);
521+
log:printInfo(string `[AiSearchKnowledgeBase] ${value}`);
522522
if err is error {
523-
log:printError(string `[AzureAiSearchKnowledgeBase] Error Details: ${err.message()}`, err);
523+
log:printError(string `[AiSearchKnowledgeBase] Error Details: ${err.message()}`, err);
524524
}
525525
}
526526
}
@@ -563,7 +563,7 @@ isolated function generateVectorFromEmbedding(ai:Embedding embedding) returns ai
563563
return embedding.dense;
564564
} else {
565565
// Explicitly fail for sparse-only embeddings
566-
return error ai:Error("AzureAiSearchKnowledgeBase only supports dense or hybrid embeddings, but received a SparseVector.");
566+
return error ai:Error("AiSearchKnowledgeBase only supports dense or hybrid embeddings, but received a SparseVector.");
567567
}
568568
}
569569

build-config/resources/Ballerina.toml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,15 @@ groupId = "io.ballerina.lib"
1717
artifactId = "ai.azure-native"
1818
version = "@toml.version@"
1919
path = "../native/build/libs/ai.azure-native-@project.version@.jar"
20+
21+
[[dependency]]
22+
org="ballerinax"
23+
name="azure.ai.search"
24+
version="1.0.0"
25+
repository="local"
26+
27+
[[dependency]]
28+
org="ballerinax"
29+
name="azure.ai.search.index"
30+
version="1.0.0"
31+
repository="local"

0 commit comments

Comments
 (0)