EpistasisLab / KRAGEN

Software to implement GoT with a weviate vectorized database
MIT License
588 stars 35 forks source link

API Error on KRAGEN backend #87

Open HyunjunA opened 3 months ago

HyunjunA commented 3 months ago

Describe the bug The error shown in the screenshot sometimes occurs when posting a question "Please list five genes associated with Alzheimer's disease" to the Kragen server. Specifically, the POST request to http://127.0.0.1:5050/chat/api/v1/got results in a "500 Internal Server Error." The browser console displays "Failed to fetch data: SyntaxError: Unexpected token '<', '<!doctype '... is not valid JSON," indicating that the server response was not in JSON format as expected. Instead, the server seems to have returned an HTML document (often an error page), which the client-side script attempted to parse as JSON.

To Reproduce Steps to reproduce the behavior:

  1. Ask KRAGEN the question: 'Please list five genes associated with Alzheimer's disease.
  2. Check if it shows the API call error or not by opening the console on the web.
  3. Please use docker logs to check the API calls and error messages.

Screenshots image

image
jay-m-dev commented 3 months ago

Which vector DB are you connected to when you see this error? The full AlzKB vector DB? or the local (test) vector DB?

HyunjunA commented 3 months ago

I used the full AlzKB vector DB.

jay-m-dev commented 3 months ago

If the WEAVIATE_URL and WEAVIATE_API_KEY are configured correctly, it works fine. It's likely that you mixed the test and prod WEAVIATE_API_KEYs

During troubleshooting, I found that setting the wrong WEAVIATE_API_KEY causes the IndexError you're experiencing (very likely because no "knowledge* was retrieved.)

We'll need to resolve these tasks:

@HyunjunA Please confirm if you can get this to work with the correct weaviate configuration (i.e. having the right corresponding WEAVIATE_URL and WEAVIATE_API_KEY)

HyunjunA commented 3 months ago

@jay-m-dev I believe the WEAVIATE_URL and WEAVIATE_API_KEY are configured correctly. However, I can review with you how they are set up on my local machine.

It is functioning properly, but occasionally, this error occurs.