paper-qa
paper-qa copied to clipboard
client.model_name doesn't work for langchain ChatAnthropic
When running the below:
docs = Docs(llm="langchain", client=ChatAnthropic(temperature=0, model_name="claude-3-haiku-20240307"), prompts=prompts)
Error:
| File "D:\_Ai\my\free\free\langserve\paper\packages\ask-paper\ask_paper\util.py", line 85, in ask_paper
| _docs = Docs(llm="langchain", client=ChatAnthropic(temperature=0, model_name="claude-3-haiku-20240307"), prompts=prompts)
| File "D:\_Ai\my\free\venv\lib\site-packages\paperqa\docs.py", line 110, in __init__
| self.set_client(client, embedding_client)
| File "D:\_Ai\my\free\venv\lib\site-packages\paperqa\docs.py", line 214, in set_client
| Docs.make_llm_names_consistent(self)
| File "D:\_Ai\my\free\venv\lib\site-packages\paperqa\docs.py", line 153, in make_llm_names_consistent
| data.llm_model.infer_llm_type(data._client)
| File "D:\_Ai\my\free\venv\lib\site-packages\paperqa\llms.py", line 649, in infer_llm_type
| self.name = client.model_name
| AttributeError: 'ChatAnthropic' object has no attribute 'model_name'
How to fix this?
Thanks,
I am also having the save issue. @yiouyou did you solve it or find any solution?
found any resolution for this yet? @nistha2024 @yiouyou @whitead
Similar issue to https://github.com/Future-House/paper-qa/issues/279, please see its resolution