Skip to content
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
import io.ballerina.compiler.api.symbols.TypeDescKind;
import io.ballerina.compiler.api.symbols.TypeSymbol;
import io.ballerina.compiler.api.symbols.UnionTypeSymbol;
import io.ballerina.compiler.syntax.tree.MappingConstructorExpressionNode;
import io.ballerina.compiler.syntax.tree.Node;
import io.ballerina.flowmodelgenerator.core.DiagnosticHandler;
import io.ballerina.modelgenerator.commons.CommonUtils;
Expand Down Expand Up @@ -633,13 +632,7 @@ public Builder<T> typeWithExpression(TypeSymbol typeSymbol, ModuleInfo moduleInf
if (matchingValueType == ValueType.MAPPING_EXPRESSION_SET) {
Optional<TypeSymbol> paramType = semanticModel.typeOf(value);
if (paramType.isPresent()) {
if (paramType.get().typeKind() == TypeDescKind.MAP) {
matchingValueType = ValueType.MAPPING_EXPRESSION;
// convert string to a Map<String, Object>
Map<String, Object> mapValue = CommonUtils.convertMappingExprToMap(
(MappingConstructorExpressionNode) value);
value(mapValue);
} else if (paramType.get().typeKind() == TypeDescKind.RECORD) {
Comment on lines -636 to -642
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the change is temporary, we should ideally add a TODO comment instead of removing the entire code block. Better if we can create an issue for this.

if (paramType.get().typeKind() == TypeDescKind.RECORD) {
matchingValueType = ValueType.RECORD_MAP_EXPRESSION;
}
}
Expand Down Expand Up @@ -712,8 +705,6 @@ private boolean handlePrimitiveType(TypeSymbol typeSymbol, String ballerinaType)
INT_SIGNED32, INT_UNSIGNED32, BYTE, FLOAT, DECIMAL -> type(ValueType.NUMBER, ballerinaType);
case STRING, STRING_CHAR -> type(ValueType.TEXT, ballerinaType);
case BOOLEAN -> type(ValueType.FLAG, ballerinaType);
case ARRAY -> type(ValueType.EXPRESSION_SET, ballerinaType);
case MAP -> type(ValueType.MAPPING_EXPRESSION, ballerinaType);
case RECORD -> {
if (typeSymbol.typeKind() != TypeDescKind.RECORD && typeSymbol.getModule().isPresent()) {
// not an anonymous record
Expand Down Expand Up @@ -747,7 +738,6 @@ private ValueType findMatchingValueType(Node node) {
case STRING_TEMPLATE_EXPRESSION, STRING_LITERAL -> ValueType.TEXT;
case NUMERIC_LITERAL -> ValueType.NUMBER;
case TRUE_KEYWORD, FALSE_KEYWORD, BOOLEAN_LITERAL -> ValueType.FLAG;
case LIST_BINDING_PATTERN, LIST_CONSTRUCTOR -> ValueType.EXPRESSION_SET;
case MAPPING_BINDING_PATTERN, MAPPING_CONSTRUCTOR -> ValueType.MAPPING_EXPRESSION_SET;
default -> ValueType.EXPRESSION;
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,11 +172,6 @@
"description": "The tools available for the agent"
},
"types": [
{
"fieldType": "EXPRESSION_SET",
"ballerinaType": "(ai:BaseToolKit|ai:ToolConfig|ai:FunctionTool)[]",
"selected": false
},
{
"fieldType": "EXPRESSION",
"ballerinaType": "(ai:BaseToolKit|ai:ToolConfig|ai:FunctionTool)[]",
Expand Down Expand Up @@ -661,15 +656,10 @@
"description": "The tools available for the agent"
},
"types": [
{
"fieldType": "EXPRESSION_SET",
"ballerinaType": "(ai:BaseToolKit|ai:ToolConfig|ai:FunctionTool)[]",
"selected": true
},
{
"fieldType": "EXPRESSION",
"ballerinaType": "(ai:BaseToolKit|ai:ToolConfig|ai:FunctionTool)[]",
"selected": false
"selected": true
}
],
"value": "[set, sum, mutiply]",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,11 +173,6 @@
"description": "The tools available for the agent"
},
"types": [
{
"fieldType": "EXPRESSION_SET",
"ballerinaType": "(ai:BaseToolKit|ai:ToolConfig|ai:FunctionTool)[]",
"selected": false
},
{
"fieldType": "EXPRESSION",
"ballerinaType": "(ai:BaseToolKit|ai:ToolConfig|ai:FunctionTool)[]",
Expand Down Expand Up @@ -662,15 +657,10 @@
"description": "The tools available for the agent"
},
"types": [
{
"fieldType": "EXPRESSION_SET",
"ballerinaType": "(ai:BaseToolKit|ai:ToolConfig|ai:FunctionTool)[]",
"selected": true
},
{
"fieldType": "EXPRESSION",
"ballerinaType": "(ai:BaseToolKit|ai:ToolConfig|ai:FunctionTool)[]",
"selected": false
"selected": true
}
],
"value": "[set, sum, mutiply]",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,11 +172,6 @@
"description": "The tools available for the agent"
},
"types": [
{
"fieldType": "EXPRESSION_SET",
"ballerinaType": "(ai:BaseToolKit|ai:ToolConfig|ai:FunctionTool)[]",
"selected": false
},
{
"fieldType": "EXPRESSION",
"ballerinaType": "(ai:BaseToolKit|ai:ToolConfig|ai:FunctionTool)[]",
Expand Down Expand Up @@ -661,15 +656,10 @@
"description": "The tools available for the agent"
},
"types": [
{
"fieldType": "EXPRESSION_SET",
"ballerinaType": "(ai:BaseToolKit|ai:ToolConfig|ai:FunctionTool)[]",
"selected": true
},
{
"fieldType": "EXPRESSION",
"ballerinaType": "(ai:BaseToolKit|ai:ToolConfig|ai:FunctionTool)[]",
"selected": false
"selected": true
}
],
"value": "[set, sum, mutiply]",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,11 +173,6 @@
"description": "The tools available for the agent"
},
"types": [
{
"fieldType": "EXPRESSION_SET",
"ballerinaType": "(ai:BaseToolKit|ai:ToolConfig|ai:FunctionTool)[]",
"selected": false
},
{
"fieldType": "EXPRESSION",
"ballerinaType": "(ai:BaseToolKit|ai:ToolConfig|ai:FunctionTool)[]",
Expand Down Expand Up @@ -687,15 +682,10 @@
"description": "The tools available for the agent"
},
"types": [
{
"fieldType": "EXPRESSION_SET",
"ballerinaType": "(ai:BaseToolKit|ai:ToolConfig|ai:FunctionTool)[]",
"selected": true
},
{
"fieldType": "EXPRESSION",
"ballerinaType": "(ai:BaseToolKit|ai:ToolConfig|ai:FunctionTool)[]",
"selected": false
"selected": true
}
],
"value": "[set, sum, mutiply]",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -271,11 +271,6 @@
"description": "The tools available for the agent"
},
"types": [
{
"fieldType": "EXPRESSION_SET",
"ballerinaType": "(ai:BaseToolKit|ai:ToolConfig|ai:FunctionTool)[]",
"selected": false
},
{
"fieldType": "EXPRESSION",
"ballerinaType": "(ai:BaseToolKit|ai:ToolConfig|ai:FunctionTool)[]",
Expand Down Expand Up @@ -865,11 +860,6 @@
"description": "The tools available for the agent"
},
"types": [
{
"fieldType": "EXPRESSION_SET",
"ballerinaType": "(ai:BaseToolKit|ai:ToolConfig|ai:FunctionTool)[]",
"selected": false
},
{
"fieldType": "EXPRESSION",
"ballerinaType": "(ai:BaseToolKit|ai:ToolConfig|ai:FunctionTool)[]",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,11 +172,6 @@
"description": "The tools available for the agent"
},
"types": [
{
"fieldType": "EXPRESSION_SET",
"ballerinaType": "(ai:BaseToolKit|ai:ToolConfig|ai:FunctionTool)[]",
"selected": false
},
{
"fieldType": "EXPRESSION",
"ballerinaType": "(ai:BaseToolKit|ai:ToolConfig|ai:FunctionTool)[]",
Expand Down Expand Up @@ -667,11 +662,6 @@
"description": "The tools available for the agent"
},
"types": [
{
"fieldType": "EXPRESSION_SET",
"ballerinaType": "(ai:BaseToolKit|ai:ToolConfig|ai:FunctionTool)[]",
"selected": false
},
{
"fieldType": "EXPRESSION",
"ballerinaType": "(ai:BaseToolKit|ai:ToolConfig|ai:FunctionTool)[]",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,11 +174,6 @@
"description": "The tools available for the agent"
},
"types": [
{
"fieldType": "EXPRESSION_SET",
"ballerinaType": "(ai:BaseToolKit|ai:ToolConfig|ai:FunctionTool)[]",
"selected": false
},
{
"fieldType": "EXPRESSION",
"ballerinaType": "(ai:BaseToolKit|ai:ToolConfig|ai:FunctionTool)[]",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,11 +98,6 @@
"description": "The tools available for the agent"
},
"types": [
{
"fieldType": "EXPRESSION_SET",
"ballerinaType": "(ai:BaseToolKit|ai:ToolConfig|ai:FunctionTool)[]",
"selected": false
},
{
"fieldType": "EXPRESSION",
"ballerinaType": "(ai:BaseToolKit|ai:ToolConfig|ai:FunctionTool)[]",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,11 +98,6 @@
"description": "The tools available for the agent"
},
"types": [
{
"fieldType": "EXPRESSION_SET",
"ballerinaType": "(ai:BaseToolKit|ai:ToolConfig|ai:FunctionTool)[]",
"selected": false
},
{
"fieldType": "EXPRESSION",
"ballerinaType": "(ai:BaseToolKit|ai:ToolConfig|ai:FunctionTool)[]",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,11 +98,6 @@
"description": "The tools available for the agent"
},
"types": [
{
"fieldType": "EXPRESSION_SET",
"ballerinaType": "(ai:BaseToolKit|ai:ToolConfig|ai:FunctionTool)[]",
"selected": false
},
{
"fieldType": "EXPRESSION",
"ballerinaType": "(ai:BaseToolKit|ai:ToolConfig|ai:FunctionTool)[]",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,11 +106,6 @@
"description": "The tools available for the agent"
},
"types": [
{
"fieldType": "EXPRESSION_SET",
"ballerinaType": "(ai:BaseToolKit|ai:ToolConfig|ai:FunctionTool)[]",
"selected": false
},
{
"fieldType": "EXPRESSION",
"ballerinaType": "(ai:BaseToolKit|ai:ToolConfig|ai:FunctionTool)[]",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,11 +106,6 @@
"description": "The tools available for the agent"
},
"types": [
{
"fieldType": "EXPRESSION_SET",
"ballerinaType": "(ai:BaseToolKit|ai:ToolConfig|ai:FunctionTool)[]",
"selected": false
},
{
"fieldType": "EXPRESSION",
"ballerinaType": "(ai:BaseToolKit|ai:ToolConfig|ai:FunctionTool)[]",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,11 +188,6 @@
"description": "The tools available for the agent"
},
"types": [
{
"fieldType": "EXPRESSION_SET",
"ballerinaType": "(ai:BaseToolKit|ai:ToolConfig|ai:FunctionTool)[]",
"selected": false
},
{
"fieldType": "EXPRESSION",
"ballerinaType": "(ai:BaseToolKit|ai:ToolConfig|ai:FunctionTool)[]",
Expand Down Expand Up @@ -682,15 +677,10 @@
"description": "The tools available for the agent"
},
"types": [
{
"fieldType": "EXPRESSION_SET",
"ballerinaType": "(ai:BaseToolKit|ai:ToolConfig|ai:FunctionTool)[]",
"selected": true
},
{
"fieldType": "EXPRESSION",
"ballerinaType": "(ai:BaseToolKit|ai:ToolConfig|ai:FunctionTool)[]",
"selected": false
"selected": true
}
],
"value": "[]",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,11 +188,6 @@
"description": "The tools available for the agent"
},
"types": [
{
"fieldType": "EXPRESSION_SET",
"ballerinaType": "(ai:BaseToolKit|ai:ToolConfig|ai:FunctionTool)[]",
"selected": false
},
{
"fieldType": "EXPRESSION",
"ballerinaType": "(ai:BaseToolKit|ai:ToolConfig|ai:FunctionTool)[]",
Expand Down Expand Up @@ -682,15 +677,10 @@
"description": "The tools available for the agent"
},
"types": [
{
"fieldType": "EXPRESSION_SET",
"ballerinaType": "(ai:BaseToolKit|ai:ToolConfig|ai:FunctionTool)[]",
"selected": true
},
{
"fieldType": "EXPRESSION",
"ballerinaType": "(ai:BaseToolKit|ai:ToolConfig|ai:FunctionTool)[]",
"selected": false
"selected": true
}
],
"value": "[]",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,11 +123,6 @@
"description": "The entity headers"
},
"types": [
{
"fieldType": "MAPPING_EXPRESSION",
"ballerinaType": "map<string|string[]>",
"selected": false
},
{
"fieldType": "EXPRESSION",
"ballerinaType": "map<string|string[]>?",
Expand Down Expand Up @@ -548,11 +543,6 @@
"description": "The entity headers"
},
"types": [
{
"fieldType": "MAPPING_EXPRESSION",
"ballerinaType": "map<string|string[]>",
"selected": false
},
{
"fieldType": "EXPRESSION",
"ballerinaType": "map<string|string[]>?",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -930,11 +930,6 @@
"description": "The entity headers"
},
"types": [
{
"fieldType": "MAPPING_EXPRESSION",
"ballerinaType": "map<string|string[]>",
"selected": false
},
{
"fieldType": "EXPRESSION",
"ballerinaType": "map<string|string[]>?",
Expand Down Expand Up @@ -2000,11 +1995,6 @@
"description": "The error stack trace to be logged"
},
"types": [
{
"fieldType": "EXPRESSION_SET",
"ballerinaType": "error:StackFrame[]",
"selected": false
},
{
"fieldType": "EXPRESSION",
"ballerinaType": "error:StackFrame[]?",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -468,15 +468,10 @@
"label": "J"
},
"types": [
{
"fieldType": "MAPPING_EXPRESSION",
"ballerinaType": "map<json>",
"selected": false
},
{
"fieldType": "EXPRESSION",
"ballerinaType": "map<json>",
"selected": false
"selected": true
}
],
"value": "[]",
Expand Down
Loading
Loading