chat-langchain
chat-langchain copied to clipboard
First request hangs and it never completes
Hello, the entire installation process completes alright, vectorstore is created, then I start the server with make start, I go to the browser and enter a query, then it freezes at "loading"
Do you see a stack trace when you exit out of the program? How about anything in the console?
Nothing in either
On Thu, Feb 16, 2023, 12:08 AM Ankush Gola @.***> wrote:
Do you see a stack trace when you exit out of the program? How about anything in the console?
— Reply to this email directly, view it on GitHub https://github.com/hwchase17/chat-langchain/issues/13#issuecomment-1432109242, or unsubscribe https://github.com/notifications/unsubscribe-auth/AECBJN2QOGSOXJ6VZGHVKEDWXVHXFANCNFSM6AAAAAAU5MCH4E . You are receiving this because you authored the thread.Message ID: @.***>
I also need to say that I'm accessing it remotely, the code runs on my VPS and Im trying to access it in my browser via the VPS IP
On Thu, Feb 16, 2023, 00:08 Ankush Gola @.***> wrote:
Do you see a stack trace when you exit out of the program? How about anything in the console?
— Reply to this email directly, view it on GitHub https://github.com/hwchase17/chat-langchain/issues/13#issuecomment-1432109242, or unsubscribe https://github.com/notifications/unsubscribe-auth/AECBJN2QOGSOXJ6VZGHVKEDWXVHXFANCNFSM6AAAAAAU5MCH4E . You are receiving this because you authored the thread.Message ID: @.***>
The same problem.
Mac os M1


