Skip to content

Commit dc21ede

Browse files
authored
Merge pull request #904 from ScrapeGraphAI/pre/beta
Pre/beta
2 parents e721a49 + c002bf4 commit dc21ede

31 files changed

+385
-64
lines changed

CHANGELOG.md

+14-3
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,29 @@
1-
## [1.37.0](https://github.com/ScrapeGraphAI/Scrapegraph-ai/compare/v1.36.0...v1.37.0) (2025-01-21)
1+
## [1.37.1-beta.1](https://github.com/ScrapeGraphAI/Scrapegraph-ai/compare/v1.37.0...v1.37.1-beta.1) (2025-01-22)
22

33

4-
### Features
4+
### Bug Fixes
5+
6+
* Schema parameter type ([2b5bd80](https://github.com/ScrapeGraphAI/Scrapegraph-ai/commit/2b5bd80a945a24072e578133eacc751feeec6188))
7+
8+
9+
### CI
10+
11+
* **release:** 1.36.1-beta.1 [skip ci] ([006a2aa](https://github.com/ScrapeGraphAI/Scrapegraph-ai/commit/006a2aaa3fbafbd5b2030c48d5b04b605532c06f))
12+
13+
## [1.36.1-beta.1](https://github.com/ScrapeGraphAI/Scrapegraph-ai/compare/v1.36.0...v1.36.1-beta.1) (2025-01-21)
514

6-
* add integration for search on web ([224ff07](https://github.com/ScrapeGraphAI/Scrapegraph-ai/commit/224ff07032d006d75160a7094366fac17023aca1))
715

816

917
### Bug Fixes
1018

19+
* Schema parameter type ([2b5bd80](https://github.com/ScrapeGraphAI/Scrapegraph-ai/commit/2b5bd80a945a24072e578133eacc751feeec6188))
1120
* search ([ce25b6a](https://github.com/ScrapeGraphAI/Scrapegraph-ai/commit/ce25b6a4b0e1ea15edf14a5867f6336bb27590cb))
1221

1322

23+
1424
### Docs
1525

26+
1627
* add requirements.dev ([6e12981](https://github.com/ScrapeGraphAI/Scrapegraph-ai/commit/6e12981e637d078a6d3b3ce83f0d4901e9dd9996))
1728
* added first ollama example ([aa6a76e](https://github.com/ScrapeGraphAI/Scrapegraph-ai/commit/aa6a76e5bdf63544f62786b0d17effa205aab3d8))
1829

codebeaver.yml

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
from: pytest
2+
setup_commands: ['@merge', 'pip install -q selenium', 'pip install -q playwright', 'playwright install']

pyproject.toml

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
[project]
22
name = "scrapegraphai"
3-
version = "1.37.0"
3+
4+
version = "1.37.1b1"
45

56

67
description = "A web scraping library based on LangChain which uses LLM and direct graph logic to create scraping pipelines."

scrapegraphai/graphs/abstract_graph.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import uuid
77
import warnings
88
from abc import ABC, abstractmethod
9-
from typing import Optional
9+
from typing import Optional, Type
1010

1111
from langchain.chat_models import init_chat_model
1212
from langchain_core.rate_limiters import InMemoryRateLimiter
@@ -51,7 +51,7 @@ def __init__(
5151
prompt: str,
5252
config: dict,
5353
source: Optional[str] = None,
54-
schema: Optional[BaseModel] = None,
54+
schema: Optional[Type[BaseModel]] = None,
5555
):
5656
if config.get("llm").get("temperature") is None:
5757
config["llm"]["temperature"] = 0

scrapegraphai/graphs/code_generator_graph.py

+6-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
SmartScraperGraph Module
33
"""
44

5-
from typing import Optional
5+
from typing import Optional, Type
66

77
from pydantic import BaseModel
88

@@ -56,7 +56,11 @@ class CodeGeneratorGraph(AbstractGraph):
5656
"""
5757

5858
def __init__(
59-
self, prompt: str, source: str, config: dict, schema: Optional[BaseModel] = None
59+
self,
60+
prompt: str,
61+
source: str,
62+
config: dict,
63+
schema: Optional[Type[BaseModel]] = None,
6064
):
6165
super().__init__(prompt, config, source, schema)
6266

scrapegraphai/graphs/csv_scraper_graph.py

+7-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
Module for creating the smart scraper
33
"""
44

5-
from typing import Optional
5+
from typing import Optional, Type
66

77
from pydantic import BaseModel
88

@@ -22,7 +22,7 @@ class CSVScraperGraph(AbstractGraph):
2222
config (dict): Additional configuration parameters needed by some nodes in the graph.
2323
2424
Methods:
25-
__init__ (prompt: str, source: str, config: dict, schema: Optional[BaseModel] = None):
25+
__init__ (prompt: str, source: str, config: dict, schema: Optional[Type[BaseModel]] = None):
2626
Initializes the CSVScraperGraph with a prompt, source, and configuration.
2727
2828
__init__ initializes the CSVScraperGraph class. It requires the user's prompt as input,
@@ -49,7 +49,11 @@ class CSVScraperGraph(AbstractGraph):
4949
"""
5050

5151
def __init__(
52-
self, prompt: str, source: str, config: dict, schema: Optional[BaseModel] = None
52+
self,
53+
prompt: str,
54+
source: str,
55+
config: dict,
56+
schema: Optional[Type[BaseModel]] = None,
5357
):
5458
"""
5559
Initializes the CSVScraperGraph with a prompt, source, and configuration.

scrapegraphai/graphs/csv_scraper_multi_graph.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"""
44

55
from copy import deepcopy
6-
from typing import List, Optional
6+
from typing import List, Optional, Type
77

88
from pydantic import BaseModel
99

@@ -47,7 +47,7 @@ def __init__(
4747
prompt: str,
4848
source: List[str],
4949
config: dict,
50-
schema: Optional[BaseModel] = None,
50+
schema: Optional[Type[BaseModel]] = None,
5151
):
5252

5353
self.copy_config = safe_deepcopy(config)

scrapegraphai/graphs/depth_search_graph.py

+6-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
depth search graph Module
33
"""
44

5-
from typing import Optional
5+
from typing import Optional, Type
66

77
from pydantic import BaseModel
88

@@ -54,7 +54,11 @@ class DepthSearchGraph(AbstractGraph):
5454
"""
5555

5656
def __init__(
57-
self, prompt: str, source: str, config: dict, schema: Optional[BaseModel] = None
57+
self,
58+
prompt: str,
59+
source: str,
60+
config: dict,
61+
schema: Optional[Type[BaseModel]] = None,
5862
):
5963
super().__init__(prompt, config, source, schema)
6064

scrapegraphai/graphs/document_scraper_graph.py

+6-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
This module implements the Document Scraper Graph for the ScrapeGraphAI application.
33
"""
44

5-
from typing import Optional
5+
from typing import Optional, Type
66

77
from pydantic import BaseModel
88

@@ -44,7 +44,11 @@ class DocumentScraperGraph(AbstractGraph):
4444
"""
4545

4646
def __init__(
47-
self, prompt: str, source: str, config: dict, schema: Optional[BaseModel] = None
47+
self,
48+
prompt: str,
49+
source: str,
50+
config: dict,
51+
schema: Optional[Type[BaseModel]] = None,
4852
):
4953
super().__init__(prompt, config, source, schema)
5054

scrapegraphai/graphs/document_scraper_multi_graph.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"""
44

55
from copy import deepcopy
6-
from typing import List, Optional
6+
from typing import List, Optional, Type
77

88
from pydantic import BaseModel
99

@@ -47,7 +47,7 @@ def __init__(
4747
prompt: str,
4848
source: List[str],
4949
config: dict,
50-
schema: Optional[BaseModel] = None,
50+
schema: Optional[Type[BaseModel]] = None,
5151
):
5252
self.copy_config = safe_deepcopy(config)
5353
self.copy_schema = deepcopy(schema)

scrapegraphai/graphs/json_scraper_graph.py

+6-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
JSONScraperGraph Module
33
"""
44

5-
from typing import Optional
5+
from typing import Optional, Type
66

77
from pydantic import BaseModel
88

@@ -42,7 +42,11 @@ class JSONScraperGraph(AbstractGraph):
4242
"""
4343

4444
def __init__(
45-
self, prompt: str, source: str, config: dict, schema: Optional[BaseModel] = None
45+
self,
46+
prompt: str,
47+
source: str,
48+
config: dict,
49+
schema: Optional[Type[BaseModel]] = None,
4650
):
4751
super().__init__(prompt, config, source, schema)
4852

scrapegraphai/graphs/json_scraper_multi_graph.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"""
44

55
from copy import deepcopy
6-
from typing import List, Optional
6+
from typing import List, Optional, Type
77

88
from pydantic import BaseModel
99

@@ -47,7 +47,7 @@ def __init__(
4747
prompt: str,
4848
source: List[str],
4949
config: dict,
50-
schema: Optional[BaseModel] = None,
50+
schema: Optional[Type[BaseModel]] = None,
5151
):
5252

5353
self.copy_config = safe_deepcopy(config)

scrapegraphai/graphs/omni_scraper_graph.py

+6-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
This module implements the Omni Scraper Graph for the ScrapeGraphAI application.
33
"""
44

5-
from typing import Optional
5+
from typing import Optional, Type
66

77
from pydantic import BaseModel
88

@@ -47,7 +47,11 @@ class OmniScraperGraph(AbstractGraph):
4747
"""
4848

4949
def __init__(
50-
self, prompt: str, source: str, config: dict, schema: Optional[BaseModel] = None
50+
self,
51+
prompt: str,
52+
source: str,
53+
config: dict,
54+
schema: Optional[Type[BaseModel]] = None,
5155
):
5256
self.max_images = 5 if config is None else config.get("max_images", 5)
5357

scrapegraphai/graphs/omni_search_graph.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"""
44

55
from copy import deepcopy
6-
from typing import Optional
6+
from typing import Optional, Type
77

88
from pydantic import BaseModel
99

@@ -41,7 +41,9 @@ class OmniSearchGraph(AbstractGraph):
4141
>>> result = search_graph.run()
4242
"""
4343

44-
def __init__(self, prompt: str, config: dict, schema: Optional[BaseModel] = None):
44+
def __init__(
45+
self, prompt: str, config: dict, schema: Optional[Type[BaseModel]] = None
46+
):
4547

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

scrapegraphai/graphs/screenshot_scraper_graph.py

+7-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
ScreenshotScraperGraph Module
33
"""
44

5-
from typing import Optional
5+
from typing import Optional, Type
66

77
from pydantic import BaseModel
88

@@ -21,7 +21,7 @@ class ScreenshotScraperGraph(AbstractGraph):
2121
source (str): The source URL or image link to scrape from.
2222
2323
Methods:
24-
__init__(prompt: str, source: str, config: dict, schema: Optional[BaseModel] = None)
24+
__init__(prompt: str, source: str, config: dict, schema: Optional[Type[BaseModel]] = None)
2525
Initializes the ScreenshotScraperGraph instance with the given prompt,
2626
source, and configuration parameters.
2727
@@ -33,7 +33,11 @@ class ScreenshotScraperGraph(AbstractGraph):
3333
"""
3434

3535
def __init__(
36-
self, prompt: str, source: str, config: dict, schema: Optional[BaseModel] = None
36+
self,
37+
prompt: str,
38+
source: str,
39+
config: dict,
40+
schema: Optional[Type[BaseModel]] = None,
3741
):
3842
super().__init__(prompt, config, source, schema)
3943

scrapegraphai/graphs/script_creator_graph.py

+6-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
ScriptCreatorGraph Module
33
"""
44

5-
from typing import Optional
5+
from typing import Optional, Type
66

77
from pydantic import BaseModel
88

@@ -44,7 +44,11 @@ class ScriptCreatorGraph(AbstractGraph):
4444
"""
4545

4646
def __init__(
47-
self, prompt: str, source: str, config: dict, schema: Optional[BaseModel] = None
47+
self,
48+
prompt: str,
49+
source: str,
50+
config: dict,
51+
schema: Optional[Type[BaseModel]] = None,
4852
):
4953
self.library = config["library"]
5054

scrapegraphai/graphs/script_creator_multi_graph.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"""
44

55
from copy import deepcopy
6-
from typing import List, Optional
6+
from typing import List, Optional, Type
77

88
from pydantic import BaseModel
99

@@ -46,7 +46,7 @@ def __init__(
4646
prompt: str,
4747
source: List[str],
4848
config: dict,
49-
schema: Optional[BaseModel] = None,
49+
schema: Optional[Type[BaseModel]] = None,
5050
):
5151

5252
self.copy_config = safe_deepcopy(config)

scrapegraphai/graphs/search_graph.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"""
44

55
from copy import deepcopy
6-
from typing import List, Optional
6+
from typing import List, Optional, Type
77

88
from pydantic import BaseModel
99

@@ -42,7 +42,9 @@ class SearchGraph(AbstractGraph):
4242
>>> print(search_graph.get_considered_urls())
4343
"""
4444

45-
def __init__(self, prompt: str, config: dict, schema: Optional[BaseModel] = None):
45+
def __init__(
46+
self, prompt: str, config: dict, schema: Optional[Type[BaseModel]] = None
47+
):
4648
self.max_results = config.get("max_results", 3)
4749

4850
self.copy_config = safe_deepcopy(config)

scrapegraphai/graphs/search_link_graph.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
SearchLinkGraph Module
33
"""
44

5-
from typing import Optional
5+
from typing import Optional, Type
66

77
from pydantic import BaseModel
88

@@ -36,7 +36,9 @@ class SearchLinkGraph(AbstractGraph):
3636
3737
"""
3838

39-
def __init__(self, source: str, config: dict, schema: Optional[BaseModel] = None):
39+
def __init__(
40+
self, source: str, config: dict, schema: Optional[Type[BaseModel]] = None
41+
):
4042
super().__init__("", config, source, schema)
4143

4244
self.input_key = "url" if source.startswith("http") else "local_dir"

0 commit comments

Comments
 (0)