@@ -84,7 +84,7 @@ def create_task(
8484 system_prompt_extension : typing .Optional [str ] = OMIT ,
8585 request_options : typing .Optional [RequestOptions ] = None ,
8686 ) -> typing .Union [WrappedStructuredTaskCreatedResponse [T ], WrappedTaskCreatedResponse ]:
87- if schema is not None :
87+ if schema is not None and schema is not OMIT :
8888 structured_output = json .dumps (schema .model_json_schema ())
8989
9090 res = super ().create_task (
@@ -145,7 +145,7 @@ def get_task(
145145 ) -> typing .Union [TaskViewWithOutput [T ], TaskView ]:
146146 res = super ().get_task (task_id , request_options = request_options )
147147
148- if schema is not None :
148+ if schema is not None and schema is not OMIT :
149149 return _parse_task_view_with_output (res , schema )
150150 else :
151151 return res
@@ -219,7 +219,7 @@ async def create_task(
219219 system_prompt_extension : typing .Optional [str ] = OMIT ,
220220 request_options : typing .Optional [RequestOptions ] = None ,
221221 ) -> typing .Union [AsyncWrappedStructuredTaskCreatedResponse [T ], AsyncWrappedTaskCreatedResponse ]:
222- if schema is not None :
222+ if schema is not None and schema is not OMIT :
223223 structured_output = json .dumps (schema .model_json_schema ())
224224
225225 res = await super ().create_task (
@@ -278,7 +278,7 @@ async def get_task(
278278 ) -> typing .Union [TaskViewWithOutput [T ], TaskView ]:
279279 res = await super ().get_task (task_id , request_options = request_options )
280280
281- if schema is not None :
281+ if schema is not None and schema is not OMIT :
282282 return _parse_task_view_with_output (res , schema )
283283 else :
284284 return res
0 commit comments