Python scraper based on AI
Python ai-crawlerai-scrapingai-searchcrawlerdata-extractionfirecrawl-alternativelarge-language-modelllmmarkdownragscrapingscraping-pythonweb-crawlerweb-crawlersweb-dataweb-data-extractionweb-scraperweb-scrapingweb-searchwebscraping
Fixed anthropic/bedrock conflict; Removed duplicate class Claude; Updated BedrockEmbeddings class
JGalego39be38f292f7
diff --git a/scrapegraphai/graphs/abstract_graph.py b/scrapegraphai/graphs/abstract_graph.pyindex f58f04a2..b96503ba 100644--- a/scrapegraphai/graphs/abstract_graph.py+++ b/scrapegraphai/graphs/abstract_graph.py@@ -3,11 +3,12 @@ AbstractGraph Module"""from abc import ABC, abstractmethodfrom typing import Optional+from langchain_aws import BedrockEmbeddingsfrom langchain_openai import AzureOpenAIEmbeddings, OpenAIEmbeddings-from langchain_community.embeddings import HuggingFaceHubEmbeddings, OllamaEmbeddings, BedrockEmbeddings+from langchain_community.embeddings import HuggingFaceHubEmbeddings, OllamaEmbeddingsfrom langchain_google_genai import GoogleGenerativeAIEmbeddingsfrom ..helpers import models_tokens-from ..models import AzureOpenAI, Bedrock, Gemini, Groq, HuggingFace, Ollama, OpenAI, Anthropic, Claude, DeepSeek+from ..models import AzureOpenAI, Bedrock, Gemini, Groq, HuggingFace, Ollama, OpenAI, Anthropic, DeepSeekclass AbstractGraph(ABC):@@ -145,12 +146,12 @@ class AbstractGraph(ABC):except KeyError as exc:raise KeyError("Model not supported") from excreturn Gemini(llm_params)- elif "claude" in llm_params["model"]:+ elif llm_params["model"].startswith("claude"):try:self.model_token = models_tokens["claude"][llm_params["model"]]except KeyError as exc:raise KeyError("Model not supported") from exc- return Claude(llm_params)+ return Anthropic(llm_params)elif "ollama" in llm_params["model"]:llm_params["model"] = llm_params["model"].split("/")[-1]diff --git a/scrapegraphai/models/__init__.py b/scrapegraphai/models/__init__.pyindex 9c049fcd..7e7d5e18 100644--- a/scrapegraphai/models/__init__.py+++ b/scrapegraphai/models/__init__.py@@ -12,5 +12,4 @@ from .hugging_face import HuggingFacefrom .groq import Groqfrom .bedrock import Bedrockfrom .anthropic import Anthropic-from .claude import Claudefrom .deepseek import DeepSeekdiff --git a/scrapegraphai/models/claude.py b/scrapegraphai/models/claude.pydeleted file mode 100644index b0030fc4..00000000--- a/scrapegraphai/models/claude.py+++ /dev/null@@ -1,19 +0,0 @@-"""-Claude model-"""-from langchain_anthropic import ChatAnthropic---class Claude(ChatAnthropic):- """Class for wrapping bedrock module"""-- def __init__(self, llm_config: dict):- """- A wrapper for the Claude class that provides default configuration- and could be extended with additional methods if needed.-- Args:- llm_config (dict): Configuration parameters for the language model.- """- # Initialize the superclass (ChatAnthropic) with provided config parameters- super().__init__(**llm_config)