Skip to content

Python scraper based on AI

Merge branch 'pre/beta' into main

Marco Vinciguerra98cf5f1f83c4
diff --cc CHANGELOG.md
index 7449d264,fb9ab58a..436433a6
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@@ -1,9 -1,42 +1,46 @@@
+## [1.30.0](https://github.com/ScrapeGraphAI/Scrapegraph-ai/compare/v1.29.0...v1.30.0) (2024-11-06)
+
+ ## [1.30.0-beta.5](https://github.com/ScrapeGraphAI/Scrapegraph-ai/compare/v1.30.0-beta.4...v1.30.0-beta.5) (2024-11-18)
+
+
+ ### Bug Fixes
+
+ * try to infer possible provider from the model name, resolves [#805](https://github.com/ScrapeGraphAI/Scrapegraph-ai/issues/805) ([d2d0312](https://github.com/ScrapeGraphAI/Scrapegraph-ai/commit/d2d0312dc618fde305e650981cac90add93ec552))
+
+ ## [1.30.0-beta.4](https://github.com/ScrapeGraphAI/Scrapegraph-ai/compare/v1.30.0-beta.3...v1.30.0-beta.4) (2024-11-16)
+
+
+ ### Bug Fixes
+
+ * generate answer node ([49897c4](https://github.com/ScrapeGraphAI/Scrapegraph-ai/commit/49897c4d2ee9950438d99dda6987bc8ba402a6ad))
+
+ ## [1.30.0-beta.3](https://github.com/ScrapeGraphAI/Scrapegraph-ai/compare/v1.30.0-beta.2...v1.30.0-beta.3) (2024-11-15)
+
+
+ ### Features
+
+ * refactoring of generate answer node ([1f465e6](https://github.com/ScrapeGraphAI/Scrapegraph-ai/commit/1f465e636d2869e4e36555124767de026d3a66ae))
+
+ ## [1.30.0-beta.2](https://github.com/ScrapeGraphAI/Scrapegraph-ai/compare/v1.30.0-beta.1...v1.30.0-beta.2) (2024-11-09)
+
+
+ ### Bug Fixes
+
+ * fix generate answer node ([d332e21](https://github.com/ScrapeGraphAI/Scrapegraph-ai/commit/d332e216db15e48ca4163a9f74818c4c6874568c))
+
+
+ ### Docs
+
+ * Improved Turkish README ([f665138](https://github.com/ScrapeGraphAI/Scrapegraph-ai/commit/f665138b3dc2597088ca2c6a2e8be6cc4ce956d2))
+
+ ## [1.30.0-beta.1](https://github.com/ScrapeGraphAI/Scrapegraph-ai/compare/v1.29.0...v1.30.0-beta.1) (2024-11-05)
+
### Features
+* update chromium ([38c6dd2](https://github.com/ScrapeGraphAI/Scrapegraph-ai/commit/38c6dd2aa1ce31b981eb8c35a56e9533d19df81b))
++
+ * Turkish language support has been added to README.md ([60f673d](https://github.com/ScrapeGraphAI/Scrapegraph-ai/commit/60f673dc39cba70706291e11211b9ad180860e24))
## [1.29.0](https://github.com/ScrapeGraphAI/Scrapegraph-ai/compare/v1.28.0...v1.29.0) (2024-11-04)
diff --cc pyproject.toml
index 2cef768f,3211252f..9cbe60f7
--- a/pyproject.toml
+++ b/pyproject.toml
@@@ -2,7 -2,8 +2,9 @@@
name = "scrapegraphai"
- version = "1.30.0"
++
+ version = "1.30.0b5"
+
diff --cc scrapegraphai/nodes/generate_answer_node.py
index 8e89ff39,01d834b8..758cdaf1
--- a/scrapegraphai/nodes/generate_answer_node.py
+++ b/scrapegraphai/nodes/generate_answer_node.py
@@@ -122,10 -138,26 +138,17 @@@ class GenerateAnswerNode(BaseNode)
partial_variables={"context": doc, "format_instructions": format_instructions}
)
chain = prompt | self.llm_model
++
+ try:
+ raw_response = invoke_with_timeout(chain, {"question": user_prompt}, self.timeout)
+ except Timeout:
+ state.update({self.output[0]: {"error": "Response timeout exceeded"}})
+ return state
+
if output_parser:
- try:
- answer = output_parser.parse(raw_response.content)
- except JSONDecodeError:
- lines = raw_response.split('\n')
- if lines[0].strip().startswith('```'):
- lines = lines[1:]
- if lines[-1].strip().endswith('```'):
- lines = lines[:-1]
- cleaned_response = '\n'.join(lines)
- answer = output_parser.parse(cleaned_response)
- else:
- answer = raw_response.content
+ chain = chain | output_parser
+ answer = chain.invoke({"question": user_prompt})
state.update({self.output[0]: answer})
return state