mirror of
https://github.com/VinciGit00/Scrapegraph-ai.git
synced 2026-07-04 21:00:36 +08:00
Merge pull request #584 from ScrapeGraphAI/revert-583-anthropic-refactoring
Revert "Anthropic refactoring"
This commit is contained in:
commit
869bbd798e
@ -26,7 +26,7 @@ text = pd.read_csv(file_path)
|
||||
graph_config = {
|
||||
"llm": {
|
||||
"api_key": os.getenv("ANTHROPIC_API_KEY"),
|
||||
"model": "anthropic/claude-3-haiku-20240307",
|
||||
"model": "claude-3-haiku-20240307",
|
||||
"max_tokens": 4000},
|
||||
}
|
||||
|
||||
@ -32,7 +32,7 @@ load_dotenv()
|
||||
graph_config = {
|
||||
"llm": {
|
||||
"api_key": os.getenv("ANTHROPIC_API_KEY"),
|
||||
"model": "anthropic/claude-3-haiku-20240307",
|
||||
"model": "claude-3-haiku-20240307",
|
||||
"max_tokens": 4000
|
||||
},
|
||||
}
|
||||
@ -18,7 +18,7 @@ load_dotenv()
|
||||
graph_config = {
|
||||
"llm": {
|
||||
"api_key": os.getenv("ANTHROPIC_API_KEY"),
|
||||
"model": "anthropic/claude-3-haiku-20240307",
|
||||
"model": "claude-3-haiku-20240307",
|
||||
"max_tokens": 4000
|
||||
},
|
||||
}
|
||||
@ -26,7 +26,7 @@ with open(file_path, 'r', encoding="utf-8") as file:
|
||||
graph_config = {
|
||||
"llm": {
|
||||
"api_key": os.getenv("ANTHROPIC_API_KEY"),
|
||||
"model": "anthropic/claude-3-haiku-20240307",
|
||||
"model": "claude-3-haiku-20240307",
|
||||
"max_tokens": 4000
|
||||
},
|
||||
}
|
||||
@ -11,7 +11,7 @@ load_dotenv()
|
||||
graph_config = {
|
||||
"llm": {
|
||||
"api_key": os.getenv("ANTHROPIC_API_KEY"),
|
||||
"model": "anthropic/claude-3-haiku-20240307",
|
||||
"model": "claude-3-haiku-20240307",
|
||||
"max_tokens": 4000
|
||||
},
|
||||
}
|
||||
@ -14,7 +14,7 @@ load_dotenv()
|
||||
graph_config = {
|
||||
"llm": {
|
||||
"api_key": os.getenv("ANTHROPIC_API_KEY"),
|
||||
"model": "anthropic/claude-3-haiku-20240307",
|
||||
"model": "claude-3-haiku-20240307",
|
||||
"max_tokens": 4000
|
||||
},
|
||||
}
|
||||
@ -11,7 +11,7 @@ load_dotenv()
|
||||
graph_config = {
|
||||
"llm": {
|
||||
"api_key": os.getenv("ANTHROPIC_API_KEY"),
|
||||
"model": "anthropic/claude-3-haiku-20240307",
|
||||
"model": "claude-3-haiku-20240307",
|
||||
"max_tokens": 4000
|
||||
},
|
||||
}
|
||||
@ -28,7 +28,7 @@ with open(file_path, 'r', encoding="utf-8") as file:
|
||||
graph_config = {
|
||||
"llm": {
|
||||
"api_key": os.getenv("ANTHROPIC_API_KEY"),
|
||||
"model": "anthropic/claude-3-haiku-20240307",
|
||||
"model": "claude-3-haiku-20240307",
|
||||
"max_tokens": 4000
|
||||
},
|
||||
}
|
||||
@ -16,7 +16,7 @@ load_dotenv()
|
||||
graph_config = {
|
||||
"llm": {
|
||||
"api_key": os.getenv("ANTHROPIC_API_KEY"),
|
||||
"model": "anthropic/claude-3-haiku-20240307",
|
||||
"model": "claude-3-haiku-20240307",
|
||||
"max_tokens": 4000
|
||||
},
|
||||
}
|
||||
@ -16,7 +16,7 @@ load_dotenv()
|
||||
graph_config = {
|
||||
"llm": {
|
||||
"api_key": os.getenv("ANTHROPIC_API_KEY"),
|
||||
"model": "anthropic/claude-3-haiku-20240307",
|
||||
"model": "claude-3-haiku-20240307",
|
||||
"max_tokens": 4000
|
||||
},
|
||||
"library": "beautifulsoup"
|
||||
@ -15,7 +15,7 @@ load_dotenv()
|
||||
graph_config = {
|
||||
"llm": {
|
||||
"api_key": os.getenv("ANTHROPIC_API_KEY"),
|
||||
"model": "anthropic/claude-3-haiku-20240307",
|
||||
"model": "claude-3-haiku-20240307",
|
||||
"max_tokens": 4000
|
||||
},
|
||||
}
|
||||
@ -27,9 +27,8 @@ class Dishes(BaseModel):
|
||||
graph_config = {
|
||||
"llm": {
|
||||
"api_key": os.getenv("ANTHROPIC_API_KEY"),
|
||||
"model": "anthropic/claude-3-haiku-20240307",
|
||||
"max_tokens": 4000
|
||||
},
|
||||
"model": "claude-3-haiku-20240307",
|
||||
"max_tokens": 4000},
|
||||
}
|
||||
|
||||
# ************************************************
|
||||
@ -29,11 +29,8 @@ embedder_model_instance = AzureOpenAIEmbeddings(
|
||||
# ************************************************
|
||||
|
||||
graph_config = {
|
||||
"llm": {
|
||||
"api_key": os.getenv("ANTHROPIC_API_KEY"),
|
||||
"model": "anthropic/claude-3-haiku-20240307",
|
||||
"max_tokens": 4000
|
||||
},
|
||||
"llm": {"model_instance": llm_model_instance},
|
||||
"embeddings": {"model_instance": embedder_model_instance}
|
||||
}
|
||||
|
||||
# ************************************************
|
||||
@ -19,7 +19,7 @@ load_dotenv()
|
||||
graph_config = {
|
||||
"llm": {
|
||||
"api_key": os.getenv("ANTHROPIC_API_KEY"),
|
||||
"model": "anthropic/claude-3-haiku-20240307",
|
||||
"model": "claude-3-haiku-20240307",
|
||||
"max_tokens": 4000
|
||||
},
|
||||
}
|
||||
@ -17,7 +17,7 @@ load_dotenv()
|
||||
graph_config = {
|
||||
"llm": {
|
||||
"api_key": os.getenv("ANTHROPIC_API_KEY"),
|
||||
"model": "anthropic/claude-3-haiku-20240307",
|
||||
"model": "claude-3-haiku-20240307",
|
||||
"max_tokens": 4000
|
||||
},
|
||||
}
|
||||
@ -33,7 +33,7 @@ class Projects(BaseModel):
|
||||
graph_config = {
|
||||
"llm": {
|
||||
"api_key": os.getenv("ANTHROPIC_API_KEY"),
|
||||
"model": "anthropic/claude-3-haiku-20240307",
|
||||
"model": "claude-3-haiku-20240307",
|
||||
"max_tokens": 4000},
|
||||
}
|
||||
|
||||
@ -26,7 +26,7 @@ with open(file_path, 'r', encoding="utf-8") as file:
|
||||
graph_config = {
|
||||
"llm": {
|
||||
"api_key": os.getenv("ANTHROPIC_API_KEY"),
|
||||
"model": "anthropic/claude-3-haiku-20240307",
|
||||
"model": "claude-3-haiku-20240307",
|
||||
"max_tokens": 4000},
|
||||
}
|
||||
|
||||
@ -26,7 +26,7 @@ with open(file_path, 'r', encoding="utf-8") as file:
|
||||
graph_config = {
|
||||
"llm": {
|
||||
"api_key": os.getenv("ANTHROPIC_API_KEY"),
|
||||
"model": "anthropic/claude-3-haiku-20240307",
|
||||
"model": "claude-3-haiku-20240307",
|
||||
"max_tokens": 4000
|
||||
},
|
||||
}
|
||||
@ -142,7 +142,7 @@ class AbstractGraph(ABC):
|
||||
known_models = {"chatgpt","gpt","openai", "azure_openai", "google_genai",
|
||||
"ollama", "oneapi", "nvidia", "groq", "google_vertexai",
|
||||
"bedrock", "mistralai", "hugging_face", "deepseek", "ernie",
|
||||
"fireworks", "anthropic"}
|
||||
"fireworks", "claude-3-"}
|
||||
|
||||
if llm_params["model"].split("/")[0] not in known_models and llm_params["model"].split("-")[0] not in known_models:
|
||||
raise ValueError(f"Model '{llm_params['model']}' is not supported")
|
||||
@ -172,9 +172,8 @@ class AbstractGraph(ABC):
|
||||
token_key = model_name if "model_tokens" not in llm_params else llm_params["model_tokens"]
|
||||
return handle_model(model_name, "ollama", token_key)
|
||||
|
||||
elif "anthropic" in llm_params["model"]:
|
||||
model_name = llm_params["model"].split("anthropic/")[-1]
|
||||
return handle_model(model_name, "anthropic", model_name)
|
||||
elif "claude-3-" in llm_params["model"]:
|
||||
return handle_model(llm_params["model"], "anthropic", "claude3")
|
||||
|
||||
elif llm_params["model"].startswith("mistral"):
|
||||
model_name = llm_params["model"].split("/")[-1]
|
||||
|
||||
Loading…
Reference in New Issue
Block a user