diff --git a/README.md b/README.md index 9676dd8014c..b485389fb18 100644 --- a/README.md +++ b/README.md @@ -619,7 +619,12 @@ MODELS=`[ // Optional "safetyThreshold": "BLOCK_MEDIUM_AND_ABOVE", - "apiEndpoint": "", // alternative api endpoint url + "apiEndpoint": "", // alternative api endpoint url, + "tools": [{ + "googleSearchRetrieval": { + "disableAttribution": true + } + }] }] }, ]` diff --git a/src/lib/server/endpoints/google/endpointVertex.ts b/src/lib/server/endpoints/google/endpointVertex.ts index d8d3778ae82..6392b653e1b 100644 --- a/src/lib/server/endpoints/google/endpointVertex.ts +++ b/src/lib/server/endpoints/google/endpointVertex.ts @@ -26,10 +26,11 @@ export const endpointVertexParametersSchema = z.object({ HarmBlockThreshold.BLOCK_ONLY_HIGH, ]) .optional(), + tools: z.array(z.any()), }); export function endpointVertex(input: z.input): Endpoint { - const { project, location, model, apiEndpoint, safetyThreshold } = + const { project, location, model, apiEndpoint, safetyThreshold, tools } = endpointVertexParametersSchema.parse(input); const vertex_ai = new VertexAI({ @@ -39,6 +40,8 @@ export function endpointVertex(input: z.input { + const parameters = { ...model.parameters, ...generateSettings }; + const generativeModel = vertex_ai.getGenerativeModel({ model: model.id ?? model.name, safetySettings: safetyThreshold @@ -66,10 +69,11 @@ export function endpointVertex(input: z.input