mirror of
https://github.com/VinciGit00/Scrapegraph-ai.git
synced 2026-07-12 21:01:56 +08:00
feat: refactoring of mdscraper
This commit is contained in:
parent
528a9746fe
commit
3b7b701a89
@ -37,7 +37,7 @@ graph_config = {
|
||||
# ************************************************
|
||||
|
||||
md_scraper_graph = DocumentScraperGraph(
|
||||
prompt="List me all the authors, title and genres of the books",
|
||||
prompt="List me all the projects",
|
||||
source=text, # Pass the content of the file, not the file object
|
||||
config=graph_config
|
||||
)
|
||||
|
||||
@ -85,10 +85,13 @@ class ParseNode(BaseNode):
|
||||
else:
|
||||
docs_transformed = docs_transformed[0]
|
||||
|
||||
link_urls, img_urls = self._extract_urls(docs_transformed.page_content, source)
|
||||
try:
|
||||
link_urls, img_urls = self._extract_urls(docs_transformed.page_content, source)
|
||||
except Exception as e:
|
||||
link_urls, img_urls = "", ""
|
||||
|
||||
chunk_size = self.chunk_size
|
||||
chunk_size = min(chunk_size - 500, int(chunk_size * 0.75))
|
||||
chunk_size = min(chunk_size - 500, int(chunk_size * 0.8))
|
||||
|
||||
if isinstance(docs_transformed, Document):
|
||||
chunks = split_text_into_chunks(text=docs_transformed.page_content,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user