Skip to content

Commit e3fbf01

Browse files
authored
Revert "Anthropic refactoring"
1 parent 4dea972 commit e3fbf01

19 files changed

+23
-28
lines changed

examples/anthropic/csv_scraper_graph_multi_anthropic.py renamed to examples/anthropic/csv_scraper_graph_multi_haiku.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
graph_config = {
2727
"llm": {
2828
"api_key": os.getenv("ANTHROPIC_API_KEY"),
29-
"model": "anthropic/claude-3-haiku-20240307",
29+
"model": "claude-3-haiku-20240307",
3030
"max_tokens": 4000},
3131
}
3232

examples/anthropic/csv_scraper_anthropic.py renamed to examples/anthropic/csv_scraper_haiku.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
graph_config = {
3333
"llm": {
3434
"api_key": os.getenv("ANTHROPIC_API_KEY"),
35-
"model": "anthropic/claude-3-haiku-20240307",
35+
"model": "claude-3-haiku-20240307",
3636
"max_tokens": 4000
3737
},
3838
}

examples/anthropic/custom_graph_anthropic.py renamed to examples/anthropic/custom_graph_haiku.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
graph_config = {
1919
"llm": {
2020
"api_key": os.getenv("ANTHROPIC_API_KEY"),
21-
"model": "anthropic/claude-3-haiku-20240307",
21+
"model": "claude-3-haiku-20240307",
2222
"max_tokens": 4000
2323
},
2424
}

examples/anthropic/json_scraper_anthropic.py renamed to examples/anthropic/json_scraper_haiku.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
graph_config = {
2727
"llm": {
2828
"api_key": os.getenv("ANTHROPIC_API_KEY"),
29-
"model": "anthropic/claude-3-haiku-20240307",
29+
"model": "claude-3-haiku-20240307",
3030
"max_tokens": 4000
3131
},
3232
}

examples/anthropic/json_scraper_multi_anthropic.py renamed to examples/anthropic/json_scraper_multi_haiku.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
graph_config = {
1212
"llm": {
1313
"api_key": os.getenv("ANTHROPIC_API_KEY"),
14-
"model": "anthropic/claude-3-haiku-20240307",
14+
"model": "claude-3-haiku-20240307",
1515
"max_tokens": 4000
1616
},
1717
}

examples/anthropic/pdf_scraper_graph_anthropic.py renamed to examples/anthropic/pdf_scraper_graph_haiku.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
graph_config = {
1515
"llm": {
1616
"api_key": os.getenv("ANTHROPIC_API_KEY"),
17-
"model": "anthropic/claude-3-haiku-20240307",
17+
"model": "claude-3-haiku-20240307",
1818
"max_tokens": 4000
1919
},
2020
}

examples/anthropic/pdf_scraper_multi_anthropic.py renamed to examples/anthropic/pdf_scraper_multi_haiku.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
graph_config = {
1212
"llm": {
1313
"api_key": os.getenv("ANTHROPIC_API_KEY"),
14-
"model": "anthropic/claude-3-haiku-20240307",
14+
"model": "claude-3-haiku-20240307",
1515
"max_tokens": 4000
1616
},
1717
}

examples/anthropic/scrape_plain_text_anthropic.py renamed to examples/anthropic/scrape_plain_text_haiku.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
graph_config = {
2929
"llm": {
3030
"api_key": os.getenv("ANTHROPIC_API_KEY"),
31-
"model": "anthropic/claude-3-haiku-20240307",
31+
"model": "claude-3-haiku-20240307",
3232
"max_tokens": 4000
3333
},
3434
}

examples/anthropic/script_generator_anthropic.py renamed to examples/anthropic/script_generator_haiku.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
graph_config = {
1717
"llm": {
1818
"api_key": os.getenv("ANTHROPIC_API_KEY"),
19-
"model": "anthropic/claude-3-haiku-20240307",
19+
"model": "claude-3-haiku-20240307",
2020
"max_tokens": 4000
2121
},
2222
}

examples/anthropic/script_multi_generator_anthropic.py renamed to examples/anthropic/script_multi_generator_haiku.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
graph_config = {
1717
"llm": {
1818
"api_key": os.getenv("ANTHROPIC_API_KEY"),
19-
"model": "anthropic/claude-3-haiku-20240307",
19+
"model": "claude-3-haiku-20240307",
2020
"max_tokens": 4000
2121
},
2222
"library": "beautifulsoup"

examples/anthropic/search_graph_anthropic.py renamed to examples/anthropic/search_graph_haiku.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
graph_config = {
1616
"llm": {
1717
"api_key": os.getenv("ANTHROPIC_API_KEY"),
18-
"model": "anthropic/claude-3-haiku-20240307",
18+
"model": "claude-3-haiku-20240307",
1919
"max_tokens": 4000
2020
},
2121
}

examples/anthropic/search_graph_schema_anthropic.py renamed to examples/anthropic/search_graph_schema_haiku.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,8 @@ class Dishes(BaseModel):
2727
graph_config = {
2828
"llm": {
2929
"api_key": os.getenv("ANTHROPIC_API_KEY"),
30-
"model": "anthropic/claude-3-haiku-20240307",
31-
"max_tokens": 4000
32-
},
30+
"model": "claude-3-haiku-20240307",
31+
"max_tokens": 4000},
3332
}
3433

3534
# ************************************************

examples/anthropic/search_link_graph_anthropic.py renamed to examples/anthropic/search_link_graph_haiku.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,8 @@
2929
# ************************************************
3030

3131
graph_config = {
32-
"llm": {
33-
"api_key": os.getenv("ANTHROPIC_API_KEY"),
34-
"model": "anthropic/claude-3-haiku-20240307",
35-
"max_tokens": 4000
36-
},
32+
"llm": {"model_instance": llm_model_instance},
33+
"embeddings": {"model_instance": embedder_model_instance}
3734
}
3835

3936
# ************************************************

examples/anthropic/smart_scraper_anthropic.py renamed to examples/anthropic/smart_scraper_haiku.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
graph_config = {
2020
"llm": {
2121
"api_key": os.getenv("ANTHROPIC_API_KEY"),
22-
"model": "anthropic/claude-3-haiku-20240307",
22+
"model": "claude-3-haiku-20240307",
2323
"max_tokens": 4000
2424
},
2525
}

examples/anthropic/smart_scraper_multi_anthropic.py renamed to examples/anthropic/smart_scraper_multi_haiku.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
graph_config = {
1818
"llm": {
1919
"api_key": os.getenv("ANTHROPIC_API_KEY"),
20-
"model": "anthropic/claude-3-haiku-20240307",
20+
"model": "claude-3-haiku-20240307",
2121
"max_tokens": 4000
2222
},
2323
}

examples/anthropic/smart_scraper_schema_anthropic.py renamed to examples/anthropic/smart_scraper_schema_haiku.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class Projects(BaseModel):
3333
graph_config = {
3434
"llm": {
3535
"api_key": os.getenv("ANTHROPIC_API_KEY"),
36-
"model": "anthropic/claude-3-haiku-20240307",
36+
"model": "claude-3-haiku-20240307",
3737
"max_tokens": 4000},
3838
}
3939

examples/anthropic/xml_scraper_graph_multi_anthropic.py renamed to examples/anthropic/xml_scraper_graph_multi_haiku.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
graph_config = {
2727
"llm": {
2828
"api_key": os.getenv("ANTHROPIC_API_KEY"),
29-
"model": "anthropic/claude-3-haiku-20240307",
29+
"model": "claude-3-haiku-20240307",
3030
"max_tokens": 4000},
3131
}
3232

examples/anthropic/xml_scraper_anthropic.py renamed to examples/anthropic/xml_scraper_haiku.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
graph_config = {
2727
"llm": {
2828
"api_key": os.getenv("ANTHROPIC_API_KEY"),
29-
"model": "anthropic/claude-3-haiku-20240307",
29+
"model": "claude-3-haiku-20240307",
3030
"max_tokens": 4000
3131
},
3232
}

scrapegraphai/graphs/abstract_graph.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ def handle_model(model_name, provider, token_key, default_token=8192):
142142
known_models = {"chatgpt","gpt","openai", "azure_openai", "google_genai",
143143
"ollama", "oneapi", "nvidia", "groq", "google_vertexai",
144144
"bedrock", "mistralai", "hugging_face", "deepseek", "ernie",
145-
"fireworks", "anthropic"}
145+
"fireworks", "claude-3-"}
146146

147147
if llm_params["model"].split("/")[0] not in known_models and llm_params["model"].split("-")[0] not in known_models:
148148
raise ValueError(f"Model '{llm_params['model']}' is not supported")
@@ -172,9 +172,8 @@ def handle_model(model_name, provider, token_key, default_token=8192):
172172
token_key = model_name if "model_tokens" not in llm_params else llm_params["model_tokens"]
173173
return handle_model(model_name, "ollama", token_key)
174174

175-
elif "anthropic" in llm_params["model"]:
176-
model_name = llm_params["model"].split("anthropic/")[-1]
177-
return handle_model(model_name, "anthropic", model_name)
175+
elif "claude-3-" in llm_params["model"]:
176+
return handle_model(llm_params["model"], "anthropic", "claude3")
178177

179178
elif llm_params["model"].startswith("mistral"):
180179
model_name = llm_params["model"].split("/")[-1]

0 commit comments

Comments
 (0)