Skip to content

Commit 89d8d54

Browse files
box-sdk-buildbox-sdk-build
andauthored
test: Fix AI extract structured test to ignore overriding embeddings model (box/box-codegen#651) (#456)
Co-authored-by: box-sdk-build <box-sdk-build@box.com>
1 parent 60c2b8b commit 89d8d54

File tree

2 files changed

+17
-2
lines changed

2 files changed

+17
-2
lines changed

.codegen.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{ "engineHash": "038fca8", "specHash": "3dc3f1e", "version": "1.10.0" }
1+
{ "engineHash": "3b1ef0e", "specHash": "3dc3f1e", "version": "1.10.0" }

test/ai.py

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,21 @@ def testAIExtractStructuredWithFields():
240240
GetAiAgentDefaultConfigMode.EXTRACT_STRUCTURED, language='en-US'
241241
)
242242
)
243+
long_text_config_with_no_embeddings: AiAgentExtractStructured = (
244+
AiAgentExtractStructured(
245+
system_message=ai_extract_structured_agent_config.long_text.system_message,
246+
prompt_template=ai_extract_structured_agent_config.long_text.prompt_template,
247+
model=ai_extract_structured_agent_config.long_text.model,
248+
num_tokens_for_completion=ai_extract_structured_agent_config.long_text.num_tokens_for_completion,
249+
llm_endpoint_params=ai_extract_structured_agent_config.long_text.llm_endpoint_params,
250+
)
251+
)
252+
agent_ignoring_overriding_embeddings_model: AiAgentExtractStructured = (
253+
AiAgentExtractStructured(
254+
basic_text=ai_extract_structured_agent_config.basic_text,
255+
long_text=long_text_config_with_no_embeddings,
256+
)
257+
)
243258
uploaded_files: Files = client.uploads.upload_file(
244259
UploadFileAttributes(
245260
name=''.join([get_uuid(), '.txt']),
@@ -294,7 +309,7 @@ def testAIExtractStructuredWithFields():
294309
],
295310
),
296311
],
297-
ai_agent=ai_extract_structured_agent_config,
312+
ai_agent=agent_ignoring_overriding_embeddings_model,
298313
)
299314
assert to_string(get_value_from_object_raw_data(response, 'firstName')) == 'John'
300315
assert to_string(get_value_from_object_raw_data(response, 'lastName')) == 'Doe'

0 commit comments

Comments
 (0)