Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
VinciGit00 committed Sep 27, 2024
2 parents 7c39b06 + e5efc9a commit e9d6f54
Show file tree
Hide file tree
Showing 11 changed files with 31 additions and 44 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
## [1.24.1](https://github.com/ScrapeGraphAI/Scrapegraph-ai/compare/v1.24.0...v1.24.1) (2024-09-26)


### Bug Fixes

* script creator multi ([9905be8](https://github.com/ScrapeGraphAI/Scrapegraph-ai/commit/9905be8a37dc1ff4b90fe9b8be987887253be8bd))

## [1.24.0](https://github.com/ScrapeGraphAI/Scrapegraph-ai/compare/v1.23.1...v1.24.0) (2024-09-26)


Expand Down
8 changes: 4 additions & 4 deletions examples/fireworks/script_multi_generator_fireworks.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,18 @@
# ************************************************
# Create the ScriptCreatorGraph instance and run it
# ************************************************

urls=[
"https://perinim.github.io/",
"https://perinim.github.io/cv/"
"https://schultzbergagency.com/emil-raste-karlsen/",
"https://schultzbergagency.com/johanna-hedberg/",
]

# ************************************************
# Create the ScriptCreatorGraph instance and run it
# ************************************************

script_creator_graph = ScriptCreatorMultiGraph(
prompt="Who is Marco Perini?",
prompt="Find information about actors",
# also accepts a string with the already downloaded HTML code
source=urls,
config=graph_config
)
Expand Down
7 changes: 4 additions & 3 deletions examples/mistral/script_multi_generator_mistral.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,17 @@
# ************************************************

urls=[
"https://perinim.github.io/",
"https://perinim.github.io/cv/"
"https://schultzbergagency.com/emil-raste-karlsen/",
"https://schultzbergagency.com/johanna-hedberg/",
]

# ************************************************
# Create the ScriptCreatorGraph instance and run it
# ************************************************

script_creator_graph = ScriptCreatorMultiGraph(
prompt="Who is Marco Perini?",
prompt="Find information about actors",
# also accepts a string with the already downloaded HTML code
source=urls,
config=graph_config
)
Expand Down
7 changes: 4 additions & 3 deletions examples/nemotron/script_multi_generator_nemotron.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,17 @@
# ************************************************

urls=[
"https://perinim.github.io/",
"https://perinim.github.io/cv/"
"https://schultzbergagency.com/emil-raste-karlsen/",
"https://schultzbergagency.com/johanna-hedberg/",
]

# ************************************************
# Create the ScriptCreatorGraph instance and run it
# ************************************************

script_creator_graph = ScriptCreatorMultiGraph(
prompt="Who is Marco Perini?",
prompt="Find information about actors",
# also accepts a string with the already downloaded HTML code
source=urls,
config=graph_config
)
Expand Down
7 changes: 4 additions & 3 deletions examples/openai/script_multi_generator_openai.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,17 @@
# ************************************************

urls=[
"https://perinim.github.io/",
"https://perinim.github.io/cv/"
"https://schultzbergagency.com/emil-raste-karlsen/",
"https://schultzbergagency.com/johanna-hedberg/",
]

# ************************************************
# Create the ScriptCreatorGraph instance and run it
# ************************************************

script_creator_graph = ScriptCreatorMultiGraph(
prompt="Who is Marco Perini?",
prompt="Find information about actors",
# also accepts a string with the already downloaded HTML code
source=urls,
config=graph_config
)
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[project]
name = "scrapegraphai"

version = "1.24.0"
version = "1.24.1"


description = "A web scraping library based on LangChain which uses LLM and direct graph logic to create scraping pipelines."
Expand Down
2 changes: 0 additions & 2 deletions scrapegraphai/graphs/json_scraper_multi_graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,7 @@ def __init__(self, prompt: str, source: List[str],
config: dict, schema: Optional[BaseModel] = None):

self.max_results = config.get("max_results", 3)

self.copy_config = safe_deepcopy(config)

self.copy_schema = deepcopy(schema)

super().__init__(prompt, config, source, schema)
Expand Down
2 changes: 1 addition & 1 deletion scrapegraphai/graphs/markdown_scraper_multi_graph.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""
MDScraperMultiGraph Module
"""
from copy import copy, deepcopy
from copy import deepcopy
from typing import List, Optional
from pydantic import BaseModel
from .base_graph import BaseGraph
Expand Down
16 changes: 6 additions & 10 deletions scrapegraphai/graphs/script_creator_multi_graph.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
ScriptCreatorMultiGraph Module
"""
from copy import deepcopy
from typing import List, Optional
from pydantic import BaseModel
from .base_graph import BaseGraph
Expand Down Expand Up @@ -45,7 +46,7 @@ def __init__(self, prompt: str, source: List[str],
self.max_results = config.get("max_results", 3)

self.copy_config = safe_deepcopy(config)

self.copy_schema = deepcopy(schema)
super().__init__(prompt, config, source, schema)

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

script_generator_instance = ScriptCreatorGraph(
prompt="",
source="",
config=self.copy_config,
schema=self.schema
)

graph_iterator_node = GraphIteratorNode(
input="user_prompt & urls",
output=["scripts"],
node_config={
"graph_instance": script_generator_instance,
}
"graph_instance": ScriptCreatorGraph,
"scraper_config": self.copy_config,
},
schema=self.copy_schema
)

merge_scripts_node = MergeGeneratedScriptsNode(
Expand Down
7 changes: 0 additions & 7 deletions scrapegraphai/graphs/smart_scraper_multi_graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,6 @@ def _create_graph(self) -> BaseGraph:
BaseGraph: A graph instance representing the web scraping and searching workflow.
"""

# smart_scraper_instance = SmartScraperGraph(
# prompt="",
# source="",
# config=self.copy_config,
# schema=self.copy_schema
# )

graph_iterator_node = GraphIteratorNode(
input="user_prompt & urls",
output=["results"],
Expand Down
10 changes: 0 additions & 10 deletions scrapegraphai/graphs/xml_scraper_multi_graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,7 @@ def __init__(self, prompt: str, source: List[str],
config: dict, schema: Optional[BaseModel] = None):

self.copy_config = safe_deepcopy(config)

self.copy_schema = deepcopy(schema)

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

def _create_graph(self) -> BaseGraph:
Expand All @@ -57,14 +55,6 @@ def _create_graph(self) -> BaseGraph:
Returns:
BaseGraph: A graph instance representing the web scraping and searching workflow.
"""

# smart_scraper_instance = XMLScraperGraph(
# prompt="",
# source="",
# config=self.copy_config,
# schema=self.copy_schema
# )

graph_iterator_node = GraphIteratorNode(
input="user_prompt & jsons",
output=["results"],
Expand Down

0 comments on commit e9d6f54

Please sign in to comment.