@@ -328,21 +328,11 @@ def testAIExtractStructuredWithFields():
328328 ],
329329 ai_agent = agent_ignoring_overriding_embeddings_model ,
330330 )
331- assert to_string (
332- get_value_from_object_raw_data (response , 'answer.hobby' )
333- ) == to_string (['guitar' ])
334- assert (
335- to_string (get_value_from_object_raw_data (response , 'answer.firstName' ))
336- == 'John'
337- )
338- assert (
339- to_string (get_value_from_object_raw_data (response , 'answer.lastName' )) == 'Doe'
340- )
341- assert (
342- to_string (get_value_from_object_raw_data (response , 'answer.dateOfBirth' ))
343- == '1990-07-04'
344- )
345- assert to_string (get_value_from_object_raw_data (response , 'answer.age' )) == '34'
331+ assert to_string (response .answer .get ('hobby' )) == to_string (['guitar' ])
332+ assert to_string (response .answer .get ('firstName' )) == 'John'
333+ assert to_string (response .answer .get ('lastName' )) == 'Doe'
334+ assert to_string (response .answer .get ('dateOfBirth' )) == '1990-07-04'
335+ assert to_string (response .answer .get ('age' )) == '34'
346336 assert response .completion_reason == 'done'
347337 client .files .delete_file_by_id (file .id )
348338
@@ -407,21 +397,11 @@ def testAIExtractStructuredWithMetadataTemplate():
407397 template_key = template_key , scope = 'enterprise'
408398 ),
409399 )
410- assert (
411- to_string (get_value_from_object_raw_data (response , 'answer.firstName' ))
412- == 'John'
413- )
414- assert (
415- to_string (get_value_from_object_raw_data (response , 'answer.lastName' )) == 'Doe'
416- )
417- assert (
418- to_string (get_value_from_object_raw_data (response , 'answer.dateOfBirth' ))
419- == '1990-07-04T00:00:00Z'
420- )
421- assert to_string (get_value_from_object_raw_data (response , 'answer.age' )) == '34'
422- assert to_string (
423- get_value_from_object_raw_data (response , 'answer.hobby' )
424- ) == to_string (['guitar' ])
400+ assert to_string (response .answer .get ('firstName' )) == 'John'
401+ assert to_string (response .answer .get ('lastName' )) == 'Doe'
402+ assert to_string (response .answer .get ('dateOfBirth' )) == '1990-07-04T00:00:00Z'
403+ assert to_string (response .answer .get ('age' )) == '34'
404+ assert to_string (response .answer .get ('hobby' )) == to_string (['guitar' ])
425405 assert response .completion_reason == 'done'
426406 client .metadata_templates .delete_metadata_template (
427407 DeleteMetadataTemplateScope .ENTERPRISE , template .template_key
0 commit comments