Skip to content

Commit 05ecc3a

Browse files
committed
Added missing logic to extract model_name from model_id
1 parent f1a2523 commit 05ecc3a

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

scrapegraphai/nodes/robots_node.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,10 +96,12 @@ 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+
self.llm_model.model_name = self.llm_model.model_id.split("/")[-1]
104+
model = self.llm_model.model_name
103105
else:
104106
model = self.llm_model.model_name
105107
try:

0 commit comments

Comments
 (0)