refactor: add missing schemas and renamed files
Some checks are pending
/ build (3.10) (push) Waiting to run
Release / Build (push) Waiting to run
Release / Release (push) Blocked by required conditions

This commit is contained in:
Marco Perini 2024-06-14 15:38:46 +02:00
parent d8a99e96b7
commit 09cb6e964e
6 changed files with 18 additions and 7 deletions

View File

@ -16,8 +16,8 @@ from .pdf_scraper_graph import PDFScraperGraph
from .omni_scraper_graph import OmniScraperGraph
from .omni_search_graph import OmniSearchGraph
from .smart_scraper_multi_graph import SmartScraperMultiGraph
from .pdf_scraper_multi import PdfScraperMultiGraph
from .json_scraper_multi import JSONScraperMultiGraph
from .csv_scraper_graph_multi import CSVScraperMultiGraph
from .xml_scraper_graph_multi import XMLScraperMultiGraph
from .pdf_scraper_multi_graph import PdfScraperMultiGraph
from .json_scraper_multi_graph import JSONScraperMultiGraph
from .csv_scraper_multi_graph import CSVScraperMultiGraph
from .xml_scraper_multi_graph import XMLScraperMultiGraph
from .script_creator_multi_graph import ScriptCreatorMultiGraph

View File

@ -4,6 +4,7 @@ JSONScraperMultiGraph Module
from copy import copy, deepcopy
from typing import List, Optional
from pydantic import BaseModel
from .base_graph import BaseGraph
from .abstract_graph import AbstractGraph
@ -42,7 +43,7 @@ class JSONScraperMultiGraph(AbstractGraph):
>>> result = search_graph.run()
"""
def __init__(self, prompt: str, source: List[str], config: dict, schema: Optional[str] = None):
def __init__(self, prompt: str, source: List[str], config: dict, schema: Optional[BaseModel] = None):
self.max_results = config.get("max_results", 3)
@ -51,6 +52,8 @@ class JSONScraperMultiGraph(AbstractGraph):
else:
self.copy_config = deepcopy(config)
self.copy_schema = deepcopy(schema)
super().__init__(prompt, config, source, schema)
def _create_graph(self) -> BaseGraph:
@ -69,6 +72,7 @@ class JSONScraperMultiGraph(AbstractGraph):
prompt="",
source="",
config=self.copy_config,
schema=self.copy_schema
)
# ************************************************

View File

@ -53,6 +53,8 @@ class OmniSearchGraph(AbstractGraph):
else:
self.copy_config = deepcopy(config)
self.copy_schema = deepcopy(schema)
super().__init__(prompt, config, schema)
def _create_graph(self) -> BaseGraph:
@ -70,7 +72,8 @@ class OmniSearchGraph(AbstractGraph):
omni_scraper_instance = OmniScraperGraph(
prompt="",
source="",
config=self.copy_config
config=self.copy_config,
schema=self.copy_schema
)
# ************************************************

View File

@ -4,6 +4,7 @@ XMLScraperMultiGraph Module
from copy import copy, deepcopy
from typing import List, Optional
from pydantic import BaseModel
from .base_graph import BaseGraph
from .abstract_graph import AbstractGraph
@ -43,7 +44,7 @@ class XMLScraperMultiGraph(AbstractGraph):
>>> result = search_graph.run()
"""
def __init__(self, prompt: str, source: List[str], config: dict, schema: Optional[str] = None):
def __init__(self, prompt: str, source: List[str], config: dict, schema: Optional[BaseModel] = None):
self.max_results = config.get("max_results", 3)
@ -52,6 +53,8 @@ class XMLScraperMultiGraph(AbstractGraph):
else:
self.copy_config = deepcopy(config)
self.copy_schema = deepcopy(schema)
super().__init__(prompt, config, source, schema)
def _create_graph(self) -> BaseGraph:
@ -70,6 +73,7 @@ class XMLScraperMultiGraph(AbstractGraph):
prompt="",
source="",
config=self.copy_config,
schema=self.copy_schema
)
# ************************************************