@@ -15,9 +15,9 @@ def my_callback(
1515 b : str | int = "" ,
1616 c : bool | None = False ,
1717 d : list [str ] = (),
18- e : dict [str , Any ] = () ,
18+ e : dict [str , Any ] | None = None ,
1919) -> str :
20- return f"{ a } -{ b } -{ c } -{ d } "
20+ return f"{ a } -{ b } -{ c } -{ d } - { e } "
2121
2222
2323def my_callback_2 (ctx , n : int ) -> tuple [list [str ], str | None ]:
@@ -45,29 +45,29 @@ def test_to_dict_with_no_outputs(self):
4545 "function" : {
4646 "name" : "my_callback" ,
4747 "parameters" : [
48- {"name" : "a" , "type " : {"type" : "integer" }},
48+ {"name" : "a" , "schema " : {"type" : "integer" }},
4949 {
50- "default" : "" ,
5150 "name" : "b" ,
52- "type" : {"type" : ["string" , "integer" ]},
51+ "schema" : {"type" : ["string" , "integer" ]},
52+ "default" : "" ,
5353 },
5454 {
55- "default" : False ,
5655 "name" : "c" ,
57- "type" : {"type" : ["boolean" , "null" ]},
56+ "schema" : {"type" : ["boolean" , "null" ]},
57+ "default" : False ,
5858 },
5959 {
60- "default" : (),
6160 "name" : "d" ,
62- "type" : {"items" : {"type" : "string" }, "type" : "array" },
61+ "schema" : {"items" : {"type" : "string" }, "type" : "array" },
62+ "default" : (),
6363 },
6464 {
65- "default" : (),
6665 "name" : "e" ,
67- "type" : {"additionalProperties" : {}, "type" : "object" },
66+ "schema" : {'type' : ['object' , 'null' ]},
67+ "default" : None ,
6868 },
6969 ],
70- "returnType " : {"type" : "string" },
70+ "return " : {"schema" : { " type" : "string" } },
7171 },
7272 "inputs" : [
7373 {"id" : "a" , "property" : "value" },
@@ -95,14 +95,14 @@ def test_to_dict_with_two_outputs(self):
9595 {
9696 "function" : {
9797 "name" : "my_callback_2" ,
98- "parameters" : [{"name" : "n" , "type " : {"type" : "integer" }}],
99- "returnType " : {
98+ "parameters" : [{"name" : "n" , "schema " : {"type" : "integer" }}],
99+ "return " : { "schema" : {
100100 "items" : [
101101 {"items" : {"type" : "string" }, "type" : "array" },
102102 {"type" : ["string" , "null" ]},
103103 ],
104104 "type" : "array" ,
105- },
105+ }} ,
106106 },
107107 "inputs" : [{"id" : "n" , "property" : "value" }],
108108 "outputs" : [
0 commit comments