Skip to content

Commit c8c3201

Browse files
authored
Merge pull request #273 from JGalego/bugfix/bedrock-runs
bugfix: ScriptCreatorGraph verbose settings + RobotsNode handling model IDs
2 parents 0ad78ca + 3ffa896 commit c8c3201

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

scrapegraphai/graphs/abstract_graph.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,19 +49,18 @@ def __init__(self, prompt: str, config: dict, source: Optional[str] = None):
4949
self.embedder_model = self._create_default_embedder(llm_config=config["llm"]
5050
) if "embeddings" not in config else self._create_embedder(
5151
config["embeddings"])
52+
self.verbose = False if config is None else config.get(
53+
"verbose", False)
54+
self.headless = True if config is None else config.get(
55+
"headless", True)
56+
self.loader_kwargs = config.get("loader_kwargs", {})
5257

5358
# Create the graph
5459
self.graph = self._create_graph()
5560
self.final_state = None
5661
self.execution_info = None
5762

5863
# Set common configuration parameters
59-
self.verbose = False if config is None else config.get(
60-
"verbose", False)
61-
self.headless = True if config is None else config.get(
62-
"headless", True)
63-
self.loader_kwargs = config.get("loader_kwargs", {})
64-
6564
common_params = {"headless": self.headless,
6665
"verbose": self.verbose,
6766
"loader_kwargs": self.loader_kwargs,

scrapegraphai/nodes/robots_node.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,10 +96,11 @@ def execute(self, state: dict) -> dict:
9696
base_url = f"{parsed_url.scheme}://{parsed_url.netloc}"
9797
loader = AsyncChromiumLoader(f"{base_url}/robots.txt")
9898
document = loader.load()
99-
if "ollama" in self.llm_model.model_name:
99+
if hasattr(self.llm_model, "model_name") and "ollama" in self.llm_model.model_name:
100100
self.llm_model.model_name = self.llm_model.model_name.split("/")[-1]
101101
model = self.llm_model.model_name.split("/")[-1]
102-
102+
elif hasattr(self.llm_model, "model_id"): # Bedrock uses model IDs, not model names
103+
model = self.llm_model.model_id.split("/")[-1]
103104
else:
104105
model = self.llm_model.model_name
105106
try:

0 commit comments

Comments
 (0)