qdrant / rivet-plugin-qdrant

Apache License 2.0
3 stars 0 forks source link

Search Points node always errors out with "SyntaxError: Unexpected token o in JSON at position 1" #2

Closed sfile-gaicklen closed 2 months ago

sfile-gaicklen commented 3 months ago

I'm trying to use the Qdrant plugin in a very basic graph to search an existing collection. I can see all collections using the LIST COLLECTIONS node, so connectivity is not an issue. I use the GET EMBEDDING node to generate the embedding and link that to the EMBEDDING input on the SEARCH POINTS node. GET EMBEDDING returns a 1,536 length vector, but SEARCH POINTS errors out every time.

I can't be sure that this is due to the vector, of course. It could be due to the interaction with Qdrant or some other esoteric interaction.

Software versions: Qdrant: 1.8.4 node-js: 20.16.0 Rivet: 1.7.12 rivet-plugin-qdrant: 0.0.2 (also used github May 21st main branch) Windows 10 Pro

Ouput from developer console:

remote: Node Search Points (CF_QMcRmWmIqQZI6WGkU4-u6Z1xitZREjqgctDG-5bu) errored: SyntaxError: Unexpected token o in JSON at position 1
    at JSON.parse (<anonymous>)
    at Object.process (file:///C:/Users/gaicklen/AppData/Local/com.ironcladapp.rivet/plugins/rivet-plugin-qdrant-latest/package/dist/bundle.js:330:27)
    at pluginClass.process (C:\snapshot\rivet\packages\app-executor\bin\executor-bundle.cjs:67845:22)
    at #processNodeWithInputData (C:\snapshot\rivet\packages\app-executor\bin\executor-bundle.cjs:79227:36)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async #processNormalNode (C:\snapshot\rivet\packages\app-executor\bin\executor-bundle.cjs:79062:28)
    at async #processNode (C:\snapshot\rivet\packages\app-executor\bin\executor-bundle.cjs:78917:7)
    at async #processNodeIfAllInputsAvailable (C:\snapshot\rivet\packages\app-executor\bin\executor-bundle.cjs:78800:23)
    at async C:\snapshot\rivet\packages\app-executor\bin\executor-bundle.cjs:78884:9
    at async C:\snapshot\rivet\packages\app-executor\bin\executor-bundle.cjs:67179:26
index-DX_vkOMZ.js:2988 remote: Finished processing node Search Points (CF_QMcRmWmIqQZI6WGkU4)
index-DX_vkOMZ.js:2988  Error: Graph Subgraphs/Query Qdrant (6hrXphGlBeFFPuHK2Yhbr) failed to process due to errors in nodes: Search Points (CF_QMcRmWmIqQZI6WGkU4): SyntaxError: Unexpected token o in JSON at position 1

Normally, I'd expect this error to mean that JS is trying to parse JSON twice (i.e. parse the object that results when JSON is parsed.) Don't know if that's relevant here.

Anush008 commented 3 months ago

Can you share a screenshot of how you've filled the fields of the search points node?

sfile-gaicklen commented 3 months ago

As requested:

[Image Deleted]

The form:

[Image Deleted]

Anush008 commented 3 months ago

Can you set search filter to {}?

sfile-gaicklen commented 3 months ago

I changed the "Search Filter" field to "[]" and the subject error disappeared. Initially, I just set the field to blank but that resulted in a "SyntaxError: Unexpected end of JSONinput". Changing this field to "[]" got rid of that issue, and now, the result is "Error: Bad request". Clearly that means that the original issue was with the default value for the "Search Filter" field.

sfile-gaicklen commented 3 months ago

Hah! Changing to "{}" solved the problem! Many thanks!

Maybe some documentation update ... :)

Anush008 commented 2 months ago

Better would be setting the default to {} instead of null.