Skip to content

Commit 6361d56

Browse files
committed
use the same json schema fixer as xlam does, an operator entered main with xlam
Signed-off-by: dafnapension <[email protected]>
1 parent 280e745 commit 6361d56

14 files changed

+56
-16
lines changed

prepare/cards/bfcl.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
Copy,
77
ExecuteExpression,
88
FilterByExpression,
9+
FixJsonSchemaOfParameterTypes,
910
Set,
1011
)
1112
from unitxt.stream_operators import DeleteSplits, JoinStreams
@@ -35,7 +36,7 @@
3536
DeleteSplits(splits=["questions", "answers"]),
3637
Copy(field="question/0/0/content", to_field="query"),
3738
Copy(field="function", to_field="tools"),
38-
"operators.fix_json_schema",
39+
FixJsonSchemaOfParameterTypes(main_field="tools"),
3940
# Process ground truth data in this dataset, which is a provided as a list of options per field,
4041
# and convert it into a list of explicit tool calls
4142
#
@@ -105,7 +106,7 @@
105106
DeleteSplits(splits=["questions", "answers"]),
106107
Copy(field="question/*/0", to_field="dialog"),
107108
Copy(field="function", to_field="tools"),
108-
"operators.fix_json_schema",
109+
FixJsonSchemaOfParameterTypes(main_field="tools"),
109110
FilterByExpression(
110111
expression="all(isinstance(v, dict) for d in ground_truth for k, v in d.items())"
111112
),
@@ -159,7 +160,7 @@
159160
preprocess_steps=[
160161
Copy(field="question/*/0", to_field="dialog"),
161162
Copy(field="function", to_field="tools"),
162-
"operators.fix_json_schema",
163+
FixJsonSchemaOfParameterTypes(main_field="tools"),
163164
Set(fields={"reference_calls": []}),
164165
],
165166
task="tasks.tool_calling.multi_turn",

src/unitxt/catalog/cards/bfcl/multi_turn/java_v3.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,10 @@
3737
"field": "function",
3838
"to_field": "tools"
3939
},
40-
"operators.fix_json_schema",
40+
{
41+
"__type__": "fix_json_schema_of_parameter_types",
42+
"main_field": "tools"
43+
},
4144
{
4245
"__type__": "filter_by_expression",
4346
"expression": "all(isinstance(v, dict) for d in ground_truth for k, v in d.items())"

src/unitxt/catalog/cards/bfcl/multi_turn/javascript_v3.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,10 @@
3737
"field": "function",
3838
"to_field": "tools"
3939
},
40-
"operators.fix_json_schema",
40+
{
41+
"__type__": "fix_json_schema_of_parameter_types",
42+
"main_field": "tools"
43+
},
4144
{
4245
"__type__": "filter_by_expression",
4346
"expression": "all(isinstance(v, dict) for d in ground_truth for k, v in d.items())"

src/unitxt/catalog/cards/bfcl/multi_turn/live_irrelevance_v3.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,10 @@
2121
"field": "function",
2222
"to_field": "tools"
2323
},
24-
"operators.fix_json_schema",
24+
{
25+
"__type__": "fix_json_schema_of_parameter_types",
26+
"main_field": "tools"
27+
},
2528
{
2629
"__type__": "set",
2730
"fields": {

src/unitxt/catalog/cards/bfcl/multi_turn/live_multiple_v3.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,10 @@
3737
"field": "function",
3838
"to_field": "tools"
3939
},
40-
"operators.fix_json_schema",
40+
{
41+
"__type__": "fix_json_schema_of_parameter_types",
42+
"main_field": "tools"
43+
},
4144
{
4245
"__type__": "filter_by_expression",
4346
"expression": "all(isinstance(v, dict) for d in ground_truth for k, v in d.items())"

src/unitxt/catalog/cards/bfcl/multi_turn/live_parallel_multiple_v3.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,10 @@
3737
"field": "function",
3838
"to_field": "tools"
3939
},
40-
"operators.fix_json_schema",
40+
{
41+
"__type__": "fix_json_schema_of_parameter_types",
42+
"main_field": "tools"
43+
},
4144
{
4245
"__type__": "filter_by_expression",
4346
"expression": "all(isinstance(v, dict) for d in ground_truth for k, v in d.items())"

src/unitxt/catalog/cards/bfcl/multi_turn/live_parallel_v3.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,10 @@
3737
"field": "function",
3838
"to_field": "tools"
3939
},
40-
"operators.fix_json_schema",
40+
{
41+
"__type__": "fix_json_schema_of_parameter_types",
42+
"main_field": "tools"
43+
},
4144
{
4245
"__type__": "filter_by_expression",
4346
"expression": "all(isinstance(v, dict) for d in ground_truth for k, v in d.items())"

src/unitxt/catalog/cards/bfcl/multi_turn/live_relevance_v3.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,10 @@
2121
"field": "function",
2222
"to_field": "tools"
2323
},
24-
"operators.fix_json_schema",
24+
{
25+
"__type__": "fix_json_schema_of_parameter_types",
26+
"main_field": "tools"
27+
},
2528
{
2629
"__type__": "set",
2730
"fields": {

src/unitxt/catalog/cards/bfcl/multi_turn/live_simple_v3.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,10 @@
3737
"field": "function",
3838
"to_field": "tools"
3939
},
40-
"operators.fix_json_schema",
40+
{
41+
"__type__": "fix_json_schema_of_parameter_types",
42+
"main_field": "tools"
43+
},
4144
{
4245
"__type__": "filter_by_expression",
4346
"expression": "all(isinstance(v, dict) for d in ground_truth for k, v in d.items())"

src/unitxt/catalog/cards/bfcl/multi_turn/multiple_v3.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,10 @@
3737
"field": "function",
3838
"to_field": "tools"
3939
},
40-
"operators.fix_json_schema",
40+
{
41+
"__type__": "fix_json_schema_of_parameter_types",
42+
"main_field": "tools"
43+
},
4144
{
4245
"__type__": "filter_by_expression",
4346
"expression": "all(isinstance(v, dict) for d in ground_truth for k, v in d.items())"

0 commit comments

Comments
 (0)