8484
8585from box_sdk_gen .schemas .ai_agent_extract_structured import AiAgentExtractStructured
8686
87+ from box_sdk_gen .schemas .ai_agent_long_text_tool import AiAgentLongTextTool
88+
8789client : BoxClient = get_default_client ()
8890
8991
@@ -216,6 +218,17 @@ def testAIExtract():
216218 ai_extract_agent_config : AiAgentExtract = client .ai .get_ai_agent_default_config (
217219 GetAiAgentDefaultConfigMode .EXTRACT , language = 'en-US'
218220 )
221+ long_text_config_with_no_embeddings : AiAgentLongTextTool = AiAgentLongTextTool (
222+ system_message = ai_extract_agent_config .long_text .system_message ,
223+ prompt_template = ai_extract_agent_config .long_text .prompt_template ,
224+ model = ai_extract_agent_config .long_text .model ,
225+ num_tokens_for_completion = ai_extract_agent_config .long_text .num_tokens_for_completion ,
226+ llm_endpoint_params = ai_extract_agent_config .long_text .llm_endpoint_params ,
227+ )
228+ agent_ignoring_overriding_embeddings_model : AiAgentExtract = AiAgentExtract (
229+ basic_text = ai_extract_agent_config .basic_text ,
230+ long_text = long_text_config_with_no_embeddings ,
231+ )
219232 uploaded_files : Files = client .uploads .upload_file (
220233 UploadFileAttributes (
221234 name = '' .join ([get_uuid (), '.txt' ]),
@@ -230,7 +243,7 @@ def testAIExtract():
230243 response : AiResponse = client .ai .create_ai_extract (
231244 'firstName, lastName, location, yearOfBirth, company' ,
232245 [AiItemBase (id = file .id )],
233- ai_agent = ai_extract_agent_config ,
246+ ai_agent = agent_ignoring_overriding_embeddings_model ,
234247 )
235248 expected_response : str = (
236249 '{"firstName": "John", "lastName": "Doe", "location": "San Francisco", "yearOfBirth": "1990", "company": "Box"}'
@@ -246,14 +259,12 @@ def testAIExtractStructuredWithFields():
246259 GetAiAgentDefaultConfigMode .EXTRACT_STRUCTURED , language = 'en-US'
247260 )
248261 )
249- long_text_config_with_no_embeddings : AiAgentExtractStructured = (
250- AiAgentExtractStructured (
251- system_message = ai_extract_structured_agent_config .long_text .system_message ,
252- prompt_template = ai_extract_structured_agent_config .long_text .prompt_template ,
253- model = ai_extract_structured_agent_config .long_text .model ,
254- num_tokens_for_completion = ai_extract_structured_agent_config .long_text .num_tokens_for_completion ,
255- llm_endpoint_params = ai_extract_structured_agent_config .long_text .llm_endpoint_params ,
256- )
262+ long_text_config_with_no_embeddings : AiAgentLongTextTool = AiAgentLongTextTool (
263+ system_message = ai_extract_structured_agent_config .long_text .system_message ,
264+ prompt_template = ai_extract_structured_agent_config .long_text .prompt_template ,
265+ model = ai_extract_structured_agent_config .long_text .model ,
266+ num_tokens_for_completion = ai_extract_structured_agent_config .long_text .num_tokens_for_completion ,
267+ llm_endpoint_params = ai_extract_structured_agent_config .long_text .llm_endpoint_params ,
257268 )
258269 agent_ignoring_overriding_embeddings_model : AiAgentExtractStructured = (
259270 AiAgentExtractStructured (
0 commit comments