spiderforce4ai 2.5.7__tar.gz → 2.5.8__tar.gz
Sign up to get free protection for your applications and to get access to all the features.
- {spiderforce4ai-2.5.7 → spiderforce4ai-2.5.8}/PKG-INFO +1 -1
- {spiderforce4ai-2.5.7 → spiderforce4ai-2.5.8}/pyproject.toml +1 -1
- {spiderforce4ai-2.5.7 → spiderforce4ai-2.5.8}/setup.py +1 -1
- {spiderforce4ai-2.5.7 → spiderforce4ai-2.5.8}/spiderforce4ai/post_extraction_agent.py +12 -0
- {spiderforce4ai-2.5.7 → spiderforce4ai-2.5.8}/spiderforce4ai.egg-info/PKG-INFO +1 -1
- {spiderforce4ai-2.5.7 → spiderforce4ai-2.5.8}/README.md +0 -0
- {spiderforce4ai-2.5.7 → spiderforce4ai-2.5.8}/setup.cfg +0 -0
- {spiderforce4ai-2.5.7 → spiderforce4ai-2.5.8}/spiderforce4ai/__init__.py +0 -0
- {spiderforce4ai-2.5.7 → spiderforce4ai-2.5.8}/spiderforce4ai.egg-info/SOURCES.txt +0 -0
- {spiderforce4ai-2.5.7 → spiderforce4ai-2.5.8}/spiderforce4ai.egg-info/dependency_links.txt +0 -0
- {spiderforce4ai-2.5.7 → spiderforce4ai-2.5.8}/spiderforce4ai.egg-info/entry_points.txt +0 -0
- {spiderforce4ai-2.5.7 → spiderforce4ai-2.5.8}/spiderforce4ai.egg-info/not-zip-safe +0 -0
- {spiderforce4ai-2.5.7 → spiderforce4ai-2.5.8}/spiderforce4ai.egg-info/requires.txt +0 -0
- {spiderforce4ai-2.5.7 → spiderforce4ai-2.5.8}/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.5.
|
7
|
+
version = "2.5.8"
|
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.5.
|
10
|
+
version="2.5.8",
|
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",
|
@@ -167,6 +167,8 @@ class PostExtractionAgent:
|
|
167
167
|
backup_path = self.config.output_file.with_suffix(f".bak_{int(time.time())}")
|
168
168
|
self.config.output_file.rename(backup_path)
|
169
169
|
self.config.output_file.touch()
|
170
|
+
# Initialize empty results dictionary
|
171
|
+
self.results = {}
|
170
172
|
|
171
173
|
def _process_single_content(self, url: str, content: str) -> Optional[Dict]:
|
172
174
|
"""Process a single piece of content through the LLM."""
|
@@ -259,8 +261,18 @@ class PostExtractionAgent:
|
|
259
261
|
try:
|
260
262
|
if self.config.combine_output and self.config.output_file:
|
261
263
|
self.results[url] = result
|
264
|
+
# Save combined results
|
262
265
|
with open(self.config.output_file, 'w') as f:
|
263
266
|
json.dump(self.results, f, indent=2)
|
267
|
+
|
268
|
+
# Cleanup backup files after successful save
|
269
|
+
for backup_file in self.config.output_file.parent.glob(f"{self.config.output_file.stem}.bak_*"):
|
270
|
+
try:
|
271
|
+
backup_file.unlink()
|
272
|
+
logger.info(f"Cleaned up backup file: {backup_file}")
|
273
|
+
except Exception as e:
|
274
|
+
logger.warning(f"Failed to remove backup file {backup_file}: {e}")
|
275
|
+
|
264
276
|
elif not self.config.combine_output and self.config.output_file:
|
265
277
|
individual_file = self.config.output_file.parent / f"{url.replace('/', '_')}.json"
|
266
278
|
with open(individual_file, 'w') as f:
|
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
|