mayooear / gpt4-pdf-chatbot-langchain

GPT4 & LangChain Chatbot for large PDF docs
https://www.youtube.com/watch?v=ih9PBGVVOO4
14.94k stars 3.02k forks source link

How to change the BaseUrl if I use a proxy #444

Closed scottyeung closed 11 months ago

scottyeung commented 11 months ago

I tried to change the baseUrl of OpenAi via changing the following but it says Incorrect API key provided:. Can you please advise?

  const model = new ChatOpenAI({
    temperature: 5, // increase temperature to get more creative answers
    modelName: 'gpt-4', //change this to gpt-4 if you have access
    configuration: {
      baseURL: process.env.OPENAI_BASE,
    },
  });
dosubot[bot] commented 11 months ago

🤖

It seems like you're having trouble with setting the baseURL for the OpenAI API. The error message Incorrect API key provided: suggests that there might be an issue with the API key rather than the baseURL.

Could you please confirm if you've set the API key correctly? Also, are you sure that the proxy you're using is correctly forwarding your requests to the OpenAI API?

If you're using an environment variable for the API key, make sure it's being loaded correctly in your application. If you're hardcoding it, ensure there are no extra spaces or characters.

Please provide these details so I can assist you better.


This response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research.

Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant.

If you want to continue the conversation, start your reply with @dosu-bot.