Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Quivr sometimes cannot reply to the content of documents I upload. #1712

Closed
hongruilin opened this issue Nov 26, 2023 · 8 comments
Closed
Assignees
Labels
area: backend Related to backend functionality or under the /backend directory bug Something isn't working Stale

Comments

@hongruilin
Copy link

What happened?

Quivr sometimes cannot reply to the content of documents I upload. When I ask a question, the output content is empty, but the system log shows that the document content is being read normally. I immediately ask a second question, and Quivr can reply normally again. What is the reason why this often happens?
4

Relevant log output

No response

Twitter / LinkedIn details

No response

@hongruilin hongruilin added the bug Something isn't working label Nov 26, 2023
Copy link

dosubot bot commented Nov 26, 2023

🤖

Hello @hongruilin! I'm Dosu, a bot here to assist you with bugs, answer your questions, and guide you in contributing to Quivr. While we're waiting for a human maintainer to join us, I'm here to help you get started. Let's dive in and tackle this issue together.

Based on the information you've provided, it seems like Quivr is intermittently unable to process the content of uploaded documents. This could be due to a variety of reasons, such as network issues, file format issues, or bugs in the code.

From the context provided, I found a similar issue that was resolved: [Bug]: First installation, why is there no response?. This issue was about Quivr not responding after the first installation, which is somewhat similar to your issue of Quivr not responding to the content of uploaded documents. It might be helpful to look at the discussion and solution of this issue to see if it can provide any insights into your problem.

Quivr uses the upload_file_storage function to upload files to the storage and the DocumentSerializable class to store and process the content of the documents. If there's an exception during the upload or processing, it's logged and re-raised. Here's the relevant code:

def upload_file_storage(file, file_identifier: str):
    supabase_client: Client = get_supabase_client()
    response = supabase_client.storage.from_("quivr").upload(file_identifier, file)
    return response

class DocumentSerializable(Document):
    page_content: str
    metadata: dict = Field(default_factory=dict)

    def to_json(self) -> str:
        return json.dumps({"page_content": self.page_content, "metadata": self.metadata})

    @classmethod
    def from_json(cls, json_str: str):
        data = json.loads(json_str)
        return cls(page_content=data["page_content"], metadata=data["metadata"])

If the issue persists, it would be helpful if you could provide more information, such as the type and size of the documents you're uploading, the exact steps you're taking to upload and process the documents, and any error messages you're seeing in the logs. This will help us better understand and diagnose the problem.

Sources

@dosubot dosubot bot added the area: backend Related to backend functionality or under the /backend directory label Nov 26, 2023
@hongruilin
Copy link
Author

🤖

Hello @hongruilin! I'm Dosu, a bot here to assist you with bugs, answer your questions, and guide you in contributing to Quivr. While we're waiting for a human maintainer to join us, I'm here to help you get started. Let's dive in and tackle this issue together.

Based on the information you've provided, it seems like Quivr is intermittently unable to process the content of uploaded documents. This could be due to a variety of reasons, such as network issues, file format issues, or bugs in the code.

From the context provided, I found a similar issue that was resolved: [Bug]: First installation, why is there no response?. This issue was about Quivr not responding after the first installation, which is somewhat similar to your issue of Quivr not responding to the content of uploaded documents. It might be helpful to look at the discussion and solution of this issue to see if it can provide any insights into your problem.

Quivr uses the upload_file_storage function to upload files to the storage and the DocumentSerializable class to store and process the content of the documents. If there's an exception during the upload or processing, it's logged and re-raised. Here's the relevant code:

def upload_file_storage(file, file_identifier: str):
    supabase_client: Client = get_supabase_client()
    response = supabase_client.storage.from_("quivr").upload(file_identifier, file)
    return response

class DocumentSerializable(Document):
    page_content: str
    metadata: dict = Field(default_factory=dict)

    def to_json(self) -> str:
        return json.dumps({"page_content": self.page_content, "metadata": self.metadata})

    @classmethod
    def from_json(cls, json_str: str):
        data = json.loads(json_str)
        return cls(page_content=data["page_content"], metadata=data["metadata"])

If the issue persists, it would be helpful if you could provide more information, such as the type and size of the documents you're uploading, the exact steps you're taking to upload and process the documents, and any error messages you're seeing in the logs. This will help us better understand and diagnose the problem.

Sources

I saw the message you sent me #1402 The problem is indeed the same, but I couldn't solve it either. Do you have any more practical suggestions?

Copy link

dosubot bot commented Nov 26, 2023

🤖

Based on the information you've provided, it seems like the issue might be related to the state of the DocumentSerializable object when the first question is asked. If the document content is being read normally as per the system log, then the issue might be with how the content is being stored or retrieved.

One possible cause could be a race condition where the question is asked before the document content is fully processed and stored. This could explain why the second question can get a normal response, as by that time the processing might have completed.

To debug this, you could add some logging in the upload_file_storage function and the from_json method of the DocumentSerializable class to check the state of the document content at different stages. Here's an example of how you could do this:

def upload_file_storage(file, file_identifier: str):
    supabase_client: Client = get_supabase_client()
    response = supabase_client.storage.from_("quivr").upload(file_identifier, file)
    print(f"Upload response: {response}")  # Add logging
    return response

class DocumentSerializable(Document):
    page_content: str
    metadata: dict = Field(default_factory=dict)

    def to_json(self) -> str:
        return json.dumps({"page_content": self.page_content, "metadata": self.metadata})

    @classmethod
    def from_json(cls, json_str: str):
        data = json.loads(json_str)
        print(f"Data from JSON: {data}")  # Add logging
        return cls(page_content=data["page_content"], metadata=data["metadata"])

This should give you more information about what's happening when the document content is being processed.

If the issue persists, it would be helpful to know the exact version of Quivr you're using, as well as any error messages you're seeing in the console or logs. This will help narrow down the possible causes of the issue.

Sources


This response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research.

Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant.

If you want to continue the conversation, start your reply with @dosu-bot.

@hongruilin
Copy link
Author

🤖

Hello @hongruilin! I'm Dosu, a bot here to assist you with bugs, answer your questions, and guide you in contributing to Quivr. While we're waiting for a human maintainer to join us, I'm here to help you get started. Let's dive in and tackle this issue together.

Based on the information you've provided, it seems like Quivr is intermittently unable to process the content of uploaded documents. This could be due to a variety of reasons, such as network issues, file format issues, or bugs in the code.

From the context provided, I found a similar issue that was resolved: [Bug]: First installation, why is there no response?. This issue was about Quivr not responding after the first installation, which is somewhat similar to your issue of Quivr not responding to the content of uploaded documents. It might be helpful to look at the discussion and solution of this issue to see if it can provide any insights into your problem.

Quivr uses the upload_file_storage function to upload files to the storage and the DocumentSerializable class to store and process the content of the documents. If there's an exception during the upload or processing, it's logged and re-raised. Here's the relevant code:

def upload_file_storage(file, file_identifier: str):
    supabase_client: Client = get_supabase_client()
    response = supabase_client.storage.from_("quivr").upload(file_identifier, file)
    return response

class DocumentSerializable(Document):
    page_content: str
    metadata: dict = Field(default_factory=dict)

    def to_json(self) -> str:
        return json.dumps({"page_content": self.page_content, "metadata": self.metadata})

    @classmethod
    def from_json(cls, json_str: str):
        data = json.loads(json_str)
        return cls(page_content=data["page_content"], metadata=data["metadata"])

If the issue persists, it would be helpful if you could provide more information, such as the type and size of the documents you're uploading, the exact steps you're taking to upload and process the documents, and any error messages you're seeing in the logs. This will help us better understand and diagnose the problem.

Sources

I have observed that if I don't use my brain to send messages, Quivr will reply to them. Chat in Supabase database_ The assistant field of the history table will also be written to the content. But if I use my brain to ask questions, Quivr will reply with blank content. How can I fix the situation where there is no content written to the assistant field?

Copy link

dosubot bot commented Nov 26, 2023

🤖

Based on your description, it seems like there are two separate issues you're encountering with Quivr.

Firstly, regarding the issue of Quivr not writing any content to the assistant field in the chat_history table in the Supabase database when you use your brain to ask questions, this could be due to an error in the generate_stream method. In this method, the assistant field is initially set to an empty string and then updated with the generated tokens during the streaming process. If there's an error during this process, the assistant field might not get updated. To identify the issue, you could add error handling to catch and log any exceptions during the streaming process. Here's an example of how you could modify the code:

async for token in callback.aiter():
    try:
        logger.debug("Token: %s", token)
        response_tokens.append(token)
        streamed_chat_history.assistant = token
        yield f"data: {json.dumps(streamed_chat_history.dict())}"
    except Exception as e:
        logger.error(f"Error during streaming: {e}")

This will log any exceptions that occur during the streaming process, which should help you identify the issue.

Secondly, regarding the intermittent issue of Quivr being unable to process the content of uploaded documents, the provided context does not contain enough information to identify the cause of the problem. The issue could be due to various factors such as file format, file size, or an error in the document processing code. Could you provide more information about the specific errors or issues you're encountering? For example, are there any error messages displayed when the issue occurs? What types of documents are you trying to upload (e.g., PDF, Word)? Are there specific documents that consistently cause the issue, or does it seem to occur randomly? This additional information will help in diagnosing the issue.

Sources


This response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research.

Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant.

If you want to continue the conversation, start your reply with @dosu-bot.

@hongruilin
Copy link
Author

🤖

Hello @hongruilin! I'm Dosu, a bot here to assist you with bugs, answer your questions, and guide you in contributing to Quivr. While we're waiting for a human maintainer to join us, I'm here to help you get started. Let's dive in and tackle this issue together.

Based on the information you've provided, it seems like Quivr is intermittently unable to process the content of uploaded documents. This could be due to a variety of reasons, such as network issues, file format issues, or bugs in the code.

From the context provided, I found a similar issue that was resolved: [Bug]: First installation, why is there no response?. This issue was about Quivr not responding after the first installation, which is somewhat similar to your issue of Quivr not responding to the content of uploaded documents. It might be helpful to look at the discussion and solution of this issue to see if it can provide any insights into your problem.

Quivr uses the function to upload files to the storage and the class to store and process the content of the documents. If there's an exception during the upload or processing, it's logged and re-raised. Here's the relevant code:upload_file_storage``DocumentSerializable

def upload_file_storage(file, file_identifier: str):
    supabase_client: Client = get_supabase_client()
    response = supabase_client.storage.from_("quivr").upload(file_identifier, file)
    return response

class DocumentSerializable(Document):
    page_content: str
    metadata: dict = Field(default_factory=dict)

    def to_json(self) -> str:
        return json.dumps({"page_content": self.page_content, "metadata": self.metadata})

    @classmethod
    def from_json(cls, json_str: str):
        data = json.loads(json_str)
        return cls(page_content=data["page_content"], metadata=data["metadata"])

If the issue persists, it would be helpful if you could provide more information, such as the type and size of the documents you're uploading, the exact steps you're taking to upload and process the documents, and any error messages you're seeing in the logs. This will help us better understand and diagnose the problem.

Sources

I have redeployed Quivr and have not uploaded any documents. When I select the default brain to ask a question, it will return empty. If I do not select the default brain, it will reply normally. I have checked the server logs and obtained the following information