@CristiVlad25 -- we haven't tested in VPS, only locally. Any other information, logs would be helpful as we can't repro.
@alex-dmowski -- I don't think this is the same issue. You're able to input questions while @CristiVlad25 immediately gets a loading button. Are you getting an APIConnectionError connecting to OpenAI in general, outside the context of running this app?
My steps to repeat:
1. langchain-server
In iterm2 terminal
>export OPENAI_API_KEY=sk-K6E****
>langchain-server
logs
[+] Running 3/3
⠿ langchain-db Pulled 1.6s
⠿ langchain-frontend Pulled 1.5s
⠿ langchain-backend Pulled 1.6s
[+] Running 3/0
⠿ Container langchain-langchain-db-1 Created 0.0s
⠿ Container langchain-langchain-backend-1 Created 0.0s
⠿ Container langchain-langchain-frontend-1 Created 0.0s
Attaching to langchain-langchain-backend-1, langchain-langchain-db-1, langchain-langchain-frontend-1
langchain-langchain-db-1 |
langchain-langchain-db-1 | PostgreSQL Database directory appears to contain a database; Skipping initialization
langchain-langchain-db-1 |
langchain-langchain-db-1 | 2023-02-16 00:45:55.941 UTC [1] LOG: starting PostgreSQL 14.1 (Debian 14.1-1.pgdg110+1) on aarch64-unknown-linux-gnu, compiled by gcc (Debian 10.2.1-6) 10.2.1 20210110, 64-bit
langchain-langchain-db-1 | 2023-02-16 00:45:55.941 UTC [1] LOG: listening on IPv4 address "0.0.0.0", port 5432
langchain-langchain-db-1 | 2023-02-16 00:45:55.941 UTC [1] LOG: listening on IPv6 address "::", port 5432
langchain-langchain-db-1 | 2023-02-16 00:45:55.946 UTC [1] LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
langchain-langchain-db-1 | 2023-02-16 00:45:55.951 UTC [26] LOG: database system was shut down at 2023-02-16 00:44:38 UTC
langchain-langchain-db-1 | 2023-02-16 00:45:55.957 UTC [1] LOG: database system is ready to accept connections
langchain-langchain-backend-1 | /code/./app/config.py:106: UserWarning: directory "/run/secrets" does not exist
langchain-langchain-backend-1 | settings = Settings(LANGCHAIN_ENV=LANGCHAIN_ENV, _env_file=f"app/.env.{LANGCHAIN_ENV}")
langchain-langchain-frontend-1 |
langchain-langchain-frontend-1 | > [email protected] preview
langchain-langchain-frontend-1 | > vite preview --host
langchain-langchain-frontend-1 |
langchain-langchain-backend-1 | INFO: Started server process [1]
langchain-langchain-backend-1 | INFO: Waiting for application startup.
langchain-langchain-backend-1 | INFO: Application startup complete.
langchain-langchain-backend-1 | INFO: Uvicorn running on http://0.0.0.0:8000 (Press CTRL+C to quit)
langchain-langchain-frontend-1 |
langchain-langchain-frontend-1 | PUBLIC_BASE_URL is set to: http://localhost:8000
langchain-langchain-frontend-1 | DEV_MODE is set to: true
langchain-langchain-frontend-1 | ➜ Local: http://localhost:4173/
langchain-langchain-frontend-1 | ➜ Network: http://172.19.0.4:4173/
langchain-langchain-backend-1 | INFO: 172.19.0.4:42116 - "GET /sessions HTTP/1.1" 200 OK
2. Chat
In separate tab, I am trying to run chat
chat-langchain % export OPENAI_API_KEY=sk-***
pip3 install -r requirements.txt
Logs
Requirement already satisfied: openai in /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages (from -r requirements.txt (line 1)) (0.26.5)
Requirement already satisfied: fastapi in /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages (from -r requirements.txt (line 2)) (0.92.0)
Requirement already satisfied: black in /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages (from -r requirements.txt (line 3)) (23.1.0)
Requirement already satisfied: isort in /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages (from -r requirements.txt (line 4)) (5.12.0)
Requirement already satisfied: websockets in /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages (from -r requirements.txt (line 5)) (10.4)
Requirement already satisfied: pydantic in /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages (from -r requirements.txt (line 6)) (1.10.4)
Requirement already satisfied: langchain in /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages (from -r requirements.txt (line 7)) (0.0.87)
Requirement already satisfied: uvicorn in /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages (from -r requirements.txt (line 8)) (0.20.0)
Requirement already satisfied: jinja2 in /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages (from -r requirements.txt (line 9)) (3.1.2)
Requirement already satisfied: faiss-cpu in /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages (from -r requirements.txt (line 10)) (1.7.3)
Requirement already satisfied: bs4 in /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages (from -r requirements.txt (line 11)) (0.0.1)
Requirement already satisfied: unstructured in /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages (from -r requirements.txt (line 12)) (0.4.8)
Requirement already satisfied: libmagic in /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages (from -r requirements.txt (line 13)) (1.0)
Requirement already satisfied: requests>=2.20 in /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages (from openai->-r requirements.txt (line 1)) (2.28.2)
Requirement already satisfied: tqdm in /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages (from openai->-r requirements.txt (line 1)) (4.64.1)
Requirement already satisfied: aiohttp in /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages (from openai->-r requirements.txt (line 1)) (3.8.4)
Requirement already satisfied: starlette<0.26.0,>=0.25.0 in /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages (from fastapi->-r requirements.txt (line 2)) (0.25.0)
Requirement already satisfied: click>=8.0.0 in /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages (from black->-r requirements.txt (line 3)) (8.1.3)
Requirement already satisfied: mypy-extensions>=0.4.3 in /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages (from black->-r requirements.txt (line 3)) (1.0.0)
Requirement already satisfied: packaging>=22.0 in /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages (from black->-r requirements.txt (line 3)) (23.0)
Requirement already satisfied: pathspec>=0.9.0 in /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages (from black->-r requirements.txt (line 3)) (0.11.0)
Requirement already satisfied: platformdirs>=2 in /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages (from black->-r requirements.txt (line 3)) (3.0.0)
Requirement already satisfied: typing-extensions>=4.2.0 in /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages (from pydantic->-r requirements.txt (line 6)) (4.5.0)
Requirement already satisfied: PyYAML<7,>=6 in /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages (from langchain->-r requirements.txt (line 7)) (6.0)
Requirement already satisfied: SQLAlchemy<2,>=1 in /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages (from langchain->-r requirements.txt (line 7)) (1.4.46)
Requirement already satisfied: dataclasses-json<0.6.0,>=0.5.7 in /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages (from langchain->-r requirements.txt (line 7)) (0.5.7)
Requirement already satisfied: numpy<2,>=1 in /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages (from langchain->-r requirements.txt (line 7)) (1.23.5)
Requirement already satisfied: tenacity<9.0.0,>=8.1.0 in /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages (from langchain->-r requirements.txt (line 7)) (8.2.1)
Requirement already satisfied: h11>=0.8 in /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages (from uvicorn->-r requirements.txt (line 8)) (0.14.0)
Requirement already satisfied: MarkupSafe>=2.0 in /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages (from jinja2->-r requirements.txt (line 9)) (2.1.2)
Requirement already satisfied: beautifulsoup4 in /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages (from bs4->-r requirements.txt (line 11)) (4.11.2)
Requirement already satisfied: argilla in /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages (from unstructured->-r requirements.txt (line 12)) (1.3.0)
Requirement already satisfied: lxml in /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages (from unstructured->-r requirements.txt (line 12)) (4.9.2)
Requirement already satisfied: nltk in /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages (from unstructured->-r requirements.txt (line 12)) (3.8.1)
Requirement already satisfied: openpyxl in /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages (from unstructured->-r requirements.txt (line 12)) (3.1.1)
Requirement already satisfied: pandas in /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages (from unstructured->-r requirements.txt (line 12)) (1.5.3)
Requirement already satisfied: pillow in /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages (from unstructured->-r requirements.txt (line 12)) (9.4.0)
Requirement already satisfied: python-docx in /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages (from unstructured->-r requirements.txt (line 12)) (0.8.11)
Requirement already satisfied: python-pptx in /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages (from unstructured->-r requirements.txt (line 12)) (0.6.21)
Requirement already satisfied: python-magic in /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages (from unstructured->-r requirements.txt (line 12)) (0.4.27)
Requirement already satisfied: certifi>=2022.12.07 in /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages (from unstructured->-r requirements.txt (line 12)) (2022.12.7)
Requirement already satisfied: attrs>=17.3.0 in /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages (from aiohttp->openai->-r requirements.txt (line 1)) (22.2.0)
Requirement already satisfied: charset-normalizer<4.0,>=2.0 in /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages (from aiohttp->openai->-r requirements.txt (line 1)) (3.0.1)
Requirement already satisfied: multidict<7.0,>=4.5 in /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages (from aiohttp->openai->-r requirements.txt (line 1)) (6.0.4)
Requirement already satisfied: async-timeout<5.0,>=4.0.0a3 in /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages (from aiohttp->openai->-r requirements.txt (line 1)) (4.0.2)
Requirement already satisfied: yarl<2.0,>=1.0 in /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages (from aiohttp->openai->-r requirements.txt (line 1)) (1.8.2)
Requirement already satisfied: frozenlist>=1.1.1 in /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages (from aiohttp->openai->-r requirements.txt (line 1)) (1.3.3)
Requirement already satisfied: aiosignal>=1.1.2 in /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages (from aiohttp->openai->-r requirements.txt (line 1)) (1.3.1)
Requirement already satisfied: marshmallow<4.0.0,>=3.3.0 in /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages (from dataclasses-json<0.6.0,>=0.5.7->langchain->-r requirements.txt (line 7)) (3.19.0)
Requirement already satisfied: marshmallow-enum<2.0.0,>=1.5.1 in /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages (from dataclasses-json<0.6.0,>=0.5.7->langchain->-r requirements.txt (line 7)) (1.5.1)
Requirement already satisfied: typing-inspect>=0.4.0 in /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages (from dataclasses-json<0.6.0,>=0.5.7->langchain->-r requirements.txt (line 7)) (0.8.0)
Requirement already satisfied: idna<4,>=2.5 in /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages (from requests>=2.20->openai->-r requirements.txt (line 1)) (3.4)
Requirement already satisfied: urllib3<1.27,>=1.21.1 in /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages (from requests>=2.20->openai->-r requirements.txt (line 1)) (1.26.14)
Requirement already satisfied: anyio<5,>=3.4.0 in /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages (from starlette<0.26.0,>=0.25.0->fastapi->-r requirements.txt (line 2)) (3.6.2)
Requirement already satisfied: httpx<0.24,>=0.15 in /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages (from argilla->unstructured->-r requirements.txt (line 12)) (0.23.3)
Requirement already satisfied: deprecated~=1.2.0 in /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages (from argilla->unstructured->-r requirements.txt (line 12)) (1.2.13)
Requirement already satisfied: wrapt<1.15,>=1.13 in /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages (from argilla->unstructured->-r requirements.txt (line 12)) (1.14.1)
Requirement already satisfied: backoff in /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages (from argilla->unstructured->-r requirements.txt (line 12)) (2.2.1)
Requirement already satisfied: monotonic in /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages (from argilla->unstructured->-r requirements.txt (line 12)) (1.6)
Requirement already satisfied: python-dateutil>=2.8.1 in /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages (from pandas->unstructured->-r requirements.txt (line 12)) (2.8.2)
Requirement already satisfied: pytz>=2020.1 in /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages (from pandas->unstructured->-r requirements.txt (line 12)) (2022.7.1)
Requirement already satisfied: soupsieve>1.2 in /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages (from beautifulsoup4->bs4->-r requirements.txt (line 11)) (2.4)
Requirement already satisfied: joblib in /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages (from nltk->unstructured->-r requirements.txt (line 12)) (1.2.0)
Requirement already satisfied: regex>=2021.8.3 in /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages (from nltk->unstructured->-r requirements.txt (line 12)) (2022.10.31)
Requirement already satisfied: et-xmlfile in /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages (from openpyxl->unstructured->-r requirements.txt (line 12)) (1.1.0)
Requirement already satisfied: XlsxWriter>=0.5.7 in /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages (from python-pptx->unstructured->-r requirements.txt (line 12)) (3.0.8)
Requirement already satisfied: sniffio>=1.1 in /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages (from anyio<5,>=3.4.0->starlette<0.26.0,>=0.25.0->fastapi->-r requirements.txt (line 2)) (1.3.0)
Requirement already satisfied: httpcore<0.17.0,>=0.15.0 in /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages (from httpx<0.24,>=0.15->argilla->unstructured->-r requirements.txt (line 12)) (0.16.3)
Requirement already satisfied: rfc3986[idna2008]<2,>=1.3 in /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages (from httpx<0.24,>=0.15->argilla->unstructured->-r requirements.txt (line 12)) (1.5.0)
Requirement already satisfied: six>=1.5 in /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages (from python-dateutil>=2.8.1->pandas->unstructured->-r requirements.txt (line 12)) (1.16.0)
then, I am running ingest.sh
chat-langchain % sh ./ingest.sh

