@@ -46,7 +46,7 @@ async def test_tool_output_json_schema():
4646
4747 agent = Agent (
4848 'test' ,
49- output_type = [ToolOutput (bool , name = 'alice' , description = 'Dreaming' ), ToolOutput (bool , name = 'bob' )],
49+ output_type = [ToolOutput (bool , name = 'alice' ), ToolOutput (bool , name = 'bob' )],
5050 )
5151 assert agent .output_json_schema () == snapshot (
5252 {
@@ -88,63 +88,6 @@ async def test_tool_output_json_schema():
8888 }
8989 )
9090
91- agent = Agent (
92- 'test' ,
93- output_type = [ToolOutput (bool , name = 'alice' )] * 3 ,
94- )
95- assert agent .output_json_schema () == snapshot (
96- {
97- 'type' : 'object' ,
98- 'properties' : {
99- 'result' : {
100- 'anyOf' : [
101- {
102- 'type' : 'object' ,
103- 'properties' : {
104- 'kind' : {'type' : 'string' , 'const' : 'alice' },
105- 'data' : {
106- 'properties' : {'response' : {'type' : 'boolean' }},
107- 'required' : ['response' ],
108- 'type' : 'object' ,
109- },
110- },
111- 'required' : ['kind' , 'data' ],
112- 'additionalProperties' : False ,
113- },
114- {
115- 'type' : 'object' ,
116- 'properties' : {
117- 'kind' : {'type' : 'string' , 'const' : 'alice_2' },
118- 'data' : {
119- 'properties' : {'response' : {'type' : 'boolean' }},
120- 'required' : ['response' ],
121- 'type' : 'object' ,
122- },
123- },
124- 'required' : ['kind' , 'data' ],
125- 'additionalProperties' : False ,
126- },
127- {
128- 'type' : 'object' ,
129- 'properties' : {
130- 'kind' : {'type' : 'string' , 'const' : 'alice_3' },
131- 'data' : {
132- 'properties' : {'response' : {'type' : 'boolean' }},
133- 'required' : ['response' ],
134- 'type' : 'object' ,
135- },
136- },
137- 'required' : ['kind' , 'data' ],
138- 'additionalProperties' : False ,
139- },
140- ]
141- }
142- },
143- 'required' : ['result' ],
144- 'additionalProperties' : False ,
145- }
146- )
147-
14891
14992async def test_native_output_json_schema ():
15093 agent = Agent (
@@ -372,7 +315,7 @@ async def test_image_output_json_schema():
372315async def test_override_output_json_schema ():
373316 agent = Agent ('test' )
374317 assert agent .output_json_schema () == snapshot ({'type' : 'string' })
375- output_type = [ToolOutput (bool , name = 'alice' , description = 'Dreaming...' )]
318+ output_type = [ToolOutput (bool )]
376319 assert agent .output_json_schema (output_type = output_type ) == snapshot (
377320 {'type' : 'object' , 'properties' : {'response' : {'type' : 'boolean' }}, 'required' : ['response' ]}
378321 )
0 commit comments