GuglielmoTor commited on
Commit
16c56d2
·
verified ·
1 Parent(s): a556bfd

Update features/insight_and_tasks/agents/task_extraction_model.py

Browse files
features/insight_and_tasks/agents/task_extraction_model.py CHANGED
@@ -144,7 +144,8 @@ TEXT TO ANALYZE:
144
  if response_json_text:
145
  try:
146
  # Validate and parse the JSON response using the Pydantic model
147
- return TaskExtractionOutput.model_validate_json(response_json_text)
 
148
  except Exception as e: # Catch Pydantic validation errors or JSON parsing errors
149
  raise ValueError(f"Failed to parse or validate API response: {e}\nRaw response text: {response_json_text}")
150
  else:
 
144
  if response_json_text:
145
  try:
146
  # Validate and parse the JSON response using the Pydantic model
147
+ task_output = TaskExtractionOutput.model_validate_json(response_json_text)
148
+ return task_output, quarter, year, days_remaining
149
  except Exception as e: # Catch Pydantic validation errors or JSON parsing errors
150
  raise ValueError(f"Failed to parse or validate API response: {e}\nRaw response text: {response_json_text}")
151
  else: