VinciGit00 / Scrapegraph-ai

Python scraper based on AI
https://scrapegraphai.com
MIT License
12.65k stars 962 forks source link

Not able to run Anthropic Claude models. #402

Open paarthmadan-avataar opened 1 week ago

paarthmadan-avataar commented 1 week ago

KeyError Traceback (most recent call last) /usr/local/lib/python3.10/dist-packages/scrapegraphai/graphs/abstract_graph.py in _create_llm(self, llm_config, chat) 181 try: --> 182 self.model_token = models_tokens["claude"][llm_params["model"]] 183 except KeyError as exc:

KeyError: 'claude-3-haiku-20240307'

The above exception was the direct cause of the following exception:

KeyError Traceback (most recent call last) 3 frames /usr/local/lib/python3.10/dist-packages/scrapegraphai/graphs/abstract_graph.py in _create_llm(self, llm_config, chat) 182 self.model_token = models_tokens["claude"][llm_params["model"]] 183 except KeyError as exc: --> 184 raise KeyError("Model not supported") from exc 185 return Anthropic(llm_params) 186 elif "ollama" in llm_params["model"]:

KeyError: 'Model not supported'

VinciGit00 commented 1 week ago

please update

paarthmadan-avataar commented 1 week ago

Can you share the a correct claude api model names to key in the graph config?

GRiDD commented 3 days ago

Still getting this error. I tried with 1.7.4 and 1.8.0-beta.1

self.model_token = models_tokens["claude"][llm_params["model"]]

KeyError: 'claude-3-haiku-20240307'

VinciGit00 commented 3 days ago

hi, please install the new version, we added that model.