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

Query after upsert-file #37

Closed
magallardo opened this issue Mar 24, 2023 · 4 comments
Closed

Query after upsert-file #37

magallardo opened this issue Mar 24, 2023 · 4 comments

Comments

@magallardo
Copy link

Hello,

I was able to call upsert-file with a pdf document and it returned successfully an id for the document. However, when I try to query I am getting a 500 Internal Server Error.

In the console running the plugin, I can see the following error:
Error: None is not a valid Source

In my query request I only provided the document_id in the filter section as the upsert-file operation does not allow to provide any other metadata.

Could you please advise how to query when the documents are added using upsert-file.

Thanks,
Marcelo

@hardbyte
Copy link

hardbyte commented Mar 25, 2023

I'm getting the same with the Weaviate provider.

The proper solution is to ensure a source gets propogated from the upsert-file endpoint (see #32).

A quick fix is to add if resp["source"] else None where it creates the DocumentChunkMetadata:

image

@CyberAmyntas
Copy link
Contributor

Hello,

I was able to call upsert-file with a pdf document and it returned successfully an id for the document. However, when I try to query I am getting a 500 Internal Server Error.

In the console running the plugin, I can see the following error: Error: None is not a valid Source

In my query request I only provided the document_id in the filter section as the upsert-file operation does not allow to provide any other metadata.

Could you please advise how to query when the documents are added using upsert-file.

Thanks, Marcelo

For the time being, when you query use the filter, source = "file" to query correctly until this is resolved.

{
  "queries": [
    {
      "query": "string",
      "filter": {
        "source": "file"
      },
      "top_k": 5
    }
  ]
}

@isafulf
Copy link
Collaborator

isafulf commented Mar 27, 2023

Thank you all!
Resolved here: e07ffed

@isafulf isafulf closed this as completed Mar 27, 2023
@olaf-hoops
Copy link

Hello,

I was able to call upsert-file with a pdf document and it returned successfully an id for the document. However, when I try to query I am getting a 500 Internal Server Error.

In the console running the plugin, I can see the following error: Error: None is not a valid Source

In my query request I only provided the document_id in the filter section as the upsert-file operation does not allow to provide any other metadata.

Could you please advise how to query when the documents are added using upsert-file.

Thanks, Marcelo

Hi Marcelo,
I'm currently trying to upsert a pdf file but I'm stuck. Always getting "Internal Server Error".
I can't seem to find proper documentation how to do it right. It would be really kind if you could show me a little code example how you uperserted a file properly.
Thank, Olaf

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants