@genkit-ai/vertexai
Version:
Genkit AI framework plugin for Google Cloud Vertex AI APIs including Gemini APIs, Imagen, and more.
1,589 lines (1,586 loc) • 213 kB
text/typescript
import { z, JSONSchema, Genkit, ModelReference as ModelReference$1 } from 'genkit';
import { GoogleAuthOptions } from 'google-auth-library';
import { HarmCategory, HarmBlockThreshold, FunctionDeclaration, Content, GenerateContentCandidate, VertexAI } from '@google-cloud/vertexai';
import { ModelReference, ToolDefinitionSchema, MessageData, ModelInfo, CandidateData, GenerateRequest, ModelAction } from 'genkit/model';
/**
* Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* Zod schema of Gemini model options.
*/
declare const GeminiConfigSchema: z.ZodObject<z.objectUtil.extendShape<{
version: z.ZodOptional<z.ZodString>;
temperature: z.ZodOptional<z.ZodNumber>;
maxOutputTokens: z.ZodOptional<z.ZodNumber>;
topK: z.ZodOptional<z.ZodNumber>;
topP: z.ZodOptional<z.ZodNumber>;
stopSequences: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
}, {
location: z.ZodOptional<z.ZodString>;
/**
* Safety filter settings. See: https://cloud.google.com/vertex-ai/generative-ai/docs/multimodal/configure-safety-filters#configurable-filters
*
* E.g.
*
* ```js
* config: {
* safetySettings: [
* {
* category: 'HARM_CATEGORY_HATE_SPEECH',
* threshold: 'BLOCK_LOW_AND_ABOVE',
* },
* {
* category: 'HARM_CATEGORY_DANGEROUS_CONTENT',
* threshold: 'BLOCK_MEDIUM_AND_ABOVE',
* },
* {
* category: 'HARM_CATEGORY_HARASSMENT',
* threshold: 'BLOCK_ONLY_HIGH',
* },
* {
* category: 'HARM_CATEGORY_SEXUALLY_EXPLICIT',
* threshold: 'BLOCK_NONE',
* },
* ],
* }
* ```
*/
safetySettings: z.ZodOptional<z.ZodArray<z.ZodObject<{
category: z.ZodNativeEnum<typeof HarmCategory>;
threshold: z.ZodNativeEnum<typeof HarmBlockThreshold>;
}, "strip", z.ZodTypeAny, {
category: HarmCategory;
threshold: HarmBlockThreshold;
}, {
category: HarmCategory;
threshold: HarmBlockThreshold;
}>, "many">>;
/**
* Vertex retrieval options.
*
* E.g.
*
* ```js
* config: {
* vertexRetrieval: {
* datastore: {
* projectId: 'your-cloud-project',
* location: 'us-central1',
* collection: 'your-collection',
* },
* disableAttribution: true,
* }
* }
* ```
*/
vertexRetrieval: z.ZodOptional<z.ZodObject<{
datastore: z.ZodObject<{
projectId: z.ZodOptional<z.ZodString>;
location: z.ZodOptional<z.ZodString>;
dataStoreId: z.ZodString;
}, "strip", z.ZodTypeAny, {
dataStoreId: string;
location?: string | undefined;
projectId?: string | undefined;
}, {
dataStoreId: string;
location?: string | undefined;
projectId?: string | undefined;
}>;
disableAttribution: z.ZodOptional<z.ZodBoolean>;
}, "strip", z.ZodTypeAny, {
datastore: {
dataStoreId: string;
location?: string | undefined;
projectId?: string | undefined;
};
disableAttribution?: boolean | undefined;
}, {
datastore: {
dataStoreId: string;
location?: string | undefined;
projectId?: string | undefined;
};
disableAttribution?: boolean | undefined;
}>>;
/**
* Google Search retrieval options.
*
* ```js
* config: {
* googleSearchRetrieval: {
* disableAttribution: true,
* }
* }
* ```
*/
googleSearchRetrieval: z.ZodOptional<z.ZodObject<{
disableAttribution: z.ZodOptional<z.ZodBoolean>;
}, "strip", z.ZodTypeAny, {
disableAttribution?: boolean | undefined;
}, {
disableAttribution?: boolean | undefined;
}>>;
/**
* Function calling options.
*
* E.g. forced tool call:
*
* ```js
* config: {
* functionCallingConfig: {
* mode: 'ANY',
* }
* }
* ```
*/
functionCallingConfig: z.ZodOptional<z.ZodObject<{
mode: z.ZodOptional<z.ZodEnum<["MODE_UNSPECIFIED", "AUTO", "ANY", "NONE"]>>;
allowedFunctionNames: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
}, "strip", z.ZodTypeAny, {
mode?: "MODE_UNSPECIFIED" | "AUTO" | "ANY" | "NONE" | undefined;
allowedFunctionNames?: string[] | undefined;
}, {
mode?: "MODE_UNSPECIFIED" | "AUTO" | "ANY" | "NONE" | undefined;
allowedFunctionNames?: string[] | undefined;
}>>;
}>, "strip", z.ZodTypeAny, {
location?: string | undefined;
version?: string | undefined;
safetySettings?: {
category: HarmCategory;
threshold: HarmBlockThreshold;
}[] | undefined;
vertexRetrieval?: {
datastore: {
dataStoreId: string;
location?: string | undefined;
projectId?: string | undefined;
};
disableAttribution?: boolean | undefined;
} | undefined;
googleSearchRetrieval?: {
disableAttribution?: boolean | undefined;
} | undefined;
functionCallingConfig?: {
mode?: "MODE_UNSPECIFIED" | "AUTO" | "ANY" | "NONE" | undefined;
allowedFunctionNames?: string[] | undefined;
} | undefined;
temperature?: number | undefined;
maxOutputTokens?: number | undefined;
topK?: number | undefined;
topP?: number | undefined;
stopSequences?: string[] | undefined;
}, {
location?: string | undefined;
version?: string | undefined;
safetySettings?: {
category: HarmCategory;
threshold: HarmBlockThreshold;
}[] | undefined;
vertexRetrieval?: {
datastore: {
dataStoreId: string;
location?: string | undefined;
projectId?: string | undefined;
};
disableAttribution?: boolean | undefined;
} | undefined;
googleSearchRetrieval?: {
disableAttribution?: boolean | undefined;
} | undefined;
functionCallingConfig?: {
mode?: "MODE_UNSPECIFIED" | "AUTO" | "ANY" | "NONE" | undefined;
allowedFunctionNames?: string[] | undefined;
} | undefined;
temperature?: number | undefined;
maxOutputTokens?: number | undefined;
topK?: number | undefined;
topP?: number | undefined;
stopSequences?: string[] | undefined;
}>;
/**
* Known model names, to allow code completion for convenience. Allows other model names.
*/
type GeminiVersionString = keyof typeof SUPPORTED_GEMINI_MODELS | (string & {});
/**
* Returns a reference to a model that can be used in generate calls.
*
* ```js
* await ai.generate({
* prompt: 'hi',
* model: gemini('gemini-1.5-flash')
* });
* ```
*/
declare function gemini(version: GeminiVersionString, options?: GeminiConfig): ModelReference<typeof GeminiConfigSchema>;
/**
* Gemini model configuration options.
*
* E.g.
* ```js
* config: {
* temperature: 0.9,
* maxOutputTokens: 300,
* safetySettings: [
* {
* category: 'HARM_CATEGORY_HATE_SPEECH',
* threshold: 'BLOCK_LOW_AND_ABOVE',
* },
* {
* category: 'HARM_CATEGORY_DANGEROUS_CONTENT',
* threshold: 'BLOCK_MEDIUM_AND_ABOVE',
* },
* {
* category: 'HARM_CATEGORY_HARASSMENT',
* threshold: 'BLOCK_ONLY_HIGH',
* },
* {
* category: 'HARM_CATEGORY_SEXUALLY_EXPLICIT',
* threshold: 'BLOCK_NONE',
* },
* ],
* functionCallingConfig: {
* mode: 'ANY',
* }
* }
* ```
*/
type GeminiConfig = z.infer<typeof GeminiConfigSchema>;
declare const gemini10Pro: ModelReference<z.ZodObject<z.objectUtil.extendShape<{
version: z.ZodOptional<z.ZodString>;
temperature: z.ZodOptional<z.ZodNumber>;
maxOutputTokens: z.ZodOptional<z.ZodNumber>;
topK: z.ZodOptional<z.ZodNumber>;
topP: z.ZodOptional<z.ZodNumber>;
stopSequences: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
}, {
location: z.ZodOptional<z.ZodString>;
/**
* Safety filter settings. See: https://cloud.google.com/vertex-ai/generative-ai/docs/multimodal/configure-safety-filters#configurable-filters
*
* E.g.
*
* ```js
* config: {
* safetySettings: [
* {
* category: 'HARM_CATEGORY_HATE_SPEECH',
* threshold: 'BLOCK_LOW_AND_ABOVE',
* },
* {
* category: 'HARM_CATEGORY_DANGEROUS_CONTENT',
* threshold: 'BLOCK_MEDIUM_AND_ABOVE',
* },
* {
* category: 'HARM_CATEGORY_HARASSMENT',
* threshold: 'BLOCK_ONLY_HIGH',
* },
* {
* category: 'HARM_CATEGORY_SEXUALLY_EXPLICIT',
* threshold: 'BLOCK_NONE',
* },
* ],
* }
* ```
*/
safetySettings: z.ZodOptional<z.ZodArray<z.ZodObject<{
category: z.ZodNativeEnum<typeof HarmCategory>;
threshold: z.ZodNativeEnum<typeof HarmBlockThreshold>;
}, "strip", z.ZodTypeAny, {
category: HarmCategory;
threshold: HarmBlockThreshold;
}, {
category: HarmCategory;
threshold: HarmBlockThreshold;
}>, "many">>;
/**
* Vertex retrieval options.
*
* E.g.
*
* ```js
* config: {
* vertexRetrieval: {
* datastore: {
* projectId: 'your-cloud-project',
* location: 'us-central1',
* collection: 'your-collection',
* },
* disableAttribution: true,
* }
* }
* ```
*/
vertexRetrieval: z.ZodOptional<z.ZodObject<{
datastore: z.ZodObject<{
projectId: z.ZodOptional<z.ZodString>;
location: z.ZodOptional<z.ZodString>;
dataStoreId: z.ZodString;
}, "strip", z.ZodTypeAny, {
dataStoreId: string;
location?: string | undefined;
projectId?: string | undefined;
}, {
dataStoreId: string;
location?: string | undefined;
projectId?: string | undefined;
}>;
disableAttribution: z.ZodOptional<z.ZodBoolean>;
}, "strip", z.ZodTypeAny, {
datastore: {
dataStoreId: string;
location?: string | undefined;
projectId?: string | undefined;
};
disableAttribution?: boolean | undefined;
}, {
datastore: {
dataStoreId: string;
location?: string | undefined;
projectId?: string | undefined;
};
disableAttribution?: boolean | undefined;
}>>;
/**
* Google Search retrieval options.
*
* ```js
* config: {
* googleSearchRetrieval: {
* disableAttribution: true,
* }
* }
* ```
*/
googleSearchRetrieval: z.ZodOptional<z.ZodObject<{
disableAttribution: z.ZodOptional<z.ZodBoolean>;
}, "strip", z.ZodTypeAny, {
disableAttribution?: boolean | undefined;
}, {
disableAttribution?: boolean | undefined;
}>>;
/**
* Function calling options.
*
* E.g. forced tool call:
*
* ```js
* config: {
* functionCallingConfig: {
* mode: 'ANY',
* }
* }
* ```
*/
functionCallingConfig: z.ZodOptional<z.ZodObject<{
mode: z.ZodOptional<z.ZodEnum<["MODE_UNSPECIFIED", "AUTO", "ANY", "NONE"]>>;
allowedFunctionNames: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
}, "strip", z.ZodTypeAny, {
mode?: "MODE_UNSPECIFIED" | "AUTO" | "ANY" | "NONE" | undefined;
allowedFunctionNames?: string[] | undefined;
}, {
mode?: "MODE_UNSPECIFIED" | "AUTO" | "ANY" | "NONE" | undefined;
allowedFunctionNames?: string[] | undefined;
}>>;
}>, "strip", z.ZodTypeAny, {
location?: string | undefined;
version?: string | undefined;
safetySettings?: {
category: HarmCategory;
threshold: HarmBlockThreshold;
}[] | undefined;
vertexRetrieval?: {
datastore: {
dataStoreId: string;
location?: string | undefined;
projectId?: string | undefined;
};
disableAttribution?: boolean | undefined;
} | undefined;
googleSearchRetrieval?: {
disableAttribution?: boolean | undefined;
} | undefined;
functionCallingConfig?: {
mode?: "MODE_UNSPECIFIED" | "AUTO" | "ANY" | "NONE" | undefined;
allowedFunctionNames?: string[] | undefined;
} | undefined;
temperature?: number | undefined;
maxOutputTokens?: number | undefined;
topK?: number | undefined;
topP?: number | undefined;
stopSequences?: string[] | undefined;
}, {
location?: string | undefined;
version?: string | undefined;
safetySettings?: {
category: HarmCategory;
threshold: HarmBlockThreshold;
}[] | undefined;
vertexRetrieval?: {
datastore: {
dataStoreId: string;
location?: string | undefined;
projectId?: string | undefined;
};
disableAttribution?: boolean | undefined;
} | undefined;
googleSearchRetrieval?: {
disableAttribution?: boolean | undefined;
} | undefined;
functionCallingConfig?: {
mode?: "MODE_UNSPECIFIED" | "AUTO" | "ANY" | "NONE" | undefined;
allowedFunctionNames?: string[] | undefined;
} | undefined;
temperature?: number | undefined;
maxOutputTokens?: number | undefined;
topK?: number | undefined;
topP?: number | undefined;
stopSequences?: string[] | undefined;
}>>;
declare const gemini15Pro: ModelReference<z.ZodObject<z.objectUtil.extendShape<{
version: z.ZodOptional<z.ZodString>;
temperature: z.ZodOptional<z.ZodNumber>;
maxOutputTokens: z.ZodOptional<z.ZodNumber>;
topK: z.ZodOptional<z.ZodNumber>;
topP: z.ZodOptional<z.ZodNumber>;
stopSequences: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
}, {
location: z.ZodOptional<z.ZodString>;
/**
* Safety filter settings. See: https://cloud.google.com/vertex-ai/generative-ai/docs/multimodal/configure-safety-filters#configurable-filters
*
* E.g.
*
* ```js
* config: {
* safetySettings: [
* {
* category: 'HARM_CATEGORY_HATE_SPEECH',
* threshold: 'BLOCK_LOW_AND_ABOVE',
* },
* {
* category: 'HARM_CATEGORY_DANGEROUS_CONTENT',
* threshold: 'BLOCK_MEDIUM_AND_ABOVE',
* },
* {
* category: 'HARM_CATEGORY_HARASSMENT',
* threshold: 'BLOCK_ONLY_HIGH',
* },
* {
* category: 'HARM_CATEGORY_SEXUALLY_EXPLICIT',
* threshold: 'BLOCK_NONE',
* },
* ],
* }
* ```
*/
safetySettings: z.ZodOptional<z.ZodArray<z.ZodObject<{
category: z.ZodNativeEnum<typeof HarmCategory>;
threshold: z.ZodNativeEnum<typeof HarmBlockThreshold>;
}, "strip", z.ZodTypeAny, {
category: HarmCategory;
threshold: HarmBlockThreshold;
}, {
category: HarmCategory;
threshold: HarmBlockThreshold;
}>, "many">>;
/**
* Vertex retrieval options.
*
* E.g.
*
* ```js
* config: {
* vertexRetrieval: {
* datastore: {
* projectId: 'your-cloud-project',
* location: 'us-central1',
* collection: 'your-collection',
* },
* disableAttribution: true,
* }
* }
* ```
*/
vertexRetrieval: z.ZodOptional<z.ZodObject<{
datastore: z.ZodObject<{
projectId: z.ZodOptional<z.ZodString>;
location: z.ZodOptional<z.ZodString>;
dataStoreId: z.ZodString;
}, "strip", z.ZodTypeAny, {
dataStoreId: string;
location?: string | undefined;
projectId?: string | undefined;
}, {
dataStoreId: string;
location?: string | undefined;
projectId?: string | undefined;
}>;
disableAttribution: z.ZodOptional<z.ZodBoolean>;
}, "strip", z.ZodTypeAny, {
datastore: {
dataStoreId: string;
location?: string | undefined;
projectId?: string | undefined;
};
disableAttribution?: boolean | undefined;
}, {
datastore: {
dataStoreId: string;
location?: string | undefined;
projectId?: string | undefined;
};
disableAttribution?: boolean | undefined;
}>>;
/**
* Google Search retrieval options.
*
* ```js
* config: {
* googleSearchRetrieval: {
* disableAttribution: true,
* }
* }
* ```
*/
googleSearchRetrieval: z.ZodOptional<z.ZodObject<{
disableAttribution: z.ZodOptional<z.ZodBoolean>;
}, "strip", z.ZodTypeAny, {
disableAttribution?: boolean | undefined;
}, {
disableAttribution?: boolean | undefined;
}>>;
/**
* Function calling options.
*
* E.g. forced tool call:
*
* ```js
* config: {
* functionCallingConfig: {
* mode: 'ANY',
* }
* }
* ```
*/
functionCallingConfig: z.ZodOptional<z.ZodObject<{
mode: z.ZodOptional<z.ZodEnum<["MODE_UNSPECIFIED", "AUTO", "ANY", "NONE"]>>;
allowedFunctionNames: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
}, "strip", z.ZodTypeAny, {
mode?: "MODE_UNSPECIFIED" | "AUTO" | "ANY" | "NONE" | undefined;
allowedFunctionNames?: string[] | undefined;
}, {
mode?: "MODE_UNSPECIFIED" | "AUTO" | "ANY" | "NONE" | undefined;
allowedFunctionNames?: string[] | undefined;
}>>;
}>, "strip", z.ZodTypeAny, {
location?: string | undefined;
version?: string | undefined;
safetySettings?: {
category: HarmCategory;
threshold: HarmBlockThreshold;
}[] | undefined;
vertexRetrieval?: {
datastore: {
dataStoreId: string;
location?: string | undefined;
projectId?: string | undefined;
};
disableAttribution?: boolean | undefined;
} | undefined;
googleSearchRetrieval?: {
disableAttribution?: boolean | undefined;
} | undefined;
functionCallingConfig?: {
mode?: "MODE_UNSPECIFIED" | "AUTO" | "ANY" | "NONE" | undefined;
allowedFunctionNames?: string[] | undefined;
} | undefined;
temperature?: number | undefined;
maxOutputTokens?: number | undefined;
topK?: number | undefined;
topP?: number | undefined;
stopSequences?: string[] | undefined;
}, {
location?: string | undefined;
version?: string | undefined;
safetySettings?: {
category: HarmCategory;
threshold: HarmBlockThreshold;
}[] | undefined;
vertexRetrieval?: {
datastore: {
dataStoreId: string;
location?: string | undefined;
projectId?: string | undefined;
};
disableAttribution?: boolean | undefined;
} | undefined;
googleSearchRetrieval?: {
disableAttribution?: boolean | undefined;
} | undefined;
functionCallingConfig?: {
mode?: "MODE_UNSPECIFIED" | "AUTO" | "ANY" | "NONE" | undefined;
allowedFunctionNames?: string[] | undefined;
} | undefined;
temperature?: number | undefined;
maxOutputTokens?: number | undefined;
topK?: number | undefined;
topP?: number | undefined;
stopSequences?: string[] | undefined;
}>>;
declare const gemini15Flash: ModelReference<z.ZodObject<z.objectUtil.extendShape<{
version: z.ZodOptional<z.ZodString>;
temperature: z.ZodOptional<z.ZodNumber>;
maxOutputTokens: z.ZodOptional<z.ZodNumber>;
topK: z.ZodOptional<z.ZodNumber>;
topP: z.ZodOptional<z.ZodNumber>;
stopSequences: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
}, {
location: z.ZodOptional<z.ZodString>;
/**
* Safety filter settings. See: https://cloud.google.com/vertex-ai/generative-ai/docs/multimodal/configure-safety-filters#configurable-filters
*
* E.g.
*
* ```js
* config: {
* safetySettings: [
* {
* category: 'HARM_CATEGORY_HATE_SPEECH',
* threshold: 'BLOCK_LOW_AND_ABOVE',
* },
* {
* category: 'HARM_CATEGORY_DANGEROUS_CONTENT',
* threshold: 'BLOCK_MEDIUM_AND_ABOVE',
* },
* {
* category: 'HARM_CATEGORY_HARASSMENT',
* threshold: 'BLOCK_ONLY_HIGH',
* },
* {
* category: 'HARM_CATEGORY_SEXUALLY_EXPLICIT',
* threshold: 'BLOCK_NONE',
* },
* ],
* }
* ```
*/
safetySettings: z.ZodOptional<z.ZodArray<z.ZodObject<{
category: z.ZodNativeEnum<typeof HarmCategory>;
threshold: z.ZodNativeEnum<typeof HarmBlockThreshold>;
}, "strip", z.ZodTypeAny, {
category: HarmCategory;
threshold: HarmBlockThreshold;
}, {
category: HarmCategory;
threshold: HarmBlockThreshold;
}>, "many">>;
/**
* Vertex retrieval options.
*
* E.g.
*
* ```js
* config: {
* vertexRetrieval: {
* datastore: {
* projectId: 'your-cloud-project',
* location: 'us-central1',
* collection: 'your-collection',
* },
* disableAttribution: true,
* }
* }
* ```
*/
vertexRetrieval: z.ZodOptional<z.ZodObject<{
datastore: z.ZodObject<{
projectId: z.ZodOptional<z.ZodString>;
location: z.ZodOptional<z.ZodString>;
dataStoreId: z.ZodString;
}, "strip", z.ZodTypeAny, {
dataStoreId: string;
location?: string | undefined;
projectId?: string | undefined;
}, {
dataStoreId: string;
location?: string | undefined;
projectId?: string | undefined;
}>;
disableAttribution: z.ZodOptional<z.ZodBoolean>;
}, "strip", z.ZodTypeAny, {
datastore: {
dataStoreId: string;
location?: string | undefined;
projectId?: string | undefined;
};
disableAttribution?: boolean | undefined;
}, {
datastore: {
dataStoreId: string;
location?: string | undefined;
projectId?: string | undefined;
};
disableAttribution?: boolean | undefined;
}>>;
/**
* Google Search retrieval options.
*
* ```js
* config: {
* googleSearchRetrieval: {
* disableAttribution: true,
* }
* }
* ```
*/
googleSearchRetrieval: z.ZodOptional<z.ZodObject<{
disableAttribution: z.ZodOptional<z.ZodBoolean>;
}, "strip", z.ZodTypeAny, {
disableAttribution?: boolean | undefined;
}, {
disableAttribution?: boolean | undefined;
}>>;
/**
* Function calling options.
*
* E.g. forced tool call:
*
* ```js
* config: {
* functionCallingConfig: {
* mode: 'ANY',
* }
* }
* ```
*/
functionCallingConfig: z.ZodOptional<z.ZodObject<{
mode: z.ZodOptional<z.ZodEnum<["MODE_UNSPECIFIED", "AUTO", "ANY", "NONE"]>>;
allowedFunctionNames: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
}, "strip", z.ZodTypeAny, {
mode?: "MODE_UNSPECIFIED" | "AUTO" | "ANY" | "NONE" | undefined;
allowedFunctionNames?: string[] | undefined;
}, {
mode?: "MODE_UNSPECIFIED" | "AUTO" | "ANY" | "NONE" | undefined;
allowedFunctionNames?: string[] | undefined;
}>>;
}>, "strip", z.ZodTypeAny, {
location?: string | undefined;
version?: string | undefined;
safetySettings?: {
category: HarmCategory;
threshold: HarmBlockThreshold;
}[] | undefined;
vertexRetrieval?: {
datastore: {
dataStoreId: string;
location?: string | undefined;
projectId?: string | undefined;
};
disableAttribution?: boolean | undefined;
} | undefined;
googleSearchRetrieval?: {
disableAttribution?: boolean | undefined;
} | undefined;
functionCallingConfig?: {
mode?: "MODE_UNSPECIFIED" | "AUTO" | "ANY" | "NONE" | undefined;
allowedFunctionNames?: string[] | undefined;
} | undefined;
temperature?: number | undefined;
maxOutputTokens?: number | undefined;
topK?: number | undefined;
topP?: number | undefined;
stopSequences?: string[] | undefined;
}, {
location?: string | undefined;
version?: string | undefined;
safetySettings?: {
category: HarmCategory;
threshold: HarmBlockThreshold;
}[] | undefined;
vertexRetrieval?: {
datastore: {
dataStoreId: string;
location?: string | undefined;
projectId?: string | undefined;
};
disableAttribution?: boolean | undefined;
} | undefined;
googleSearchRetrieval?: {
disableAttribution?: boolean | undefined;
} | undefined;
functionCallingConfig?: {
mode?: "MODE_UNSPECIFIED" | "AUTO" | "ANY" | "NONE" | undefined;
allowedFunctionNames?: string[] | undefined;
} | undefined;
temperature?: number | undefined;
maxOutputTokens?: number | undefined;
topK?: number | undefined;
topP?: number | undefined;
stopSequences?: string[] | undefined;
}>>;
declare const gemini20Flash001: ModelReference<z.ZodObject<z.objectUtil.extendShape<{
version: z.ZodOptional<z.ZodString>;
temperature: z.ZodOptional<z.ZodNumber>;
maxOutputTokens: z.ZodOptional<z.ZodNumber>;
topK: z.ZodOptional<z.ZodNumber>;
topP: z.ZodOptional<z.ZodNumber>;
stopSequences: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
}, {
location: z.ZodOptional<z.ZodString>;
/**
* Safety filter settings. See: https://cloud.google.com/vertex-ai/generative-ai/docs/multimodal/configure-safety-filters#configurable-filters
*
* E.g.
*
* ```js
* config: {
* safetySettings: [
* {
* category: 'HARM_CATEGORY_HATE_SPEECH',
* threshold: 'BLOCK_LOW_AND_ABOVE',
* },
* {
* category: 'HARM_CATEGORY_DANGEROUS_CONTENT',
* threshold: 'BLOCK_MEDIUM_AND_ABOVE',
* },
* {
* category: 'HARM_CATEGORY_HARASSMENT',
* threshold: 'BLOCK_ONLY_HIGH',
* },
* {
* category: 'HARM_CATEGORY_SEXUALLY_EXPLICIT',
* threshold: 'BLOCK_NONE',
* },
* ],
* }
* ```
*/
safetySettings: z.ZodOptional<z.ZodArray<z.ZodObject<{
category: z.ZodNativeEnum<typeof HarmCategory>;
threshold: z.ZodNativeEnum<typeof HarmBlockThreshold>;
}, "strip", z.ZodTypeAny, {
category: HarmCategory;
threshold: HarmBlockThreshold;
}, {
category: HarmCategory;
threshold: HarmBlockThreshold;
}>, "many">>;
/**
* Vertex retrieval options.
*
* E.g.
*
* ```js
* config: {
* vertexRetrieval: {
* datastore: {
* projectId: 'your-cloud-project',
* location: 'us-central1',
* collection: 'your-collection',
* },
* disableAttribution: true,
* }
* }
* ```
*/
vertexRetrieval: z.ZodOptional<z.ZodObject<{
datastore: z.ZodObject<{
projectId: z.ZodOptional<z.ZodString>;
location: z.ZodOptional<z.ZodString>;
dataStoreId: z.ZodString;
}, "strip", z.ZodTypeAny, {
dataStoreId: string;
location?: string | undefined;
projectId?: string | undefined;
}, {
dataStoreId: string;
location?: string | undefined;
projectId?: string | undefined;
}>;
disableAttribution: z.ZodOptional<z.ZodBoolean>;
}, "strip", z.ZodTypeAny, {
datastore: {
dataStoreId: string;
location?: string | undefined;
projectId?: string | undefined;
};
disableAttribution?: boolean | undefined;
}, {
datastore: {
dataStoreId: string;
location?: string | undefined;
projectId?: string | undefined;
};
disableAttribution?: boolean | undefined;
}>>;
/**
* Google Search retrieval options.
*
* ```js
* config: {
* googleSearchRetrieval: {
* disableAttribution: true,
* }
* }
* ```
*/
googleSearchRetrieval: z.ZodOptional<z.ZodObject<{
disableAttribution: z.ZodOptional<z.ZodBoolean>;
}, "strip", z.ZodTypeAny, {
disableAttribution?: boolean | undefined;
}, {
disableAttribution?: boolean | undefined;
}>>;
/**
* Function calling options.
*
* E.g. forced tool call:
*
* ```js
* config: {
* functionCallingConfig: {
* mode: 'ANY',
* }
* }
* ```
*/
functionCallingConfig: z.ZodOptional<z.ZodObject<{
mode: z.ZodOptional<z.ZodEnum<["MODE_UNSPECIFIED", "AUTO", "ANY", "NONE"]>>;
allowedFunctionNames: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
}, "strip", z.ZodTypeAny, {
mode?: "MODE_UNSPECIFIED" | "AUTO" | "ANY" | "NONE" | undefined;
allowedFunctionNames?: string[] | undefined;
}, {
mode?: "MODE_UNSPECIFIED" | "AUTO" | "ANY" | "NONE" | undefined;
allowedFunctionNames?: string[] | undefined;
}>>;
}>, "strip", z.ZodTypeAny, {
location?: string | undefined;
version?: string | undefined;
safetySettings?: {
category: HarmCategory;
threshold: HarmBlockThreshold;
}[] | undefined;
vertexRetrieval?: {
datastore: {
dataStoreId: string;
location?: string | undefined;
projectId?: string | undefined;
};
disableAttribution?: boolean | undefined;
} | undefined;
googleSearchRetrieval?: {
disableAttribution?: boolean | undefined;
} | undefined;
functionCallingConfig?: {
mode?: "MODE_UNSPECIFIED" | "AUTO" | "ANY" | "NONE" | undefined;
allowedFunctionNames?: string[] | undefined;
} | undefined;
temperature?: number | undefined;
maxOutputTokens?: number | undefined;
topK?: number | undefined;
topP?: number | undefined;
stopSequences?: string[] | undefined;
}, {
location?: string | undefined;
version?: string | undefined;
safetySettings?: {
category: HarmCategory;
threshold: HarmBlockThreshold;
}[] | undefined;
vertexRetrieval?: {
datastore: {
dataStoreId: string;
location?: string | undefined;
projectId?: string | undefined;
};
disableAttribution?: boolean | undefined;
} | undefined;
googleSearchRetrieval?: {
disableAttribution?: boolean | undefined;
} | undefined;
functionCallingConfig?: {
mode?: "MODE_UNSPECIFIED" | "AUTO" | "ANY" | "NONE" | undefined;
allowedFunctionNames?: string[] | undefined;
} | undefined;
temperature?: number | undefined;
maxOutputTokens?: number | undefined;
topK?: number | undefined;
topP?: number | undefined;
stopSequences?: string[] | undefined;
}>>;
declare const gemini20Flash: ModelReference<z.ZodObject<z.objectUtil.extendShape<{
version: z.ZodOptional<z.ZodString>;
temperature: z.ZodOptional<z.ZodNumber>;
maxOutputTokens: z.ZodOptional<z.ZodNumber>;
topK: z.ZodOptional<z.ZodNumber>;
topP: z.ZodOptional<z.ZodNumber>;
stopSequences: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
}, {
location: z.ZodOptional<z.ZodString>;
/**
* Safety filter settings. See: https://cloud.google.com/vertex-ai/generative-ai/docs/multimodal/configure-safety-filters#configurable-filters
*
* E.g.
*
* ```js
* config: {
* safetySettings: [
* {
* category: 'HARM_CATEGORY_HATE_SPEECH',
* threshold: 'BLOCK_LOW_AND_ABOVE',
* },
* {
* category: 'HARM_CATEGORY_DANGEROUS_CONTENT',
* threshold: 'BLOCK_MEDIUM_AND_ABOVE',
* },
* {
* category: 'HARM_CATEGORY_HARASSMENT',
* threshold: 'BLOCK_ONLY_HIGH',
* },
* {
* category: 'HARM_CATEGORY_SEXUALLY_EXPLICIT',
* threshold: 'BLOCK_NONE',
* },
* ],
* }
* ```
*/
safetySettings: z.ZodOptional<z.ZodArray<z.ZodObject<{
category: z.ZodNativeEnum<typeof HarmCategory>;
threshold: z.ZodNativeEnum<typeof HarmBlockThreshold>;
}, "strip", z.ZodTypeAny, {
category: HarmCategory;
threshold: HarmBlockThreshold;
}, {
category: HarmCategory;
threshold: HarmBlockThreshold;
}>, "many">>;
/**
* Vertex retrieval options.
*
* E.g.
*
* ```js
* config: {
* vertexRetrieval: {
* datastore: {
* projectId: 'your-cloud-project',
* location: 'us-central1',
* collection: 'your-collection',
* },
* disableAttribution: true,
* }
* }
* ```
*/
vertexRetrieval: z.ZodOptional<z.ZodObject<{
datastore: z.ZodObject<{
projectId: z.ZodOptional<z.ZodString>;
location: z.ZodOptional<z.ZodString>;
dataStoreId: z.ZodString;
}, "strip", z.ZodTypeAny, {
dataStoreId: string;
location?: string | undefined;
projectId?: string | undefined;
}, {
dataStoreId: string;
location?: string | undefined;
projectId?: string | undefined;
}>;
disableAttribution: z.ZodOptional<z.ZodBoolean>;
}, "strip", z.ZodTypeAny, {
datastore: {
dataStoreId: string;
location?: string | undefined;
projectId?: string | undefined;
};
disableAttribution?: boolean | undefined;
}, {
datastore: {
dataStoreId: string;
location?: string | undefined;
projectId?: string | undefined;
};
disableAttribution?: boolean | undefined;
}>>;
/**
* Google Search retrieval options.
*
* ```js
* config: {
* googleSearchRetrieval: {
* disableAttribution: true,
* }
* }
* ```
*/
googleSearchRetrieval: z.ZodOptional<z.ZodObject<{
disableAttribution: z.ZodOptional<z.ZodBoolean>;
}, "strip", z.ZodTypeAny, {
disableAttribution?: boolean | undefined;
}, {
disableAttribution?: boolean | undefined;
}>>;
/**
* Function calling options.
*
* E.g. forced tool call:
*
* ```js
* config: {
* functionCallingConfig: {
* mode: 'ANY',
* }
* }
* ```
*/
functionCallingConfig: z.ZodOptional<z.ZodObject<{
mode: z.ZodOptional<z.ZodEnum<["MODE_UNSPECIFIED", "AUTO", "ANY", "NONE"]>>;
allowedFunctionNames: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
}, "strip", z.ZodTypeAny, {
mode?: "MODE_UNSPECIFIED" | "AUTO" | "ANY" | "NONE" | undefined;
allowedFunctionNames?: string[] | undefined;
}, {
mode?: "MODE_UNSPECIFIED" | "AUTO" | "ANY" | "NONE" | undefined;
allowedFunctionNames?: string[] | undefined;
}>>;
}>, "strip", z.ZodTypeAny, {
location?: string | undefined;
version?: string | undefined;
safetySettings?: {
category: HarmCategory;
threshold: HarmBlockThreshold;
}[] | undefined;
vertexRetrieval?: {
datastore: {
dataStoreId: string;
location?: string | undefined;
projectId?: string | undefined;
};
disableAttribution?: boolean | undefined;
} | undefined;
googleSearchRetrieval?: {
disableAttribution?: boolean | undefined;
} | undefined;
functionCallingConfig?: {
mode?: "MODE_UNSPECIFIED" | "AUTO" | "ANY" | "NONE" | undefined;
allowedFunctionNames?: string[] | undefined;
} | undefined;
temperature?: number | undefined;
maxOutputTokens?: number | undefined;
topK?: number | undefined;
topP?: number | undefined;
stopSequences?: string[] | undefined;
}, {
location?: string | undefined;
version?: string | undefined;
safetySettings?: {
category: HarmCategory;
threshold: HarmBlockThreshold;
}[] | undefined;
vertexRetrieval?: {
datastore: {
dataStoreId: string;
location?: string | undefined;
projectId?: string | undefined;
};
disableAttribution?: boolean | undefined;
} | undefined;
googleSearchRetrieval?: {
disableAttribution?: boolean | undefined;
} | undefined;
functionCallingConfig?: {
mode?: "MODE_UNSPECIFIED" | "AUTO" | "ANY" | "NONE" | undefined;
allowedFunctionNames?: string[] | undefined;
} | undefined;
temperature?: number | undefined;
maxOutputTokens?: number | undefined;
topK?: number | undefined;
topP?: number | undefined;
stopSequences?: string[] | undefined;
}>>;
declare const gemini20FlashLite: ModelReference<z.ZodObject<z.objectUtil.extendShape<{
version: z.ZodOptional<z.ZodString>;
temperature: z.ZodOptional<z.ZodNumber>;
maxOutputTokens: z.ZodOptional<z.ZodNumber>;
topK: z.ZodOptional<z.ZodNumber>;
topP: z.ZodOptional<z.ZodNumber>;
stopSequences: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
}, {
location: z.ZodOptional<z.ZodString>;
/**
* Safety filter settings. See: https://cloud.google.com/vertex-ai/generative-ai/docs/multimodal/configure-safety-filters#configurable-filters
*
* E.g.
*
* ```js
* config: {
* safetySettings: [
* {
* category: 'HARM_CATEGORY_HATE_SPEECH',
* threshold: 'BLOCK_LOW_AND_ABOVE',
* },
* {
* category: 'HARM_CATEGORY_DANGEROUS_CONTENT',
* threshold: 'BLOCK_MEDIUM_AND_ABOVE',
* },
* {
* category: 'HARM_CATEGORY_HARASSMENT',
* threshold: 'BLOCK_ONLY_HIGH',
* },
* {
* category: 'HARM_CATEGORY_SEXUALLY_EXPLICIT',
* threshold: 'BLOCK_NONE',
* },
* ],
* }
* ```
*/
safetySettings: z.ZodOptional<z.ZodArray<z.ZodObject<{
category: z.ZodNativeEnum<typeof HarmCategory>;
threshold: z.ZodNativeEnum<typeof HarmBlockThreshold>;
}, "strip", z.ZodTypeAny, {
category: HarmCategory;
threshold: HarmBlockThreshold;
}, {
category: HarmCategory;
threshold: HarmBlockThreshold;
}>, "many">>;
/**
* Vertex retrieval options.
*
* E.g.
*
* ```js
* config: {
* vertexRetrieval: {
* datastore: {
* projectId: 'your-cloud-project',
* location: 'us-central1',
* collection: 'your-collection',
* },
* disableAttribution: true,
* }
* }
* ```
*/
vertexRetrieval: z.ZodOptional<z.ZodObject<{
datastore: z.ZodObject<{
projectId: z.ZodOptional<z.ZodString>;
location: z.ZodOptional<z.ZodString>;
dataStoreId: z.ZodString;
}, "strip", z.ZodTypeAny, {
dataStoreId: string;
location?: string | undefined;
projectId?: string | undefined;
}, {
dataStoreId: string;
location?: string | undefined;
projectId?: string | undefined;
}>;
disableAttribution: z.ZodOptional<z.ZodBoolean>;
}, "strip", z.ZodTypeAny, {
datastore: {
dataStoreId: string;
location?: string | undefined;
projectId?: string | undefined;
};
disableAttribution?: boolean | undefined;
}, {
datastore: {
dataStoreId: string;
location?: string | undefined;
projectId?: string | undefined;
};
disableAttribution?: boolean | undefined;
}>>;
/**
* Google Search retrieval options.
*
* ```js
* config: {
* googleSearchRetrieval: {
* disableAttribution: true,
* }
* }
* ```
*/
googleSearchRetrieval: z.ZodOptional<z.ZodObject<{
disableAttribution: z.ZodOptional<z.ZodBoolean>;
}, "strip", z.ZodTypeAny, {
disableAttribution?: boolean | undefined;
}, {
disableAttribution?: boolean | undefined;
}>>;
/**
* Function calling options.
*
* E.g. forced tool call:
*
* ```js
* config: {
* functionCallingConfig: {
* mode: 'ANY',
* }
* }
* ```
*/
functionCallingConfig: z.ZodOptional<z.ZodObject<{
mode: z.ZodOptional<z.ZodEnum<["MODE_UNSPECIFIED", "AUTO", "ANY", "NONE"]>>;
allowedFunctionNames: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
}, "strip", z.ZodTypeAny, {
mode?: "MODE_UNSPECIFIED" | "AUTO" | "ANY" | "NONE" | undefined;
allowedFunctionNames?: string[] | undefined;
}, {
mode?: "MODE_UNSPECIFIED" | "AUTO" | "ANY" | "NONE" | undefined;
allowedFunctionNames?: string[] | undefined;
}>>;
}>, "strip", z.ZodTypeAny, {
location?: string | undefined;
version?: string | undefined;
safetySettings?: {
category: HarmCategory;
threshold: HarmBlockThreshold;
}[] | undefined;
vertexRetrieval?: {
datastore: {
dataStoreId: string;
location?: string | undefined;
projectId?: string | undefined;
};
disableAttribution?: boolean | undefined;
} | undefined;
googleSearchRetrieval?: {
disableAttribution?: boolean | undefined;
} | undefined;
functionCallingConfig?: {
mode?: "MODE_UNSPECIFIED" | "AUTO" | "ANY" | "NONE" | undefined;
allowedFunctionNames?: string[] | undefined;
} | undefined;
temperature?: number | undefined;
maxOutputTokens?: number | undefined;
topK?: number | undefined;
topP?: number | undefined;
stopSequences?: string[] | undefined;
}, {
location?: string | undefined;
version?: string | undefined;
safetySettings?: {
category: HarmCategory;
threshold: HarmBlockThreshold;
}[] | undefined;
vertexRetrieval?: {
datastore: {
dataStoreId: string;
location?: string | undefined;
projectId?: string | undefined;
};
disableAttribution?: boolean | undefined;
} | undefined;
googleSearchRetrieval?: {
disableAttribution?: boolean | undefined;
} | undefined;
functionCallingConfig?: {
mode?: "MODE_UNSPECIFIED" | "AUTO" | "ANY" | "NONE" | undefined;
allowedFunctionNames?: string[] | undefined;
} | undefined;
temperature?: number | undefined;
maxOutputTokens?: number | undefined;
topK?: number | undefined;
topP?: number | undefined;
stopSequences?: string[] | undefined;
}>>;
declare const gemini20FlashLitePreview0205: ModelReference<z.ZodObject<z.objectUtil.extendShape<{
version: z.ZodOptional<z.ZodString>;
temperature: z.ZodOptional<z.ZodNumber>;
maxOutputTokens: z.ZodOptional<z.ZodNumber>;
topK: z.ZodOptional<z.ZodNumber>;
topP: z.ZodOptional<z.ZodNumber>;
stopSequences: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
}, {
location: z.ZodOptional<z.ZodString>;
/**
* Safety filter settings. See: https://cloud.google.com/vertex-ai/generative-ai/docs/multimodal/configure-safety-filters#configurable-filters
*
* E.g.
*
* ```js
* config: {
* safetySettings: [
* {
* category: 'HARM_CATEGORY_HATE_SPEECH',
* threshold: 'BLOCK_LOW_AND_ABOVE',
* },
* {
* category: 'HARM_CATEGORY_DANGEROUS_CONTENT',
* threshold: 'BLOCK_MEDIUM_AND_ABOVE',
* },
* {
* category: 'HARM_CATEGORY_HARASSMENT',
* threshold: 'BLOCK_ONLY_HIGH',
* },
* {
* category: 'HARM_CATEGORY_SEXUALLY_EXPLICIT',
* threshold: 'BLOCK_NONE',
* },
* ],
* }
* ```
*/
safetySettings: z.ZodOptional<z.ZodArray<z.ZodObject<{
category: z.ZodNativeEnum<typeof HarmCategory>;
threshold: z.ZodNativeEnum<typeof HarmBlockThreshold>;
}, "strip", z.ZodTypeAny, {
category: HarmCategory;
threshold: HarmBlockThreshold;
}, {
category: HarmCategory;
threshold: HarmBlockThreshold;
}>, "many">>;
/**
* Vertex retrieval options.
*
* E.g.
*
* ```js
* config: {
* vertexRetrieval: {
* datastore: {
* projectId: 'your-cloud-project',
* location: 'us-central1',
* collection: 'your-collection',
* },
* disableAttribution: true,
* }
* }
* ```
*/
vertexRetrieval: z.ZodOptional<z.ZodObject<{
datastore: z.ZodObject<{
projectId: z.ZodOptional<z.ZodString>;
location: z.ZodOptional<z.ZodString>;
dataStoreId: z.ZodString;
}, "strip", z.ZodTypeAny, {
dataStoreId: string;
location?: string | undefined;
projectId?: string | undefined;
}, {
dataStoreId: string;
location?: string | undefined;
projectId?: string | undefined;
}>;
disableAttribution: z.ZodOptional<z.ZodBoolean>;
}, "strip", z.ZodTypeAny, {
datastore: {
dataStoreId: string;
location?: string | undefined;
projectId?: string | undefined;
};
disableAttribution?: boolean | undefined;
}, {
datastore: {
dataStoreId: string;
location?: string | undefined;
projectId?: string | undefined;
};
disableAttribution?: boolean | undefined;
}>>;
/**
* Google Search retrieval options.
*
* ```js
* config: {
* googleSearchRetrieval: {
* disableAttribution: true,
* }
* }
* ```
*/
googleSearchRetrieval: z.ZodOptional<z.ZodObject<{
disableAttribution: z.ZodOptional<z.ZodBoolean>;
}, "strip", z.ZodTypeAny, {
disableAttribution?: boolean | undefined;
}, {
disableAttribution?: boolean | undefined;
}>>;
/**
* Function calling options.
*
* E.g. forced tool call:
*
* ```js
* config: {
* functionCallingConfig: {
* mode: 'ANY',
* }
* }
* ```
*/
functionCallingConfig: z.ZodOptional<z.ZodObject<{
mode: z.ZodOptional<z.ZodEnum<["MODE_UNSPECIFIED", "AUTO", "ANY", "NONE"]>>;
allowedFunctionNames: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
}, "strip", z.ZodTypeAny, {
mode?: "MODE_UNSPECIFIED" | "AUTO" | "ANY" | "NONE" | undefined;
allowedFunctionNames?: string[] | undefined;
}, {
mode?: "MODE_UNSPECIFIED" | "AUTO" | "ANY" | "NONE" | undefined;
allowedFunctionNames?: string[] | undefined;
}>>;
}>, "strip", z.ZodTypeAny, {
location?: string | undefined;
version?: string | undefined;
safetySettings?: {
category: HarmCategory;
threshold: HarmBlockThreshold;
}[] | undefined;
vertexRetrieval?: {
datastore: {
dataStoreId: string;
location?: string | undefined;
projectId?: string | undefined;
};
disableAttribution?: boolean | undefined;
} | undefined;
googleSearchRetrieval?: {
disableAttribution?: boolean | undefined;
} | undefined;
functionCallingConfig?: {
mode?: "MODE_UNSPECIFIED" | "AUTO" | "ANY" | "NONE" | undefined;
allowedFunctionNames?: string[] | undefined;
} | undefined;
temperature?: number | undefined;
maxOutputTokens?: number | undefined;
topK?: number | undefined;
topP?: number | undefined;
stopSequences?: string[] | undefined;
}, {
location?: string | undefined;
version?: string | undefined;
safetySettings?: {
category: HarmCategory;
threshold: HarmBlockThreshold;
}[] | undefined;
vertexRetrieval?: {
datastore: {
dataStoreId: string;
location?: string | undefined;
projectId?: string | undefined;
};
disableAttribution?: boolean | undefined;
} | undefined;
googleSearchRetrieval?: {