by the end, these lines
--2023-02-16 01:54:04-- https://langchain.readthedocs.io/en/latest/tracing/agent_with_tracing.html
Reusing existing connection to langchain.readthedocs.io:443.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]
Saving to: ‘langchain.readthedocs.io/en/latest/tracing/agent_with_tracing.html’
langchain.readthedocs.io/en/latest/tracing/agent_wit [ <=> ] 50,68K --.-KB/s in 0,004s
2023-02-16 01:54:04 (12,1 MB/s) - ‘langchain.readthedocs.io/en/latest/tracing/agent_with_tracing.html’ saved [51892]
FINISHED --2023-02-16 01:54:04--
Total wall clock time: 2m 9s
Downloaded: 263 files, 16M in 0,6s (28,4 MB/s)
/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/langchain/document_loaders/readthedocs.py:21: GuessedAtParserWarning: No parser was explicitly specified, so I'm using the best available HTML parser for this system ("lxml"). This usually isn't a problem, but if you run this code on another system, or in a different virtual environment, it may use a different parser and behave differently.
The code that caused this warning is on line 21 of the file /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/langchain/document_loaders/readthedocs.py. To get rid of this warning, pass the additional argument 'features="lxml"' to the BeautifulSoup constructor.
soup = BeautifulSoup(data)
3. make start
>make start
logs
uvicorn main:app --reload --port 9000
INFO: Will watch for changes in these directories: ['/Users/dmowski/Desktop/ai/chat-langchain']
INFO: Uvicorn running on http://127.0.0.1:9000 (Press CTRL+C to quit)
INFO: Started reloader process [19796] using StatReload
INFO: Started server process [19798]
INFO: Waiting for application startup.
INFO: Application startup complete.
4. Trying to open http://127.0.0.1:9000




