ruoccofabrizio / azure-open-ai-embeddings-qna

A simple web application for a OpenAI-enabled document search. This repo uses Azure OpenAI Service for creating embeddings vectors from documents. For answering the question of a user, it retrieves the most relevant document and then uses GPT-3, GPT-3.5 or GPT-4 to extract the matching answer for the question.
https://azure.microsoft.com/en-us/products/cognitive-services/openai-service
MIT License
846 stars 510 forks source link

Error while pasting text in add document section #110

Open rehat22 opened 1 year ago

rehat22 commented 1 year ago

I get the following error while pasting text : HttpResponseError: (MissingRequiredParameter) The request is invalid. Details: actions : No indexing actions found in the request. Please include between 1 and 32000 indexing actions in your request. Code: MissingRequiredParameter Message: The request is invalid. Details: actions : No indexing actions found in the request. Please include between 1 and 32000 indexing actions in your request. Exception Details: (MissingIndexDocumentsActions) No indexing actions found in the request. Please include between 1 and 32000 indexing actions in your request. Parameters: actions Code: MissingIndexDocumentsActions Message: No indexing actions found in the request. Please include between 1 and 32000 indexing actions in your request. Parameters: actions Traceback: File "/usr/local/lib/python3.9/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 561, in _run_script self._session_state.on_script_will_rerun(rerun_data.widget_states) File "/usr/local/lib/python3.9/site-packages/streamlit/runtime/state/safe_session_state.py", line 68, in on_script_will_rerun self._state.on_script_will_rerun(latest_widget_states) File "/usr/local/lib/python3.9/site-packages/streamlit/runtime/state/session_state.py", line 474, in on_script_will_rerun self._call_callbacks() File "/usr/local/lib/python3.9/site-packages/streamlit/runtime/state/session_state.py", line 487, in _call_callbacks self._new_widget_state.call_callback(wid) File "/usr/local/lib/python3.9/site-packages/streamlit/runtime/state/session_state.py", line 242, in call_callback callback(*args, kwargs) File "/usr/local/src/myscripts/pages/01_Add_Document.py", line 16, in upload_text_and_embeddings llm_helper.add_embeddings_lc(source_url) File "/usr/local/src/myscripts/utilities/helper.py", line 148, in add_embeddings_lc raise e File "/usr/local/src/myscripts/utilities/helper.py", line 142, in add_embeddings_lc self.vector_store.add_documents(documents=docs, keys=keys) File "/usr/local/lib/python3.9/site-packages/langchain/vectorstores/base.py", line 57, in add_documents return self.add_texts(texts, metadatas, kwargs) File "/usr/local/src/myscripts/utilities/azuresearch.py", line 184, in add_texts response = self.client.upload_documents(documents=data) File "/usr/local/lib/python3.9/site-packages/azure/search/documents/_search_client.py", line 544, in upload_documents results = self.index_documents(batch, kwargs) File "/usr/local/lib/python3.9/site-packages/azure/core/tracing/decorator.py", line 76, in wrapper_use_tracer return func(args, kwargs) File "/usr/local/lib/python3.9/site-packages/azure/search/documents/_search_client.py", line 635, in index_documents return self._index_documents_actions(actions=batch.actions, kwargs) File "/usr/local/lib/python3.9/site-packages/azure/search/documents/_search_client.py", line 643, in _index_documents_actions batch_response = self._client.documents.index( File "/usr/local/lib/python3.9/site-packages/azure/core/tracing/decorator.py", line 76, in wrapper_use_tracer return func(args, kwargs) File "/usr/local/lib/python3.9/site-packages/azure/search/documents/_generated/operations/_documents_operations.py", line 1270, in index raise HttpResponseError(response=response, model=error)

JoroVelev commented 11 months ago

The error you are getting means you are sending to Azure Search service an empty content for indexing. So, when you paste the text, first press Ctrl+Enter to apply the change (there is a hint for this at the bottom right corner of the input text area). Then hit Embeddings button.