Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .codegen.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{ "engineHash": "f9e2519", "specHash": "ccdb456", "version": "10.3.0" }
{ "engineHash": "b181eba", "specHash": "ccdb456", "version": "10.3.0" }
1 change: 1 addition & 0 deletions docs/ai.md
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,7 @@ client.ai.create_ai_extract_structured(
],
),
],
include_confidence_score=True,
ai_agent=ai_extract_structured_agent_basic_text_config,
)
```
Expand Down
16 changes: 14 additions & 2 deletions test/ai.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down Expand Up @@ -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'
Expand All @@ -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]
Expand Down