paper-qa icon indicating copy to clipboard operation
paper-qa copied to clipboard

client.model_name doesn't work for langchain ChatAnthropic

Open yiouyou opened this issue 10 months ago • 1 comments

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,

yiouyou avatar Apr 19 '24 05:04 yiouyou

I am also having the save issue. @yiouyou did you solve it or find any solution?

nistha2024 avatar May 23 '24 12:05 nistha2024

found any resolution for this yet? @nistha2024 @yiouyou @whitead

eyeqwe avatar Aug 22 '24 06:08 eyeqwe

Similar issue to https://github.com/Future-House/paper-qa/issues/279, please see its resolution

jamesbraza avatar Sep 11 '24 17:09 jamesbraza