After few minutes

logs
uvicorn main:app --reload --port 9000
INFO: Will watch for changes in these directories: ['/Users/dmowski/Desktop/ai/chat-langchain']
INFO: Uvicorn running on http://127.0.0.1:9000 (Press CTRL+C to quit)
INFO: Started reloader process [19796] using StatReload
INFO: Started server process [19798]
INFO: Waiting for application startup.
INFO: Application startup complete.
INFO: 127.0.0.1:53719 - "GET / HTTP/1.1" 200 OK
INFO: ('127.0.0.1', 53722) - "WebSocket /chat" [accepted]
INFO: connection open
WARNING:langchain.llms.openai:Retrying langchain.llms.openai.BaseOpenAI.acompletion_with_retry.<locals>._completion_with_retry in 4.0 seconds as it raised APIConnectionError: Error communicating with OpenAI.
WARNING:langchain.llms.openai:Retrying langchain.llms.openai.BaseOpenAI.acompletion_with_retry.<locals>._completion_with_retry in 4.0 seconds as it raised APIConnectionError: Error communicating with OpenAI.
WARNING:langchain.llms.openai:Retrying langchain.llms.openai.BaseOpenAI.acompletion_with_retry.<locals>._completion_with_retry in 4.0 seconds as it raised APIConnectionError: Error communicating with OpenAI.
WARNING:langchain.llms.openai:Retrying langchain.llms.openai.BaseOpenAI.acompletion_with_retry.<locals>._completion_with_retry in 8.0 seconds as it raised APIConnectionError: Error communicating with OpenAI.
WARNING:langchain.llms.openai:Retrying langchain.llms.openai.BaseOpenAI.acompletion_with_retry.<locals>._completion_with_retry in 10.0 seconds as it raised APIConnectionError: Error communicating with OpenAI.
ERROR:root:Error communicating with OpenAI
Logs from http://localhost:4173/session-1

