spiderforce4ai 2.4.9__tar.gz → 2.5__tar.gz
Sign up to get free protection for your applications and to get access to all the features.
- {spiderforce4ai-2.4.9 → spiderforce4ai-2.5}/PKG-INFO +1 -1
- {spiderforce4ai-2.4.9 → spiderforce4ai-2.5}/pyproject.toml +1 -1
- {spiderforce4ai-2.4.9 → spiderforce4ai-2.5}/setup.py +1 -1
- {spiderforce4ai-2.4.9 → spiderforce4ai-2.5}/spiderforce4ai/__init__.py +17 -1
- {spiderforce4ai-2.4.9 → spiderforce4ai-2.5}/spiderforce4ai.egg-info/PKG-INFO +1 -1
- {spiderforce4ai-2.4.9 → spiderforce4ai-2.5}/README.md +0 -0
- {spiderforce4ai-2.4.9 → spiderforce4ai-2.5}/setup.cfg +0 -0
- {spiderforce4ai-2.4.9 → spiderforce4ai-2.5}/spiderforce4ai/post_extraction_agent.py +0 -0
- {spiderforce4ai-2.4.9 → spiderforce4ai-2.5}/spiderforce4ai.egg-info/SOURCES.txt +0 -0
- {spiderforce4ai-2.4.9 → spiderforce4ai-2.5}/spiderforce4ai.egg-info/dependency_links.txt +0 -0
- {spiderforce4ai-2.4.9 → spiderforce4ai-2.5}/spiderforce4ai.egg-info/entry_points.txt +0 -0
- {spiderforce4ai-2.4.9 → spiderforce4ai-2.5}/spiderforce4ai.egg-info/not-zip-safe +0 -0
- {spiderforce4ai-2.4.9 → spiderforce4ai-2.5}/spiderforce4ai.egg-info/requires.txt +0 -0
- {spiderforce4ai-2.4.9 → spiderforce4ai-2.5}/spiderforce4ai.egg-info/top_level.txt +0 -0
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
4
4
|
|
5
5
|
[project]
|
6
6
|
name = "spiderforce4ai"
|
7
|
-
version = "2.
|
7
|
+
version = "2.5"
|
8
8
|
description = "Python wrapper for SpiderForce4AI HTML-to-Markdown conversion service with LLM post-processing"
|
9
9
|
readme = "README.md"
|
10
10
|
authors = [
|
@@ -7,7 +7,7 @@ with open("README.md", encoding="utf-8") as f:
|
|
7
7
|
|
8
8
|
setup(
|
9
9
|
name="spiderforce4ai",
|
10
|
-
version="2.
|
10
|
+
version="2.5",
|
11
11
|
author="Piotr Tamulewicz",
|
12
12
|
author_email="pt@petertam.pro",
|
13
13
|
description="Python wrapper for SpiderForce4AI HTML-to-Markdown conversion service with LLM post-processing",
|
@@ -5,6 +5,9 @@ import asyncio
|
|
5
5
|
import aiohttp
|
6
6
|
import json
|
7
7
|
import logging
|
8
|
+
|
9
|
+
logger = logging.getLogger(__name__)
|
10
|
+
import logging
|
8
11
|
from typing import List, Dict, Union, Optional, Tuple, Callable, Any
|
9
12
|
from dataclasses import dataclass, asdict
|
10
13
|
from urllib.parse import urljoin, urlparse
|
@@ -877,7 +880,20 @@ class SpiderForce4AI:
|
|
877
880
|
|
878
881
|
for result in successful_results:
|
879
882
|
try:
|
880
|
-
|
883
|
+
# Get LLM response
|
884
|
+
llm_response = agent.process_content(result.url, result.markdown)
|
885
|
+
if llm_response:
|
886
|
+
# Add URL to the response before transformation
|
887
|
+
llm_response['url'] = result.url
|
888
|
+
# Apply transformation if provided
|
889
|
+
if config.post_agent_transformer_function:
|
890
|
+
try:
|
891
|
+
result.extraction_result = config.post_agent_transformer_function(llm_response)
|
892
|
+
except Exception as e:
|
893
|
+
logger.error(f"Transformer error for {result.url}: {str(e)}")
|
894
|
+
result.extraction_result = llm_response # Use original response if transform fails
|
895
|
+
else:
|
896
|
+
result.extraction_result = llm_response
|
881
897
|
progress.update(llm_task, advance=1)
|
882
898
|
except Exception as e:
|
883
899
|
console.print(f"[red]Error in post-extraction processing for {result.url}: {str(e)}[/red]")
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|