Problem adding filter to datastore in retrieval tool. Are typedefs out of date?

I’m successfully using the VertexAI APIs via the @google-cloud/vertexai npm library to generate content using the retrieval tool into a DiscoveryEngine data store.

Now I’d like to add a filter so that the retrieval is limited to a subset of the content in the data store. The typedefs do not suggest that there is a “filter” field available for this purpose. If I ask gemini interactively about this, it suggests various ways to do this, none of which match the typedefs in the latest (1.9.3) version of the library. (I have the feeling that Gemini and other LLMs are extremely confused by a lot of conflicting documentation online about different versions of these APIs.)

I’m guessing that the problem is not in the underlying ability but, rather, in the typedefs. However, I can’t find any documentation that addresses this question.

Here’s a snippet from my current code. I want to add a “filter” term under “datastore”, but it isn’t valid.

      const vertexAIRetrievalTool: Tool | null = dataStoreId ? {
        retrieval: {
          vertexAiSearch: {
            datastore: `projects/${this.projectId}/locations/global/collections/default_collection/dataStores/${dataStoreId}`,
          },
          disableAttribution: false,
        },
      } : null;
      const generateResult = await model.generateContent({
        contents: contents,
        systemInstruction: instructions,
        tools: vertexAIRetrievalTool ? [vertexAIRetrievalTool] : [],
      });

Anyone with relevant experience?