mirror of
https://github.com/VinciGit00/Scrapegraph-ai.git
synced 2026-06-23 21:00:30 +08:00
Merge remote-tracking branch 'upstream/main' into ernie
This commit is contained in:
commit
1a404e358d
@ -1,3 +1,10 @@
|
||||
## [1.5.6](https://github.com/VinciGit00/Scrapegraph-ai/compare/v1.5.5...v1.5.6) (2024-06-05)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* getter ([67d83cf](https://github.com/VinciGit00/Scrapegraph-ai/commit/67d83cff46d8ea606b8972c364ab4c56e6fa4fe4))
|
||||
|
||||
## [1.5.5](https://github.com/VinciGit00/Scrapegraph-ai/compare/v1.5.4...v1.5.5) (2024-06-05)
|
||||
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
name = "scrapegraphai"
|
||||
|
||||
|
||||
version = "1.5.5"
|
||||
version = "1.5.6"
|
||||
|
||||
|
||||
description = "A web scraping library based on LangChain which uses LLM and direct graph logic to create scraping pipelines."
|
||||
|
||||
@ -83,35 +83,35 @@ class GenerateAnswerNode(BaseNode):
|
||||
|
||||
# Use tqdm to add progress bar
|
||||
for i, chunk in enumerate(tqdm(doc, desc="Processing chunks", disable=not self.verbose)):
|
||||
if self.node_config("schema", None) is None and len(doc) == 1:
|
||||
if self.node_config.get("schema", None) is None and len(doc) == 1:
|
||||
prompt = PromptTemplate(
|
||||
template=template_no_chunks,
|
||||
input_variables=["question"],
|
||||
partial_variables={"context": chunk.page_content,
|
||||
"format_instructions": format_instructions})
|
||||
elif self.node_config("schema", None) is not None and len(doc) == 1:
|
||||
elif self.node_config.get("schema", None) is not None and len(doc) == 1:
|
||||
prompt = PromptTemplate(
|
||||
template=template_no_chunks_with_schema,
|
||||
input_variables=["question"],
|
||||
partial_variables={"context": chunk.page_content,
|
||||
"format_instructions": format_instructions,
|
||||
"schema": self.node_config("schema", None)
|
||||
"schema": self.node_config.get("schema", None)
|
||||
})
|
||||
elif self.node_config("schema", None) is None and len(doc) > 1:
|
||||
elif self.node_config.get("schema", None) is None and len(doc) > 1:
|
||||
prompt = PromptTemplate(
|
||||
template=template_chunks,
|
||||
input_variables=["question"],
|
||||
partial_variables={"context": chunk.page_content,
|
||||
"chunk_id": i + 1,
|
||||
"format_instructions": format_instructions})
|
||||
elif self.node_config("schema", None) is not None and len(doc) > 1:
|
||||
elif self.node_config.get("schema", None) is not None and len(doc) > 1:
|
||||
prompt = PromptTemplate(
|
||||
template=template_chunks_with_schema,
|
||||
input_variables=["question"],
|
||||
partial_variables={"context": chunk.page_content,
|
||||
"chunk_id": i + 1,
|
||||
"format_instructions": format_instructions,
|
||||
"schema": self.node_config("schema", None)})
|
||||
"schema": self.node_config.get("schema", None)})
|
||||
|
||||
# Dynamically name the chains based on their index
|
||||
chain_name = f"chunk{i+1}"
|
||||
|
||||
Loading…
Reference in New Issue
Block a user