backend-core | 2023-11-27 15:20:02,481 [INFO] repository.chat.create_chat: New chat entry in chats table for user f6420558-056f-4699-bb85-cf16960ce753
backend-core | 2023-11-27 15:20:03,006:INFO - HTTP Request: POST https://vhbwmlbjqbdeoxhdhuyd.supabase.co/rest/v1/chats "HTTP/1.1 201 Created"
backend-core | 2023-11-27 15:20:03,007 [INFO] repository.chat.create_chat: Insert response [{'chat_id': 'bff40da1-6b20-4199-85d3-1263a93ab1fb', 'user_id': 'f6420558-056f-4699-bb85-cf16960ce753', 'creation_time': '2023-11-27T15:20:03.006055', 'history': None, 'chat_name': '你好'}]
backend-core | INFO: 13.230.43.211:1387 - "POST /chat HTTP/1.1" 200 OK
backend-core | INFO: 13.230.43.211:1387 - "OPTIONS /chat/bff40da1-6b20-4199-85d3-1263a93ab1fb/question/stream?brain_id=a485993b-6b6f-4f51-8907-228c833a9383 HTTP/1.1" 200 OK
backend-core | 2023-11-27 15:20:07,921:INFO - HTTP Request: GET https://vhbwmlbjqbdeoxhdhuyd.supabase.co/rest/v1/chats?select=chat_id%2Cuser_id%2Ccreation_time%2Cchat_name&user_id=eq.f6420558-056f-4699-bb85-cf16960ce753&order=creation_time "HTTP/1.1 200 OK"
backend-core | INFO: 13.230.43.211:32649 - "GET /chat HTTP/1.1" 200 OK
backend-core | 2023-11-27 15:20:08,033:INFO - HTTP Request: GET https://vhbwmlbjqbdeoxhdhuyd.supabase.co/rest/v1/brains?select=%2A&brain_id=eq.a485993b-6b6f-4f51-8907-228c833a9383 "HTTP/1.1 200 OK"
backend-core | 2023-11-27 15:20:09,213:INFO - HTTP Request: GET https://vhbwmlbjqbdeoxhdhuyd.supabase.co/rest/v1/brains_users?select=id%3Abrain_id%2C%20rights%2C%20brains%20%28id%3A%20brain_id%2C%20status%2C%20name%2C%20brain_type%29&user_id=eq.f6420558-056f-4699-bb85-cf16960ce753&brain_id=eq.a485993b-6b6f-4f51-8907-228c833a9383 "HTTP/1.1 200 OK"
backend-core | 2023-11-27 15:20:09,512:INFO - HTTP Request: GET https://vhbwmlbjqbdeoxhdhuyd.supabase.co/rest/v1/user_settings?select=%2A&user_id=eq.f6420558-056f-4699-bb85-cf16960ce753 "HTTP/1.1 200 OK"
backend-core | 2023-11-27 15:20:09,760:INFO - HTTP Request: GET https://vhbwmlbjqbdeoxhdhuyd.supabase.co/rest/v1/users?select=%2A&id=eq.f6420558-056f-4699-bb85-cf16960ce753 "HTTP/1.1 200 OK"
backend-core | 2023-11-27 15:20:10,070:INFO - HTTP Request: GET https://vhbwmlbjqbdeoxhdhuyd.supabase.co/rest/v1/customers?select=email&email=eq.495079044%40qq.com "HTTP/1.1 405 Method Not Allowed"
backend-core | 2023-11-27 15:20:10,071 [ERROR] models.databases.supabase.user_usage: Error while checking if user is a premium user
backend-core | 2023-11-27 15:20:10,071 [ERROR] models.databases.supabase.user_usage: {'code': '25006', 'details': None, 'hint': None, 'message': 'cannot execute INSERT in a read-only transaction'}
backend-core | 2023-11-27 15:20:10,071:INFO - Streaming request for gpt-3.5-turbo
backend-core | 2023-11-27 15:20:10,221:INFO - HTTP Request: GET https://vhbwmlbjqbdeoxhdhuyd.supabase.co/rest/v1/user_settings?select=%2A&user_id=eq.f6420558-056f-4699-bb85-cf16960ce753 "HTTP/1.1 200 OK"
backend-core | 2023-11-27 15:20:10,329:INFO - HTTP Request: GET https://vhbwmlbjqbdeoxhdhuyd.supabase.co/rest/v1/users?select=%2A&id=eq.f6420558-056f-4699-bb85-cf16960ce753 "HTTP/1.1 200 OK"
backend-core | 2023-11-27 15:20:10,587:INFO - HTTP Request: GET https://vhbwmlbjqbdeoxhdhuyd.supabase.co/rest/v1/customers?select=email&email=eq.495079044%40qq.com "HTTP/1.1 405 Method Not Allowed"
backend-core | 2023-11-27 15:20:10,587 [ERROR] models.databases.supabase.user_usage: Error while checking if user is a premium user
backend-core | 2023-11-27 15:20:10,587 [ERROR] models.databases.supabase.user_usage: {'code': '25006', 'details': None, 'hint': None, 'message': 'cannot execute INSERT in a read-only transaction'}
backend-core | 2023-11-27 15:20:10,870:INFO - HTTP Request: GET https://vhbwmlbjqbdeoxhdhuyd.supabase.co/rest/v1/user_daily_usage?select=daily_requests_count&user_id=eq.f6420558-056f-4699-bb85-cf16960ce753&date=eq.20231127 "HTTP/1.1 200 OK"
backend-core | 2023-11-27 15:20:11,175:INFO - HTTP Request: PATCH https://vhbwmlbjqbdeoxhdhuyd.supabase.co/rest/v1/user_daily_usage?user_id=eq.f6420558-056f-4699-bb85-cf16960ce753&date=eq.20231127 "HTTP/1.1 200 OK"
backend-core | 2023-11-27 15:20:11,176 [INFO] models.user_usage: User 495079044@qq.com request count updated to 12
backend-core | 2023-11-27 15:20:11,440:INFO - HTTP Request: GET https://vhbwmlbjqbdeoxhdhuyd.supabase.co/rest/v1/brains?select=id%3Abrain_id%2C%20name%2C%20%2A&brain_id=eq.a485993b-6b6f-4f51-8907-228c833a9383 "HTTP/1.1 200 OK"
backend-core | INFO: 13.230.43.211:25169 - "POST /chat/bff40da1-6b20-4199-85d3-1263a93ab1fb/question/stream?brain_id=a485993b-6b6f-4f51-8907-228c833a9383 HTTP/1.1" 200 OK
backend-core | 2023-11-27 15:20:11,745:INFO - HTTP Request: GET https://vhbwmlbjqbdeoxhdhuyd.supabase.co/rest/v1/chat_history?select=%2A&chat_id=eq.bff40da1-6b20-4199-85d3-1263a93ab1fb&order=message_time "HTTP/1.1 200 OK"
backend-core | 2023-11-27 15:20:12,014:INFO - HTTP Request: GET https://vhbwmlbjqbdeoxhdhuyd.supabase.co/rest/v1/brains?select=id%3Abrain_id%2C%20name%2C%20%2A&brain_id=eq.a485993b-6b6f-4f51-8907-228c833a9383 "HTTP/1.1 200 OK"
backend-core | 2023-11-27 15:20:12,306:INFO - HTTP Request: GET https://vhbwmlbjqbdeoxhdhuyd.supabase.co/rest/v1/brains?select=id%3Abrain_id%2C%20name%2C%20%2A&brain_id=eq.a485993b-6b6f-4f51-8907-228c833a9383 "HTTP/1.1 200 OK"
backend-core | 2023-11-27 15:20:12,439:INFO - HTTP Request: GET https://vhbwmlbjqbdeoxhdhuyd.supabase.co/rest/v1/brains?select=id%3Abrain_id%2C%20name%2C%20%2A&brain_id=eq.a485993b-6b6f-4f51-8907-228c833a9383 "HTTP/1.1 200 OK"
backend-core | 2023-11-27 15:20:12,724:INFO - HTTP Request: GET https://vhbwmlbjqbdeoxhdhuyd.supabase.co/rest/v1/brains?select=id%3Abrain_id%2C%20name%2C%20%2A&brain_id=eq.a485993b-6b6f-4f51-8907-228c833a9383 "HTTP/1.1 200 OK"
backend-core | 2023-11-27 15:20:13,005:INFO - HTTP Request: POST https://vhbwmlbjqbdeoxhdhuyd.supabase.co/rest/v1/chat_history "HTTP/1.1 201 Created"
backend-core | 2023-11-27 15:20:13,140:INFO - HTTP Request: GET https://vhbwmlbjqbdeoxhdhuyd.supabase.co/rest/v1/brains?select=id%3Abrain_id%2C%20name%2C%20%2A&brain_id=eq.a485993b-6b6f-4f51-8907-228c833a9383 "HTTP/1.1 200 OK"
backend-core | 2023-11-27 15:20:13,229:INFO - error_code=rate_limit_exceeded error_message='Rate limit reached for text-embedding-ada-002 in organization org-1w9YcpXjN6IXHk4tfGYHnv1m on requests per day (RPD): Limit 200, Used 200, Requested 1. Please try again in 7m12s. Visit https://platform.openai.com/account/rate-limits to learn more. You can increase your rate limit by adding a payment method to your account at https://platform.openai.com/account/billing.' error_param=None error_type=requests message='OpenAI API error received' stream_error=False
backend-core | 2023-11-27 15:20:13,229:WARNING - Retrying langchain.embeddings.openai.embed_with_retry.._embed_with_retry in 4.0 seconds as it raised RateLimitError: Rate limit reached for text-embedding-ada-002 in organization org-1w9YcpXjN6IXHk4tfGYHnv1m on requests per day (RPD): Limit 200, Used 200, Requested 1. Please try again in 7m12s. Visit https://platform.openai.com/account/rate-limits to learn more. You can increase your rate limit by adding a payment method to your account at https://platform.openai.com/account/billing..
backend-core | 2023-11-27 15:20:17,323:INFO - error_code=rate_limit_exceeded error_message='Rate limit reached for text-embedding-ada-002 in organization org-1w9YcpXjN6IXHk4tfGYHnv1m on requests per day (RPD): Limit 200, Used 200, Requested 1. Please try again in 7m12s. Visit https://platform.openai.com/account/rate-limits to learn more. You can increase your rate limit by adding a payment method to your account at https://platform.openai.com/account/billing.' error_param=None error_type=requests message='OpenAI API error received' stream_error=False
backend-core | 2023-11-27 15:20:17,324 [ERROR] llm.qa_base: Caught exception: Rate limit reached for text-embedding-ada-002 in organization org-1w9YcpXjN6IXHk4tfGYHnv1m on requests per day (RPD): Limit 200, Used 200, Requested 1. Please try again in 7m12s. Visit https://platform.openai.com/account/rate-limits to learn more. You can increase your rate limit by adding a payment method to your account at https://platform.openai.com/account/billing.
backend-core | 2023-11-27 15:20:17,324 [ERROR] llm.qa_base: Error processing source documents: 'NoneType' object has no attribute 'get'
backend-core | 2023-11-27 15:20:17,585:INFO - HTTP Request: PATCH https://vhbwmlbjqbdeoxhdhuyd.supabase.co/rest/v1/chat_history?message_id=eq.4a1205e3-96a3-4197-820e-a270af95d133 "HTTP/1.1 200 OK"
backend-core | 2023-11-27 15:20:17,586 [INFO] repository.chat.update_message_by_id: Message 4a1205e3-96a3-4197-820e-a270af95d133 updated
backend-core | INFO: 13.230.43.211:25169 - "OPTIONS /chat/bff40da1-6b20-4199-85d3-1263a93ab1fb/history HTTP/1.1" 200 OK
backend-core | 2023-11-27 15:20:18,932:INFO - HTTP Request: GET https://vhbwmlbjqbdeoxhdhuyd.supabase.co/rest/v1/onboardings?select=onboarding_a%2Conboarding_b1%2Conboarding_b2%2Conboarding_b3&user_id=eq.f6420558-056f-4699-bb85-cf16960ce753&limit=1 "HTTP/1.1 200 OK"
backend-core | INFO: 13.230.43.211:9848 - "GET /onboarding HTTP/1.1" 200 OK
backend-core | 2023-11-27 15:20:20,557:INFO - HTTP Request: GET https://vhbwmlbjqbdeoxhdhuyd.supabase.co/rest/v1/chat_history?select=%2A&chat_id=eq.bff40da1-6b20-4199-85d3-1263a93ab1fb&order=message_time "HTTP/1.1 200 OK"
backend-core | 2023-11-27 15:20:20,576:INFO - HTTP Request: GET https://vhbwmlbjqbdeoxhdhuyd.supabase.co/rest/v1/user_settings?select=%2A&user_id=eq.f6420558-056f-4699-bb85-cf16960ce753 "HTTP/1.1 200 OK"
backend-core | 2023-11-27 15:20:20,690:INFO - HTTP Request: GET https://vhbwmlbjqbdeoxhdhuyd.supabase.co/rest/v1/brains?select=id%3Abrain_id%2C%20name%2C%20%2A&brain_id=eq.a485993b-6b6f-4f51-8907-228c833a9383 "HTTP/1.1 200 OK"
backend-core | 2023-11-27 15:20:20,826:INFO - HTTP Request: GET https://vhbwmlbjqbdeoxhdhuyd.supabase.co/rest/v1/users?select=%2A&id=eq.f6420558-056f-4699-bb85-cf16960ce753 "HTTP/1.1 200 OK"
backend-core | 2023-11-27 15:20:21,078:INFO - HTTP Request: GET https://vhbwmlbjqbdeoxhdhuyd.supabase.co/rest/v1/customers?select=email&email=eq.495079044%40qq.com "HTTP/1.1 405 Method Not Allowed"
backend-core | 2023-11-27 15:20:21,079 [ERROR] models.databases.supabase.user_usage: Error while checking if user is a premium user
backend-core | 2023-11-27 15:20:21,079 [ERROR] models.databases.supabase.user_usage: {'code': '25006', 'details': None, 'hint': None, 'message': 'cannot execute INSERT in a read-only transaction'}
backend-core | 2023-11-27 15:20:21,129:INFO - HTTP Request: GET https://vhbwmlbjqbdeoxhdhuyd.supabase.co/rest/v1/notifications?select=%2A&chat_id=eq.bff40da1-6b20-4199-85d3-1263a93ab1fb&datetime=gt.2023-11-27%2015%3A15%3A20.695816 "HTTP/1.1 200 OK"
backend-core | INFO: 13.230.43.211:23268 - "GET /chat/bff40da1-6b20-4199-85d3-1263a93ab1fb/history HTTP/1.1" 200 OK
backend-core | 2023-11-27 15:20:21,403:INFO - HTTP Request: GET https://vhbwmlbjqbdeoxhdhuyd.supabase.co/rest/v1/user_daily_usage?select=%2A&user_id=eq.f6420558-056f-4699-bb85-cf16960ce753 "HTTP/1.1 200 OK"
backend-core | 2023-11-27 15:20:21,640:INFO - HTTP Request: GET https://vhbwmlbjqbdeoxhdhuyd.supabase.co/rest/v1/brains_users?select=brain_id&user_id=eq.f6420558-056f-4699-bb85-cf16960ce753&default_brain=eq.True "HTTP/1.1 200 OK"
backend-core | 2023-11-27 15:20:21,649 [INFO] repository.brain.get_default_user_brain: Default brain response: a485993b-6b6f-4f51-8907-228c833a9383
backend-core | 2023-11-27 15:20:21,649 [INFO] repository.brain.get_default_user_brain: Default brain id: a485993b-6b6f-4f51-8907-228c833a9383
backend-core | 2023-11-27 15:20:21,924:INFO - HTTP Request: GET https://vhbwmlbjqbdeoxhdhuyd.supabase.co/rest/v1/brains?select=id%3Abrain_id%2C%20name%2C%20%2A&brain_id=eq.a485993b-6b6f-4f51-8907-228c833a9383 "HTTP/1.1 200 OK"
backend-core | 2023-11-27 15:20:22,406:INFO - HTTP Request: GET https://vhbwmlbjqbdeoxhdhuyd.supabase.co/rest/v1/brains_vectors?select=vector_id&brain_id=eq.a485993b-6b6f-4f51-8907-228c833a9383 "HTTP/1.1 200 OK"
backend-core | INFO: 13.230.43.211:11138 - "GET /user HTTP/1.1" 200 OK

