@@ -84,7 +84,7 @@ def create_task(
84
84
system_prompt_extension : typing .Optional [str ] = OMIT ,
85
85
request_options : typing .Optional [RequestOptions ] = None ,
86
86
) -> typing .Union [WrappedStructuredTaskCreatedResponse [T ], WrappedTaskCreatedResponse ]:
87
- if schema is not None :
87
+ if schema is not None and schema is not OMIT :
88
88
structured_output = json .dumps (schema .model_json_schema ())
89
89
90
90
res = super ().create_task (
@@ -145,7 +145,7 @@ def get_task(
145
145
) -> typing .Union [TaskViewWithOutput [T ], TaskView ]:
146
146
res = super ().get_task (task_id , request_options = request_options )
147
147
148
- if schema is not None :
148
+ if schema is not None and schema is not OMIT :
149
149
return _parse_task_view_with_output (res , schema )
150
150
else :
151
151
return res
@@ -219,7 +219,7 @@ async def create_task(
219
219
system_prompt_extension : typing .Optional [str ] = OMIT ,
220
220
request_options : typing .Optional [RequestOptions ] = None ,
221
221
) -> typing .Union [AsyncWrappedStructuredTaskCreatedResponse [T ], AsyncWrappedTaskCreatedResponse ]:
222
- if schema is not None :
222
+ if schema is not None and schema is not OMIT :
223
223
structured_output = json .dumps (schema .model_json_schema ())
224
224
225
225
res = await super ().create_task (
@@ -278,7 +278,7 @@ async def get_task(
278
278
) -> typing .Union [TaskViewWithOutput [T ], TaskView ]:
279
279
res = await super ().get_task (task_id , request_options = request_options )
280
280
281
- if schema is not None :
281
+ if schema is not None and schema is not OMIT :
282
282
return _parse_task_view_with_output (res , schema )
283
283
else :
284
284
return res
0 commit comments