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

Model Group gpt-4o-2024-08-06

Open ryanSir opened this issue 1 year ago • 2 comments

I've worked out a model version called gpt-40, but it doesn't seem to work and I'm still using the default model image

ryanSir avatar Sep 19 '24 08:09 ryanSir

Hey @ryanSir! I'm here to help you out with any bugs, questions, or contributions you have. Let's tackle this together!

I found a similar open issue that might help you resolve the problem. The issue is titled Error Code 404 and is currently open. The suggested solution is as follows:

  1. Check the Model Name: Ensure that the model name gpt-4o-2024-08-06 is correct and exists in the list of available models.

  2. Update the Model Configuration: If the model name is incorrect or unavailable, update the model configuration in your settings. You can specify a different model that you have access to. For example:

    from paperqa import Settings, ask
    
    answer = ask(
        "What manufacturing challenges are unique to bispecific antibodies?",
        settings=Settings(
            llm="gpt-4o-mini", summary_llm="gpt-4o-mini", paper_directory="my_papers"
        ),
    )
    
  3. Check Permissions: Ensure that you have the necessary permissions to access the specified model. If you are using a service like OpenAI, verify that your API key has access to the model.

  4. Fallback Mechanism: Implement a fallback mechanism to handle cases where the specified model is not found. This can be done by catching the NotFoundError and using an alternative model. For example:

    try:
        answer = ask(
            "What manufacturing challenges are unique to bispecific antibodies?",
            settings=Settings(
                llm="gpt-4o-2024-08-06", summary_llm="gpt-4o-2024-08-06"
            ),
        )
    except litellm.NotFoundError:
        answer = ask(
            "What manufacturing challenges are unique to bispecific antibodies?",
            settings=Settings(
                llm="gpt-4o-mini", summary_llm="gpt-4o-mini"
            ),
        )
    

By following these steps, you should be able to resolve the NotFoundError and successfully run the pqa ask command [1].

Additionally, the AuthenticationError due to an incorrect API key (resulting in a 401 error code) suggests that the API key being used is either incorrect or not authorized. Ensure that the API key is correctly set and has the necessary permissions. The API key is typically set in the environment variables or directly in the code. For example, in the ZoteroDB class's __init__ method, the API key is retrieved from the environment variable ZOTERO_API_KEY if not provided directly [2].

To continue talking to Dosu, mention @dosu.

dosubot[bot] avatar Sep 19 '24 08:09 dosubot[bot]

It says "incorrect API key" in your error message

macromeer avatar Sep 19 '24 08:09 macromeer