spiderforce4ai 2.5.4__py3-none-any.whl → 2.5.6__py3-none-any.whl

Sign up to get free protection for your applications and to get access to all the features.
@@ -750,7 +750,10 @@ class SpiderForce4AI:
750
750
  for result in successful_results:
751
751
  try:
752
752
  # Process content synchronously since it's not an async method
753
- result.extraction_result = agent.process_content(result.url, result.markdown)
753
+ extraction_result = agent.process_content(result.url, result.markdown)
754
+ if extraction_result:
755
+ result.extraction_result = extraction_result
756
+ logger.info(f"Successfully processed and transformed content for {result.url}")
754
757
  progress.update(llm_task, advance=1)
755
758
  except Exception as e:
756
759
  console.print(f"[red]Error in post-extraction processing for {result.url}: {str(e)}[/red]")
@@ -889,7 +892,9 @@ class SpiderForce4AI:
889
892
  # Apply transformation if provided
890
893
  if config.post_agent_transformer_function:
891
894
  try:
895
+ logger.info(f"Starting transformer function execution for {result.url}")
892
896
  result.extraction_result = config.post_agent_transformer_function(llm_response)
897
+ logger.info(f"Successfully executed transformer function for {result.url}")
893
898
  except KeyError as e:
894
899
  # Log missing field but continue with transformation
895
900
  missing_field = str(e).strip("'")
@@ -897,7 +902,9 @@ class SpiderForce4AI:
897
902
  # Add missing field with empty value
898
903
  llm_response[missing_field] = ""
899
904
  # Retry transformation with added field
905
+ logger.info(f"Retrying transformer function for {result.url} after adding missing field")
900
906
  result.extraction_result = config.post_agent_transformer_function(llm_response)
907
+ logger.info(f"Successfully executed transformer function on retry for {result.url}")
901
908
  except Exception as e:
902
909
  logger.error(f"Transformer error for {result.url}: {str(e)}")
903
910
  result.extraction_result = llm_response # Use original response if transform fails
@@ -306,8 +306,11 @@ class PostExtractionAgent:
306
306
  logger.warning(f"Missing field '{field}' in LLM response for {url}, setting to None")
307
307
  result[field] = None
308
308
 
309
- result = self.config.custom_transform_function(result)
310
- logger.info(f"Applied custom transformation for {url}")
309
+ logger.info(f"Executing custom transformer function for {url}")
310
+ transformed_result = self.config.custom_transform_function(result)
311
+ logger.info(f"Successfully applied custom transformation for {url}")
312
+ logger.info(f"Webhook response sent for {url}")
313
+ return transformed_result # Return the transformed result
311
314
  except Exception as e:
312
315
  error_msg = f"Warning: Issue in custom transform for {url}: {str(e)}"
313
316
  logger.warning(error_msg)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: spiderforce4ai
3
- Version: 2.5.4
3
+ Version: 2.5.6
4
4
  Summary: Python wrapper for SpiderForce4AI HTML-to-Markdown conversion service with LLM post-processing
5
5
  Home-page: https://petertam.pro
6
6
  Author: Piotr Tamulewicz
@@ -0,0 +1,7 @@
1
+ spiderforce4ai/__init__.py,sha256=BlrRIrtpDUHjmDedqgXP1KbAAsAH9vwFPncUR5VGGyM,44804
2
+ spiderforce4ai/post_extraction_agent.py,sha256=OP8_gVWzWdQ3B6d0vd54IbcopHSVpAkWrUmnrDVT5_k,16327
3
+ spiderforce4ai-2.5.6.dist-info/METADATA,sha256=TjgWAC0iHPrSaedmZL-1PZWCoLEMZ7NJUhd74tfWj6A,9012
4
+ spiderforce4ai-2.5.6.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
5
+ spiderforce4ai-2.5.6.dist-info/entry_points.txt,sha256=ibARQxOlDiL1ho12zbDZt4Uq5RKSIk_qk159ZlZ46hc,59
6
+ spiderforce4ai-2.5.6.dist-info/top_level.txt,sha256=Kth7A21Js7DCp0j5XBBi-FE45SCLouZkeNZU__Yr9Yk,15
7
+ spiderforce4ai-2.5.6.dist-info/RECORD,,
@@ -1,7 +0,0 @@
1
- spiderforce4ai/__init__.py,sha256=YgzX9AKw_q2Jp_jZq17UgOuoeJeBRfWz9I73TOBerSs,44100
2
- spiderforce4ai/post_extraction_agent.py,sha256=vQcna7GMYXQBRaU6uCeGi4-uZYDVAaW0dugFFEscs6o,16059
3
- spiderforce4ai-2.5.4.dist-info/METADATA,sha256=_oVetBxWh-pkOdK1BNKfMJgPv3uDGgSlKeiIfDR2gvo,9012
4
- spiderforce4ai-2.5.4.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
5
- spiderforce4ai-2.5.4.dist-info/entry_points.txt,sha256=ibARQxOlDiL1ho12zbDZt4Uq5RKSIk_qk159ZlZ46hc,59
6
- spiderforce4ai-2.5.4.dist-info/top_level.txt,sha256=Kth7A21Js7DCp0j5XBBi-FE45SCLouZkeNZU__Yr9Yk,15
7
- spiderforce4ai-2.5.4.dist-info/RECORD,,