Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
1583d6f
Update version from 1.1.2 to 1.2.0
nipunayf Sep 2, 2025
5fd6a88
Add new API for mapping with transformation function
pasindufernando1 Sep 2, 2025
8a991ea
Change version to 1.2.0
pasindufernando1 Sep 2, 2025
e3b379c
Merge remote-tracking branch 'upstream/main' into transformationFunction
pasindufernando1 Sep 2, 2025
cc9b6d4
Fix checkstyle issues
pasindufernando1 Sep 2, 2025
64f7eb8
Fix PR comment
pasindufernando1 Sep 3, 2025
a3aaba2
Refactor the function name generation logic to avoid special characters
pasindufernando1 Sep 3, 2025
1047d51
Update test cases related to transformation function
pasindufernando1 Sep 3, 2025
525cb96
Change the logic to generate the target expression
KavinduZoysa Sep 1, 2025
9010306
Fix bug in convert to query for multidimentional array
KavinduZoysa Sep 2, 2025
a309aee
Fix bug in data mapper source generation
KavinduZoysa Sep 3, 2025
42dcacc
Add new test sample
pasindufernando1 Sep 3, 2025
4f74e64
Fix PR comments and checkstyle violations
pasindufernando1 Sep 3, 2025
859253b
Fix function range collection logic for non existent files
pasindufernando1 Sep 3, 2025
e93cd8f
Remove unused import
pasindufernando1 Sep 3, 2025
10cb567
Add minor refactoring
pasindufernando1 Sep 3, 2025
25cb80d
Merge pull request #275 from pasindufernando1/transformationFunction
KavinduZoysa Sep 4, 2025
aef3b6e
Properly handle the typeName of unions in Mappings API
pasindufernando1 Sep 4, 2025
0589618
Merge pull request #279 from pasindufernando1/unionNameFix
madushajg Sep 4, 2025
4db927a
Populate the design approach of the http service
LakshanWeerasinghe Sep 4, 2025
1b05187
Update tests
LakshanWeerasinghe Sep 4, 2025
e47e43e
Identify http map type params as payload params
LakshanWeerasinghe Sep 4, 2025
fde289d
Fix adding duplicate params
LakshanWeerasinghe Sep 4, 2025
3c8b802
Update tests
LakshanWeerasinghe Sep 4, 2025
4f60156
Implement programmatic retrieval of AI components
MohamedSabthar Sep 4, 2025
023b7ec
Fix test failures
KavinduZoysa Sep 4, 2025
549def6
Merge branch '1.2.x' of https://github.com/ballerina-platform/balleri…
KavinduZoysa Sep 4, 2025
8756bd2
Merge pull request #278 from KavinduZoysa/refactor-target-expression-…
KavinduZoysa Sep 5, 2025
a1ff40b
Merge pull request #284 from MohamedSabthar/1.2.x
NipunaRanasinghe Sep 5, 2025
5f0ec84
Apply review suggestions
NipunaRanasinghe Sep 5, 2025
c25d7e7
Merge pull request #282 from LakshanWeerasinghe/fix#1140
NipunaRanasinghe Sep 5, 2025
44eb185
Merge pull request #280 from LakshanWeerasinghe/fix#1146
NipunaRanasinghe Sep 5, 2025
7e71bf3
Sync with main
NipunaRanasinghe Sep 8, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
import java.util.Comparator;
import java.util.List;
import java.util.Optional;
import java.util.Set;
import java.util.function.Function;
import java.util.function.Predicate;
import java.util.stream.Collectors;
Expand Down Expand Up @@ -251,9 +252,13 @@ private void setDefaultNodes(boolean disableBallerinaAiNodes) {
}

private List<Item> getAiNodes(boolean disableBallerinaAiNodes) {
String aiPackageVersion = AiUtils.getBallerinaAiModuleVersion(pkg.project());
Set<NodeKind> supportedFeatures = AiUtils.getSupportedFeatures(aiPackageVersion);

AvailableNode modelProvider = new AvailableNode(new Metadata.Builder<>(null)
.label(ModelProviderBuilder.LABEL).description(ModelProviderBuilder.DESCRIPTION).build(),
new Codedata.Builder<>(null).node(NodeKind.MODEL_PROVIDERS).build(), !disableBallerinaAiNodes);
new Codedata.Builder<>(null).node(NodeKind.MODEL_PROVIDERS).build(),
!disableBallerinaAiNodes && supportedFeatures.contains(NodeKind.MODEL_PROVIDERS));

AvailableNode npFunction = new AvailableNode(
new Metadata.Builder<>(null).label(NPFunctionCall.LABEL)
Expand All @@ -268,44 +273,43 @@ private List<Item> getAiNodes(boolean disableBallerinaAiNodes) {
.description(VectorKnowledgeBaseBuilder.DESCRIPTION).build(),
new Codedata.Builder<>(null).node(NodeKind.VECTOR_KNOWLEDGE_BASES).org(Ai.BALLERINA_ORG)
.module(Ai.AI_PACKAGE).packageName(Ai.AI_PACKAGE)
.object(Ai.VECTOR_KNOWLEDGE_BASE_TYPE_NAME).symbol("init").build(),
!disableBallerinaAiNodes);
.object(Ai.VECTOR_KNOWLEDGE_BASE_TYPE_NAME).symbol("init").version(aiPackageVersion).build(),
!disableBallerinaAiNodes && supportedFeatures.contains(NodeKind.VECTOR_KNOWLEDGE_BASES));

