Skip to content

Commit 0d58762

Browse files
committed
Improve test coverage
1 parent 09184e2 commit 0d58762

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

tests/test_agent.py

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6184,6 +6184,38 @@ async def test_text_output_json_schema():
61846184
assert agent.output_json_schema() == snapshot({'type': 'string'})
61856185

61866186

6187+
async def test_auto_output_json_schema():
6188+
agent = Agent('test', output_type=bool)
6189+
assert agent.output_json_schema() == snapshot(
6190+
{
6191+
'type': 'object',
6192+
'properties': {
6193+
'result': {
6194+
'anyOf': [
6195+
{
6196+
'type': 'object',
6197+
'properties': {
6198+
'kind': {'type': 'string', 'const': 'final_result'},
6199+
'data': {
6200+
'properties': {'response': {'type': 'boolean'}},
6201+
'required': ['response'],
6202+
'type': 'object',
6203+
},
6204+
},
6205+
'required': ['kind', 'data'],
6206+
'additionalProperties': False,
6207+
'title': 'final_result',
6208+
'description': 'The final response which ends this conversation',
6209+
}
6210+
]
6211+
}
6212+
},
6213+
'required': ['result'],
6214+
'additionalProperties': False,
6215+
}
6216+
)
6217+
6218+
61876219
async def test_tool_output_json_schema():
61886220
agent = Agent(
61896221
'test',

0 commit comments

Comments
 (0)