Support "Grounding with your own data" in Google provider #4230
Open
Description
Feature Description
Following on @shaper's message in #3553 (comment), I'm creating a new issue to track the feature of being able to use Google's grounding-to-your-own data feature (https://cloud.google.com/vertex-ai/generative-ai/docs/multimodal/ground-gemini#private-ground-gemini).
Use Cases
I want to ground answers with my own data, using Google's feature for this :)
Additional context
I'd be very happy to send over a PR. Here's what I am thinking:
- Add the following setting in the
GoogleGenerativeAISettings
interface:
/**
Optional. When enabled, the model will use your own Vertex data store to ground the response.
@see https://cloud.google.com/vertex-ai/generative-ai/docs/multimodal/ground-gemini#private-ground-gemini
*/
useOwnDataGrounding?: {
datastore: string;
}
- In the
google
packageprepareTool
function:- Add a
useOwnDataGrounding: { datastore: string; } | undefined
argument. - Make it so that you can use
tools
and any of the grounding tools - Add the
{ retrieval: { vertexAiSearch: useOwnDataGrounding } }
tool ifuseOwnDataGrounding
is not undefined
- Add a
If broadly aligned, let me know and I'll send a PR.