Also I am able to call OpenAI api (In separate script)

@agola11 Should i create new issue?
@alex-dmowski -- yes please create an issue and move your latest comment there. For what it's worth, I followed your exact instructions step by step and could not reproduce the issue. Can you try to reinstall all your requirements? Delete your virtual environment directory, recreate it, and re install requirements into it.
You have not reproduced because you did not test remote. I do not have the option to test locally.
And I think remote is going to cover many more people especially if they want to bring this or a version of this into production.
On Thu, Feb 16, 2023, 02:38 Ankush Gola @.***> wrote:
@CristiVlad25 https://github.com/CristiVlad25 -- we haven't tested in VPS, only locally. Any other information, logs would be helpful as we can't repro.
@alex-dmowski https://github.com/alex-dmowski -- I don't think this is the same issue. You're able to input questions while @CristiVlad25 https://github.com/CristiVlad25 immediately gets a loading button. Are you getting an APIConnectionError connecting to OpenAI in general, outside the context of running this app?
— Reply to this email directly, view it on GitHub https://github.com/hwchase17/chat-langchain/issues/13#issuecomment-1432291816, or unsubscribe https://github.com/notifications/unsubscribe-auth/AECBJN3JG2VLP3SKFMD3MNTWXVZJFANCNFSM6AAAAAAU5MCH4E . You are receiving this because you were mentioned.Message ID: @.***>
For what it's worth, I tried with reverse proxy to open it in the browser, it's the same thing. I also ran it with langchain-server and it doesn't show anything.
My assumption is that for some reason it doesn't connect to the web sockets.
Facing the same issue... I need to reload the page and ask again. Sometimes it works, sometimes it just hangs
facing the same issue as @alex-dmowski
To fix this issue, it might be better to log out what's the root cause. To do that, run the following simple code
import openai
openai.api_key = os.environ[
"OPENAI_API_KEY" # put your OpenAI API key here
] # supply your API key however you choose
completion_resp = await openai.Completion.acreate(
prompt="This is a test", model="davinci"
)
print(f"========================================")
print(f"===> Async completion resp: {completion_resp}")
print(f"========================================")
Before running, change the following line: <path to openAI installation>/openai/api_requestor.py", line 604, in arequest_raw
FROM: except aiohttp.ClientError as e:
raise error.APIConnectionError("Error communicating with OpenAI") from e
TO: except aiohttp.ClientError as e:
raise error.APIConnectionError(
f"Error communicating with OpenAI: {e}")
Now, run the above code. For me, the root cause is as follows:
This seems to be a common issue with a lot of users.
To fix this SSL-certificate issue, there are 3 ways:
- Export using terminal (need to do it every time we open a new terminal):
export SSL_CERT_FILE=/etc/ssl/certs/ca-certificates.crt
- Insert the following line into the top of the main file
os.environ["SSL_CERT_FILE"] = "/etc/ssl/certs/ca-certificates.crt"
- Insert the following line to
.env
file (and make sure to insertfrom dotenv import load_dotenv; load_dotenv()
in the main file)
SSL_CERT_FILE=/etc/ssl/certs/ca-certificates.crt
For more info about this issue, Check this
@CristiVlad25 have you been able to solve this?
facing the same issue..