diff --git a/.codegen.json b/.codegen.json index ff89bc9f..9969bcb4 100644 --- a/.codegen.json +++ b/.codegen.json @@ -1 +1 @@ -{ "engineHash": "f9e2519", "specHash": "ccdb456", "version": "10.3.0" } +{ "engineHash": "b181eba", "specHash": "ccdb456", "version": "10.3.0" } diff --git a/docs/ai.md b/docs/ai.md index 1c9ab630..96e3d76b 100644 --- a/docs/ai.md +++ b/docs/ai.md @@ -246,6 +246,7 @@ client.ai.create_ai_extract_structured( ], ), ], + include_confidence_score=True, ai_agent=ai_extract_structured_agent_basic_text_config, ) ``` diff --git a/test/ai.py b/test/ai.py index 1658d4e6..00e1100c 100644 --- a/test/ai.py +++ b/test/ai.py @@ -252,7 +252,12 @@ def testAIExtractStructuredWithFields(): parent=UploadFileAttributesParentField(id='0'), ), string_to_byte_stream( - 'My name is John Doe. I was born in 4th July 1990. I am 34 years old. My hobby is guitar.' + ''.join( + [ + 'My name is John Doe. I was born in 4th July 1990. I am 34 years old. My hobby is guitar. My UUID is ', + get_uuid(), + ] + ) ), ) file: FileFull = uploaded_files.entries[0] @@ -300,8 +305,10 @@ def testAIExtractStructuredWithFields(): ], ), ], + include_confidence_score=True, ai_agent=ai_extract_structured_agent_basic_text_config, ) + assert not response.confidence_score == None assert to_string(response.answer.get('hobby')) == to_string(['guitar']) assert to_string(response.answer.get('firstName')) == 'John' assert to_string(response.answer.get('lastName')) == 'Doe' @@ -318,7 +325,12 @@ def testAIExtractStructuredWithMetadataTemplate(): parent=UploadFileAttributesParentField(id='0'), ), string_to_byte_stream( - 'My name is John Doe. I was born in 4th July 1990. I am 34 years old. My hobby is guitar.' + ''.join( + [ + 'My name is John Doe. I was born in 4th July 1990. I am 34 years old. My hobby is guitar. My UUID is ', + get_uuid(), + ] + ) ), ) file: FileFull = uploaded_files.entries[0]