Copy link

dosubot bot commented Nov 27, 2023

🤖

Hello @dosubot[bot],

Nice to meet you! I'm here to help you with your questions and issues related to the Quivr project. I'm an AI bot designed to assist users like you while waiting for a human maintainer. Don't worry, we'll work on your issues together in the meantime.

Let's get started, shall we?

Based on the information you've provided, there could be several reasons why you're experiencing these issues. Let's tackle them one by one.

Firstly, the issue where Quivr responds with blank content and fails to write to the assistant field in the chat_history table when you use your brain to ask questions. This could be due to an error in the methods responsible for generating the assistant's response and writing to the chat_history table. These include the generate_answer or generate_stream methods, the ConversationalRetrievalChain or LLMChain, the update_chat_history or update_message_by_id methods, the get_prompt_to_use or get_prompt_to_use_id methods, and the format_chat_history or get_chat_history methods.

To debug this issue, you should check the logs for any exceptions or errors that might have occurred during the execution of these methods. You should also add more logging statements to these methods to get more information about what's happening during their execution. If necessary, you could also write unit tests for these methods to ensure they're working as expected. You can find these methods in the backend/llm/qa_base.py file.

Secondly, the issue where Quivr intermittently fails to process the content of uploaded documents. This could be due to an error in the upload_file_storage function or the DocumentSerializable class. You should check the logs for any exceptions or errors that might have occurred during the execution of these functions and methods. You should also add more logging statements to these functions and methods to get more information about what's happening during their execution. If necessary, you could also write unit tests for these functions and methods to ensure they're working as expected.

Lastly, regarding the structure of the chat_history table in the Supabase database, the assistant field is of type string. This is inferred from the CreateChatHistory class and the update_chat_history method, which you can find in the backend/models/databases/supabase/chats.py file.

I hope this helps! If you need further assistance, please provide more information about the issues you're experiencing, such as any error messages you're seeing and the steps you're taking to reproduce these issues.

Sources


This response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research.

Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant.

If you want to continue the conversation, start your reply with @dosu-bot.

Copy link
Contributor

Thanks for your contributions, we'll be closing this issue as it has gone stale. Feel free to reopen if you'd like to continue the discussion.

@github-actions github-actions bot added the Stale label Dec 27, 2023
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Jan 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: backend Related to backend functionality or under the /backend directory bug Something isn't working Stale
Projects
None yet
Development

No branches or pull requests

2 participants