import {z} from 'zod' export type GoogleCloudAiplatformV1ToolCodeExecution = Record; export type GoogleCloudAiplatformV1ToolComputerUse = {disabledSafetyPolicies?: (Array<'SAFETY_POLICY_UNSPECIFIED' | 'FINANCIAL_TRANSACTIONS' | 'SENSITIVE_DATA_MODIFICATION' | 'COMMUNICATION_TOOL' | 'ACCOUNT_CREATION' | 'DATA_MODIFICATION' | 'USER_CONSENT_MANAGEMENT' | 'LEGAL_TERMS_AND_AGREEMENTS'>) | undefined, enablePromptInjectionDetection?: boolean | undefined, environment?: ('ENVIRONMENT_UNSPECIFIED' | 'ENVIRONMENT_BROWSER' | 'ENVIRONMENT_MOBILE' | 'ENVIRONMENT_DESKTOP') | undefined, excludedPredefinedFunctions?: Array | undefined}; export type GoogleCloudAiplatformV1EnterpriseWebSearch = {blockingConfidence?: ('PHISH_BLOCK_THRESHOLD_UNSPECIFIED' | 'BLOCK_LOW_AND_ABOVE' | 'BLOCK_MEDIUM_AND_ABOVE' | 'BLOCK_HIGH_AND_ABOVE' | 'BLOCK_HIGHER_AND_ABOVE' | 'BLOCK_VERY_HIGH_AND_ABOVE' | 'BLOCK_ONLY_EXTREMELY_HIGH') | undefined, excludeDomains?: Array | undefined}; export type GoogleCloudAiplatformV1ToolExaAiSearch = {apiKey?: string | undefined, customConfigs?: {[key: string]: unknown} | undefined}; export type GoogleCloudAiplatformV1Schema = {additionalProperties: unknown, anyOf?: Array | undefined, default: unknown, defs?: {[key: string]: GoogleCloudAiplatformV1Schema} | undefined, description?: string | undefined, enum?: Array | undefined, example: unknown, format?: string | undefined, items?: GoogleCloudAiplatformV1Schema | undefined, maxItems?: unknown | undefined, maxLength?: unknown | undefined, maxProperties?: unknown | undefined, maximum?: number | undefined, minItems?: unknown | undefined, minLength?: unknown | undefined, minProperties?: unknown | undefined, minimum?: number | undefined, nullable?: boolean | undefined, pattern?: string | undefined, properties?: {[key: string]: GoogleCloudAiplatformV1Schema} | undefined, propertyOrdering?: Array | undefined, ref?: string | undefined, required?: Array | undefined, title?: string | undefined, type?: ('TYPE_UNSPECIFIED' | 'STRING' | 'NUMBER' | 'INTEGER' | 'BOOLEAN' | 'ARRAY' | 'OBJECT' | 'NULL') | undefined}; export type GoogleCloudAiplatformV1FunctionDeclaration = {behavior?: ('UNSPECIFIED' | 'BLOCKING' | 'NON_BLOCKING') | undefined, description?: string | undefined, name?: string | undefined, parameters?: GoogleCloudAiplatformV1Schema | undefined, parametersJsonSchema: unknown, response?: GoogleCloudAiplatformV1Schema | undefined, responseJsonSchema: unknown}; export type GoogleCloudAiplatformV1GoogleMapsPlaces = Record; export type GoogleCloudAiplatformV1GoogleMapsRouting = Record; export type GoogleCloudAiplatformV1GoogleMapsGroundingTypes = {places?: GoogleCloudAiplatformV1GoogleMapsPlaces | undefined, routing?: GoogleCloudAiplatformV1GoogleMapsRouting | undefined}; export type GoogleCloudAiplatformV1GoogleMaps = {enableWidget?: boolean | undefined, groundingTypes?: GoogleCloudAiplatformV1GoogleMapsGroundingTypes | undefined}; export type GoogleCloudAiplatformV1ToolGoogleSearchImageSearch = Record; export type GoogleCloudAiplatformV1ToolGoogleSearchWebSearch = Record; export type GoogleCloudAiplatformV1ToolGoogleSearchSearchTypes = {imageSearch?: GoogleCloudAiplatformV1ToolGoogleSearchImageSearch | undefined, webSearch?: GoogleCloudAiplatformV1ToolGoogleSearchWebSearch | undefined}; export type GoogleCloudAiplatformV1ToolGoogleSearch = {blockingConfidence?: ('PHISH_BLOCK_THRESHOLD_UNSPECIFIED' | 'BLOCK_LOW_AND_ABOVE' | 'BLOCK_MEDIUM_AND_ABOVE' | 'BLOCK_HIGH_AND_ABOVE' | 'BLOCK_HIGHER_AND_ABOVE' | 'BLOCK_VERY_HIGH_AND_ABOVE' | 'BLOCK_ONLY_EXTREMELY_HIGH') | undefined, excludeDomains?: Array | undefined, searchTypes?: GoogleCloudAiplatformV1ToolGoogleSearchSearchTypes | undefined}; export type GoogleCloudAiplatformV1DynamicRetrievalConfig = {dynamicThreshold?: number | undefined, mode?: ('MODE_UNSPECIFIED' | 'MODE_DYNAMIC') | undefined}; export type GoogleCloudAiplatformV1GoogleSearchRetrieval = {dynamicRetrievalConfig?: GoogleCloudAiplatformV1DynamicRetrievalConfig | undefined}; export type GoogleCloudAiplatformV1ToolParallelAiSearch = {apiKey?: string | undefined, customConfigs?: {[key: string]: unknown} | undefined, enableDataRetention?: boolean | undefined, enableZeroDataRetention?: boolean | undefined}; export type GoogleCloudAiplatformV1ApiAuthApiKeyConfig = {apiKeySecretVersion?: string | undefined, apiKeyString?: string | undefined}; export type GoogleCloudAiplatformV1ApiAuth = {apiKeyConfig?: GoogleCloudAiplatformV1ApiAuthApiKeyConfig | undefined}; export type GoogleCloudAiplatformV1AuthConfigApiKeyConfig = {apiKeySecret?: string | undefined, apiKeyString?: string | undefined, httpElementLocation?: ('HTTP_IN_UNSPECIFIED' | 'HTTP_IN_QUERY' | 'HTTP_IN_HEADER' | 'HTTP_IN_PATH' | 'HTTP_IN_BODY' | 'HTTP_IN_COOKIE') | undefined, name?: string | undefined}; export type GoogleCloudAiplatformV1AuthConfigGoogleServiceAccountConfig = {serviceAccount?: string | undefined}; export type GoogleCloudAiplatformV1AuthConfigHttpBasicAuthConfig = {credentialSecret?: string | undefined}; export type GoogleCloudAiplatformV1AuthConfigOauthConfig = {accessToken?: string | undefined, serviceAccount?: string | undefined}; export type GoogleCloudAiplatformV1AuthConfigOidcConfig = {idToken?: string | undefined, serviceAccount?: string | undefined}; export type GoogleCloudAiplatformV1AuthConfig = {apiKeyConfig?: GoogleCloudAiplatformV1AuthConfigApiKeyConfig | undefined, authType?: ('AUTH_TYPE_UNSPECIFIED' | 'NO_AUTH' | 'API_KEY_AUTH' | 'HTTP_BASIC_AUTH' | 'GOOGLE_SERVICE_ACCOUNT_AUTH' | 'OAUTH' | 'OIDC_AUTH') | undefined, googleServiceAccountConfig?: GoogleCloudAiplatformV1AuthConfigGoogleServiceAccountConfig | undefined, httpBasicAuthConfig?: GoogleCloudAiplatformV1AuthConfigHttpBasicAuthConfig | undefined, oauthConfig?: GoogleCloudAiplatformV1AuthConfigOauthConfig | undefined, oidcConfig?: GoogleCloudAiplatformV1AuthConfigOidcConfig | undefined}; export type GoogleCloudAiplatformV1ExternalApiElasticSearchParams = {index?: string | undefined, numHits?: number | undefined, searchTemplate?: string | undefined}; export type GoogleCloudAiplatformV1ExternalApiSimpleSearchParams = Record; export type GoogleCloudAiplatformV1ExternalApi = {apiAuth?: GoogleCloudAiplatformV1ApiAuth | undefined, apiSpec?: ('API_SPEC_UNSPECIFIED' | 'SIMPLE_SEARCH' | 'ELASTIC_SEARCH') | undefined, authConfig?: GoogleCloudAiplatformV1AuthConfig | undefined, elasticSearchParams?: GoogleCloudAiplatformV1ExternalApiElasticSearchParams | undefined, endpoint?: string | undefined, simpleSearchParams?: GoogleCloudAiplatformV1ExternalApiSimpleSearchParams | undefined}; export type GoogleCloudAiplatformV1VertexAISearchDataStoreSpec = {dataStore?: string | undefined, filter?: string | undefined}; export type GoogleCloudAiplatformV1VertexAISearch = {dataStoreSpecs?: Array | undefined, datastore?: string | undefined, engine?: string | undefined, filter?: string | undefined, maxResults?: number | undefined}; export type GoogleCloudAiplatformV1VertexRagStoreRagResource = {ragCorpus?: string | undefined, ragFileIds?: Array | undefined}; export type GoogleCloudAiplatformV1RagRetrievalConfigFilter = {metadataFilter?: string | undefined, vectorDistanceThreshold?: number | undefined, vectorSimilarityThreshold?: number | undefined}; export type GoogleCloudAiplatformV1RagRetrievalConfigRankingLlmRanker = {modelName?: string | undefined}; export type GoogleCloudAiplatformV1RagRetrievalConfigRankingRankService = {modelName?: string | undefined}; export type GoogleCloudAiplatformV1RagRetrievalConfigRanking = {llmRanker?: GoogleCloudAiplatformV1RagRetrievalConfigRankingLlmRanker | undefined, rankService?: GoogleCloudAiplatformV1RagRetrievalConfigRankingRankService | undefined}; export type GoogleCloudAiplatformV1RagRetrievalConfig = {filter?: GoogleCloudAiplatformV1RagRetrievalConfigFilter | undefined, ranking?: GoogleCloudAiplatformV1RagRetrievalConfigRanking | undefined, topK?: number | undefined}; export type GoogleCloudAiplatformV1VertexRagStore = {ragResources?: Array | undefined, ragRetrievalConfig?: GoogleCloudAiplatformV1RagRetrievalConfig | undefined, similarityTopK?: number | undefined, vectorDistanceThreshold?: number | undefined}; export type GoogleCloudAiplatformV1Retrieval = {disableAttribution?: boolean | undefined, externalApi?: GoogleCloudAiplatformV1ExternalApi | undefined, vertexAiSearch?: GoogleCloudAiplatformV1VertexAISearch | undefined, vertexRagStore?: GoogleCloudAiplatformV1VertexRagStore | undefined}; export type GoogleCloudAiplatformV1UrlContext = Record; export type GoogleCloudAiplatformV1Tool = {codeExecution?: GoogleCloudAiplatformV1ToolCodeExecution | undefined, computerUse?: GoogleCloudAiplatformV1ToolComputerUse | undefined, enterpriseWebSearch?: GoogleCloudAiplatformV1EnterpriseWebSearch | undefined, exaAiSearch?: GoogleCloudAiplatformV1ToolExaAiSearch | undefined, functionDeclarations?: Array | undefined, googleMaps?: GoogleCloudAiplatformV1GoogleMaps | undefined, googleSearch?: GoogleCloudAiplatformV1ToolGoogleSearch | undefined, googleSearchRetrieval?: GoogleCloudAiplatformV1GoogleSearchRetrieval | undefined, parallelAiSearch?: GoogleCloudAiplatformV1ToolParallelAiSearch | undefined, retrieval?: GoogleCloudAiplatformV1Retrieval | undefined, urlContext?: GoogleCloudAiplatformV1UrlContext | undefined}; export type GoogleCloudAiplatformV1AgentConfig = {agentId?: string | undefined, agentType?: string | undefined, description?: string | undefined, instruction?: string | undefined, subAgents?: Array | undefined, tools?: Array | undefined}; export type GoogleCloudAiplatformV1EncryptionSpec = {kmsKeyName?: string | undefined}; export type GoogleCloudAiplatformV1EvaluationSet = {agentConfigs?: {[key: string]: GoogleCloudAiplatformV1AgentConfig} | undefined, createTime?: unknown | undefined, displayName?: string | undefined, encryptionSpec?: GoogleCloudAiplatformV1EncryptionSpec | undefined, evaluationItems?: Array | undefined, metadata: unknown, name?: string | undefined, updateTime?: unknown | undefined}; export type PatchApiV1ProjectsProjectsIdLocationsLocationsIdEvaluationSetsEvaluationSetsIdArgs = {projectsId: string, locationsId: string, evaluationSetsId: string, updateMask?: unknown | undefined, body: GoogleCloudAiplatformV1EvaluationSet}; export type PatchApiV1ProjectsProjectsIdLocationsLocationsIdEvaluationSetsEvaluationSetsIdOptions = {baseUrl?: string | undefined, Oauth2?: string | undefined, Oauth2c?: string | undefined, fetch?: typeof fetch | undefined}; export const googleCloudAiplatformV1ToolCodeExecution = z.object({}); export const googleCloudAiplatformV1ToolComputerUse = z.object({disabledSafetyPolicies: z.array(z.enum(["SAFETY_POLICY_UNSPECIFIED", "FINANCIAL_TRANSACTIONS", "SENSITIVE_DATA_MODIFICATION", "COMMUNICATION_TOOL", "ACCOUNT_CREATION", "DATA_MODIFICATION", "USER_CONSENT_MANAGEMENT", "LEGAL_TERMS_AND_AGREEMENTS"])).optional(), enablePromptInjectionDetection: z.boolean().optional(), environment: z.enum(["ENVIRONMENT_UNSPECIFIED", "ENVIRONMENT_BROWSER", "ENVIRONMENT_MOBILE", "ENVIRONMENT_DESKTOP"]).optional(), excludedPredefinedFunctions: z.array(z.string()).optional()}); export const googleCloudAiplatformV1EnterpriseWebSearch = z.object({blockingConfidence: z.enum(["PHISH_BLOCK_THRESHOLD_UNSPECIFIED", "BLOCK_LOW_AND_ABOVE", "BLOCK_MEDIUM_AND_ABOVE", "BLOCK_HIGH_AND_ABOVE", "BLOCK_HIGHER_AND_ABOVE", "BLOCK_VERY_HIGH_AND_ABOVE", "BLOCK_ONLY_EXTREMELY_HIGH"]).optional(), excludeDomains: z.array(z.string()).optional()}); export const googleCloudAiplatformV1ToolExaAiSearch = z.object({apiKey: z.string().optional(), customConfigs: z.record(z.string(), z.unknown()).optional()}); export const googleCloudAiplatformV1Schema: z.ZodType = z.object({additionalProperties: z.unknown(), anyOf: z.array(z.lazy(() => googleCloudAiplatformV1Schema)).optional(), default: z.unknown(), defs: z.record(z.string(), z.lazy(() => googleCloudAiplatformV1Schema)).optional(), description: z.string().optional(), enum: z.array(z.string()).optional(), example: z.unknown(), format: z.string().optional(), items: z.lazy(() => googleCloudAiplatformV1Schema.optional()), maxItems: z.string().optional(), maxLength: z.string().optional(), maxProperties: z.string().optional(), maximum: z.number().optional(), minItems: z.string().optional(), minLength: z.string().optional(), minProperties: z.string().optional(), minimum: z.number().optional(), nullable: z.boolean().optional(), pattern: z.string().optional(), properties: z.record(z.string(), z.lazy(() => googleCloudAiplatformV1Schema)).optional(), propertyOrdering: z.array(z.string()).optional(), ref: z.string().optional(), required: z.array(z.string()).optional(), title: z.string().optional(), type: z.enum(["TYPE_UNSPECIFIED", "STRING", "NUMBER", "INTEGER", "BOOLEAN", "ARRAY", "OBJECT", "NULL"]).optional()}); export const googleCloudAiplatformV1FunctionDeclaration = z.object({behavior: z.enum(["UNSPECIFIED", "BLOCKING", "NON_BLOCKING"]).optional(), description: z.string().optional(), name: z.string().optional(), parameters: googleCloudAiplatformV1Schema.optional(), parametersJsonSchema: z.unknown(), response: googleCloudAiplatformV1Schema.optional(), responseJsonSchema: z.unknown()}); export const googleCloudAiplatformV1GoogleMapsPlaces = z.object({}); export const googleCloudAiplatformV1GoogleMapsRouting = z.object({}); export const googleCloudAiplatformV1GoogleMapsGroundingTypes = z.object({places: googleCloudAiplatformV1GoogleMapsPlaces.optional(), routing: googleCloudAiplatformV1GoogleMapsRouting.optional()}); export const googleCloudAiplatformV1GoogleMaps = z.object({enableWidget: z.boolean().optional(), groundingTypes: googleCloudAiplatformV1GoogleMapsGroundingTypes.optional()}); export const googleCloudAiplatformV1ToolGoogleSearchImageSearch = z.object({}); export const googleCloudAiplatformV1ToolGoogleSearchWebSearch = z.object({}); export const googleCloudAiplatformV1ToolGoogleSearchSearchTypes = z.object({imageSearch: googleCloudAiplatformV1ToolGoogleSearchImageSearch.optional(), webSearch: googleCloudAiplatformV1ToolGoogleSearchWebSearch.optional()}); export const googleCloudAiplatformV1ToolGoogleSearch = z.object({blockingConfidence: z.enum(["PHISH_BLOCK_THRESHOLD_UNSPECIFIED", "BLOCK_LOW_AND_ABOVE", "BLOCK_MEDIUM_AND_ABOVE", "BLOCK_HIGH_AND_ABOVE", "BLOCK_HIGHER_AND_ABOVE", "BLOCK_VERY_HIGH_AND_ABOVE", "BLOCK_ONLY_EXTREMELY_HIGH"]).optional(), excludeDomains: z.array(z.string()).optional(), searchTypes: googleCloudAiplatformV1ToolGoogleSearchSearchTypes.optional()}); export const googleCloudAiplatformV1DynamicRetrievalConfig = z.object({dynamicThreshold: z.number().optional(), mode: z.enum(["MODE_UNSPECIFIED", "MODE_DYNAMIC"]).optional()}); export const googleCloudAiplatformV1GoogleSearchRetrieval = z.object({dynamicRetrievalConfig: googleCloudAiplatformV1DynamicRetrievalConfig.optional()}); export const googleCloudAiplatformV1ToolParallelAiSearch = z.object({apiKey: z.string().optional(), customConfigs: z.record(z.string(), z.unknown()).optional(), enableDataRetention: z.boolean().optional(), enableZeroDataRetention: z.boolean().optional()}); export const googleCloudAiplatformV1ApiAuthApiKeyConfig = z.object({apiKeySecretVersion: z.string().optional(), apiKeyString: z.string().optional()}); export const googleCloudAiplatformV1ApiAuth = z.object({apiKeyConfig: googleCloudAiplatformV1ApiAuthApiKeyConfig.optional()}); export const googleCloudAiplatformV1AuthConfigApiKeyConfig = z.object({apiKeySecret: z.string().optional(), apiKeyString: z.string().optional(), httpElementLocation: z.enum(["HTTP_IN_UNSPECIFIED", "HTTP_IN_QUERY", "HTTP_IN_HEADER", "HTTP_IN_PATH", "HTTP_IN_BODY", "HTTP_IN_COOKIE"]).optional(), name: z.string().optional()}); export const googleCloudAiplatformV1AuthConfigGoogleServiceAccountConfig = z.object({serviceAccount: z.string().optional()}); export const googleCloudAiplatformV1AuthConfigHttpBasicAuthConfig = z.object({credentialSecret: z.string().optional()}); export const googleCloudAiplatformV1AuthConfigOauthConfig = z.object({accessToken: z.string().optional(), serviceAccount: z.string().optional()}); export const googleCloudAiplatformV1AuthConfigOidcConfig = z.object({idToken: z.string().optional(), serviceAccount: z.string().optional()}); export const googleCloudAiplatformV1AuthConfig = z.object({apiKeyConfig: googleCloudAiplatformV1AuthConfigApiKeyConfig.optional(), authType: z.enum(["AUTH_TYPE_UNSPECIFIED", "NO_AUTH", "API_KEY_AUTH", "HTTP_BASIC_AUTH", "GOOGLE_SERVICE_ACCOUNT_AUTH", "OAUTH", "OIDC_AUTH"]).optional(), googleServiceAccountConfig: googleCloudAiplatformV1AuthConfigGoogleServiceAccountConfig.optional(), httpBasicAuthConfig: googleCloudAiplatformV1AuthConfigHttpBasicAuthConfig.optional(), oauthConfig: googleCloudAiplatformV1AuthConfigOauthConfig.optional(), oidcConfig: googleCloudAiplatformV1AuthConfigOidcConfig.optional()}); export const googleCloudAiplatformV1ExternalApiElasticSearchParams = z.object({index: z.string().optional(), numHits: z.number().int().optional(), searchTemplate: z.string().optional()}); export const googleCloudAiplatformV1ExternalApiSimpleSearchParams = z.object({}); export const googleCloudAiplatformV1ExternalApi = z.object({apiAuth: googleCloudAiplatformV1ApiAuth.optional(), apiSpec: z.enum(["API_SPEC_UNSPECIFIED", "SIMPLE_SEARCH", "ELASTIC_SEARCH"]).optional(), authConfig: googleCloudAiplatformV1AuthConfig.optional(), elasticSearchParams: googleCloudAiplatformV1ExternalApiElasticSearchParams.optional(), endpoint: z.string().optional(), simpleSearchParams: googleCloudAiplatformV1ExternalApiSimpleSearchParams.optional()}); export const googleCloudAiplatformV1VertexAISearchDataStoreSpec = z.object({dataStore: z.string().optional(), filter: z.string().optional()}); export const googleCloudAiplatformV1VertexAISearch = z.object({dataStoreSpecs: z.array(googleCloudAiplatformV1VertexAISearchDataStoreSpec).optional(), datastore: z.string().optional(), engine: z.string().optional(), filter: z.string().optional(), maxResults: z.number().int().optional()}); export const googleCloudAiplatformV1VertexRagStoreRagResource = z.object({ragCorpus: z.string().optional(), ragFileIds: z.array(z.string()).optional()}); export const googleCloudAiplatformV1RagRetrievalConfigFilter = z.object({metadataFilter: z.string().optional(), vectorDistanceThreshold: z.number().optional(), vectorSimilarityThreshold: z.number().optional()}); export const googleCloudAiplatformV1RagRetrievalConfigRankingLlmRanker = z.object({modelName: z.string().optional()}); export const googleCloudAiplatformV1RagRetrievalConfigRankingRankService = z.object({modelName: z.string().optional()}); export const googleCloudAiplatformV1RagRetrievalConfigRanking = z.object({llmRanker: googleCloudAiplatformV1RagRetrievalConfigRankingLlmRanker.optional(), rankService: googleCloudAiplatformV1RagRetrievalConfigRankingRankService.optional()}); export const googleCloudAiplatformV1RagRetrievalConfig = z.object({filter: googleCloudAiplatformV1RagRetrievalConfigFilter.optional(), ranking: googleCloudAiplatformV1RagRetrievalConfigRanking.optional(), topK: z.number().int().optional()}); export const googleCloudAiplatformV1VertexRagStore = z.object({ragResources: z.array(googleCloudAiplatformV1VertexRagStoreRagResource).optional(), ragRetrievalConfig: googleCloudAiplatformV1RagRetrievalConfig.optional(), similarityTopK: z.number().int().optional(), vectorDistanceThreshold: z.number().optional()}); export const googleCloudAiplatformV1Retrieval = z.object({disableAttribution: z.boolean().optional(), externalApi: googleCloudAiplatformV1ExternalApi.optional(), vertexAiSearch: googleCloudAiplatformV1VertexAISearch.optional(), vertexRagStore: googleCloudAiplatformV1VertexRagStore.optional()}); export const googleCloudAiplatformV1UrlContext = z.object({}); export const googleCloudAiplatformV1Tool = z.object({codeExecution: googleCloudAiplatformV1ToolCodeExecution.optional(), computerUse: googleCloudAiplatformV1ToolComputerUse.optional(), enterpriseWebSearch: googleCloudAiplatformV1EnterpriseWebSearch.optional(), exaAiSearch: googleCloudAiplatformV1ToolExaAiSearch.optional(), functionDeclarations: z.array(googleCloudAiplatformV1FunctionDeclaration).optional(), googleMaps: googleCloudAiplatformV1GoogleMaps.optional(), googleSearch: googleCloudAiplatformV1ToolGoogleSearch.optional(), googleSearchRetrieval: googleCloudAiplatformV1GoogleSearchRetrieval.optional(), parallelAiSearch: googleCloudAiplatformV1ToolParallelAiSearch.optional(), retrieval: googleCloudAiplatformV1Retrieval.optional(), urlContext: googleCloudAiplatformV1UrlContext.optional()}); export const googleCloudAiplatformV1AgentConfig = z.object({agentId: z.string().optional(), agentType: z.string().optional(), description: z.string().optional(), instruction: z.string().optional(), subAgents: z.array(z.string()).optional(), tools: z.array(googleCloudAiplatformV1Tool).optional()}); export const googleCloudAiplatformV1EncryptionSpec = z.object({kmsKeyName: z.string().optional()}); export const googleCloudAiplatformV1EvaluationSet = z.object({agentConfigs: z.record(z.string(), googleCloudAiplatformV1AgentConfig).optional(), createTime: z.string().optional(), displayName: z.string().optional(), encryptionSpec: googleCloudAiplatformV1EncryptionSpec.optional(), evaluationItems: z.array(z.string()).optional(), metadata: z.unknown(), name: z.string().optional(), updateTime: z.string().optional()}); export const validateResponse = async ( schema: { readonly '~standard': { readonly validate: (value: unknown) => ({ readonly value: Output; readonly issues?: undefined } | { readonly issues: ReadonlyArray<{ readonly message: string; readonly path?: ReadonlyArray | undefined }> }) | Promise<{ readonly value: Output; readonly issues?: undefined } | { readonly issues: ReadonlyArray<{ readonly message: string; readonly path?: ReadonlyArray | undefined }> }> } }, value: unknown ): Promise => { const result = await schema['~standard'].validate(value) if (result.issues !== undefined) { const detail = result.issues .map(({ message, path }) => path?.length ? `${path.map((segment) => String(typeof segment === 'object' ? segment.key : segment)).join('.')}: ${message}` : message ) .join('; ') throw new Error(`Response does not match the schema: ${detail}`, { cause: { issues: result.issues } }) } return result.value }; /** * Updates an Evaluation Set. * * PATCH /v1/projects/{projectsId}/locations/{locationsId}/evaluationSets/{evaluationSetsId} */ export const patchApiV1ProjectsProjectsIdLocationsLocationsIdEvaluationSetsEvaluationSetsId = async (args: PatchApiV1ProjectsProjectsIdLocationsLocationsIdEvaluationSetsEvaluationSetsIdArgs, options?: PatchApiV1ProjectsProjectsIdLocationsLocationsIdEvaluationSetsEvaluationSetsIdOptions) => { const {baseUrl = "https://aiplatform.googleapis.com", fetch: fetchFn = fetch, Oauth2, Oauth2c} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") headers.set('accept', "application/json") if (args.updateMask != null) query.append("updateMask", String(args.updateMask)) if (Oauth2 !== undefined) headers.set('authorization', `Bearer ${Oauth2}`) if (Oauth2c !== undefined) headers.set('authorization', `Bearer ${Oauth2c}`) const url = `${baseUrl.replace(/\/+$/, '')}/v1/projects/${encodeURIComponent(String(args.projectsId))}/locations/${encodeURIComponent(String(args.locationsId))}/evaluationSets/${encodeURIComponent(String(args.evaluationSetsId))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "PATCH", headers, body: JSON.stringify(args.body)}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return validateResponse(googleCloudAiplatformV1EvaluationSet, await res.json()) };