AvailableNode recursiveDocumentChunker = new AvailableNode(new Metadata.Builder<>(null)
.label(Ai.RECURSIVE_DOCUMENT_CHUNKER_LABEL).build(), new Codedata.Builder<>(null)
.node(NodeKind.FUNCTION_CALL).org(Ai.BALLERINA_ORG).module(Ai.AI_PACKAGE).packageName(Ai.AI_PACKAGE)
.symbol(Ai.CHUNK_DOCUMENT_RECURSIVELY_METHOD_NAME).build(),
.symbol(Ai.CHUNK_DOCUMENT_RECURSIVELY_METHOD_NAME).version(aiPackageVersion).build(),
!disableBallerinaAiNodes);

AvailableNode chunkers = new AvailableNode(
new Metadata.Builder<>(null).label(ChunkerBuilder.LABEL)
.description(ChunkerBuilder.DESCRIPTION).build(),
new Codedata.Builder<>(null).node(NodeKind.CHUNKERS).build(),
!disableBallerinaAiNodes);
!disableBallerinaAiNodes && supportedFeatures.contains(NodeKind.CHUNKERS));

AvailableNode augmentUserQuery = new AvailableNode(
new Metadata.Builder<>(null).label(Ai.AUGMENT_QUERY_LABEL).build(),
new Codedata.Builder<>(null).node(NodeKind.FUNCTION_CALL).org(Ai.BALLERINA_ORG)
.module(Ai.AI_PACKAGE).packageName(Ai.AI_PACKAGE).symbol(Ai.AUGMENT_USER_QUERY_METHOD_NAME)
.build(), !disableBallerinaAiNodes);
.version(aiPackageVersion).build(), !disableBallerinaAiNodes);

AvailableNode vectorStore = new AvailableNode(
new Metadata.Builder<>(null).label(VectorStoreBuilder.LABEL)
.description(VectorStoreBuilder.DESCRIPTION).build(),
new Codedata.Builder<>(null).node(NodeKind.VECTOR_STORES).build(),
!disableBallerinaAiNodes);
!disableBallerinaAiNodes && supportedFeatures.contains(NodeKind.VECTOR_STORES));

AvailableNode embeddingProvider = new AvailableNode(
new Metadata.Builder<>(null).label(EmbeddingProviderBuilder.LABEL)
.description(EmbeddingProviderBuilder.DESCRIPTION).build(),
new Codedata.Builder<>(null).node(NodeKind.EMBEDDING_PROVIDERS).build(),
!disableBallerinaAiNodes);
!disableBallerinaAiNodes && supportedFeatures.contains(NodeKind.EMBEDDING_PROVIDERS));

AvailableNode dataLoaders = new AvailableNode(
new Metadata.Builder<>(null).label(DataLoaderBuilder.LABEL)
.description(DataLoaderBuilder.DESCRIPTION).build(),
new Codedata.Builder<>(null).node(NodeKind.DATA_LOADERS).build(),
!disableBallerinaAiNodes);
!disableBallerinaAiNodes && supportedFeatures.contains(NodeKind.DATA_LOADERS));

Category ragCategory = new Category.Builder(null).name(Category.Name.RAG)
.items(List.of(vectorKnowledgeBase, dataLoaders, recursiveDocumentChunker, chunkers, augmentUserQuery,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ private NaturalFunctions() {}

// Constants used for AI
public static final class Ai {

private Ai() {}

public static final String BALLERINA_ORG = "ballerina";
Expand All @@ -107,5 +108,15 @@ private Ai() {}
public static final String AGENT_RUN_METHOD_NAME = "run";
public static final String CHUNK_DOCUMENT_RECURSIVELY_METHOD_NAME = "chunkDocumentRecursively";
public static final String AUGMENT_USER_QUERY_METHOD_NAME = "augmentUserQuery";

public static final String MODEL_PROVIDER_TYPE_NAME = "ModelProvider";
public static final String EMBEDDING_PROVIDER_TYPE_NAME = "EmbeddingProvider";
public static final String VECTOR_STORE_TYPE_NAME = "VectorStore";
public static final String CHUNKER_TYPE_NAME = "Chunker";
public static final String DATA_LOADER_TYPE_NAME = "DataLoader";
public static final String WSO2_MODEL_PROVIDER_NAME = "Wso2ModelProvider";
public static final String WSO2_EMBEDDING_PROVIDER_NAME = "Wso2EmbeddingProvider";
public static final String GET_DEFAULT_MODEL_PROVIDER_METHOD = "getDefaultModelProvider";
public static final String GET_DEFAULT_EMBEDDING_PROVIDER_METHOD = "getDefaultEmbeddingProvider";
}
}
Loading
Loading