dsekswqp1#
我遇到了同样的问题。有人能帮忙吗?
chy5wohz2#
请告诉我你在哪里设置它以及如何设置?请向我解释整个过程。
sshcrbum3#
首先,我运行了这个命令将 .env-template 复制到 .env。cp .env .env-template然后,我选择了 Pandas docs,但是它不起作用。我尝试使用 UI 重置 API 密钥,但这也没有使 Pandas docs 起作用。我得到了与 OP 相同的错误。我还尝试摄取 PDF,结果出现了如下错误片段。我已经附上了我的完整日志,这些试验的结果就是这篇文章中解释的。PS. 我使用了与 OpenAI 相同的 API 密钥来设置 OPENAI_API_KEY 和 EMBEDDINGS_KEY 的值。我真的不明白什么是 EMBEDDINGS_KEY,但我发现我可以使用相同的密钥,但这可能是一个错误。
cp .env .env-template
WARN[0000] The "VITE_API_STREAMING" variable is not set. Defaulting to a blank string. [+] Building 0.0s (0/0) [+] Running 5/5 ✔ Container docsgpt-redis-1 Running 0.0s ✔ Container docsgpt-mongo-1 Running 0.0s ✔ Container docsgpt-worker-1 Recreated 0.5s ✔ Container docsgpt-backend-1 Recreated 0.5s ✔ Container docsgpt-frontend-1 Recreated 0.4s Attaching to docsgpt-backend-1, docsgpt-frontend-1, docsgpt-mongo-1, docsgpt-redis-1, docsgpt-worker-1 docsgpt-backend-1 | [2023-06-16 12:35:51 +0000] [1] [INFO] Starting gunicorn 20.1.0 docsgpt-backend-1 | [2023-06-16 12:35:51 +0000] [1] [INFO] Listening at: http://0.0.0.0:5001 (1) docsgpt-backend-1 | [2023-06-16 12:35:51 +0000] [1] [INFO] Using worker: sync docsgpt-backend-1 | [2023-06-16 12:35:51 +0000] [7] [INFO] Booting worker with pid: 7 docsgpt-backend-1 | [2023-06-16 12:35:51 +0000] [8] [INFO] Booting worker with pid: 8 docsgpt-frontend-1 | docsgpt-frontend-1 | > frontend@0.0.0 dev docsgpt-frontend-1 | > vite "--host" docsgpt-frontend-1 | docsgpt-frontend-1 | docsgpt-frontend-1 | VITE v4.1.4 ready in 1255 ms docsgpt-frontend-1 | docsgpt-frontend-1 | ➜ Local: http://localhost:5173/ docsgpt-frontend-1 | ➜ Network: http://172.19.0.6:5173/ docsgpt-mongo-1 | {"t":{"$date":"2023-06-16T12:36:05.104+00:00"},"s":"I", "c":"NETWORK", "id":22943, "ctx":"listener","msg":"Connection accepted","attr":{"remote":"172.19.0.4:47926","uuid":"62f6907e-11ac-4064-9be1-5f2f22d59248","connectionId":1,"connectionCount":1}} docsgpt-worker-1 | /usr/local/lib/python3.10/site-packages/celery/platforms.py:840: SecurityWarning: You're running the worker with superuser privileges: this is docsgpt-worker-1 | absolutely not recommended! docsgpt-worker-1 | docsgpt-worker-1 | Please specify a different user using the --uid option. docsgpt-worker-1 | docsgpt-worker-1 | User information: uid=0 euid=0 gid=0 egid=0 docsgpt-worker-1 | docsgpt-worker-1 | warnings.warn(SecurityWarning(ROOT_DISCOURAGED.format( docsgpt-mongo-1 | {"t":{"$date":"2023-06-16T12:36:05.261+00:00"},"s":"I", "c":"NETWORK", "id":51800, "ctx":"conn1","msg":"client metadata","attr":{"remote":"172.19.0.4:47926","client":"conn1","doc":{"driver":{"name":"PyMongo","version":"4.3.3"},"os":{"type":"Linux","name":"Linux","architecture":"x86_64","version":"5.15.49-linuxkit-pr"},"platform":"CPython 3.10.12.final.0"}}} docsgpt-mongo-1 | {"t":{"$date":"2023-06-16T12:36:05.302+00:00"},"s":"I", "c":"NETWORK", "id":22943, "ctx":"listener","msg":"Connection accepted","attr":{"remote":"172.19.0.4:47930","uuid":"49352790-203b-42ae-98d2-7a6c1cff7df2","connectionId":2,"connectionCount":2}} docsgpt-mongo-1 | {"t":{"$date":"2023-06-16T12:36:05.321+00:00"},"s":"I", "c":"NETWORK", "id":51800, "ctx":"conn2","msg":"client metadata","attr":{"remote":"172.19.0.4:47930","client":"conn2","doc":{"driver":{"name":"PyMongo","version":"4.3.3"},"os":{"type":"Linux","name":"Linux","architecture":"x86_64","version":"5.15.49-linuxkit-pr"},"platform":"CPython 3.10.12.final.0"}}} docsgpt-worker-1 | docsgpt-worker-1 | -------------- celery@c72ac0a422a8 v5.2.7 (dawn-chorus) docsgpt-worker-1 | --- ***** ----- docsgpt-worker-1 | -- ******* ---- Linux-5.15.49-linuxkit-pr-x86_64-with-glibc2.31 2023-06-16 12:36:05 docsgpt-worker-1 | - *** --- * --- docsgpt-worker-1 | - ** ---------- [config] docsgpt-worker-1 | - ** ---------- .> app: __main__:0x7f88a293d8d0 docsgpt-worker-1 | - ** ---------- .> transport: redis://redis:6379/0 docsgpt-worker-1 | - ** ---------- .> results: redis://redis:6379/1 docsgpt-worker-1 | - *** --- * --- .> concurrency: 4 (prefork) docsgpt-worker-1 | -- ******* ---- .> task events: OFF (enable -E to monitor tasks in this worker) docsgpt-worker-1 | --- ***** ----- docsgpt-worker-1 | -------------- [queues] docsgpt-worker-1 | .> celery exchange=celery(direct) key=celery docsgpt-worker-1 | docsgpt-worker-1 | docsgpt-worker-1 | [tasks] docsgpt-worker-1 | . app.ingest docsgpt-worker-1 | docsgpt-backend-1 | [nltk_data] Error with downloaded zip file docsgpt-mongo-1 | {"t":{"$date":"2023-06-16T12:36:06.255+00:00"},"s":"I", "c":"NETWORK", "id":22943, "ctx":"listener","msg":"Connection accepted","attr":{"remote":"172.19.0.5:59578","uuid":"937c48e9-430b-4c22-8455-58f155918b46","connectionId":3,"connectionCount":3}} docsgpt-mongo-1 | {"t":{"$date":"2023-06-16T12:36:06.281+00:00"},"s":"I", "c":"NETWORK", "id":51800, "ctx":"conn3","msg":"client metadata","attr":{"remote":"172.19.0.5:59578","client":"conn3","doc":{"driver":{"name":"PyMongo","version":"4.3.3"},"os":{"type":"Linux","name":"Linux","architecture":"x86_64","version":"5.15.49-linuxkit-pr"},"platform":"CPython 3.10.12.final.0"}}} docsgpt-mongo-1 | {"t":{"$date":"2023-06-16T12:36:06.314+00:00"},"s":"I", "c":"NETWORK", "id":22943, "ctx":"listener","msg":"Connection accepted","attr":{"remote":"172.19.0.5:59582","uuid":"bd6440cb-9272-46e5-a581-f395c843ea51","connectionId":4,"connectionCount":4}} docsgpt-mongo-1 | {"t":{"$date":"2023-06-16T12:36:06.316+00:00"},"s":"I", "c":"NETWORK", "id":51800, "ctx":"conn4","msg":"client metadata","attr":{"remote":"172.19.0.5:59582","client":"conn4","doc":{"driver":{"name":"PyMongo","version":"4.3.3"},"os":{"type":"Linux","name":"Linux","architecture":"x86_64","version":"5.15.49-linuxkit-pr"},"platform":"CPython 3.10.12.final.0"}}} docsgpt-mongo-1 | {"t":{"$date":"2023-06-16T12:36:06.500+00:00"},"s":"I", "c":"NETWORK", "id":22943, "ctx":"listener","msg":"Connection accepted","attr":{"remote":"172.19.0.5:59586","uuid":"4d02debf-4808-49ae-8c7b-dbcb4fa8b964","connectionId":5,"connectionCount":5}} docsgpt-mongo-1 | {"t":{"$date":"2023-06-16T12:36:06.503+00:00"},"s":"I", "c":"NETWORK", "id":51800, "ctx":"conn5","msg":"client metadata","attr":{"remote":"172.19.0.5:59586","client":"conn5","doc":{"driver":{"name":"PyMongo","version":"4.3.3"},"os":{"type":"Linux","name":"Linux","architecture":"x86_64","version":"5.15.49-linuxkit-pr"},"platform":"CPython 3.10.12.final.0"}}} docsgpt-mongo-1 | {"t":{"$date":"2023-06-16T12:36:06.509+00:00"},"s":"I", "c":"NETWORK", "id":22943, "ctx":"listener","msg":"Connection accepted","attr":{"remote":"172.19.0.5:59588","uuid":"948d8e96-d274-4508-9e8d-c880de78739e","connectionId":6,"connectionCount":6}} docsgpt-mongo-1 | {"t":{"$date":"2023-06-16T12:36:06.515+00:00"},"s":"I", "c":"NETWORK", "id":51800, "ctx":"conn6","msg":"client metadata","attr":{"remote":"172.19.0.5:59588","client":"conn6","doc":{"driver":{"name":"PyMongo","version":"4.3.3"},"os":{"type":"Linux","name":"Linux","architecture":"x86_64","version":"5.15.49-linuxkit-pr"},"platform":"CPython 3.10.12.final.0"}}} docsgpt-worker-1 | [2023-06-16 12:36:06,873: INFO/MainProcess] Connected to redis://redis:6379/0 docsgpt-redis-1 | 1:M 16 Jun 2023 12:36:06.873 * 1 changes in 3600 seconds. Saving... docsgpt-redis-1 | 1:M 16 Jun 2023 12:36:06.882 * Background saving started by pid 14 docsgpt-worker-1 | [2023-06-16 12:36:06,890: INFO/MainProcess] mingle: searching for neighbors docsgpt-redis-1 | 14:C 16 Jun 2023 12:36:06.961 * DB saved on disk docsgpt-redis-1 | 14:C 16 Jun 2023 12:36:06.962 * RDB: 0 MB of memory used by copy-on-write docsgpt-redis-1 | 1:M 16 Jun 2023 12:36:06.983 * Background saving terminated with success docsgpt-worker-1 | [2023-06-16 12:36:07,926: INFO/MainProcess] mingle: all alone docsgpt-worker-1 | [2023-06-16 12:36:08,017: INFO/MainProcess] celery@c72ac0a422a8 ready. docsgpt-redis-1 | 1:M 16 Jun 2023 13:36:07.085 * 1 changes in 3600 seconds. Saving... docsgpt-redis-1 | 1:M 16 Jun 2023 13:36:07.109 * Background saving started by pid 15 docsgpt-redis-1 | 15:C 16 Jun 2023 13:36:07.143 * DB saved on disk docsgpt-redis-1 | 15:C 16 Jun 2023 13:36:07.144 * RDB: 0 MB of memory used by copy-on-write docsgpt-redis-1 | 1:M 16 Jun 2023 13:36:07.213 * Background saving terminated with success docsgpt-mongo-1 | {"t":{"$date":"2023-06-16T14:03:53.636+00:00"},"s":"I", "c":"NETWORK", "id":22943, "ctx":"listener","msg":"Connection accepted","attr":{"remote":"172.19.0.5:38740","uuid":"5b352e1e-69cf-4c19-bef8-4921144890e8","connectionId":7,"connectionCount":7}} docsgpt-mongo-1 | {"t":{"$date":"2023-06-16T14:03:53.657+00:00"},"s":"I", "c":"NETWORK", "id":51800, "ctx":"conn7","msg":"client metadata","attr":{"remote":"172.19.0.5:38740","client":"conn7","doc":{"driver":{"name":"PyMongo","version":"4.3.3"},"os":{"type":"Linux","name":"Linux","architecture":"x86_64","version":"5.15.49-linuxkit-pr"},"platform":"CPython 3.10.12.final.0"}}} docsgpt-mongo-1 | {"t":{"$date":"2023-06-16T14:03:54.725+00:00"},"s":"I", "c":"NETWORK", "id":22943, "ctx":"listener","msg":"Connection accepted","attr":{"remote":"172.19.0.5:38748","uuid":"4b6fabfa-ca24-4104-ab67-a50ba16c76ac","connectionId":8,"connectionCount":8}} docsgpt-mongo-1 | {"t":{"$date":"2023-06-16T14:03:54.729+00:00"},"s":"I", "c":"NETWORK", "id":51800, "ctx":"conn8","msg":"client metadata","attr":{"remote":"172.19.0.5:38748","client":"conn8","doc":{"driver":{"name":"PyMongo","version":"4.3.3"},"os":{"type":"Linux","name":"Linux","architecture":"x86_64","version":"5.15.49-linuxkit-pr"},"platform":"CPython 3.10.12.final.0"}}} docsgpt-backend-1 | Traceback (most recent call last): docsgpt-backend-1 | File "/app/app.py", line 294, in api_answer docsgpt-backend-1 | result = run_async_chain(chain, question, chat_history) docsgpt-backend-1 | File "/app/app.py", line 102, in run_async_chain docsgpt-backend-1 | answer = loop.run_until_complete(async_generate(chain, question, chat_history)) docsgpt-backend-1 | File "/usr/local/lib/python3.10/asyncio/base_events.py", line 649, in run_until_complete docsgpt-backend-1 | return future.result() docsgpt-backend-1 | File "/app/app.py", line 93, in async_generate docsgpt-backend-1 | result = await chain.arun({"question": question, "chat_history": chat_history}) docsgpt-backend-1 | File "/usr/local/lib/python3.10/site-packages/langchain/chains/base.py", line 300, in arun docsgpt-backend-1 | return (await self.acall(args[0], callbacks=callbacks, tags=tags))[ docsgpt-backend-1 | File "/usr/local/lib/python3.10/site-packages/langchain/chains/base.py", line 198, in acall docsgpt-backend-1 | raise e docsgpt-backend-1 | File "/usr/local/lib/python3.10/site-packages/langchain/chains/base.py", line 192, in acall docsgpt-backend-1 | await self._acall(inputs, run_manager=run_manager) docsgpt-backend-1 | File "/usr/local/lib/python3.10/site-packages/langchain/chains/conversational_retrieval/base.py", line 144, in _acall docsgpt-backend-1 | docs = await self._aget_docs(new_question, inputs) docsgpt-backend-1 | File "/usr/local/lib/python3.10/site-packages/langchain/chains/conversational_retrieval/base.py", line 195, in _aget_docs docsgpt-backend-1 | docs = await self.retriever.aget_relevant_documents(question) docsgpt-backend-1 | File "/usr/local/lib/python3.10/site-packages/langchain/vectorstores/base.py", line 410, in aget_relevant_documents docsgpt-backend-1 | docs = await self.vectorstore.asimilarity_search( docsgpt-backend-1 | File "/usr/local/lib/python3.10/site-packages/langchain/vectorstores/base.py", line 199, in asimilarity_search docsgpt-backend-1 | return await asyncio.get_event_loop().run_in_executor(None, func) docsgpt-backend-1 | File "/usr/local/lib/python3.10/concurrent/futures/thread.py", line 58, in run docsgpt-backend-1 | result = self.fn(*self.args, **self.kwargs) docsgpt-backend-1 | File "/usr/local/lib/python3.10/site-packages/langchain/vectorstores/faiss.py", line 303, in similarity_search docsgpt-backend-1 | docs_and_scores = self.similarity_search_with_score( docsgpt-backend-1 | File "/usr/local/lib/python3.10/site-packages/langchain/vectorstores/faiss.py", line 244, in similarity_search_with_score docsgpt-backend-1 | embedding = self.embedding_function(query) docsgpt-backend-1 | File "/usr/local/lib/python3.10/site-packages/langchain/embeddings/openai.py", line 316, in embed_query docsgpt-backend-1 | embedding = self._embedding_func(text, engine=self.deployment) docsgpt-backend-1 | File "/usr/local/lib/python3.10/site-packages/langchain/embeddings/openai.py", line 282, in _embedding_func docsgpt-backend-1 | return embed_with_retry( docsgpt-backend-1 | File "/usr/local/lib/python3.10/site-packages/langchain/embeddings/openai.py", line 64, in embed_with_retry docsgpt-backend-1 | return _embed_with_retry(**kwargs) docsgpt-backend-1 | File "/usr/local/lib/python3.10/site-packages/tenacity/__init__.py", line 289, in wrapped_f docsgpt-backend-1 | return self(f, *args, **kw) docsgpt-backend-1 | File "/usr/local/lib/python3.10/site-packages/tenacity/__init__.py", line 379, in __call__ docsgpt-backend-1 | do = self.iter(retry_state=retry_state) docsgpt-backend-1 | File "/usr/local/lib/python3.10/site-packages/tenacity/__init__.py", line 314, in iter docsgpt-backend-1 | return fut.result() docsgpt-backend-1 | File "/usr/local/lib/python3.10/concurrent/futures/_base.py", line 451, in result docsgpt-backend-1 | return self.__get_result() docsgpt-backend-1 | File "/usr/local/lib/python3.10/concurrent/futures/_base.py", line 403, in __get_result docsgpt-backend-1 | raise self._exception docsgpt-backend-1 | File "/usr/local/lib/python3.10/site-packages/tenacity/__init__.py", line 382, in __call__ docsgpt-backend-1 | result = fn(*args, **kwargs) docsgpt-backend-1 | File "/usr/local/lib/python3.10/site-packages/langchain/embeddings/openai.py", line 62, in _embed_with_retry docsgpt-backend-1 | return embeddings.client.create(**kwargs) docsgpt-backend-1 | File "/usr/local/lib/python3.10/site-packages/openai/api_resources/embedding.py", line 33, in create docsgpt-backend-1 | response = super().create(*args, **kwargs) docsgpt-backend-1 | File "/usr/local/lib/python3.10/site-packages/openai/api_resources/abstract/engine_api_resource.py", line 153, in create docsgpt-backend-1 | response, _, api_key = requestor.request( docsgpt-backend-1 | File "/usr/local/lib/python3.10/site-packages/openai/api_requestor.py", line 298, in request docsgpt-backend-1 | resp, got_stream = self._interpret_response(result, stream) docsgpt-backend-1 | File "/usr/local/lib/python3.10/site-packages/openai/api_requestor.py", line 700, in _interpret_response docsgpt-backend-1 | self._interpret_response_line( docsgpt-backend-1 | File "/usr/local/lib/python3.10/site-packages/openai/api_requestor.py", line 763, in _interpret_response_line docsgpt-backend-1 | raise self.handle_error_response( docsgpt-backend-1 | openai.error.AuthenticationError: <empty message> docsgpt-backend-1 | Traceback (most recent call last): docsgpt-backend-1 | File "/app/app.py", line 294, in api_answer docsgpt-backend-1 | result = run_async_chain(chain, question, chat_history) docsgpt-backend-1 | File "/app/app.py", line 102, in run_async_chain docsgpt-backend-1 | answer = loop.run_until_complete(async_generate(chain, question, chat_history)) docsgpt-backend-1 | File "/usr/local/lib/python3.10/asyncio/base_events.py", line 649, in run_until_complete docsgpt-backend-1 | return future.result() docsgpt-backend-1 | File "/app/app.py", line 93, in async_generate docsgpt-backend-1 | result = await chain.arun({"question": question, "chat_history": chat_history}) docsgpt-backend-1 | File "/usr/local/lib/python3.10/site-packages/langchain/chains/base.py", line 300, in arun docsgpt-backend-1 | return (await self.acall(args[0], callbacks=callbacks, tags=tags))[ docsgpt-backend-1 | File "/usr/local/lib/python3.10/site-packages/langchain/chains/base.py", line 198, in acall docsgpt-backend-1 | raise e docsgpt-backend-1 | File "/usr/local/lib/python3.10/site-packages/langchain/chains/base.py", line 192, in acall docsgpt-backend-1 | await self._acall(inputs, run_manager=run_manager) docsgpt-backend-1 | File "/usr/local/lib/python3.10/site-packages/langchain/chains/conversational_retrieval/base.py", line 144, in _acall docsgpt-backend-1 | docs = await self._aget_docs(new_question, inputs) docsgpt-backend-1 | File "/usr/local/lib/python3.10/site-packages/langchain/chains/conversational_retrieval/base.py", line 195, in _aget_docs docsgpt-backend-1 | docs = await self.retriever.aget_relevant_documents(question) docsgpt-backend-1 | File "/usr/local/lib/python3.10/site-packages/langchain/vectorstores/base.py", line 410, in aget_relevant_documents docsgpt-backend-1 | docs = await self.vectorstore.asimilarity_search( docsgpt-backend-1 | File "/usr/local/lib/python3.10/site-packages/langchain/vectorstores/base.py", line 199, in asimilarity_search docsgpt-backend-1 | return await asyncio.get_event_loop().run_in_executor(None, func) docsgpt-backend-1 | File "/usr/local/lib/python3.10/concurrent/futures/thread.py", line 58, in run docsgpt-backend-1 | result = self.fn(*self.args, **self.kwargs) docsgpt-backend-1 | File "/usr/local/lib/python3.10/site-packages/langchain/vectorstores/faiss.py", line 303, in similarity_search docsgpt-backend-1 | docs_and_scores = self.similarity_search_with_score( docsgpt-backend-1 | File "/usr/local/lib/python3.10/site-packages/langchain/vectorstores/faiss.py", line 244, in similarity_search_with_score docsgpt-backend-1 | embedding = self.embedding_function(query) docsgpt-backend-1 | File "/usr/local/lib/python3.10/site-packages/langchain/embeddings/openai.py", line 316, in embed_query docsgpt-backend-1 | embedding = self._embedding_func(text, engine=self.deployment) docsgpt-backend-1 | File "/usr/local/lib/python3.10/site-packages/langchain/embeddings/openai.py", line 282, in _embedding_func docsgpt-backend-1 | return embed_with_retry( docsgpt-backend-1 | File "/usr/local/lib/python3.10/site-packages/langchain/embeddings/openai.py", line 64, in embed_with_retry docsgpt-backend-1 | return _embed_with_retry(**kwargs) docsgpt-backend-1 | File "/usr/local/lib/python3.10/site-packages/tenacity/__init__.py", line 289, in wrapped_f docsgpt-backend-1 | return self(f, *args, **kw) docsgpt-backend-1 | File "/usr/local/lib/python3.10/site-packages/tenacity/__init__.py", line 379, in __call__ docsgpt-backend-1 | do = self.iter(retry_state=retry_state) docsgpt-backend-1 | File "/usr/local/lib/python3.10/site-packages/tenacity/__init__.py", line 314, in iter docsgpt-backend-1 | return fut.result() docsgpt-backend-1 | File "/usr/local/lib/python3.10/concurrent/futures/_base.py", line 451, in result docsgpt-backend-1 | return self.__get_result() docsgpt-backend-1 | File "/usr/local/lib/python3.10/concurrent/futures/_base.py", line 403, in __get_result docsgpt-backend-1 | raise self._exception docsgpt-backend-1 | File "/usr/local/lib/python3.10/site-packages/tenacity/__init__.py", line 382, in __call__ docsgpt-backend-1 | result = fn(*args, **kwargs) docsgpt-backend-1 | File "/usr/local/lib/python3.10/site-packages/langchain/embeddings/openai.py", line 62, in _embed_with_retry docsgpt-backend-1 | return embeddings.client.create(**kwargs) docsgpt-backend-1 | File "/usr/local/lib/python3.10/site-packages/openai/api_resources/embedding.py", line 33, in create docsgpt-backend-1 | response = super().create(*args, **kwargs) docsgpt-backend-1 | File "/usr/local/lib/python3.10/site-packages/openai/api_resources/abstract/engine_api_resource.py", line 153, in create docsgpt-backend-1 | response, _, api_key = requestor.request( docsgpt-backend-1 | File "/usr/local/lib/python3.10/site-packages/openai/api_requestor.py", line 298, in request docsgpt-backend-1 | resp, got_stream = self._interpret_response(result, stream) docsgpt-backend-1 | File "/usr/local/lib/python3.10/site-packages/openai/api_requestor.py", line 700, in _interpret_response docsgpt-backend-1 | self._interpret_response_line( docsgpt-backend-1 | File "/usr/local/lib/python3.10/site-packages/openai/api_requestor.py", line 763, in _interpret_response_line docsgpt-backend-1 | raise self.handle_error_response( docsgpt-backend-1 | openai.error.AuthenticationError: <empty message> docsgpt-worker-1 | [2023-06-16 14:06:26,939: INFO/MainProcess] Task app.ingest[0c0e66a4-d9fe-4fdd-bdc9-e2f9d1a906cd] received docsgpt-worker-1 | [2023-06-16 14:06:28,576: WARNING/ForkPoolWorker-1] Grouping small documents docsgpt-mongo-1 | {"t":{"$date":"2023-06-16T14:06:30.136+00:00"},"s":"I", "c":"WRITE", "id":51803, "ctx":"LogicalSessionCacheRefresh","msg":"Slow query","attr":{"type":"update","ns":"config.system.sessions","command":{"q":{"_id":{"id":{"$uuid":"c229e1e8-ad3b-4ec5-a738-fd8aa3dc8447"},"uid":{"$binary":{"base64":"47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU=","subType":"0"}}}},"u":[{"$set":{"lastUse":"$$NOW"}}],"multi":false,"upsert":true},"planSummary":"IDHACK","keysExamined":0,"docsExamined":0,"nMatched":0,"nModified":0,"nUpserted":1,"keysInserted":2,"numYields":0,"locks":{"ParallelBatchWriterMode":{"acquireCount":{"r":1}},"FeatureCompatibilityVersion":{"acquireCount":{"r":1,"w":1}},"ReplicationStateTransition":{"acquireCount":{"w":1}},"Global":{"acquireCount":{"r":1,"w":1}},"Database":{"acquireCount":{"w":1}},"Collection":{"acquireCount":{"w":1}},"Mutex":{"acquireCount":{"r":2}}},"flowControl":{"acquireCount":1,"timeAcquiringMicros":4},"storage":{},"durationMillis":100}} docsgpt-mongo-1 | {"t":{"$date":"2023-06-16T14:06:30.148+00:00"},"s":"I", "c":"COMMAND", "id":51803, "ctx":"LogicalSessionCacheRefresh","msg":"Slow query","attr":{"type":"command","ns":"config.$cmd","command":{"update":"system.sessions","ordered":false,"writeConcern":{"w":"majority","wtimeout":15000},"$db":"config"},"numYields":0,"reslen":267,"locks":{"ParallelBatchWriterMode":{"acquireCount":{"r":2}},"FeatureCompatibilityVersion":{"acquireCount":{"r":2,"w":2}},"ReplicationStateTransition":{"acquireCount":{"w":3}},"Global":{"acquireCount":{"r":2,"w":2}},"Database":{"acquireCount":{"w":2}},"Collection":{"acquireCount":{"w":2}},"Mutex":{"acquireCount":{"r":3}}},"flowControl":{"acquireCount":2,"timeAcquiringMicros":7},"writeConcern":{"w":"majority","wtimeout":15000,"provenance":"clientSupplied"},"storage":{},"protocol":"op_msg","durationMillis":122}} docsgpt-worker-1 | [2023-06-16 14:06:35,077: WARNING/ForkPoolWorker-1] Separating large documents docsgpt-worker-1 | [2023-06-16 14:06:35,528: INFO/ForkPoolWorker-1] error_code=invalid_api_key error_message= error_param=None error_type=invalid_request_error message='OpenAI API error received' stream_error=False docsgpt-worker-1 | [2023-06-16 14:06:35,543: ERROR/ForkPoolWorker-1] Task app.ingest[0c0e66a4-d9fe-4fdd-bdc9-e2f9d1a906cd] raised unexpected: AuthenticationError(message='', http_status=401, request_id=None) docsgpt-worker-1 | Traceback (most recent call last): docsgpt-worker-1 | File "/usr/local/lib/python3.10/site-packages/celery/app/trace.py", line 451, in trace_task docsgpt-worker-1 | R = retval = fun(*args, **kwargs) docsgpt-worker-1 | File "/usr/local/lib/python3.10/site-packages/celery/app/trace.py", line 734, in __protected_call__ docsgpt-worker-1 | return self.run(*args, **kwargs) docsgpt-worker-1 | File "/app/app.py", line 139, in ingest docsgpt-worker-1 | resp = ingest_worker(self, directory, formats, name_job, filename, user) docsgpt-worker-1 | File "/app/worker.py", line 69, in ingest_worker docsgpt-worker-1 | call_openai_api(docs, full_path, self) docsgpt-worker-1 | File "/app/parser/open_ai_func.py", line 40, in call_openai_api docsgpt-worker-1 | store = FAISS.from_documents(docs_test, OpenAIEmbeddings(openai_api_key=os.getenv("EMBEDDINGS_KEY"))) docsgpt-worker-1 | File "/usr/local/lib/python3.10/site-packages/langchain/vectorstores/base.py", line 317, in from_documents docsgpt-worker-1 | return cls.from_texts(texts, embedding, metadatas=metadatas, **kwargs) docsgpt-worker-1 | File "/usr/local/lib/python3.10/site-packages/langchain/vectorstores/faiss.py", line 501, in from_texts docsgpt-worker-1 | embeddings = embedding.embed_documents(texts) docsgpt-worker-1 | File "/usr/local/lib/python3.10/site-packages/langchain/embeddings/openai.py", line 305, in embed_documents docsgpt-worker-1 | return self._get_len_safe_embeddings(texts, engine=self.deployment) docsgpt-worker-1 | File "/usr/local/lib/python3.10/site-packages/langchain/embeddings/openai.py", line 243, in _get_len_safe_embeddings docsgpt-worker-1 | response = embed_with_retry( docsgpt-worker-1 | File "/usr/local/lib/python3.10/site-packages/langchain/embeddings/openai.py", line 64, in embed_with_retry docsgpt-worker-1 | return _embed_with_retry(**kwargs) docsgpt-worker-1 | File "/usr/local/lib/python3.10/site-packages/tenacity/__init__.py", line 289, in wrapped_f docsgpt-worker-1 | return self(f, *args, **kw) docsgpt-worker-1 | File "/usr/local/lib/python3.10/site-packages/tenacity/__init__.py", line 379, in __call__ docsgpt-worker-1 | do = self.iter(retry_state=retry_state) docsgpt-worker-1 | File "/usr/local/lib/python3.10/site-packages/tenacity/__init__.py", line 314, in iter docsgpt-worker-1 | return fut.result() docsgpt-worker-1 | File "/usr/local/lib/python3.10/concurrent/futures/_base.py", line 451, in result docsgpt-worker-1 | return self.__get_result() docsgpt-worker-1 | File "/usr/local/lib/python3.10/concurrent/futures/_base.py", line 403, in __get_result docsgpt-worker-1 | raise self._exception docsgpt-worker-1 | File "/usr/local/lib/python3.10/site-packages/tenacity/__init__.py", line 382, in __call__ docsgpt-worker-1 | result = fn(*args, **kwargs) docsgpt-worker-1 | File "/usr/local/lib/python3.10/site-packages/langchain/embeddings/openai.py", line 62, in _embed_with_retry docsgpt-worker-1 | return embeddings.client.create(**kwargs) docsgpt-worker-1 | File "/usr/local/lib/python3.10/site-packages/openai/api_resources/embedding.py", line 33, in create docsgpt-worker-1 | response = super().create(*args, **kwargs) docsgpt-worker-1 | File "/usr/local/lib/python3.10/site-packages/openai/api_resources/abstract/engine_api_resource.py", line 153, in create docsgpt-worker-1 | response, _, api_key = requestor.request( docsgpt-worker-1 | File "/usr/local/lib/python3.10/site-packages/openai/api_requestor.py", line 298, in request docsgpt-worker-1 | resp, got_stream = self._interpret_response(result, stream) docsgpt-worker-1 | File "/usr/local/lib/python3.10/site-packages/openai/api_requestor.py", line 700, in _interpret_response docsgpt-worker-1 | self._interpret_response_line( docsgpt-worker-1 | File "/usr/local/lib/python3.10/site-packages/openai/api_requestor.py", line 763, in _interpret_response_line docsgpt-worker-1 | raise self.handle_error_response( docsgpt-worker-1 | openai.error.AuthenticationError: <empty message> docsgpt-backend-1 | [2023-06-16 14:06:37 +0000] [7] [ERROR] Error handling request /api/task_status?task_id=0c0e66a4-d9fe-4fdd-bdc9-e2f9d1a906cd docsgpt-backend-1 | Traceback (most recent call last): docsgpt-backend-1 | File "/usr/local/lib/python3.10/site-packages/gunicorn/workers/sync.py", line 136, in handle docsgpt-backend-1 | self.handle_request(listener, req, client, addr) docsgpt-backend-1 | File "/usr/local/lib/python3.10/site-packages/gunicorn/workers/sync.py", line 179, in handle_request docsgpt-backend-1 | respiter = self.wsgi(environ, resp.start_response) docsgpt-backend-1 | File "/usr/local/lib/python3.10/site-packages/flask/app.py", line 2551, in __call__ docsgpt-backend-1 | return self.wsgi_app(environ, start_response) docsgpt-backend-1 | File "/usr/local/lib/python3.10/site-packages/flask/app.py", line 2531, in wsgi_app docsgpt-backend-1 | response = self.handle_exception(e) docsgpt-backend-1 | File "/usr/local/lib/python3.10/site-packages/flask/app.py", line 2528, in wsgi_app docsgpt-backend-1 | response = self.full_dispatch_request() docsgpt-backend-1 | File "/usr/local/lib/python3.10/site-packages/flask/app.py", line 1826, in full_dispatch_request docsgpt-backend-1 | return self.finalize_request(rv) docsgpt-backend-1 | File "/usr/local/lib/python3.10/site-packages/flask/app.py", line 1845, in finalize_request docsgpt-backend-1 | response = self.make_response(rv) docsgpt-backend-1 | File "/usr/local/lib/python3.10/site-packages/flask/app.py", line 2156, in make_response docsgpt-backend-1 | rv = self.json.response(rv) docsgpt-backend-1 | File "/usr/local/lib/python3.10/site-packages/flask/json/provider.py", line 309, in response docsgpt-backend-1 | f"{self.dumps(obj, **dump_args)}\n", mimetype=mimetype docsgpt-backend-1 | File "/usr/local/lib/python3.10/site-packages/flask/json/provider.py", line 230, in dumps docsgpt-backend-1 | return json.dumps(obj, **kwargs) docsgpt-backend-1 | File "/usr/local/lib/python3.10/json/__init__.py", line 238, in dumps docsgpt-backend-1 | **kw).encode(obj) docsgpt-backend-1 | File "/usr/local/lib/python3.10/json/encoder.py", line 201, in encode docsgpt-backend-1 | chunks = list(chunks) docsgpt-backend-1 | File "/usr/local/lib/python3.10/json/encoder.py", line 431, in _iterencode docsgpt-backend-1 | yield from _iterencode_dict(o, _current_indent_level) docsgpt-backend-1 | File "/usr/local/lib/python3.10/json/encoder.py", line 405, in _iterencode_dict docsgpt-backend-1 | yield from chunks docsgpt-backend-1 | File "/usr/local/lib/python3.10/json/encoder.py", line 438, in _iterencode docsgpt-backend-1 | o = _default(o) docsgpt-backend-1 | File "/usr/local/lib/python3.10/site-packages/flask/json/provider.py", line 122, in _default docsgpt-backend-1 | raise TypeError(f"Object of type {type(o).__name__} is not JSON serializable") docsgpt-backend-1 | TypeError: Object of type AuthenticationError is not JSON serializable docsgpt-backend-1 | [2023-06-16 14:06:37 +0000] [7] [ERROR] Error handling request /api/task_status?task_id=0c0e66a4-d9fe-4fdd-bdc9-e2f9d1a906cd docsgpt-backend-1 | Traceback (most recent call last): docsgpt-backend-1 | File "/usr/local/lib/python3.10/site-packages/gunicorn/workers/sync.py", line 136, in handle docsgpt-backend-1 | self.handle_request(listener, req, client, addr) docsgpt-backend-1 | File "/usr/local/lib/python3.10/site-packages/gunicorn/workers/sync.py", line 179, in handle_request docsgpt-backend-1 | respiter = self.wsgi(environ, resp.start_response) docsgpt-backend-1 | File "/usr/local/lib/python3.10/site-packages/flask/app.py", line 2551, in __call__ docsgpt-backend-1 | return self.wsgi_app(environ, start_response) docsgpt-backend-1 | File "/usr/local/lib/python3.10/site-packages/flask/app.py", line 2531, in wsgi_app docsgpt-backend-1 | response = self.handle_exception(e) docsgpt-backend-1 | File "/usr/local/lib/python3.10/site-packages/flask/app.py", line 2528, in wsgi_app docsgpt-backend-1 | response = self.full_dispatch_request() docsgpt-backend-1 | File "/usr/local/lib/python3.10/site-packages/flask/app.py", line 1826, in full_dispatch_request docsgpt-backend-1 | return self.finalize_request(rv) docsgpt-backend-1 | File "/usr/local/lib/python3.10/site-packages/flask/app.py", line 1845, in finalize_request docsgpt-backend-1 | response = self.make_response(rv) docsgpt-backend-1 | File "/usr/local/lib/python3.10/site-packages/flask/app.py", line 2156, in make_response docsgpt-backend-1 | rv = self.json.response(rv) docsgpt-backend-1 | File "/usr/local/lib/python3.10/site-packages/flask/json/provider.py", line 309, in response docsgpt-backend-1 | f"{self.dumps(obj, **dump_args)}\n", mimetype=mimetype docsgpt-backend-1 | File "/usr/local/lib/python3.10/site-packages/flask/json/provider.py", line 230, in dumps docsgpt-backend-1 | return json.dumps(obj, **kwargs) docsgpt-backend-1 | File "/usr/local/lib/python3.10/json/__init__.py", line 238, in dumps docsgpt-backend-1 | **kw).encode(obj) docsgpt-backend-1 | File "/usr/local/lib/python3.10/json/encoder.py", line 201, in encode docsgpt-backend-1 | chunks = list(chunks) docsgpt-backend-1 | File "/usr/local/lib/python3.10/json/encoder.py", line 431, in _iterencode docsgpt-backend-1 | yield from _iterencode_dict(o, _current_indent_level) docsgpt-backend-1 | File "/usr/local/lib/python3.10/json/encoder.py", line 405, in _iterencode_dict docsgpt-backend-1 | yield from chunks docsgpt-backend-1 | File "/usr/local/lib/python3.10/json/encoder.py", line 438, in _iterencode docsgpt-backend-1 | o = _default(o) docsgpt-backend-1 | File "/usr/local/lib/python3.10/site-packages/flask/json/provider.py", line 122, in _default docsgpt-backend-1 | raise TypeError(f"Object of type {type(o).__name__} is not JSON serializable") docsgpt-backend-1 | TypeError: Object of type AuthenticationError is not JSON serializable docsgpt-backend-1 | [2023-06-16 14:06:37 +0000] [7] [ERROR] Error handling request /api/task_status?task_id=0c0e66a4-d9fe-4fdd-bdc9-e2f9d1a906cd docsgpt-backend-1 | Traceback (most recent call last): docsgpt-backend-1 | File "/usr/local/lib/python3.10/site-packages/gunicorn/workers/sync.py", line 136, in handle docsgpt-backend-1 | self.handle_request(listener, req, client, addr) docsgpt-backend-1 | File "/usr/local/lib/python3.10/site-packages/gunicorn/workers/sync.py", line 179, in handle_request docsgpt-backend-1 | respiter = self.wsgi(environ, resp.start_response) docsgpt-backend-1 | File "/usr/local/lib/python3.10/site-packages/flask/app.py", line 2551, in __call__ docsgpt-backend-1 | return self.wsgi_app(environ, start_response) docsgpt-backend-1 | File "/usr/local/lib/python3.10/site-packages/flask/app.py", line 2531, in wsgi_app docsgpt-backend-1 | response = self.handle_exception(e) docsgpt-backend-1 | File "/usr/local/lib/python3.10/site-packages/flask/app.py", line 2528, in wsgi_app docsgpt-backend-1 | response = self.full_dispatch_request() docsgpt-backend-1 | File "/usr/local/lib/python3.10/site-packages/flask/app.py", line 1826, in full_dispatch_request docsgpt-backend-1 | return self.finalize_request(rv) docsgpt-backend-1 | File "/usr/local/lib/python3.10/site-packages/flask/app.py", line 1845, in finalize_request docsgpt-backend-1 | response = self.make_response(rv) docsgpt-backend-1 | File "/usr/local/lib/python3.10/site-packages/flask/app.py", line 2156, in make_response docsgpt-backend-1 | rv = self.json.response(rv) docsgpt-backend-1 | File "/usr/local/lib/python3.10/site-packages/flask/json/provider.py", line 309, in response docsgpt-backend-1 | f"{self.dumps(obj, **dump_args)}\n", mimetype=mimetype docsgpt-backend-1 | File "/usr/local/lib/python3.10/site-packages/flask/json/provider.py", line 230, in dumps docsgpt-backend-1 | return json.dumps(obj, **kwargs) docsgpt-backend-1 | File "/usr/local/lib/python3.10/json/__init__.py", line 238, in dumps docsgpt-backend-1 | **kw).encode(obj) docsgpt-backend-1 | File "/usr/local/lib/python3.10/json/encoder.py", line 201, in encode docsgpt-backend-1 | chunks = list(chunks) docsgpt-backend-1 | File "/usr/local/lib/python3.10/json/encoder.py", line 431, in _iterencode docsgpt-backend-1 | yield from _iterencode_dict(o, _current_indent_level) docsgpt-backend-1 | File "/usr/local/lib/python3.10/json/encoder.py", line 405, in _iterencode_dict docsgpt-backend-1 | yield from chunks docsgpt-backend-1 | File "/usr/local/lib/python3.10/json/encoder.py", line 438, in _iterencode docsgpt-backend-1 | o = _default(o) docsgpt-backend-1 | File "/usr/local/lib/python3.10/site-packages/flask/json/provider.py", line 122, in _default docsgpt-backend-1 | raise TypeError(f"Object of type {type(o).__name__} is not JSON serializable") docsgpt-backend-1 | TypeError: Object of type AuthenticationError is not JSON serializable docsgpt-backend-1 | [2023-06-16 14:06:37 +0000] [7] [ERROR] Error handling request /api/task_status?task_id=0c0e66a4-d9fe-4fdd-bdc9-e2f9d1a906cd docsgpt-backend-1 | Traceback (most recent call last): docsgpt-backend-1 | File "/usr/local/lib/python3.10/site-packages/gunicorn/workers/sync.py", line 136, in handle docsgpt-backend-1 | self.handle_request(listener, req, client, addr) docsgpt-backend-1 | File "/usr/local/lib/python3.10/site-packages/gunicorn/workers/sync.py", line 179, in handle_request docsgpt-backend-1 | respiter = self.wsgi(environ, resp.start_response) docsgpt-backend-1 | File "/usr/local/lib/python3.10/site-packages/flask/app.py", line 2551, in __call__ docsgpt-backend-1 | return self.wsgi_app(environ, start_response) docsgpt-backend-1 | File "/usr/local/lib/python3.10/site-packages/flask/app.py", line 2531, in wsgi_app docsgpt-backend-1 | response = self.handle_exception(e) docsgpt-backend-1 | File "/usr/local/lib/python3.10/site-packages/flask/app.py", line 2528, in wsgi_app docsgpt-backend-1 | response = self.full_dispatch_request() docsgpt-backend-1 | File "/usr/local/lib/python3.10/site-packages/flask/app.py", line 1826, in full_dispatch_request docsgpt-backend-1 | return self.finalize_request(rv) docsgpt-backend-1 | File "/usr/local/lib/python3.10/site-packages/flask/app.py", line 1845, in finalize_request docsgpt-backend-1 | response = self.make_response(rv) docsgpt-backend-1 | File "/usr/local/lib/python3.10/site-packages/flask/app.py", line 2156, in make_response docsgpt-backend-1 | rv = self.json.response(rv) docsgpt-backend-1 | File "/usr/local/lib/python3.10/site-packages/flask/json/provider.py", line 309, in response docsgpt-backend-1 | f"{self.dumps(obj, **dump_args)}\n", mimetype=mimetype docsgpt-backend-1 | File "/usr/local/lib/python3.10/site-packages/flask/json/provider.py", line 230, in dumps docsgpt-backend-1 | return json.dumps(obj, **kwargs) docsgpt-backend-1 | File "/usr/local/lib/python3.10/json/__init__.py", line 238, in dumps docsgpt-backend-1 | **kw).encode(obj) docsgpt-backend-1 | File "/usr/local/lib/python3.10/json/encoder.py", line 201, in encode docsgpt-backend-1 | chunks = list(chunks) docsgpt-backend-1 | File "/usr/local/lib/python3.10/json/encoder.py", line 431, in _iterencode docsgpt-backend-1 | yield from _iterencode_dict(o, _current_indent_level) docsgpt-backend-1 | File "/usr/local/lib/python3.10/json/encoder.py", line 405, in _iterencode_dict docsgpt-backend-1 | yield from chunks docsgpt-backend-1 | File "/usr/local/lib/python3.10/json/encoder.py", line 438, in _iterencode docsgpt-backend-1 | o = _default(o) docsgpt-backend-1 | File "/usr/local/lib/python3.10/site-packages/flask/json/provider.py", line 122, in _default docsgpt-backend-1 | raise TypeError(f"Object of type {type(o).__name__} is not JSON serializable") docsgpt-backend-1 | TypeError: Object of type AuthenticationError is not JSON serializable
kcrjzv8t4#
在最新更改后是否仍然可复现?
4条答案
按热度按时间dsekswqp1#
我遇到了同样的问题。有人能帮忙吗?
chy5wohz2#
请告诉我你在哪里设置它以及如何设置?
请向我解释整个过程。
sshcrbum3#
首先,我运行了这个命令将 .env-template 复制到 .env。
cp .env .env-template
然后,我选择了 Pandas docs,但是它不起作用。我尝试使用 UI 重置 API 密钥,但这也没有使 Pandas docs 起作用。我得到了与 OP 相同的错误。
我还尝试摄取 PDF,结果出现了如下错误片段。我已经附上了我的完整日志,这些试验的结果就是这篇文章中解释的。
PS. 我使用了与 OpenAI 相同的 API 密钥来设置 OPENAI_API_KEY 和 EMBEDDINGS_KEY 的值。我真的不明白什么是 EMBEDDINGS_KEY,但我发现我可以使用相同的密钥,但这可能是一个错误。
kcrjzv8t4#
在最新更改后是否仍然可复现?