Skip to content

Allow vector storage query to be filtered by entities from a View.

Mark Jones requested to merge proof-of-concept/views-filter into 1.0.x

This MR enables the ChatForm to provide a filter to the vector storage based on a View as part of the build info.

The ChatFormBlock can be configured with a View ID that will be passed to the ChatForm.

If the ChatForm can access a View it will execute the View and pass the entities returned as a filter to the vector storage query.

If the View is on the page then this will include any currently applied exposed filters.

Therefore, this can be used to ask chatgpt a question about the entities and have it restricted to the same entities as the View.

However, this is not suitable for large datasets because each entity in the View result will increase the size of the filter. A future approach would use the Search API & Views config to recreate filters on specific fields/values rather than execute the View to get a list of IDs.

Edited by Mark Jones

Merge request reports