Skip to content

Commit 8b6d9dd

Browse files
authored
Merge pull request #521 from ScrapeGraphAI/temp
allignmenet
2 parents e75b574 + 157d59d commit 8b6d9dd

10 files changed

+28
-16
lines changed

CHANGELOG.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,22 @@
1-
## [1.13.0-beta.6](https://github.com/ScrapeGraphAI/Scrapegraph-ai/compare/v1.13.0-beta.5...v1.13.0-beta.6) (2024-08-09)
1+
## [1.12.2](https://github.com/ScrapeGraphAI/Scrapegraph-ai/compare/v1.12.1...v1.12.2) (2024-08-07)
2+
23

34

45
### Bug Fixes
56

7+
* generate answer node omni ([b52e4a3](https://github.com/ScrapeGraphAI/Scrapegraph-ai/commit/b52e4a390bb23ca55922e47046db558e1969a047))
8+
9+
## [1.12.1](https://github.com/ScrapeGraphAI/Scrapegraph-ai/compare/v1.12.0...v1.12.1) (2024-08-07)
10+
611
* **FetchNode:** missing bracket syntax error ([50edbcc](https://github.com/ScrapeGraphAI/Scrapegraph-ai/commit/50edbcc7f80e419f72f3f69249fec4a37597ef9a))
712

813
## [1.13.0-beta.5](https://github.com/ScrapeGraphAI/Scrapegraph-ai/compare/v1.13.0-beta.4...v1.13.0-beta.5) (2024-08-08)
914

1015

1116
### Bug Fixes
1217

18+
* generate answer node pdf has a bug ([625ca9f](https://github.com/ScrapeGraphAI/Scrapegraph-ai/commit/625ca9f22a91a292a844ddb45e0edc767bf24711))
19+
1320
* **chunking:** count tokens from words instead of characters ([5ec2de9](https://github.com/ScrapeGraphAI/Scrapegraph-ai/commit/5ec2de9e1a14def5596738b6cdf769f5039a246d)), closes [#513](https://github.com/ScrapeGraphAI/Scrapegraph-ai/issues/513)
1421

1522
## [1.13.0-beta.4](https://github.com/ScrapeGraphAI/Scrapegraph-ai/compare/v1.13.0-beta.3...v1.13.0-beta.4) (2024-08-07)
@@ -63,6 +70,7 @@
6370
* **release:** 1.11.0-beta.11 [skip ci] ([579d3f3](https://github.com/ScrapeGraphAI/Scrapegraph-ai/commit/579d3f394b54636673baf8e9f619f1c57a2ecce4))
6471
* **release:** 1.11.0-beta.12 [skip ci] ([cf2a17e](https://github.com/ScrapeGraphAI/Scrapegraph-ai/commit/cf2a17ed5d79c62271fd9ea8ec89793884b04b56))
6572

73+
6674
## [1.12.0](https://github.com/ScrapeGraphAI/Scrapegraph-ai/compare/v1.11.3...v1.12.0) (2024-08-06)
6775

6876

examples/local_models/smart_scraper_ollama.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,9 @@
2222
# ************************************************
2323
# Create the SmartScraperGraph instance and run it
2424
# ************************************************
25-
2625
smart_scraper_graph = SmartScraperGraph(
27-
prompt="List me all the titles of the website",
28-
source="https://sport.sky.it/nba?gr=www",
26+
prompt="Find some information about what does the company do, the name and a contact email.",
27+
source="https://scrapegraphai.com/",
2928
config=graph_config
3029
)
3130

examples/openai/search_graph_openai.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
graph_config = {
1717
"llm": {
1818
"api_key": openai_key,
19-
"model": "gpt-3.5-turbo",
19+
"model": "gpt-4o",
2020
},
2121
"max_results": 2,
2222
"verbose": True,

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
[project]
22
name = "scrapegraphai"
33

4+
45
version = "1.13.0b6"
56

67

scrapegraphai/graphs/script_creator_multi_graph.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,4 +113,4 @@ def run(self) -> str:
113113
"""
114114
inputs = {"user_prompt": self.prompt, "urls": self.source}
115115
self.final_state, self.execution_info = self.graph.execute(inputs)
116-
return self.final_state.get("merged_script", "Failed to generate the script.")
116+
return self.final_state.get("merged_script", "Failed to generate the script.")

scrapegraphai/graphs/search_link_graph.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,4 +101,4 @@ def run(self) -> str:
101101
inputs = {"user_prompt": self.prompt, self.input_key: self.source}
102102
self.final_state, self.execution_info = self.graph.execute(inputs)
103103

104-
return self.final_state.get("parsed_doc", "No answer found.")
104+
return self.final_state.get("parsed_doc", "No answer found.")

scrapegraphai/nodes/conditional_node.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
"""
22
Module for implementing the conditional node
33
"""
4-
4+
from typing import Optional, List
55
from .base_node import BaseNode
66

7-
87
class ConditionalNode(BaseNode):
98
"""
109
A node that determines the next step in the graph's execution flow based on
@@ -29,16 +28,21 @@ class ConditionalNode(BaseNode):
2928
3029
"""
3130

32-
def __init__(self, key_name: str, node_name="ConditionalNode"):
31+
def __init__(self,
32+
input: str,
33+
output: List[str],
34+
node_config: Optional[dict] = None,
35+
node_name: str = "GenerateAnswerCSV",
36+
):
3337
"""
3438
Initializes the node with the key to check and the next node names based on the condition.
3539
3640
Args:
3741
key_name (str): The name of the key to check in the state.
3842
"""
3943

40-
super().__init__(node_name, "conditional_node")
41-
self.key_name = key_name
44+
super().__init__(node_name, "node", input, output, 2, node_config)
45+
4246

4347
def execute(self, state: dict) -> dict:
4448
"""

scrapegraphai/nodes/generate_answer_csv_node.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ def __init__(
5858
self.verbose = (
5959
False if node_config is None else node_config.get("verbose", False)
6060
)
61-
61+
6262
self.additional_info = node_config.get("additional_info")
6363

6464
def execute(self, state):

scrapegraphai/nodes/generate_answer_omni_node.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ def execute(self, state: dict) -> dict:
105105
template=template_no_chunk_omni_prompt,
106106
input_variables=["question"],
107107
partial_variables={
108-
"context": chunk,
108+
"context": doc,
109109
"format_instructions": format_instructions,
110110
"img_desc": imag_desc,
111111
},

scrapegraphai/nodes/generate_answer_pdf_node.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ def __init__(
5656
self.llm_model = node_config["llm_model"]
5757
if isinstance(node_config["llm_model"], ChatOllama):
5858
self.llm_model.format="json"
59-
59+
6060
self.verbose = (
6161
False if node_config is None else node_config.get("verbose", False)
6262
)
@@ -114,7 +114,7 @@ def execute(self, state):
114114
template=template_no_chunks_pdf_prompt,
115115
input_variables=["question"],
116116
partial_variables={
117-
"context":chunk,
117+
"context": doc,
118118
"format_instructions": format_instructions,
119119
},
120120
)

0 commit comments

Comments
 (0)