Skip to content

Commit 9905be8

Browse files
committed
fix: script creator multi
1 parent c181fea commit 9905be8

9 files changed

+23
-43
lines changed

examples/fireworks/script_multi_generator_fireworks.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,18 +26,18 @@
2626
# ************************************************
2727
# Create the ScriptCreatorGraph instance and run it
2828
# ************************************************
29-
3029
urls=[
31-
"https://perinim.github.io/",
32-
"https://perinim.github.io/cv/"
30+
"https://schultzbergagency.com/emil-raste-karlsen/",
31+
"https://schultzbergagency.com/johanna-hedberg/",
3332
]
3433

3534
# ************************************************
3635
# Create the ScriptCreatorGraph instance and run it
3736
# ************************************************
3837

3938
script_creator_graph = ScriptCreatorMultiGraph(
40-
prompt="Who is Marco Perini?",
39+
prompt="Find information about actors",
40+
# also accepts a string with the already downloaded HTML code
4141
source=urls,
4242
config=graph_config
4343
)

examples/mistral/script_multi_generator_mistral.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,16 +29,17 @@
2929
# ************************************************
3030

3131
urls=[
32-
"https://perinim.github.io/",
33-
"https://perinim.github.io/cv/"
32+
"https://schultzbergagency.com/emil-raste-karlsen/",
33+
"https://schultzbergagency.com/johanna-hedberg/",
3434
]
3535

3636
# ************************************************
3737
# Create the ScriptCreatorGraph instance and run it
3838
# ************************************************
3939

4040
script_creator_graph = ScriptCreatorMultiGraph(
41-
prompt="Who is Marco Perini?",
41+
prompt="Find information about actors",
42+
# also accepts a string with the already downloaded HTML code
4243
source=urls,
4344
config=graph_config
4445
)

examples/nemotron/script_multi_generator_nemotron.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,16 +29,17 @@
2929
# ************************************************
3030

3131
urls=[
32-
"https://perinim.github.io/",
33-
"https://perinim.github.io/cv/"
32+
"https://schultzbergagency.com/emil-raste-karlsen/",
33+
"https://schultzbergagency.com/johanna-hedberg/",
3434
]
3535

3636
# ************************************************
3737
# Create the ScriptCreatorGraph instance and run it
3838
# ************************************************
3939

4040
script_creator_graph = ScriptCreatorMultiGraph(
41-
prompt="Who is Marco Perini?",
41+
prompt="Find information about actors",
42+
# also accepts a string with the already downloaded HTML code
4243
source=urls,
4344
config=graph_config
4445
)

examples/openai/script_multi_generator_openai.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,16 +29,17 @@
2929
# ************************************************
3030

3131
urls=[
32-
"https://perinim.github.io/",
33-
"https://perinim.github.io/cv/"
32+
"https://schultzbergagency.com/emil-raste-karlsen/",
33+
"https://schultzbergagency.com/johanna-hedberg/",
3434
]
3535

3636
# ************************************************
3737
# Create the ScriptCreatorGraph instance and run it
3838
# ************************************************
3939

4040
script_creator_graph = ScriptCreatorMultiGraph(
41-
prompt="Who is Marco Perini?",
41+
prompt="Find information about actors",
42+
# also accepts a string with the already downloaded HTML code
4243
source=urls,
4344
config=graph_config
4445
)

scrapegraphai/graphs/json_scraper_multi_graph.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,7 @@ def __init__(self, prompt: str, source: List[str],
4545
config: dict, schema: Optional[BaseModel] = None):
4646

4747
self.max_results = config.get("max_results", 3)
48-
4948
self.copy_config = safe_deepcopy(config)
50-
5149
self.copy_schema = deepcopy(schema)
5250

5351
super().__init__(prompt, config, source, schema)

scrapegraphai/graphs/markdown_scraper_multi_graph.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"""
22
MDScraperMultiGraph Module
33
"""
4-
from copy import copy, deepcopy
4+
from copy import deepcopy
55
from typing import List, Optional
66
from pydantic import BaseModel
77
from .base_graph import BaseGraph

scrapegraphai/graphs/script_creator_multi_graph.py

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""
22
ScriptCreatorMultiGraph Module
33
"""
4+
from copy import deepcopy
45
from typing import List, Optional
56
from pydantic import BaseModel
67
from .base_graph import BaseGraph
@@ -45,7 +46,7 @@ def __init__(self, prompt: str, source: List[str],
4546
self.max_results = config.get("max_results", 3)
4647

4748
self.copy_config = safe_deepcopy(config)
48-
49+
self.copy_schema = deepcopy(schema)
4950
super().__init__(prompt, config, source, schema)
5051

5152
def _create_graph(self) -> BaseGraph:
@@ -55,19 +56,14 @@ def _create_graph(self) -> BaseGraph:
5556
BaseGraph: A graph instance representing the web scraping and searching workflow.
5657
"""
5758

58-
script_generator_instance = ScriptCreatorGraph(
59-
prompt="",
60-
source="",
61-
config=self.copy_config,
62-
schema=self.schema
63-
)
64-
6559
graph_iterator_node = GraphIteratorNode(
6660
input="user_prompt & urls",
6761
output=["scripts"],
6862
node_config={
69-
"graph_instance": script_generator_instance,
70-
}
63+
"graph_instance": ScriptCreatorGraph,
64+
"scraper_config": self.copy_config,
65+
},
66+
schema=self.copy_schema
7167
)
7268

7369
merge_scripts_node = MergeGeneratedScriptsNode(

scrapegraphai/graphs/smart_scraper_multi_graph.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -60,13 +60,6 @@ def _create_graph(self) -> BaseGraph:
6060
BaseGraph: A graph instance representing the web scraping and searching workflow.
6161
"""
6262

63-
# smart_scraper_instance = SmartScraperGraph(
64-
# prompt="",
65-
# source="",
66-
# config=self.copy_config,
67-
# schema=self.copy_schema
68-
# )
69-
7063
graph_iterator_node = GraphIteratorNode(
7164
input="user_prompt & urls",
7265
output=["results"],

scrapegraphai/graphs/xml_scraper_multi_graph.py

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,7 @@ def __init__(self, prompt: str, source: List[str],
4545
config: dict, schema: Optional[BaseModel] = None):
4646

4747
self.copy_config = safe_deepcopy(config)
48-
4948
self.copy_schema = deepcopy(schema)
50-
5149
super().__init__(prompt, config, source, schema)
5250

5351
def _create_graph(self) -> BaseGraph:
@@ -57,14 +55,6 @@ def _create_graph(self) -> BaseGraph:
5755
Returns:
5856
BaseGraph: A graph instance representing the web scraping and searching workflow.
5957
"""
60-
61-
# smart_scraper_instance = XMLScraperGraph(
62-
# prompt="",
63-
# source="",
64-
# config=self.copy_config,
65-
# schema=self.copy_schema
66-
# )
67-
6858
graph_iterator_node = GraphIteratorNode(
6959
input="user_prompt & jsons",
7060
output=["results"],

0 commit comments

Comments
 (0)