danny-avila / LibreChat

Enhanced ChatGPT Clone: Features OpenAI, Assistants API, Azure, Groq, GPT-4 Vision, Mistral, Bing, Anthropic, OpenRouter, Vertex AI, Gemini, AI model switching, message search, langchain, DALL-E-3, ChatGPT Plugins, OpenAI Functions, Secure Multi-User System, Presets, completely open-source for self-hosting. More features in development
https://librechat.ai/
MIT License
15.69k stars 2.6k forks source link

[Bug]: When I try to run normal Bing or Sydney I get an Invalid URL error. #423

Closed Kolyanpetuh closed 1 year ago

Kolyanpetuh commented 1 year ago

Contact Details

ons44950@gmail.com

What happened?

I installed the program exactly as instructed and inserted a full cookie string into BINGAI_TOKEN, but I still get this error. I've tried restarting the computer and reinstalling the browser and the command line, but unfortunately none of this has helped me. At first I was getting a slightly different error, namely /turing/conversation/create: failed to parse response body. I am using the latest version of this software at the moment (0.4.7).

Steps to Reproduce

Just go to regular Bing or its hacked version (Sydney).

What browsers are you seeing the problem on?

No response

Relevant log output

conversationId: '0952e7ce-51d3-40ac-bbba-f9e4379dc731'
}
bing options {
  conversationId: '0952e7ce-51d3-40ac-bbba-f9e4379dc731',
  context: null,
  systemMessage: null,
  parentMessageId: '00000000-0000-0000-0000-000000000000',
  toneStyle: 'creative',
  onProgress: [Function: wrapper]
}
TypeError [ERR_INVALID_URL]: Invalid URL
    at new NodeError (node:internal/errors:399:5)
    at new URL (node:internal/url:560:13)
    at new ProxyAgent (C:\chatgpt-clone-0.4.7\node_modules\undici\lib\proxy-agent.js:77:25)
    at BingAIClient.createNewConversation (file:///C:/chatgpt-clone-0.4.7/node_modules/@waylaidwanderer/chatgpt-api/src/BingAIClient.js:75:39)
    at BingAIClient.sendMessage (file:///C:/chatgpt-clone-0.4.7/node_modules/@waylaidwanderer/chatgpt-api/src/BingAIClient.js:184:62)
    at askBing (C:\chatgpt-clone-0.4.7\api\app\clients\bingai.js:72:34)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async ask (C:\chatgpt-clone-0.4.7\api\server\routes\ask\askBingAI.js:137:20)
    at async C:\chatgpt-clone-0.4.7\api\server\routes\ask\askBingAI.js:75:10 {
  input: 'TRUE',
  code: 'ERR_INVALID_URL'
}

Screenshots

2023-06-03_15-53-08

Code of Conduct

danny-avila commented 1 year ago

Actually, I was having this issue too.

I updated to our dependency for bing's latest update

Then I needed to log into bing with edge, send a few messages, then get my full cookie string again. It's working now.

Pull the latest update for this project, made the change here: https://github.com/danny-avila/chatgpt-clone/pull/424

I believe the headers needed to change

image

Kolyanpetuh commented 1 year ago

Actually, I was having this issue too.

I updated to our dependency for bing's latest update

Then I needed to log into bing with edge, send a few messages, then get my full cookie string again. It's working now.

Pull the latest update for this project, made the change here: https://github.com/danny-avila/chatgpt-clone/pull/424

I believe the headers needed to change

image

I realise that my question may be rather silly, but how can I pull this update?

danny-avila commented 1 year ago

No worries! Go into the directory you have the project in and open the terminal from there. Make sure the app is not running. You need git installed to do this but run the following from the directory and it will pull the latest updates.

git checkout main
git pull origin main

image

You will need to run npm ci again after doing this.

Or you can download the project over again however you did before, and set it up as before.

Kolyanpetuh commented 1 year ago

No worries! Go into the directory you have the project in and open the terminal from there. Make sure the app is not running. You need git installed to do this but run the following from the directory and it will pull the latest updates.

git checkout main
git pull origin main

image

You will need to run npm ci again after doing this.

Or you can download the project over again however you did before, and set it up as before.

I installed git in the project directory and ran the "git checkout main" command, but I get this error: fatal: not a git repository (or any of the parent directories): .git

Kolyanpetuh commented 1 year ago

No worries! Go into the directory you have the project in and open the terminal from there. Make sure the app is not running. You need git installed to do this but run the following from the directory and it will pull the latest updates.

git checkout main
git pull origin main

image

You will need to run npm ci again after doing this.

Or you can download the project over again however you did before, and set it up as before.

Answer me please...

danny-avila commented 1 year ago

How did you download the project in the first place? you may need to run git init then git remote add origin https://github.com/danny-avila/chatgpt-clone.git

as I said before, if you have issues, just download and setup as you did before

Kolyanpetuh commented 1 year ago

How did you download the project in the first place? you may need to run git init then git remote add origin https://github.com/danny-avila/chatgpt-clone.git

as I said before, if you have issues, just download and setup as you did before

I could of course just reinstall the project, but I have to figure out why my git commands aren't working? Can you please help me to set up this problem? I've tried to install git to both the standard directory (C:/Program Files) and the project directory (C:/cahtgpt-clone), but nothing works in either case. I always opened the command line in the project directory. Now I get this error: Reinitialized existing Git repository in C:/chatgpt-clone-0.4.7/.git/

danny-avila commented 1 year ago

Now I get this error: Reinitialized existing Git repository in C:/chatgpt-clone-0.4.7/.git/

This is not an error, this is just git telling you it already exists

Here's what you should do:

  1. Open a command prompt.

  2. Navigate to the directory where the project is located. For example, if the project is in a directory named chatgpt-clone on the C: drive, you would type cd C:/chatgpt-clone. Alternatively, open the project directory in your file explorer, right-click empty space, and select the option to open the terminal from there.

  3. Run git init. This initializes a new Git repository in the current directory. Since the repository is already there, Git will tell you that it's reinitializing the repository, but that's okay.

  4. Run git remote add origin https://github.com/danny-avila/chatgpt-clone.git. This sets up a link (called a "remote") between the local repository and the repository on GitHub.

  5. Run git pull origin main. This will fetch the latest changes from the GitHub repository and merge them into the local repository.

If you're still having issues, you should start over in a different folder location with git: git clone https://github.com/danny-avila/chatgpt-clone.git

psarno commented 1 year ago

@Kolyanpetuh If you aren't too familiar with git and you just downloaded the entire project directly as a zip (instead of cloning it), what you can do is retain a copy of your modified .env file and simply redownload the zip of the latest version, delete what you have, and unzip the new copy.

If you want to use MeiliSearch you will need to bring that executable back in also, I do not use it.

Then, take the copy of your .env file and put it back where it belongs, and delete the .env.example one from /client.

@danny-avila can correct me if I'm wrong here but without needing to go into the arcane magic of git command line, that should do the trick.

Kolyanpetuh commented 1 year ago

@Kolyanpetuh If you aren't too familiar with git and you just downloaded the entire project directly as a zip (instead of cloning it), what you can do is retain a copy of your modified .env file and simply redownload the zip of the latest version and replace what you have.

Then, take the copy of your .env file and put it back where it belongs, and delete the example one.

@danny-avila can correct me if I'm wrong here but without needing to go into the arcane magic of git command line, that shoul do the trick.

I'm not stupid about this, and I did everything right. I didn't download the project as a zip, but unzipped it to the root of my system drive. And I renamed .env.example to just .env. But for some reason I still get this error.

psarno commented 1 year ago

I didn't download the project as a zip, but unzipped it to the root of my system drive

That would be a contradictory statement.

Did you clone it or download a zip?

And I never called you stupid, so let's chill out a bit. It's not like I'm getting paid to try to help you out here.

Kolyanpetuh commented 1 year ago

I didn't download the project as a zip, but unzipped it to the root of my system drive

That would be a contradictory statement.

Did you clone it or download a zip?

To be honest, I don't really understand you. I downloaded the zip first and then unzipped the chatgpt-clone folder from there. I didn't create the project in zip format.

danny-avila commented 1 year ago

Since the main issue you brought up is resolved, I'm closing this. If you need help setting up the project further, you can open a Discussion under Troubleshooting or visit our discord server. @psarno thanks for supporting!