ItzCrazyKns / Perplexica

Perplexica is an AI-powered search engine. It is an Open source alternative to Perplexity AI
MIT License
16.45k stars 1.54k forks source link

[Help] Can not install without docker #59

Open linbojin opened 6 months ago

linbojin commented 6 months ago

Describe the bug I want to install without docker, because my working environment can only do this. I refer to the user manual and everything is done, but just after entering the query, "WebSocket is already in CLOSING or CLOSED state." is displayed.

nvm install 18.17.0
nvm use 18.17.0
cd Perplexica
npm i 
npm run build
npm run start

cd ui/  
npm i 
npm run build
npm run start

ui/.env

NEXT_PUBLIC_WS_URL=ws://xxxx/aaa/proxy/3001
NEXT_PUBLIC_API_URL=http://xxx/aaa/proxy/3001/api

and api url is working fine.

Screenshots image image

Can I get more logs about WebSocket? There are no errors in the terminal currently.

image image

Thank you for your wonderful project.

ItzCrazyKns commented 6 months ago

Hi, can you try refreshing the page and see if it works. Make sure the console is open while you refresh the page. If the error message again pops up after refreshing the page (before sending a message) it indicates that either the embedding model could not be loaded or the chat model.

linbojin commented 6 months ago

image

I can open http://xxx/aaa/proxy/3001/api/models

{
  "chatModelProviders": {
    "openai": {
      "GPT-4 turbo": {
        "lc": 1,
        "type": "constructor",
        "id": [
          "langchain",
          "chat_models",
          "openai",
          "ChatOpenAI"
        ],
        "kwargs": {
          "azure_openai_api_key": {
            "lc": 1,
            "type": "secret",
            "id": [
              "AZURE_OPENAI_API_KEY"
            ]
          },
          "azure_openai_api_version": "2024-03-01-preview",
          "azure_openai_api_deployment_name": "gpt-4-turbo",
          "azure_open_ai_base_path": "xxxxxx",
          "model": "gpt-4-turbo"
        }
      }
    },
    "custom_openai": {
    }
  },
linbojin commented 6 months ago

Hi, can you try refreshing the page and see if it works. Make sure the console is open while you refresh the page. If the error message again pops up after refreshing the page (before sending a message) it indicates that either the embedding model could not be loaded or the chat model.

Can I get error logs about "the embedding/chat model could not be loaded"

ItzCrazyKns commented 6 months ago

You're caught by an CORS error, unfortunately we only provide support for the installation of Perplexica and not for its deployment on some domain. I've pushed a new commit that should fix this problem, the HTTP requests that were being sent were having no Content-Type headers and that might be the reason CORS was blocking it. Try pulling the latest version of Perplexica from the main branch and it should fix the problem

linbojin commented 6 months ago

Yes, the CORS error is gone after pulling the latest version, Thx. There are no errors after refreshing the page (before sending a message). image

but after I send a query, the “webSocket is already in CLOSING or CLOSED state.” error message again pops up . image

ItzCrazyKns commented 6 months ago

That's weird. You can join our Discord server here https://discord.gg/Sud4rUfU, so we can communicate in a better way and we can help you resolve your issue

ItzCrazyKns commented 6 months ago

The WebSocket server shouldn't just close the socket. Its made to close the socket only if the selected model is invalid that to when connecting with it, try checking your proxy once

xywglzephyr commented 5 months ago

i met similar situation.and my error like this. image my homepage is like the upper,and my setting about chat model provider can't change. image is there feasible way for me?