mtmsdk 0.0.14 → 0.0.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (135) hide show
  1. package/dist/gomtmapi/zod.gen.d.ts +17 -17
  2. package/dist/gomtmapi_v2/@tanstack/react-query.gen.d.ts +61 -0
  3. package/dist/gomtmapi_v2/@tanstack/react-query.gen.d.ts.map +1 -1
  4. package/dist/gomtmapi_v2/@tanstack/react-query.gen.js +61 -0
  5. package/dist/gomtmapi_v2/@tanstack/react-query.gen.js.map +1 -1
  6. package/dist/gomtmapi_v2/client/index.d.ts +1 -0
  7. package/dist/gomtmapi_v2/client/index.d.ts.map +1 -1
  8. package/dist/gomtmapi_v2/client/index.js +1 -0
  9. package/dist/gomtmapi_v2/client/index.js.map +1 -1
  10. package/dist/gomtmapi_v2/client/utils.gen.d.ts +1 -1
  11. package/dist/gomtmapi_v2/client/utils.gen.d.ts.map +1 -1
  12. package/dist/gomtmapi_v2/client/utils.gen.js +7 -6
  13. package/dist/gomtmapi_v2/client/utils.gen.js.map +1 -1
  14. package/dist/gomtmapi_v2/core/bodySerializer.gen.d.ts +12 -4
  15. package/dist/gomtmapi_v2/core/bodySerializer.gen.d.ts.map +1 -1
  16. package/dist/gomtmapi_v2/core/bodySerializer.gen.js.map +1 -1
  17. package/dist/gomtmapi_v2/core/queryKeySerializer.gen.d.ts +19 -0
  18. package/dist/gomtmapi_v2/core/queryKeySerializer.gen.d.ts.map +1 -0
  19. package/dist/gomtmapi_v2/core/queryKeySerializer.gen.js +100 -0
  20. package/dist/gomtmapi_v2/core/queryKeySerializer.gen.js.map +1 -0
  21. package/dist/gomtmapi_v2/sdk.gen.d.ts +59 -0
  22. package/dist/gomtmapi_v2/sdk.gen.d.ts.map +1 -1
  23. package/dist/gomtmapi_v2/sdk.gen.js +59 -0
  24. package/dist/gomtmapi_v2/sdk.gen.js.map +1 -1
  25. package/dist/mtgate_api/@tanstack/react-query.gen.d.ts +983 -929
  26. package/dist/mtgate_api/@tanstack/react-query.gen.d.ts.map +1 -1
  27. package/dist/mtgate_api/@tanstack/react-query.gen.js +876 -387
  28. package/dist/mtgate_api/@tanstack/react-query.gen.js.map +1 -1
  29. package/dist/mtgate_api/client/index.d.ts +1 -0
  30. package/dist/mtgate_api/client/index.d.ts.map +1 -1
  31. package/dist/mtgate_api/client/index.js +1 -0
  32. package/dist/mtgate_api/client/index.js.map +1 -1
  33. package/dist/mtgate_api/client/utils.gen.d.ts +1 -1
  34. package/dist/mtgate_api/client/utils.gen.d.ts.map +1 -1
  35. package/dist/mtgate_api/client/utils.gen.js +7 -6
  36. package/dist/mtgate_api/client/utils.gen.js.map +1 -1
  37. package/dist/mtgate_api/core/bodySerializer.gen.d.ts +12 -4
  38. package/dist/mtgate_api/core/bodySerializer.gen.d.ts.map +1 -1
  39. package/dist/mtgate_api/core/bodySerializer.gen.js.map +1 -1
  40. package/dist/mtgate_api/core/queryKeySerializer.gen.d.ts +19 -0
  41. package/dist/mtgate_api/core/queryKeySerializer.gen.d.ts.map +1 -0
  42. package/dist/mtgate_api/core/queryKeySerializer.gen.js +100 -0
  43. package/dist/mtgate_api/core/queryKeySerializer.gen.js.map +1 -0
  44. package/dist/mtgate_api/schemas.gen.d.ts +2258 -483
  45. package/dist/mtgate_api/schemas.gen.d.ts.map +1 -1
  46. package/dist/mtgate_api/schemas.gen.js +2344 -492
  47. package/dist/mtgate_api/schemas.gen.js.map +1 -1
  48. package/dist/mtgate_api/sdk.gen.d.ts +94 -26
  49. package/dist/mtgate_api/sdk.gen.d.ts.map +1 -1
  50. package/dist/mtgate_api/sdk.gen.js +554 -100
  51. package/dist/mtgate_api/sdk.gen.js.map +1 -1
  52. package/dist/mtgate_api/types.gen.d.ts +3608 -1167
  53. package/dist/mtgate_api/types.gen.d.ts.map +1 -1
  54. package/dist/mtgate_api/types.gen.js +3 -0
  55. package/dist/mtgate_api/types.gen.js.map +1 -1
  56. package/dist/mtgate_api/zod.gen.d.ts +4374 -1328
  57. package/dist/mtgate_api/zod.gen.d.ts.map +1 -1
  58. package/dist/mtgate_api/zod.gen.js +2078 -629
  59. package/dist/mtgate_api/zod.gen.js.map +1 -1
  60. package/dist/mtmai_api/@tanstack/react-query.gen.d.ts +23 -0
  61. package/dist/mtmai_api/@tanstack/react-query.gen.d.ts.map +1 -1
  62. package/dist/mtmai_api/@tanstack/react-query.gen.js +23 -0
  63. package/dist/mtmai_api/@tanstack/react-query.gen.js.map +1 -1
  64. package/dist/mtmai_api/client/index.d.ts +1 -0
  65. package/dist/mtmai_api/client/index.d.ts.map +1 -1
  66. package/dist/mtmai_api/client/index.js +1 -0
  67. package/dist/mtmai_api/client/index.js.map +1 -1
  68. package/dist/mtmai_api/client/utils.gen.d.ts +1 -1
  69. package/dist/mtmai_api/client/utils.gen.d.ts.map +1 -1
  70. package/dist/mtmai_api/client/utils.gen.js +7 -6
  71. package/dist/mtmai_api/client/utils.gen.js.map +1 -1
  72. package/dist/mtmai_api/core/bodySerializer.gen.d.ts +12 -4
  73. package/dist/mtmai_api/core/bodySerializer.gen.d.ts.map +1 -1
  74. package/dist/mtmai_api/core/bodySerializer.gen.js.map +1 -1
  75. package/dist/mtmai_api/core/queryKeySerializer.gen.d.ts +19 -0
  76. package/dist/mtmai_api/core/queryKeySerializer.gen.d.ts.map +1 -0
  77. package/dist/mtmai_api/core/queryKeySerializer.gen.js +100 -0
  78. package/dist/mtmai_api/core/queryKeySerializer.gen.js.map +1 -0
  79. package/dist/mtmai_api/sdk.gen.d.ts +23 -0
  80. package/dist/mtmai_api/sdk.gen.d.ts.map +1 -1
  81. package/dist/mtmai_api/sdk.gen.js +23 -0
  82. package/dist/mtmai_api/sdk.gen.js.map +1 -1
  83. package/dist/mtmai_api/types.gen.d.ts +552 -0
  84. package/dist/mtmai_api/types.gen.d.ts.map +1 -1
  85. package/dist/mtmai_api/types.gen.js +19 -0
  86. package/dist/mtmai_api/types.gen.js.map +1 -1
  87. package/dist/mtmai_api/zod.gen.d.ts +18866 -18674
  88. package/dist/mtmai_api/zod.gen.d.ts.map +1 -1
  89. package/dist/mtmai_api/zod.gen.js +1826 -1634
  90. package/dist/mtmai_api/zod.gen.js.map +1 -1
  91. package/package.json +28 -5
  92. package/dist/components/MustAdmin.d.ts +0 -14
  93. package/dist/components/MustAdmin.d.ts.map +0 -1
  94. package/dist/components/MustAdmin.js +0 -37
  95. package/dist/components/MustAdmin.js.map +0 -1
  96. package/dist/lib/adk-utils.d.ts +0 -19
  97. package/dist/lib/adk-utils.d.ts.map +0 -1
  98. package/dist/lib/adk-utils.js +0 -50
  99. package/dist/lib/adk-utils.js.map +0 -1
  100. package/dist/lib/auth-client.d.ts +0 -5965
  101. package/dist/lib/auth-client.d.ts.map +0 -1
  102. package/dist/lib/auth-client.js +0 -29
  103. package/dist/lib/auth-client.js.map +0 -1
  104. package/dist/lib/get-query-client.d.ts +0 -3
  105. package/dist/lib/get-query-client.d.ts.map +0 -1
  106. package/dist/lib/get-query-client.js +0 -23
  107. package/dist/lib/get-query-client.js.map +0 -1
  108. package/dist/lib/mtgate_client_ss.d.ts +0 -10
  109. package/dist/lib/mtgate_client_ss.d.ts.map +0 -1
  110. package/dist/lib/mtgate_client_ss.js +0 -24
  111. package/dist/lib/mtgate_client_ss.js.map +0 -1
  112. package/dist/store/AuthProviders.d.ts +0 -8
  113. package/dist/store/AuthProviders.d.ts.map +0 -1
  114. package/dist/store/AuthProviders.js +0 -34
  115. package/dist/store/AuthProviders.js.map +0 -1
  116. package/dist/store/GomtmProvider.d.ts +0 -10
  117. package/dist/store/GomtmProvider.d.ts.map +0 -1
  118. package/dist/store/GomtmProvider.js +0 -24
  119. package/dist/store/GomtmProvider.js.map +0 -1
  120. package/dist/store/GomtmV1Provider.d.ts +0 -10
  121. package/dist/store/GomtmV1Provider.d.ts.map +0 -1
  122. package/dist/store/GomtmV1Provider.js +0 -24
  123. package/dist/store/GomtmV1Provider.js.map +0 -1
  124. package/dist/store/MtgateProvider.d.ts +0 -6015
  125. package/dist/store/MtgateProvider.d.ts.map +0 -1
  126. package/dist/store/MtgateProvider.js +0 -76
  127. package/dist/store/MtgateProvider.js.map +0 -1
  128. package/dist/store/MtmsdkProvider.d.ts +0 -16
  129. package/dist/store/MtmsdkProvider.d.ts.map +0 -1
  130. package/dist/store/MtmsdkProvider.js +0 -47
  131. package/dist/store/MtmsdkProvider.js.map +0 -1
  132. package/dist/store/ReactQueryMtmaiApiProvider.d.ts +0 -10
  133. package/dist/store/ReactQueryMtmaiApiProvider.d.ts.map +0 -1
  134. package/dist/store/ReactQueryMtmaiApiProvider.js +0 -23
  135. package/dist/store/ReactQueryMtmaiApiProvider.js.map +0 -1
@@ -1,27 +1,9 @@
1
1
  // This file is auto-generated by @hey-api/openapi-ts
2
2
  import { z } from "zod";
3
- /**
4
- * SecuritySchemeType
5
- */
6
- export const zSecuritySchemeType = z.enum([
7
- "apiKey",
8
- "http",
9
- "oauth2",
10
- "openIdConnect",
11
- ]);
12
3
  /**
13
4
  * APIKeyIn
14
5
  */
15
6
  export const zApiKeyIn = z.enum(["query", "header", "cookie"]);
16
- /**
17
- * APIKey
18
- */
19
- export const zApiKey = z.object({
20
- type: z.optional(zSecuritySchemeType),
21
- description: z.optional(z.union([z.string(), z.null()])),
22
- in: zApiKeyIn,
23
- name: z.string(),
24
- });
25
7
  /**
26
8
  * AddSessionToEvalSetRequest
27
9
  */
@@ -31,219 +13,184 @@ export const zAddSessionToEvalSetRequest = z.object({
31
13
  userId: z.string(),
32
14
  });
33
15
  /**
34
- * Behavior
35
- * Defines the function behavior. Defaults to `BLOCKING`.
16
+ * ApiKeyConfig
17
+ *
18
+ * Config for authentication with API key.
36
19
  */
37
- export const zBehavior = z.enum(["UNSPECIFIED", "BLOCKING", "NON_BLOCKING"]);
20
+ export const zApiKeyConfig = z.object({
21
+ apiKeyString: z.optional(z.union([z.string(), z.null()])),
22
+ });
38
23
  /**
39
- * Type
40
- * Optional. The type of the data.
24
+ * AuthConfigGoogleServiceAccountConfig
25
+ *
26
+ * Config for Google Service Account Authentication.
41
27
  */
42
- export const zType = z.enum([
43
- "TYPE_UNSPECIFIED",
44
- "STRING",
45
- "NUMBER",
46
- "INTEGER",
47
- "BOOLEAN",
48
- "ARRAY",
49
- "OBJECT",
50
- "NULL",
51
- ]);
28
+ export const zAuthConfigGoogleServiceAccountConfig = z.object({
29
+ serviceAccount: z.optional(z.union([z.string(), z.null()])),
30
+ });
52
31
  /**
53
- * Schema
54
- * Schema is used to define the format of input/output data.
32
+ * AuthConfigHttpBasicAuthConfig
55
33
  *
56
- * Represents a select subset of an [OpenAPI 3.0 schema
57
- * object](https://spec.openapis.org/oas/v3.0.3#schema-object). More fields may
58
- * be added in the future as needed.
34
+ * Config for HTTP Basic Authentication.
59
35
  */
60
- export const zSchemaInput = z.object({
61
- additionalProperties: z.optional(z.union([z.unknown(), z.null()])),
62
- defs: z.optional(z.union([
63
- z.record(z.string(), z.lazy(() => {
64
- return zSchemaInput;
65
- })),
66
- z.null(),
67
- ])),
68
- ref: z.optional(z.union([z.string(), z.null()])),
69
- anyOf: z.optional(z.union([
70
- z.array(z.lazy(() => {
71
- return zSchemaInput;
72
- })),
73
- z.null(),
74
- ])),
75
- default: z.optional(z.union([z.unknown(), z.null()])),
76
- description: z.optional(z.union([z.string(), z.null()])),
77
- enum: z.optional(z.union([z.array(z.string()), z.null()])),
78
- example: z.optional(z.union([z.unknown(), z.null()])),
79
- format: z.optional(z.union([z.string(), z.null()])),
80
- items: z.optional(z.union([
81
- z.lazy(() => {
82
- return zSchemaInput;
83
- }),
84
- z.null(),
85
- ])),
86
- maxItems: z.optional(z.union([z.int(), z.null()])),
87
- maxLength: z.optional(z.union([z.int(), z.null()])),
88
- maxProperties: z.optional(z.union([z.int(), z.null()])),
89
- maximum: z.optional(z.union([z.number(), z.null()])),
90
- minItems: z.optional(z.union([z.int(), z.null()])),
91
- minLength: z.optional(z.union([z.int(), z.null()])),
92
- minProperties: z.optional(z.union([z.int(), z.null()])),
93
- minimum: z.optional(z.union([z.number(), z.null()])),
94
- nullable: z.optional(z.union([z.boolean(), z.null()])),
95
- pattern: z.optional(z.union([z.string(), z.null()])),
96
- properties: z.optional(z.union([
97
- z.record(z.string(), z.lazy(() => {
98
- return zSchemaInput;
99
- })),
100
- z.null(),
101
- ])),
102
- propertyOrdering: z.optional(z.union([z.array(z.string()), z.null()])),
103
- required: z.optional(z.union([z.array(z.string()), z.null()])),
104
- title: z.optional(z.union([z.string(), z.null()])),
105
- type: z.optional(z.union([zType, z.null()])),
36
+ export const zAuthConfigHttpBasicAuthConfig = z.object({
37
+ credentialSecret: z.optional(z.union([z.string(), z.null()])),
106
38
  });
107
39
  /**
108
- * FunctionDeclaration
109
- * Defines a function that the model can generate JSON inputs for.
40
+ * AuthConfigOauthConfig
110
41
  *
111
- * The inputs are based on `OpenAPI 3.0 specifications
112
- * <https://spec.openapis.org/oas/v3.0.3>`_.
42
+ * Config for user oauth.
113
43
  */
114
- export const zFunctionDeclarationInput = z.object({
115
- behavior: z.optional(z.union([zBehavior, z.null()])),
116
- description: z.optional(z.union([z.string(), z.null()])),
117
- name: z.optional(z.union([z.string(), z.null()])),
118
- parameters: z.optional(z.union([zSchemaInput, z.null()])),
119
- parametersJsonSchema: z.optional(z.union([z.unknown(), z.null()])),
120
- response: z.optional(z.union([zSchemaInput, z.null()])),
121
- responseJsonSchema: z.optional(z.union([z.unknown(), z.null()])),
44
+ export const zAuthConfigOauthConfig = z.object({
45
+ accessToken: z.optional(z.union([z.string(), z.null()])),
46
+ serviceAccount: z.optional(z.union([z.string(), z.null()])),
122
47
  });
123
48
  /**
124
- * VertexAISearchDataStoreSpec
125
- * Define data stores within engine to filter on in a search call and configurations for those data stores.
49
+ * AuthConfigOidcConfig
126
50
  *
127
- * For more information, see
128
- * https://cloud.google.com/generative-ai-app-builder/docs/reference/rpc/google.cloud.discoveryengine.v1#datastorespec
51
+ * Config for user OIDC auth.
129
52
  */
130
- export const zVertexAiSearchDataStoreSpec = z.object({
131
- dataStore: z.optional(z.union([z.string(), z.null()])),
132
- filter: z.optional(z.union([z.string(), z.null()])),
53
+ export const zAuthConfigOidcConfig = z.object({
54
+ idToken: z.optional(z.union([z.string(), z.null()])),
55
+ serviceAccount: z.optional(z.union([z.string(), z.null()])),
133
56
  });
134
57
  /**
135
- * VertexAISearch
136
- * Retrieve from Vertex AI Search datastore or engine for grounding.
58
+ * AuthCredentialTypes
137
59
  *
138
- * datastore and engine are mutually exclusive. See
139
- * https://cloud.google.com/products/agent-builder
60
+ * Represents the type of authentication credential.
140
61
  */
141
- export const zVertexAiSearch = z.object({
142
- dataStoreSpecs: z.optional(z.union([z.array(zVertexAiSearchDataStoreSpec), z.null()])),
143
- datastore: z.optional(z.union([z.string(), z.null()])),
144
- engine: z.optional(z.union([z.string(), z.null()])),
145
- filter: z.optional(z.union([z.string(), z.null()])),
146
- maxResults: z.optional(z.union([z.int(), z.null()])),
147
- });
62
+ export const zAuthCredentialTypes = z.enum([
63
+ "apiKey",
64
+ "http",
65
+ "oauth2",
66
+ "openIdConnect",
67
+ "serviceAccount",
68
+ ]);
148
69
  /**
149
- * VertexRagStoreRagResource
150
- * The definition of the Rag resource.
70
+ * AuthType
71
+ *
72
+ * Type of auth scheme.
151
73
  */
152
- export const zVertexRagStoreRagResource = z.object({
153
- ragCorpus: z.optional(z.union([z.string(), z.null()])),
154
- ragFileIds: z.optional(z.union([z.array(z.string()), z.null()])),
155
- });
74
+ export const zAuthType = z.enum([
75
+ "AUTH_TYPE_UNSPECIFIED",
76
+ "NO_AUTH",
77
+ "API_KEY_AUTH",
78
+ "HTTP_BASIC_AUTH",
79
+ "GOOGLE_SERVICE_ACCOUNT_AUTH",
80
+ "OAUTH",
81
+ "OIDC_AUTH",
82
+ ]);
156
83
  /**
157
- * RagRetrievalConfigFilter
158
- * Config for filters.
84
+ * AutomaticFunctionCallingConfig
85
+ *
86
+ * The configuration for automatic function calling.
159
87
  */
160
- export const zRagRetrievalConfigFilter = z.object({
161
- metadataFilter: z.optional(z.union([z.string(), z.null()])),
162
- vectorDistanceThreshold: z.optional(z.union([z.number(), z.null()])),
163
- vectorSimilarityThreshold: z.optional(z.union([z.number(), z.null()])),
88
+ export const zAutomaticFunctionCallingConfig = z.object({
89
+ disable: z.optional(z.union([z.boolean(), z.null()])),
90
+ maximumRemoteCalls: z.optional(z.union([z.int(), z.null()])),
91
+ ignoreCallHistory: z.optional(z.union([z.boolean(), z.null()])),
164
92
  });
165
93
  /**
166
- * RagRetrievalConfigHybridSearch
167
- * Config for Hybrid Search.
94
+ * BaseCriterion
95
+ *
96
+ * Base creterion to use for an Eval Metric.
168
97
  */
169
- export const zRagRetrievalConfigHybridSearch = z.object({
170
- alpha: z.optional(z.union([z.number(), z.null()])),
98
+ export const zBaseCriterion = z.object({
99
+ threshold: z.number(),
171
100
  });
172
101
  /**
173
- * RagRetrievalConfigRankingLlmRanker
174
- * Config for LlmRanker.
102
+ * Behavior
103
+ *
104
+ * Defines the function behavior. Defaults to `BLOCKING`.
175
105
  */
176
- export const zRagRetrievalConfigRankingLlmRanker = z.object({
177
- modelName: z.optional(z.union([z.string(), z.null()])),
178
- });
106
+ export const zBehavior = z.enum(["UNSPECIFIED", "BLOCKING", "NON_BLOCKING"]);
179
107
  /**
180
- * RagRetrievalConfigRankingRankService
181
- * Config for Rank Service.
108
+ * Blob
109
+ *
110
+ * Content blob.
182
111
  */
183
- export const zRagRetrievalConfigRankingRankService = z.object({
184
- modelName: z.optional(z.union([z.string(), z.null()])),
112
+ export const zBlob = z.object({
113
+ displayName: z.optional(z.union([z.string(), z.null()])),
114
+ data: z.optional(z.union([z.string(), z.null()])),
115
+ mimeType: z.optional(z.union([z.string(), z.null()])),
185
116
  });
186
117
  /**
187
- * RagRetrievalConfigRanking
188
- * Config for ranking and reranking.
118
+ * Body_builder_build
189
119
  */
190
- export const zRagRetrievalConfigRanking = z.object({
191
- llmRanker: z.optional(z.union([zRagRetrievalConfigRankingLlmRanker, z.null()])),
192
- rankService: z.optional(z.union([zRagRetrievalConfigRankingRankService, z.null()])),
120
+ export const zBodyBuilderBuild = z.object({
121
+ files: z.array(z.string()),
193
122
  });
194
123
  /**
195
- * RagRetrievalConfig
196
- * Specifies the context retrieval config.
124
+ * CacheMetadata
125
+ *
126
+ * Metadata for context cache associated with LLM responses.
127
+ *
128
+ * This class stores cache identification, usage tracking, and lifecycle
129
+ * information for a particular cache instance.
130
+ *
131
+ * Token counts (cached and total) are available in the LlmResponse.usage_metadata
132
+ * and should be accessed from there to avoid duplication.
133
+ *
134
+ * Attributes:
135
+ * cache_name: The full resource name of the cached content (e.g.,
136
+ * 'projects/123/locations/us-central1/cachedContents/456')
137
+ * expire_time: Unix timestamp when the cache expires
138
+ * fingerprint: Hash of agent configuration (instruction + tools + model)
139
+ * invocations_used: Number of invocations this cache has been used for
140
+ * cached_contents_count: Number of contents stored in this cache
141
+ * created_at: Unix timestamp when the cache was created
197
142
  */
198
- export const zRagRetrievalConfigInput = z.object({
199
- filter: z.optional(z.union([zRagRetrievalConfigFilter, z.null()])),
200
- hybridSearch: z.optional(z.union([zRagRetrievalConfigHybridSearch, z.null()])),
201
- ranking: z.optional(z.union([zRagRetrievalConfigRanking, z.null()])),
202
- topK: z.optional(z.union([z.int(), z.null()])),
143
+ export const zCacheMetadata = z.object({
144
+ cache_name: z.string(),
145
+ expire_time: z.number(),
146
+ fingerprint: z.string(),
147
+ invocations_used: z.int().gte(0),
148
+ cached_contents_count: z.int().gte(0),
149
+ created_at: z.optional(z.union([z.number(), z.null()])),
203
150
  });
204
151
  /**
205
- * VertexRagStore
206
- * Retrieve from Vertex RAG Store for grounding.
152
+ * ChatConfig
153
+ *
154
+ * 聊天配置
207
155
  */
208
- export const zVertexRagStoreInput = z.object({
209
- ragCorpora: z.optional(z.union([z.array(z.string()), z.null()])),
210
- ragResources: z.optional(z.union([z.array(zVertexRagStoreRagResource), z.null()])),
211
- ragRetrievalConfig: z.optional(z.union([zRagRetrievalConfigInput, z.null()])),
212
- similarityTopK: z.optional(z.union([z.int(), z.null()])),
213
- storeContext: z.optional(z.union([z.boolean(), z.null()])),
214
- vectorDistanceThreshold: z.optional(z.union([z.number(), z.null()])),
156
+ export const zChatConfig = z.object({
157
+ provider: z.optional(z.string()).default("openai"),
158
+ model_name: z.optional(z.string()).default("gpt-4o-mini"),
159
+ api_key: z.optional(z.union([z.string(), z.null()])),
160
+ base_url: z.optional(z.union([z.string(), z.null()])),
161
+ max_turns: z.optional(z.int()).default(10),
162
+ system_message: z
163
+ .optional(z.string())
164
+ .default("你是一个有用的AI助手,可以回答各种问题并提供帮助。"),
215
165
  });
216
166
  /**
217
- * Retrieval
218
- * Defines a retrieval tool that model can call to access external knowledge.
167
+ * ChatRequest
168
+ *
169
+ * 聊天请求 - 兼容旧API格式
219
170
  */
220
- export const zRetrievalInput = z.object({
221
- disableAttribution: z.optional(z.union([z.boolean(), z.null()])),
222
- vertexAiSearch: z.optional(z.union([zVertexAiSearch, z.null()])),
223
- vertexRagStore: z.optional(z.union([zVertexRagStoreInput, z.null()])),
171
+ export const zChatRequest = z.object({
172
+ message: z.string(),
173
+ config: z.optional(z.union([zChatConfig, z.null()])),
224
174
  });
225
175
  /**
226
- * Interval
227
- * Represents a time interval, encoded as a start time (inclusive) and an end time (exclusive).
176
+ * ChatResponse
228
177
  *
229
- * The start time must be less than or equal to the end time.
230
- * When the start equals the end time, the interval is an empty interval.
231
- * (matches no time)
232
- * When both start and end are unspecified, the interval matches any time.
178
+ * 聊天响应 - 兼容旧API格式
233
179
  */
234
- export const zIntervalInput = z.object({
235
- startTime: z.optional(z.union([z.iso.datetime(), z.null()])),
236
- endTime: z.optional(z.union([z.iso.datetime(), z.null()])),
180
+ export const zChatResponse = z.object({
181
+ message: z.string(),
182
+ success: z.optional(z.boolean()).default(true),
183
+ error: z.optional(z.union([z.string(), z.null()])),
237
184
  });
238
185
  /**
239
- * GoogleSearch
240
- * Tool to support Google Search in Model. Powered by Google.
186
+ * CheckSandboxStatusRequest
241
187
  */
242
- export const zGoogleSearchInput = z.object({
243
- timeRangeFilter: z.optional(z.union([zIntervalInput, z.null()])),
188
+ export const zCheckSandboxStatusRequest = z.object({
189
+ sandboxIds: z.array(z.string()),
244
190
  });
245
191
  /**
246
192
  * DynamicRetrievalConfigMode
193
+ *
247
194
  * Config for the dynamic retrieval config mode.
248
195
  */
249
196
  export const zDynamicRetrievalConfigMode = z.enum([
@@ -252,353 +199,267 @@ export const zDynamicRetrievalConfigMode = z.enum([
252
199
  ]);
253
200
  /**
254
201
  * DynamicRetrievalConfig
202
+ *
255
203
  * Describes the options to customize dynamic retrieval.
256
204
  */
257
205
  export const zDynamicRetrievalConfig = z.object({
258
206
  mode: z.optional(z.union([zDynamicRetrievalConfigMode, z.null()])),
259
207
  dynamicThreshold: z.optional(z.union([z.number(), z.null()])),
260
208
  });
261
- /**
262
- * GoogleSearchRetrieval
263
- * Tool to retrieve public web data for grounding, powered by Google.
264
- */
265
- export const zGoogleSearchRetrievalInput = z.object({
266
- dynamicRetrievalConfig: z.optional(z.union([zDynamicRetrievalConfig, z.null()])),
267
- });
268
209
  /**
269
210
  * EnterpriseWebSearch
211
+ *
270
212
  * Tool to search public web data, powered by Vertex AI Search and Sec4 compliance.
271
213
  */
272
214
  export const zEnterpriseWebSearch = z.record(z.string(), z.never());
273
215
  /**
274
- * ApiKeyConfig
275
- * Config for authentication with API key.
216
+ * EvalStatus
276
217
  */
277
- export const zApiKeyConfig = z.object({
278
- apiKeyString: z.optional(z.union([z.string(), z.null()])),
279
- });
218
+ export const zEvalStatus = z.union([z.literal(1), z.literal(2), z.literal(3)]);
280
219
  /**
281
- * AuthType
282
- * Type of auth scheme.
220
+ * FeatureSelectionPreference
221
+ *
222
+ * Options for feature selection preference.
283
223
  */
284
- export const zAuthType = z.enum([
285
- "AUTH_TYPE_UNSPECIFIED",
286
- "NO_AUTH",
287
- "API_KEY_AUTH",
288
- "HTTP_BASIC_AUTH",
289
- "GOOGLE_SERVICE_ACCOUNT_AUTH",
290
- "OAUTH",
291
- "OIDC_AUTH",
224
+ export const zFeatureSelectionPreference = z.enum([
225
+ "FEATURE_SELECTION_PREFERENCE_UNSPECIFIED",
226
+ "PRIORITIZE_QUALITY",
227
+ "BALANCED",
228
+ "PRIORITIZE_COST",
292
229
  ]);
293
230
  /**
294
- * AuthConfigGoogleServiceAccountConfig
295
- * Config for Google Service Account Authentication.
296
- */
297
- export const zAuthConfigGoogleServiceAccountConfig = z.object({
298
- serviceAccount: z.optional(z.union([z.string(), z.null()])),
299
- });
300
- /**
301
- * AuthConfigHttpBasicAuthConfig
302
- * Config for HTTP Basic Authentication.
231
+ * FileData
232
+ *
233
+ * URI based data.
303
234
  */
304
- export const zAuthConfigHttpBasicAuthConfig = z.object({
305
- credentialSecret: z.optional(z.union([z.string(), z.null()])),
235
+ export const zFileData = z.object({
236
+ displayName: z.optional(z.union([z.string(), z.null()])),
237
+ fileUri: z.optional(z.union([z.string(), z.null()])),
238
+ mimeType: z.optional(z.union([z.string(), z.null()])),
306
239
  });
307
240
  /**
308
- * AuthConfigOauthConfig
309
- * Config for user oauth.
241
+ * FileSource
242
+ *
243
+ * Source of the File.
310
244
  */
311
- export const zAuthConfigOauthConfig = z.object({
312
- accessToken: z.optional(z.union([z.string(), z.null()])),
313
- serviceAccount: z.optional(z.union([z.string(), z.null()])),
314
- });
245
+ export const zFileSource = z.enum([
246
+ "SOURCE_UNSPECIFIED",
247
+ "UPLOADED",
248
+ "GENERATED",
249
+ ]);
315
250
  /**
316
- * AuthConfigOidcConfig
317
- * Config for user OIDC auth.
251
+ * FileState
252
+ *
253
+ * State for the lifecycle of a File.
318
254
  */
319
- export const zAuthConfigOidcConfig = z.object({
320
- idToken: z.optional(z.union([z.string(), z.null()])),
321
- serviceAccount: z.optional(z.union([z.string(), z.null()])),
322
- });
255
+ export const zFileState = z.enum([
256
+ "STATE_UNSPECIFIED",
257
+ "PROCESSING",
258
+ "ACTIVE",
259
+ "FAILED",
260
+ ]);
323
261
  /**
324
- * AuthConfig
325
- * Auth configuration to run the extension.
262
+ * FileStatus
263
+ *
264
+ * Status of a File that uses a common error model.
326
265
  */
327
- export const zGoogleGenaiTypesAuthConfig = z.object({
328
- apiKeyConfig: z.optional(z.union([zApiKeyConfig, z.null()])),
329
- authType: z.optional(z.union([zAuthType, z.null()])),
330
- googleServiceAccountConfig: z.optional(z.union([zAuthConfigGoogleServiceAccountConfig, z.null()])),
331
- httpBasicAuthConfig: z.optional(z.union([zAuthConfigHttpBasicAuthConfig, z.null()])),
332
- oauthConfig: z.optional(z.union([zAuthConfigOauthConfig, z.null()])),
333
- oidcConfig: z.optional(z.union([zAuthConfigOidcConfig, z.null()])),
266
+ export const zFileStatus = z.object({
267
+ details: z.optional(z.union([z.array(z.record(z.string(), z.unknown())), z.null()])),
268
+ message: z.optional(z.union([z.string(), z.null()])),
269
+ code: z.optional(z.union([z.int(), z.null()])),
334
270
  });
335
271
  /**
336
- * GoogleMaps
337
- * Tool to support Google Maps in Model.
272
+ * File
273
+ *
274
+ * A file uploaded to the API.
338
275
  */
339
- export const zGoogleMapsInput = z.object({
340
- authConfig: z.optional(z.union([zGoogleGenaiTypesAuthConfig, z.null()])),
276
+ export const zFile = z.object({
277
+ name: z.optional(z.union([z.string(), z.null()])),
278
+ displayName: z.optional(z.union([z.string(), z.null()])),
279
+ mimeType: z.optional(z.union([z.string(), z.null()])),
280
+ sizeBytes: z.optional(z.union([z.int(), z.null()])),
281
+ createTime: z.optional(z.union([z.iso.datetime(), z.null()])),
282
+ expirationTime: z.optional(z.union([z.iso.datetime(), z.null()])),
283
+ updateTime: z.optional(z.union([z.iso.datetime(), z.null()])),
284
+ sha256Hash: z.optional(z.union([z.string(), z.null()])),
285
+ uri: z.optional(z.union([z.string(), z.null()])),
286
+ downloadUri: z.optional(z.union([z.string(), z.null()])),
287
+ state: z.optional(z.union([zFileState, z.null()])),
288
+ source: z.optional(z.union([zFileSource, z.null()])),
289
+ videoMetadata: z.optional(z.union([z.record(z.string(), z.unknown()), z.null()])),
290
+ error: z.optional(z.union([zFileStatus, z.null()])),
341
291
  });
342
292
  /**
343
- * UrlContext
344
- * Tool to support URL context retrieval.
345
- */
346
- export const zUrlContext = z.record(z.string(), z.never());
347
- /**
348
- * ToolCodeExecution
349
- * Tool that executes code generated by the model, and automatically returns the result to the model.
293
+ * FinishReason
350
294
  *
351
- * See also [ExecutableCode]and [CodeExecutionResult] which are input and output
352
- * to this tool.
295
+ * Output only. The reason why the model stopped generating tokens.
296
+ *
297
+ * If empty, the model has not stopped generating the tokens.
353
298
  */
354
- export const zToolCodeExecution = z.record(z.string(), z.never());
299
+ export const zFinishReason = z.enum([
300
+ "FINISH_REASON_UNSPECIFIED",
301
+ "STOP",
302
+ "MAX_TOKENS",
303
+ "SAFETY",
304
+ "RECITATION",
305
+ "LANGUAGE",
306
+ "OTHER",
307
+ "BLOCKLIST",
308
+ "PROHIBITED_CONTENT",
309
+ "SPII",
310
+ "MALFORMED_FUNCTION_CALL",
311
+ "IMAGE_SAFETY",
312
+ "UNEXPECTED_TOOL_CALL",
313
+ ]);
355
314
  /**
356
- * Tool
357
- * Tool details of a tool that the model may use to generate a response.
315
+ * FunctionCall
316
+ *
317
+ * A function call.
358
318
  */
359
- export const zGoogleGenaiTypesToolInput = z.object({
360
- functionDeclarations: z.optional(z.union([z.array(zFunctionDeclarationInput), z.null()])),
361
- retrieval: z.optional(z.union([zRetrievalInput, z.null()])),
362
- googleSearch: z.optional(z.union([zGoogleSearchInput, z.null()])),
363
- googleSearchRetrieval: z.optional(z.union([zGoogleSearchRetrievalInput, z.null()])),
364
- enterpriseWebSearch: z.optional(z.union([zEnterpriseWebSearch, z.null()])),
365
- googleMaps: z.optional(z.union([zGoogleMapsInput, z.null()])),
366
- urlContext: z.optional(z.union([zUrlContext, z.null()])),
367
- codeExecution: z.optional(z.union([zToolCodeExecution, z.null()])),
319
+ export const zFunctionCall = z.object({
320
+ id: z.optional(z.union([z.string(), z.null()])),
321
+ args: z.optional(z.union([z.record(z.string(), z.unknown()), z.null()])),
322
+ name: z.optional(z.union([z.string(), z.null()])),
368
323
  });
369
324
  /**
370
- * ToolAnnotations
371
- * Additional properties describing a Tool to clients.
372
- *
373
- * NOTE: all properties in ToolAnnotations are **hints**.
374
- * They are not guaranteed to provide a faithful description of
375
- * tool behavior (including descriptive properties like `title`).
325
+ * FunctionCallingConfigMode
376
326
  *
377
- * Clients should never make tool use decisions based on ToolAnnotations
378
- * received from untrusted servers.
327
+ * Config for the function calling config mode.
379
328
  */
380
- export const zToolAnnotations = z.object({
381
- title: z.optional(z.union([z.string(), z.null()])),
382
- readOnlyHint: z.optional(z.union([z.boolean(), z.null()])),
383
- destructiveHint: z.optional(z.union([z.boolean(), z.null()])),
384
- idempotentHint: z.optional(z.union([z.boolean(), z.null()])),
385
- openWorldHint: z.optional(z.union([z.boolean(), z.null()])),
386
- });
329
+ export const zFunctionCallingConfigMode = z.enum([
330
+ "MODE_UNSPECIFIED",
331
+ "AUTO",
332
+ "ANY",
333
+ "NONE",
334
+ ]);
387
335
  /**
388
- * Tool
389
- * Definition for a tool the client can call.
336
+ * FunctionCallingConfig
337
+ *
338
+ * Function calling config.
390
339
  */
391
- export const zMcpTypesTool = z.object({
392
- name: z.string(),
393
- description: z.optional(z.union([z.string(), z.null()])),
394
- inputSchema: z.record(z.string(), z.unknown()),
395
- annotations: z.optional(z.union([zToolAnnotations, z.null()])),
340
+ export const zFunctionCallingConfig = z.object({
341
+ mode: z.optional(z.union([zFunctionCallingConfigMode, z.null()])),
342
+ allowedFunctionNames: z.optional(z.union([z.array(z.string()), z.null()])),
396
343
  });
397
344
  /**
398
- * AgentDetails
399
- * Details about the individual agent in the App.
345
+ * FunctionResponseScheduling
400
346
  *
401
- * This could be a root agent or the sub-agents in the Agent Tree.
347
+ * Specifies how the response should be scheduled in the conversation.
402
348
  */
403
- export const zAgentDetailsInput = z.object({
404
- name: z.string(),
405
- instructions: z.optional(z.string()).default(""),
406
- toolDeclarations: z.optional(z.array(z.union([zGoogleGenaiTypesToolInput, zMcpTypesTool]))),
407
- });
408
- /**
409
- * Schema
410
- * Schema is used to define the format of input/output data.
411
- *
412
- * Represents a select subset of an [OpenAPI 3.0 schema
413
- * object](https://spec.openapis.org/oas/v3.0.3#schema-object). More fields may
414
- * be added in the future as needed.
415
- */
416
- export const zSchemaOutput = z.object({
417
- additionalProperties: z.optional(z.union([z.unknown(), z.null()])),
418
- defs: z.optional(z.union([
419
- z.record(z.string(), z.lazy(() => {
420
- return zSchemaOutput;
421
- })),
422
- z.null(),
423
- ])),
424
- ref: z.optional(z.union([z.string(), z.null()])),
425
- anyOf: z.optional(z.union([
426
- z.array(z.lazy(() => {
427
- return zSchemaOutput;
428
- })),
429
- z.null(),
430
- ])),
431
- default: z.optional(z.union([z.unknown(), z.null()])),
432
- description: z.optional(z.union([z.string(), z.null()])),
433
- enum: z.optional(z.union([z.array(z.string()), z.null()])),
434
- example: z.optional(z.union([z.unknown(), z.null()])),
435
- format: z.optional(z.union([z.string(), z.null()])),
436
- items: z.optional(z.union([
437
- z.lazy(() => {
438
- return zSchemaOutput;
439
- }),
440
- z.null(),
441
- ])),
442
- maxItems: z.optional(z.union([z.int(), z.null()])),
443
- maxLength: z.optional(z.union([z.int(), z.null()])),
444
- maxProperties: z.optional(z.union([z.int(), z.null()])),
445
- maximum: z.optional(z.union([z.number(), z.null()])),
446
- minItems: z.optional(z.union([z.int(), z.null()])),
447
- minLength: z.optional(z.union([z.int(), z.null()])),
448
- minProperties: z.optional(z.union([z.int(), z.null()])),
449
- minimum: z.optional(z.union([z.number(), z.null()])),
450
- nullable: z.optional(z.union([z.boolean(), z.null()])),
451
- pattern: z.optional(z.union([z.string(), z.null()])),
452
- properties: z.optional(z.union([
453
- z.record(z.string(), z.lazy(() => {
454
- return zSchemaOutput;
455
- })),
456
- z.null(),
457
- ])),
458
- propertyOrdering: z.optional(z.union([z.array(z.string()), z.null()])),
459
- required: z.optional(z.union([z.array(z.string()), z.null()])),
460
- title: z.optional(z.union([z.string(), z.null()])),
461
- type: z.optional(z.union([zType, z.null()])),
462
- });
349
+ export const zFunctionResponseScheduling = z.enum([
350
+ "SCHEDULING_UNSPECIFIED",
351
+ "SILENT",
352
+ "WHEN_IDLE",
353
+ "INTERRUPT",
354
+ ]);
463
355
  /**
464
- * FunctionDeclaration
465
- * Defines a function that the model can generate JSON inputs for.
356
+ * FunctionResponse
466
357
  *
467
- * The inputs are based on `OpenAPI 3.0 specifications
468
- * <https://spec.openapis.org/oas/v3.0.3>`_.
358
+ * A function response.
469
359
  */
470
- export const zFunctionDeclarationOutput = z.object({
471
- behavior: z.optional(z.union([zBehavior, z.null()])),
472
- description: z.optional(z.union([z.string(), z.null()])),
360
+ export const zFunctionResponse = z.object({
361
+ willContinue: z.optional(z.union([z.boolean(), z.null()])),
362
+ scheduling: z.optional(z.union([zFunctionResponseScheduling, z.null()])),
363
+ id: z.optional(z.union([z.string(), z.null()])),
473
364
  name: z.optional(z.union([z.string(), z.null()])),
474
- parameters: z.optional(z.union([zSchemaOutput, z.null()])),
475
- parametersJsonSchema: z.optional(z.union([z.unknown(), z.null()])),
476
- response: z.optional(z.union([zSchemaOutput, z.null()])),
477
- responseJsonSchema: z.optional(z.union([z.unknown(), z.null()])),
478
- });
479
- /**
480
- * RagRetrievalConfig
481
- * Specifies the context retrieval config.
482
- */
483
- export const zRagRetrievalConfigOutput = z.object({
484
- filter: z.optional(z.union([zRagRetrievalConfigFilter, z.null()])),
485
- hybridSearch: z.optional(z.union([zRagRetrievalConfigHybridSearch, z.null()])),
486
- ranking: z.optional(z.union([zRagRetrievalConfigRanking, z.null()])),
487
- topK: z.optional(z.union([z.int(), z.null()])),
365
+ response: z.optional(z.union([z.record(z.string(), z.unknown()), z.null()])),
488
366
  });
489
367
  /**
490
- * VertexRagStore
491
- * Retrieve from Vertex RAG Store for grounding.
368
+ * GenerationConfigRoutingConfigAutoRoutingMode
369
+ *
370
+ * When automated routing is specified, the routing will be determined by the pretrained routing model and customer provided model routing preference.
492
371
  */
493
- export const zVertexRagStoreOutput = z.object({
494
- ragCorpora: z.optional(z.union([z.array(z.string()), z.null()])),
495
- ragResources: z.optional(z.union([z.array(zVertexRagStoreRagResource), z.null()])),
496
- ragRetrievalConfig: z.optional(z.union([zRagRetrievalConfigOutput, z.null()])),
497
- similarityTopK: z.optional(z.union([z.int(), z.null()])),
498
- storeContext: z.optional(z.union([z.boolean(), z.null()])),
499
- vectorDistanceThreshold: z.optional(z.union([z.number(), z.null()])),
372
+ export const zGenerationConfigRoutingConfigAutoRoutingMode = z.object({
373
+ modelRoutingPreference: z.optional(z.union([
374
+ z.enum(["UNKNOWN", "PRIORITIZE_QUALITY", "BALANCED", "PRIORITIZE_COST"]),
375
+ z.null(),
376
+ ])),
500
377
  });
501
378
  /**
502
- * Retrieval
503
- * Defines a retrieval tool that model can call to access external knowledge.
379
+ * GenerationConfigRoutingConfigManualRoutingMode
380
+ *
381
+ * When manual routing is set, the specified model will be used directly.
504
382
  */
505
- export const zRetrievalOutput = z.object({
506
- disableAttribution: z.optional(z.union([z.boolean(), z.null()])),
507
- vertexAiSearch: z.optional(z.union([zVertexAiSearch, z.null()])),
508
- vertexRagStore: z.optional(z.union([zVertexRagStoreOutput, z.null()])),
383
+ export const zGenerationConfigRoutingConfigManualRoutingMode = z.object({
384
+ modelName: z.optional(z.union([z.string(), z.null()])),
509
385
  });
510
386
  /**
511
- * Interval
512
- * Represents a time interval, encoded as a start time (inclusive) and an end time (exclusive).
387
+ * GenerationConfigRoutingConfig
513
388
  *
514
- * The start time must be less than or equal to the end time.
515
- * When the start equals the end time, the interval is an empty interval.
516
- * (matches no time)
517
- * When both start and end are unspecified, the interval matches any time.
389
+ * The configuration for routing the request to a specific model.
518
390
  */
519
- export const zGoogleGenaiTypesInterval = z.object({
520
- startTime: z.optional(z.union([z.iso.datetime(), z.null()])),
521
- endTime: z.optional(z.union([z.iso.datetime(), z.null()])),
391
+ export const zGenerationConfigRoutingConfig = z.object({
392
+ autoMode: z.optional(z.union([zGenerationConfigRoutingConfigAutoRoutingMode, z.null()])),
393
+ manualMode: z.optional(z.union([zGenerationConfigRoutingConfigManualRoutingMode, z.null()])),
522
394
  });
523
395
  /**
524
- * GoogleSearch
525
- * Tool to support Google Search in Model. Powered by Google.
396
+ * GoogleSearchRetrieval
397
+ *
398
+ * Tool to retrieve public web data for grounding, powered by Google.
526
399
  */
527
- export const zGoogleSearchOutput = z.object({
528
- timeRangeFilter: z.optional(z.union([zGoogleGenaiTypesInterval, z.null()])),
400
+ export const zGoogleSearchRetrievalInput = z.object({
401
+ dynamicRetrievalConfig: z.optional(z.union([zDynamicRetrievalConfig, z.null()])),
529
402
  });
530
403
  /**
531
404
  * GoogleSearchRetrieval
405
+ *
532
406
  * Tool to retrieve public web data for grounding, powered by Google.
533
407
  */
534
408
  export const zGoogleSearchRetrievalOutput = z.object({
535
409
  dynamicRetrievalConfig: z.optional(z.union([zDynamicRetrievalConfig, z.null()])),
536
410
  });
537
411
  /**
538
- * GoogleMaps
539
- * Tool to support Google Maps in Model.
540
- */
541
- export const zGoogleMapsOutput = z.object({
542
- authConfig: z.optional(z.union([zGoogleGenaiTypesAuthConfig, z.null()])),
543
- });
544
- /**
545
- * Tool
546
- * Tool details of a tool that the model may use to generate a response.
547
- */
548
- export const zGoogleGenaiTypesToolOutput = z.object({
549
- functionDeclarations: z.optional(z.union([z.array(zFunctionDeclarationOutput), z.null()])),
550
- retrieval: z.optional(z.union([zRetrievalOutput, z.null()])),
551
- googleSearch: z.optional(z.union([zGoogleSearchOutput, z.null()])),
552
- googleSearchRetrieval: z.optional(z.union([zGoogleSearchRetrievalOutput, z.null()])),
553
- enterpriseWebSearch: z.optional(z.union([zEnterpriseWebSearch, z.null()])),
554
- googleMaps: z.optional(z.union([zGoogleMapsOutput, z.null()])),
555
- urlContext: z.optional(z.union([zUrlContext, z.null()])),
556
- codeExecution: z.optional(z.union([zToolCodeExecution, z.null()])),
557
- });
558
- /**
559
- * AgentDetails
560
- * Details about the individual agent in the App.
412
+ * GroundingChunkWeb
561
413
  *
562
- * This could be a root agent or the sub-agents in the Agent Tree.
414
+ * Chunk from the web.
563
415
  */
564
- export const zAgentDetailsOutput = z.object({
565
- name: z.string(),
566
- instructions: z.optional(z.string()).default(""),
567
- toolDeclarations: z.optional(z.array(z.union([zGoogleGenaiTypesToolOutput, zMcpTypesTool]))),
416
+ export const zGroundingChunkWeb = z.object({
417
+ domain: z.optional(z.union([z.string(), z.null()])),
418
+ title: z.optional(z.union([z.string(), z.null()])),
419
+ uri: z.optional(z.union([z.string(), z.null()])),
568
420
  });
569
421
  /**
570
- * AppDetails
571
- * Contains details about the App (the agentic system).
422
+ * HarmBlockMethod
572
423
  *
573
- * This structure is only a projection of the acutal app. Only details
574
- * that are relevant to the Eval System are captured here.
424
+ * Optional.
425
+ *
426
+ * Specify if the threshold is used for probability or severity score. If not
427
+ * specified, the threshold is used for probability score.
575
428
  */
576
- export const zAppDetailsInput = z.object({
577
- agentDetails: z.optional(z.record(z.string(), zAgentDetailsInput)),
578
- });
429
+ export const zHarmBlockMethod = z.enum([
430
+ "HARM_BLOCK_METHOD_UNSPECIFIED",
431
+ "SEVERITY",
432
+ "PROBABILITY",
433
+ ]);
579
434
  /**
580
- * AppDetails
581
- * Contains details about the App (the agentic system).
435
+ * HarmBlockThreshold
582
436
  *
583
- * This structure is only a projection of the acutal app. Only details
584
- * that are relevant to the Eval System are captured here.
437
+ * Required. The harm block threshold.
585
438
  */
586
- export const zAppDetailsOutput = z.object({
587
- agentDetails: z.optional(z.record(z.string(), zAgentDetailsOutput)),
588
- });
439
+ export const zHarmBlockThreshold = z.enum([
440
+ "HARM_BLOCK_THRESHOLD_UNSPECIFIED",
441
+ "BLOCK_LOW_AND_ABOVE",
442
+ "BLOCK_MEDIUM_AND_ABOVE",
443
+ "BLOCK_ONLY_HIGH",
444
+ "BLOCK_NONE",
445
+ "OFF",
446
+ ]);
589
447
  /**
590
- * AuthCredentialTypes
591
- * Represents the type of authentication credential.
448
+ * HarmCategory
449
+ *
450
+ * Required. Harm category.
592
451
  */
593
- export const zAuthCredentialTypes = z.enum([
594
- "apiKey",
595
- "http",
596
- "oauth2",
597
- "openIdConnect",
598
- "serviceAccount",
452
+ export const zHarmCategory = z.enum([
453
+ "HARM_CATEGORY_UNSPECIFIED",
454
+ "HARM_CATEGORY_HATE_SPEECH",
455
+ "HARM_CATEGORY_DANGEROUS_CONTENT",
456
+ "HARM_CATEGORY_HARASSMENT",
457
+ "HARM_CATEGORY_SEXUALLY_EXPLICIT",
458
+ "HARM_CATEGORY_CIVIC_INTEGRITY",
599
459
  ]);
600
460
  /**
601
461
  * HttpCredentials
462
+ *
602
463
  * Represents the secret token value for HTTP authentication, like user name, password, oauth token, etc.
603
464
  */
604
465
  export const zHttpCredentials = z.object({
@@ -608,6 +469,7 @@ export const zHttpCredentials = z.object({
608
469
  });
609
470
  /**
610
471
  * HttpAuth
472
+ *
611
473
  * The credentials and metadata for HTTP authentication.
612
474
  */
613
475
  export const zHttpAuth = z.object({
@@ -615,326 +477,262 @@ export const zHttpAuth = z.object({
615
477
  credentials: zHttpCredentials,
616
478
  });
617
479
  /**
618
- * ServiceAccountCredential
619
- * Represents Google Service Account configuration.
620
- *
621
- * Attributes:
622
- * type: The type should be "service_account".
623
- * project_id: The project ID.
624
- * private_key_id: The ID of the private key.
625
- * private_key: The private key.
626
- * client_email: The client email.
627
- * client_id: The client ID.
628
- * auth_uri: The authorization URI.
629
- * token_uri: The token URI.
630
- * auth_provider_x509_cert_url: URL for auth provider's X.509 cert.
631
- * client_x509_cert_url: URL for the client's X.509 cert.
632
- * universe_domain: The universe domain.
633
- *
634
- * Example:
480
+ * HttpRetryOptions
635
481
  *
636
- * config = ServiceAccountCredential(
637
- * type_="service_account",
638
- * project_id="your_project_id",
639
- * private_key_id="your_private_key_id",
640
- * private_key="-----BEGIN PRIVATE KEY-----...",
641
- * client_email="...@....iam.gserviceaccount.com",
642
- * client_id="your_client_id",
643
- * auth_uri="https://accounts.google.com/o/oauth2/auth",
644
- * token_uri="https://oauth2.googleapis.com/token",
645
- * auth_provider_x509_cert_url="https://www.googleapis.com/oauth2/v1/certs",
646
- * client_x509_cert_url="https://www.googleapis.com/robot/v1/metadata/x509/...",
647
- * universe_domain="googleapis.com"
648
- * )
482
+ * HTTP retry options to be used in each of the requests.
483
+ */
484
+ export const zHttpRetryOptions = z.object({
485
+ attempts: z.optional(z.union([z.int(), z.null()])),
486
+ initialDelay: z.optional(z.union([z.number(), z.null()])),
487
+ maxDelay: z.optional(z.union([z.number(), z.null()])),
488
+ expBase: z.optional(z.union([z.number(), z.null()])),
489
+ jitter: z.optional(z.union([z.number(), z.null()])),
490
+ httpStatusCodes: z.optional(z.union([z.array(z.int()), z.null()])),
491
+ });
492
+ /**
493
+ * HttpOptions
494
+ *
495
+ * HTTP options to be used in each of the requests.
496
+ */
497
+ export const zHttpOptions = z.object({
498
+ baseUrl: z.optional(z.union([z.string(), z.null()])),
499
+ apiVersion: z.optional(z.union([z.string(), z.null()])),
500
+ headers: z.optional(z.union([z.record(z.string(), z.string()), z.null()])),
501
+ timeout: z.optional(z.union([z.int(), z.null()])),
502
+ clientArgs: z.optional(z.union([z.record(z.string(), z.unknown()), z.null()])),
503
+ asyncClientArgs: z.optional(z.union([z.record(z.string(), z.unknown()), z.null()])),
504
+ extraBody: z.optional(z.union([z.record(z.string(), z.unknown()), z.null()])),
505
+ retryOptions: z.optional(z.union([zHttpRetryOptions, z.null()])),
506
+ });
507
+ /**
508
+ * Interval
649
509
  *
510
+ * Represents a time interval, encoded as a start time (inclusive) and an end time (exclusive).
650
511
  *
651
- * config = ServiceAccountConfig.model_construct(**{
652
- * ...service account config dict
653
- * })
512
+ * The start time must be less than or equal to the end time.
513
+ * When the start equals the end time, the interval is an empty interval.
514
+ * (matches no time)
515
+ * When both start and end are unspecified, the interval matches any time.
654
516
  */
655
- export const zServiceAccountCredential = z.object({
656
- type: z.optional(z.string()).default(""),
657
- projectId: z.string(),
658
- privateKeyId: z.string(),
659
- privateKey: z.string(),
660
- clientEmail: z.string(),
661
- clientId: z.string(),
662
- authUri: z.string(),
663
- tokenUri: z.string(),
664
- authProviderX509CertUrl: z.string(),
665
- clientX509CertUrl: z.string(),
666
- universeDomain: z.string(),
517
+ export const zIntervalInput = z.object({
518
+ startTime: z.optional(z.union([z.iso.datetime(), z.null()])),
519
+ endTime: z.optional(z.union([z.iso.datetime(), z.null()])),
667
520
  });
668
521
  /**
669
- * ServiceAccount
670
- * Represents Google Service Account configuration.
522
+ * GoogleSearch
523
+ *
524
+ * Tool to support Google Search in Model. Powered by Google.
671
525
  */
672
- export const zServiceAccount = z.object({
673
- serviceAccountCredential: z.optional(z.union([zServiceAccountCredential, z.null()])),
674
- scopes: z.array(z.string()),
675
- useDefaultCredential: z.optional(z.union([z.boolean(), z.null()])),
526
+ export const zGoogleSearchInput = z.object({
527
+ timeRangeFilter: z.optional(z.union([zIntervalInput, z.null()])),
676
528
  });
677
529
  /**
678
- * OAuth2Auth
679
- * Represents credential value and its metadata for a OAuth2 credential.
530
+ * Item
680
531
  */
681
- export const zOAuth2Auth = z.object({
682
- clientId: z.optional(z.union([z.string(), z.null()])),
683
- clientSecret: z.optional(z.union([z.string(), z.null()])),
684
- authUri: z.optional(z.union([z.string(), z.null()])),
685
- state: z.optional(z.union([z.string(), z.null()])),
686
- redirectUri: z.optional(z.union([z.string(), z.null()])),
687
- authResponseUri: z.optional(z.union([z.string(), z.null()])),
688
- authCode: z.optional(z.union([z.string(), z.null()])),
689
- accessToken: z.optional(z.union([z.string(), z.null()])),
690
- refreshToken: z.optional(z.union([z.string(), z.null()])),
691
- expiresAt: z.optional(z.union([z.int(), z.null()])),
692
- expiresIn: z.optional(z.union([z.int(), z.null()])),
693
- audience: z.optional(z.union([z.string(), z.null()])),
532
+ export const zItem = z.object({
533
+ id: z.int(),
534
+ name: z.string(),
535
+ description: z.optional(z.union([z.string(), z.null()])),
536
+ price: z.number(),
537
+ tags: z.optional(z.array(z.string())).default([]),
694
538
  });
695
539
  /**
696
- * AuthCredential
697
- * Data class representing an authentication credential.
698
- *
699
- * To exchange for the actual credential, please use
700
- * CredentialExchanger.exchange_credential().
701
- *
702
- * Examples: API Key Auth
703
- * AuthCredential(
704
- * auth_type=AuthCredentialTypes.API_KEY,
705
- * api_key="1234",
706
- * )
707
- *
708
- * Example: HTTP Auth
709
- * AuthCredential(
710
- * auth_type=AuthCredentialTypes.HTTP,
711
- * http=HttpAuth(
712
- * scheme="basic",
713
- * credentials=HttpCredentials(username="user", password="password"),
714
- * ),
715
- * )
716
- *
717
- * Example: OAuth2 Bearer Token in HTTP Header
718
- * AuthCredential(
719
- * auth_type=AuthCredentialTypes.HTTP,
720
- * http=HttpAuth(
721
- * scheme="bearer",
722
- * credentials=HttpCredentials(token="eyAkaknabna...."),
723
- * ),
724
- * )
540
+ * Language
725
541
  *
726
- * Example: OAuth2 Auth with Authorization Code Flow
727
- * AuthCredential(
728
- * auth_type=AuthCredentialTypes.OAUTH2,
729
- * oauth2=OAuth2Auth(
730
- * client_id="1234",
731
- * client_secret="secret",
732
- * ),
733
- * )
542
+ * Required. Programming language of the `code`.
543
+ */
544
+ export const zLanguage = z.enum(["LANGUAGE_UNSPECIFIED", "PYTHON"]);
545
+ /**
546
+ * ExecutableCode
734
547
  *
735
- * Example: OpenID Connect Auth
736
- * AuthCredential(
737
- * auth_type=AuthCredentialTypes.OPEN_ID_CONNECT,
738
- * oauth2=OAuth2Auth(
739
- * client_id="1234",
740
- * client_secret="secret",
741
- * redirect_uri="https://example.com",
742
- * scopes=["scope1", "scope2"],
743
- * ),
744
- * )
548
+ * Code generated by the model that is meant to be executed, and the result returned to the model.
745
549
  *
746
- * Example: Auth with resource reference
747
- * AuthCredential(
748
- * auth_type=AuthCredentialTypes.API_KEY,
749
- * resource_ref="projects/1234/locations/us-central1/resources/resource1",
750
- * )
550
+ * Generated when using the [FunctionDeclaration] tool and
551
+ * [FunctionCallingConfig] mode is set to [Mode.CODE].
751
552
  */
752
- export const zAuthCredentialInput = z.object({
753
- authType: zAuthCredentialTypes,
754
- resourceRef: z.optional(z.union([z.string(), z.null()])),
755
- apiKey: z.optional(z.union([z.string(), z.null()])),
756
- http: z.optional(z.union([zHttpAuth, z.null()])),
757
- serviceAccount: z.optional(z.union([zServiceAccount, z.null()])),
758
- oauth2: z.optional(z.union([zOAuth2Auth, z.null()])),
553
+ export const zExecutableCode = z.object({
554
+ code: z.optional(z.union([z.string(), z.null()])),
555
+ language: z.optional(z.union([zLanguage, z.null()])),
759
556
  });
760
557
  /**
761
- * AuthCredential
762
- * Data class representing an authentication credential.
763
- *
764
- * To exchange for the actual credential, please use
765
- * CredentialExchanger.exchange_credential().
766
- *
767
- * Examples: API Key Auth
768
- * AuthCredential(
769
- * auth_type=AuthCredentialTypes.API_KEY,
770
- * api_key="1234",
771
- * )
772
- *
773
- * Example: HTTP Auth
774
- * AuthCredential(
775
- * auth_type=AuthCredentialTypes.HTTP,
776
- * http=HttpAuth(
777
- * scheme="basic",
778
- * credentials=HttpCredentials(username="user", password="password"),
779
- * ),
780
- * )
781
- *
782
- * Example: OAuth2 Bearer Token in HTTP Header
783
- * AuthCredential(
784
- * auth_type=AuthCredentialTypes.HTTP,
785
- * http=HttpAuth(
786
- * scheme="bearer",
787
- * credentials=HttpCredentials(token="eyAkaknabna...."),
788
- * ),
789
- * )
790
- *
791
- * Example: OAuth2 Auth with Authorization Code Flow
792
- * AuthCredential(
793
- * auth_type=AuthCredentialTypes.OAUTH2,
794
- * oauth2=OAuth2Auth(
795
- * client_id="1234",
796
- * client_secret="secret",
797
- * ),
798
- * )
558
+ * LatLng
799
559
  *
800
- * Example: OpenID Connect Auth
801
- * AuthCredential(
802
- * auth_type=AuthCredentialTypes.OPEN_ID_CONNECT,
803
- * oauth2=OAuth2Auth(
804
- * client_id="1234",
805
- * client_secret="secret",
806
- * redirect_uri="https://example.com",
807
- * scopes=["scope1", "scope2"],
808
- * ),
809
- * )
560
+ * An object that represents a latitude/longitude pair.
810
561
  *
811
- * Example: Auth with resource reference
812
- * AuthCredential(
813
- * auth_type=AuthCredentialTypes.API_KEY,
814
- * resource_ref="projects/1234/locations/us-central1/resources/resource1",
815
- * )
562
+ * This is expressed as a pair of doubles to represent degrees latitude and
563
+ * degrees longitude. Unless specified otherwise, this object must conform to the
564
+ * <a href="https://en.wikipedia.org/wiki/World_Geodetic_System#1984_version">
565
+ * WGS84 standard</a>. Values must be within normalized ranges.
816
566
  */
817
- export const zAuthCredentialOutput = z.object({
818
- authType: zAuthCredentialTypes,
819
- resourceRef: z.optional(z.union([z.string(), z.null()])),
820
- apiKey: z.optional(z.union([z.string(), z.null()])),
821
- http: z.optional(z.union([zHttpAuth, z.null()])),
822
- serviceAccount: z.optional(z.union([zServiceAccount, z.null()])),
823
- oauth2: z.optional(z.union([zOAuth2Auth, z.null()])),
567
+ export const zLatLng = z.object({
568
+ latitude: z.optional(z.union([z.number(), z.null()])),
569
+ longitude: z.optional(z.union([z.number(), z.null()])),
824
570
  });
825
571
  /**
826
- * AutomaticFunctionCallingConfig
827
- * The configuration for automatic function calling.
572
+ * ListEvalResultsResponse
828
573
  */
829
- export const zAutomaticFunctionCallingConfig = z.object({
830
- disable: z.optional(z.union([z.boolean(), z.null()])),
831
- maximumRemoteCalls: z.optional(z.union([z.int(), z.null()])),
832
- ignoreCallHistory: z.optional(z.union([z.boolean(), z.null()])),
574
+ export const zListEvalResultsResponse = z.object({
575
+ evalResultIds: z.array(z.string()),
833
576
  });
834
577
  /**
835
- * BaseCriterion
836
- * Base creterion to use for an Eval Metric.
578
+ * ListEvalSetsResponse
837
579
  */
838
- export const zBaseCriterion = z.object({
839
- threshold: z.number(),
580
+ export const zListEvalSetsResponse = z.object({
581
+ evalSetIds: z.array(z.string()),
840
582
  });
841
583
  /**
842
- * Blob
843
- * Content blob.
584
+ * LiveServerSessionResumptionUpdate
585
+ *
586
+ * Update of the session resumption state.
587
+ *
588
+ * Only sent if `session_resumption` was set in the connection config.
844
589
  */
845
- export const zBlob = z.object({
846
- displayName: z.optional(z.union([z.string(), z.null()])),
847
- data: z.optional(z.union([z.string(), z.null()])),
848
- mimeType: z.optional(z.union([z.string(), z.null()])),
590
+ export const zLiveServerSessionResumptionUpdate = z.object({
591
+ newHandle: z.optional(z.union([z.string(), z.null()])),
592
+ resumable: z.optional(z.union([z.boolean(), z.null()])),
593
+ lastConsumedClientMessageIndex: z.optional(z.union([z.int(), z.null()])),
849
594
  });
850
595
  /**
851
- * Body_builder_build
596
+ * LogprobsResultCandidate
597
+ *
598
+ * Candidate for the logprobs token and score.
852
599
  */
853
- export const zBodyBuilderBuild = z.object({
854
- files: z.array(z.string()),
600
+ export const zLogprobsResultCandidate = z.object({
601
+ logProbability: z.optional(z.union([z.number(), z.null()])),
602
+ token: z.optional(z.union([z.string(), z.null()])),
603
+ tokenId: z.optional(z.union([z.int(), z.null()])),
855
604
  });
856
605
  /**
857
- * CacheMetadata
858
- * Metadata for context cache associated with LLM responses.
606
+ * LogprobsResultTopCandidates
859
607
  *
860
- * This class stores cache identification, usage tracking, and lifecycle
861
- * information for a particular cache instance.
608
+ * Candidates with top log probabilities at each decoding step.
609
+ */
610
+ export const zLogprobsResultTopCandidates = z.object({
611
+ candidates: z.optional(z.union([z.array(zLogprobsResultCandidate), z.null()])),
612
+ });
613
+ /**
614
+ * LogprobsResult
862
615
  *
863
- * Token counts (cached and total) are available in the LlmResponse.usage_metadata
864
- * and should be accessed from there to avoid duplication.
616
+ * Logprobs Result
617
+ */
618
+ export const zLogprobsResultInput = z.object({
619
+ chosenCandidates: z.optional(z.union([z.array(zLogprobsResultCandidate), z.null()])),
620
+ topCandidates: z.optional(z.union([z.array(zLogprobsResultTopCandidates), z.null()])),
621
+ });
622
+ /**
623
+ * LogprobsResult
865
624
  *
866
- * Attributes:
867
- * cache_name: The full resource name of the cached content (e.g.,
868
- * 'projects/123/locations/us-central1/cachedContents/456')
869
- * expire_time: Unix timestamp when the cache expires
870
- * fingerprint: Hash of agent configuration (instruction + tools + model)
871
- * invocations_used: Number of invocations this cache has been used for
872
- * cached_contents_count: Number of contents stored in this cache
873
- * created_at: Unix timestamp when the cache was created
625
+ * Logprobs Result
874
626
  */
875
- export const zCacheMetadata = z.object({
876
- cache_name: z.string(),
877
- expire_time: z.number(),
878
- fingerprint: z.string(),
879
- invocations_used: z.int().gte(0),
880
- cached_contents_count: z.int().gte(0),
881
- created_at: z.optional(z.union([z.number(), z.null()])),
627
+ export const zLogprobsResultOutput = z.object({
628
+ chosenCandidates: z.optional(z.union([z.array(zLogprobsResultCandidate), z.null()])),
629
+ topCandidates: z.optional(z.union([z.array(zLogprobsResultTopCandidates), z.null()])),
882
630
  });
883
631
  /**
884
- * ChatConfig
885
- * 聊天配置
632
+ * MediaModality
633
+ *
634
+ * Server content modalities.
886
635
  */
887
- export const zChatConfig = z.object({
888
- provider: z.optional(z.string()).default("openai"),
889
- model_name: z.optional(z.string()).default("gpt-4o-mini"),
890
- api_key: z.optional(z.union([z.string(), z.null()])),
891
- base_url: z.optional(z.union([z.string(), z.null()])),
892
- max_turns: z.optional(z.int()).default(10),
893
- system_message: z
894
- .optional(z.string())
895
- .default("你是一个有用的AI助手,可以回答各种问题并提供帮助。"),
636
+ export const zMediaModality = z.enum([
637
+ "MODALITY_UNSPECIFIED",
638
+ "TEXT",
639
+ "IMAGE",
640
+ "VIDEO",
641
+ "AUDIO",
642
+ "DOCUMENT",
643
+ ]);
644
+ /**
645
+ * MediaResolution
646
+ *
647
+ * The media resolution to use.
648
+ */
649
+ export const zMediaResolution = z.enum([
650
+ "MEDIA_RESOLUTION_UNSPECIFIED",
651
+ "MEDIA_RESOLUTION_LOW",
652
+ "MEDIA_RESOLUTION_MEDIUM",
653
+ "MEDIA_RESOLUTION_HIGH",
654
+ ]);
655
+ /**
656
+ * ModalityTokenCount
657
+ *
658
+ * Represents token counting info for a single modality.
659
+ */
660
+ export const zModalityTokenCount = z.object({
661
+ modality: z.optional(z.union([zMediaModality, z.null()])),
662
+ tokenCount: z.optional(z.union([z.int(), z.null()])),
896
663
  });
897
664
  /**
898
- * ChatRequest
899
- * 聊天请求 - 兼容旧API格式
665
+ * ModelSelectionConfig
666
+ *
667
+ * Config for model selection.
900
668
  */
901
- export const zChatRequest = z.object({
902
- message: z.string(),
903
- config: z.optional(z.union([zChatConfig, z.null()])),
669
+ export const zModelSelectionConfig = z.object({
670
+ featureSelectionPreference: z.optional(z.union([zFeatureSelectionPreference, z.null()])),
904
671
  });
905
672
  /**
906
- * ChatResponse
907
- * 聊天响应 - 兼容旧API格式
673
+ * OAuth2Auth
674
+ *
675
+ * Represents credential value and its metadata for a OAuth2 credential.
908
676
  */
909
- export const zChatResponse = z.object({
910
- message: z.string(),
911
- success: z.optional(z.boolean()).default(true),
912
- error: z.optional(z.union([z.string(), z.null()])),
677
+ export const zOAuth2Auth = z.object({
678
+ clientId: z.optional(z.union([z.string(), z.null()])),
679
+ clientSecret: z.optional(z.union([z.string(), z.null()])),
680
+ authUri: z.optional(z.union([z.string(), z.null()])),
681
+ state: z.optional(z.union([z.string(), z.null()])),
682
+ redirectUri: z.optional(z.union([z.string(), z.null()])),
683
+ authResponseUri: z.optional(z.union([z.string(), z.null()])),
684
+ authCode: z.optional(z.union([z.string(), z.null()])),
685
+ accessToken: z.optional(z.union([z.string(), z.null()])),
686
+ refreshToken: z.optional(z.union([z.string(), z.null()])),
687
+ expiresAt: z.optional(z.union([z.int(), z.null()])),
688
+ expiresIn: z.optional(z.union([z.int(), z.null()])),
689
+ audience: z.optional(z.union([z.string(), z.null()])),
913
690
  });
914
691
  /**
915
- * CheckSandboxStatusRequest
692
+ * OAuthFlowAuthorizationCode
916
693
  */
917
- export const zCheckSandboxStatusRequest = z.object({
918
- sandboxIds: z.array(z.string()),
694
+ export const zOAuthFlowAuthorizationCode = z.object({
695
+ refreshUrl: z.optional(z.union([z.string(), z.null()])),
696
+ scopes: z.optional(z.record(z.string(), z.string())).default({}),
697
+ authorizationUrl: z.string(),
698
+ tokenUrl: z.string(),
919
699
  });
920
700
  /**
921
- * SandboxStatusInfo
922
- * 沙盒状态信息
701
+ * OAuthFlowClientCredentials
923
702
  */
924
- export const zSandboxStatusInfo = z.object({
925
- sandboxId: z.string(),
926
- status: z.string(),
927
- error: z.optional(z.union([z.string(), z.null()])),
703
+ export const zOAuthFlowClientCredentials = z.object({
704
+ refreshUrl: z.optional(z.union([z.string(), z.null()])),
705
+ scopes: z.optional(z.record(z.string(), z.string())).default({}),
706
+ tokenUrl: z.string(),
928
707
  });
929
708
  /**
930
- * CheckSandboxStatusResponse
709
+ * OAuthFlowImplicit
931
710
  */
932
- export const zCheckSandboxStatusResponse = z.object({
933
- results: z.optional(z.array(zSandboxStatusInfo)),
934
- total_checked: z.int(),
711
+ export const zOAuthFlowImplicit = z.object({
712
+ refreshUrl: z.optional(z.union([z.string(), z.null()])),
713
+ scopes: z.optional(z.record(z.string(), z.string())).default({}),
714
+ authorizationUrl: z.string(),
715
+ });
716
+ /**
717
+ * OAuthFlowPassword
718
+ */
719
+ export const zOAuthFlowPassword = z.object({
720
+ refreshUrl: z.optional(z.union([z.string(), z.null()])),
721
+ scopes: z.optional(z.record(z.string(), z.string())).default({}),
722
+ tokenUrl: z.string(),
723
+ });
724
+ /**
725
+ * OAuthFlows
726
+ */
727
+ export const zOAuthFlows = z.object({
728
+ implicit: z.optional(z.union([zOAuthFlowImplicit, z.null()])),
729
+ password: z.optional(z.union([zOAuthFlowPassword, z.null()])),
730
+ clientCredentials: z.optional(z.union([zOAuthFlowClientCredentials, z.null()])),
731
+ authorizationCode: z.optional(z.union([zOAuthFlowAuthorizationCode, z.null()])),
935
732
  });
936
733
  /**
937
734
  * Outcome
735
+ *
938
736
  * Required. Outcome of the code execution.
939
737
  */
940
738
  export const zOutcome = z.enum([
@@ -945,6 +743,7 @@ export const zOutcome = z.enum([
945
743
  ]);
946
744
  /**
947
745
  * CodeExecutionResult
746
+ *
948
747
  * Result of executing the [ExecutableCode].
949
748
  *
950
749
  * Always follows a `part` containing the [ExecutableCode].
@@ -954,159 +753,156 @@ export const zCodeExecutionResult = z.object({
954
753
  output: z.optional(z.union([z.string(), z.null()])),
955
754
  });
956
755
  /**
957
- * VideoMetadata
958
- * Describes how the video in the Part should be used by the model.
756
+ * PrebuiltVoiceConfig
757
+ *
758
+ * The configuration for the prebuilt speaker to use.
959
759
  */
960
- export const zVideoMetadata = z.object({
961
- fps: z.optional(z.union([z.number(), z.null()])),
962
- endOffset: z.optional(z.union([z.string(), z.null()])),
963
- startOffset: z.optional(z.union([z.string(), z.null()])),
760
+ export const zPrebuiltVoiceConfig = z.object({
761
+ voiceName: z.optional(z.union([z.string(), z.null()])),
964
762
  });
965
763
  /**
966
- * FileData
967
- * URI based data.
764
+ * RagChunkPageSpan
765
+ *
766
+ * Represents where the chunk starts and ends in the document.
968
767
  */
969
- export const zFileData = z.object({
970
- displayName: z.optional(z.union([z.string(), z.null()])),
971
- fileUri: z.optional(z.union([z.string(), z.null()])),
972
- mimeType: z.optional(z.union([z.string(), z.null()])),
768
+ export const zRagChunkPageSpan = z.object({
769
+ firstPage: z.optional(z.union([z.int(), z.null()])),
770
+ lastPage: z.optional(z.union([z.int(), z.null()])),
973
771
  });
974
772
  /**
975
- * Language
976
- * Required. Programming language of the `code`.
773
+ * RagChunk
774
+ *
775
+ * A RagChunk includes the content of a chunk of a RagFile, and associated metadata.
977
776
  */
978
- export const zLanguage = z.enum(["LANGUAGE_UNSPECIFIED", "PYTHON"]);
777
+ export const zRagChunk = z.object({
778
+ pageSpan: z.optional(z.union([zRagChunkPageSpan, z.null()])),
779
+ text: z.optional(z.union([z.string(), z.null()])),
780
+ });
979
781
  /**
980
- * ExecutableCode
981
- * Code generated by the model that is meant to be executed, and the result returned to the model.
782
+ * GroundingChunkRetrievedContext
982
783
  *
983
- * Generated when using the [FunctionDeclaration] tool and
984
- * [FunctionCallingConfig] mode is set to [Mode.CODE].
784
+ * Chunk from context retrieved by the retrieval tools.
985
785
  */
986
- export const zExecutableCode = z.object({
987
- code: z.optional(z.union([z.string(), z.null()])),
988
- language: z.optional(z.union([zLanguage, z.null()])),
786
+ export const zGroundingChunkRetrievedContextInput = z.object({
787
+ ragChunk: z.optional(z.union([zRagChunk, z.null()])),
788
+ text: z.optional(z.union([z.string(), z.null()])),
789
+ title: z.optional(z.union([z.string(), z.null()])),
790
+ uri: z.optional(z.union([z.string(), z.null()])),
989
791
  });
990
792
  /**
991
- * FunctionCall
992
- * A function call.
793
+ * GroundingChunk
794
+ *
795
+ * Grounding chunk.
993
796
  */
994
- export const zFunctionCall = z.object({
995
- id: z.optional(z.union([z.string(), z.null()])),
996
- args: z.optional(z.union([z.record(z.string(), z.unknown()), z.null()])),
997
- name: z.optional(z.union([z.string(), z.null()])),
797
+ export const zGroundingChunkInput = z.object({
798
+ retrievedContext: z.optional(z.union([zGroundingChunkRetrievedContextInput, z.null()])),
799
+ web: z.optional(z.union([zGroundingChunkWeb, z.null()])),
998
800
  });
999
801
  /**
1000
- * FunctionResponseScheduling
1001
- * Specifies how the response should be scheduled in the conversation.
802
+ * GroundingChunkRetrievedContext
803
+ *
804
+ * Chunk from context retrieved by the retrieval tools.
1002
805
  */
1003
- export const zFunctionResponseScheduling = z.enum([
1004
- "SCHEDULING_UNSPECIFIED",
1005
- "SILENT",
1006
- "WHEN_IDLE",
1007
- "INTERRUPT",
1008
- ]);
806
+ export const zGroundingChunkRetrievedContextOutput = z.object({
807
+ ragChunk: z.optional(z.union([zRagChunk, z.null()])),
808
+ text: z.optional(z.union([z.string(), z.null()])),
809
+ title: z.optional(z.union([z.string(), z.null()])),
810
+ uri: z.optional(z.union([z.string(), z.null()])),
811
+ });
1009
812
  /**
1010
- * FunctionResponse
1011
- * A function response.
813
+ * GroundingChunk
814
+ *
815
+ * Grounding chunk.
1012
816
  */
1013
- export const zFunctionResponse = z.object({
1014
- willContinue: z.optional(z.union([z.boolean(), z.null()])),
1015
- scheduling: z.optional(z.union([zFunctionResponseScheduling, z.null()])),
1016
- id: z.optional(z.union([z.string(), z.null()])),
1017
- name: z.optional(z.union([z.string(), z.null()])),
1018
- response: z.optional(z.union([z.record(z.string(), z.unknown()), z.null()])),
817
+ export const zGroundingChunkOutput = z.object({
818
+ retrievedContext: z.optional(z.union([zGroundingChunkRetrievedContextOutput, z.null()])),
819
+ web: z.optional(z.union([zGroundingChunkWeb, z.null()])),
1019
820
  });
1020
821
  /**
1021
- * Part
1022
- * A datatype containing media content.
822
+ * RagRetrievalConfigFilter
1023
823
  *
1024
- * Exactly one field within a Part should be set, representing the specific type
1025
- * of content being conveyed. Using multiple fields within the same `Part`
1026
- * instance is considered invalid.
824
+ * Config for filters.
1027
825
  */
1028
- export const zPartInput = z.object({
1029
- videoMetadata: z.optional(z.union([zVideoMetadata, z.null()])),
1030
- thought: z.optional(z.union([z.boolean(), z.null()])),
1031
- inlineData: z.optional(z.union([zBlob, z.null()])),
1032
- fileData: z.optional(z.union([zFileData, z.null()])),
1033
- thoughtSignature: z.optional(z.union([z.string(), z.null()])),
1034
- codeExecutionResult: z.optional(z.union([zCodeExecutionResult, z.null()])),
1035
- executableCode: z.optional(z.union([zExecutableCode, z.null()])),
1036
- functionCall: z.optional(z.union([zFunctionCall, z.null()])),
1037
- functionResponse: z.optional(z.union([zFunctionResponse, z.null()])),
1038
- text: z.optional(z.union([z.string(), z.null()])),
826
+ export const zRagRetrievalConfigFilter = z.object({
827
+ metadataFilter: z.optional(z.union([z.string(), z.null()])),
828
+ vectorDistanceThreshold: z.optional(z.union([z.number(), z.null()])),
829
+ vectorSimilarityThreshold: z.optional(z.union([z.number(), z.null()])),
1039
830
  });
1040
831
  /**
1041
- * Content
1042
- * Contains the multi-part content of a message.
832
+ * RagRetrievalConfigHybridSearch
833
+ *
834
+ * Config for Hybrid Search.
1043
835
  */
1044
- export const zContentInput = z.object({
1045
- parts: z.optional(z.union([z.array(zPartInput), z.null()])),
1046
- role: z.optional(z.union([z.string(), z.null()])),
836
+ export const zRagRetrievalConfigHybridSearch = z.object({
837
+ alpha: z.optional(z.union([z.number(), z.null()])),
1047
838
  });
1048
839
  /**
1049
- * Part
1050
- * A datatype containing media content.
840
+ * RagRetrievalConfigRankingLlmRanker
1051
841
  *
1052
- * Exactly one field within a Part should be set, representing the specific type
1053
- * of content being conveyed. Using multiple fields within the same `Part`
1054
- * instance is considered invalid.
842
+ * Config for LlmRanker.
1055
843
  */
1056
- export const zPartOutput = z.object({
1057
- videoMetadata: z.optional(z.union([zVideoMetadata, z.null()])),
1058
- thought: z.optional(z.union([z.boolean(), z.null()])),
1059
- inlineData: z.optional(z.union([zBlob, z.null()])),
1060
- fileData: z.optional(z.union([zFileData, z.null()])),
1061
- thoughtSignature: z.optional(z.union([z.string(), z.null()])),
1062
- codeExecutionResult: z.optional(z.union([zCodeExecutionResult, z.null()])),
1063
- executableCode: z.optional(z.union([zExecutableCode, z.null()])),
1064
- functionCall: z.optional(z.union([zFunctionCall, z.null()])),
1065
- functionResponse: z.optional(z.union([zFunctionResponse, z.null()])),
1066
- text: z.optional(z.union([z.string(), z.null()])),
844
+ export const zRagRetrievalConfigRankingLlmRanker = z.object({
845
+ modelName: z.optional(z.union([z.string(), z.null()])),
1067
846
  });
1068
847
  /**
1069
- * Content
1070
- * Contains the multi-part content of a message.
848
+ * RagRetrievalConfigRankingRankService
849
+ *
850
+ * Config for Rank Service.
1071
851
  */
1072
- export const zContentOutput = z.object({
1073
- parts: z.optional(z.union([z.array(zPartOutput), z.null()])),
1074
- role: z.optional(z.union([z.string(), z.null()])),
852
+ export const zRagRetrievalConfigRankingRankService = z.object({
853
+ modelName: z.optional(z.union([z.string(), z.null()])),
1075
854
  });
1076
855
  /**
1077
- * IntermediateData
1078
- * Container for intermediate data that an agent would generate as it responds with a final answer.
856
+ * RagRetrievalConfigRanking
857
+ *
858
+ * Config for ranking and reranking.
1079
859
  */
1080
- export const zIntermediateDataInput = z.object({
1081
- toolUses: z.optional(z.array(zFunctionCall)).default([]),
1082
- toolResponses: z.optional(z.array(zFunctionResponse)).default([]),
1083
- intermediateResponses: z
1084
- .optional(z.array(z.tuple([z.string(), z.array(zPartInput)])))
1085
- .default([]),
860
+ export const zRagRetrievalConfigRanking = z.object({
861
+ llmRanker: z.optional(z.union([zRagRetrievalConfigRankingLlmRanker, z.null()])),
862
+ rankService: z.optional(z.union([zRagRetrievalConfigRankingRankService, z.null()])),
1086
863
  });
1087
864
  /**
1088
- * InvocationEvent
1089
- * An immutable record representing a specific point in the agent's invocation.
865
+ * RagRetrievalConfig
1090
866
  *
1091
- * It captures agent's replies, requests to use tools (function calls), and tool
1092
- * results.
867
+ * Specifies the context retrieval config.
868
+ */
869
+ export const zRagRetrievalConfigInput = z.object({
870
+ filter: z.optional(z.union([zRagRetrievalConfigFilter, z.null()])),
871
+ hybridSearch: z.optional(z.union([zRagRetrievalConfigHybridSearch, z.null()])),
872
+ ranking: z.optional(z.union([zRagRetrievalConfigRanking, z.null()])),
873
+ topK: z.optional(z.union([z.int(), z.null()])),
874
+ });
875
+ /**
876
+ * RagRetrievalConfig
1093
877
  *
1094
- * This structure is a simple projection of the actual `Event` datamodel that
1095
- * is intended for the Eval System.
878
+ * Specifies the context retrieval config.
1096
879
  */
1097
- export const zInvocationEventInput = z.object({
1098
- author: z.string(),
1099
- content: z.union([zContentInput, z.null()]),
880
+ export const zRagRetrievalConfigOutput = z.object({
881
+ filter: z.optional(z.union([zRagRetrievalConfigFilter, z.null()])),
882
+ hybridSearch: z.optional(z.union([zRagRetrievalConfigHybridSearch, z.null()])),
883
+ ranking: z.optional(z.union([zRagRetrievalConfigRanking, z.null()])),
884
+ topK: z.optional(z.union([z.int(), z.null()])),
1100
885
  });
1101
886
  /**
1102
- * InvocationEvents
1103
- * A container for events that occur during the course of an invocation.
887
+ * RetrievalConfig
888
+ *
889
+ * Retrieval config.
1104
890
  */
1105
- export const zInvocationEventsInput = z.object({
1106
- invocationEvents: z.optional(z.array(zInvocationEventInput)),
891
+ export const zRetrievalConfig = z.object({
892
+ latLng: z.optional(z.union([zLatLng, z.null()])),
893
+ languageCode: z.optional(z.union([z.string(), z.null()])),
894
+ });
895
+ /**
896
+ * RetrievalMetadata
897
+ *
898
+ * Metadata related to retrieval in the grounding flow.
899
+ */
900
+ export const zRetrievalMetadata = z.object({
901
+ googleSearchDynamicRetrievalScore: z.optional(z.union([z.number(), z.null()])),
1107
902
  });
1108
903
  /**
1109
904
  * RubricContent
905
+ *
1110
906
  * The content of a rubric.
1111
907
  */
1112
908
  export const zRubricContent = z.object({
@@ -1114,6 +910,7 @@ export const zRubricContent = z.object({
1114
910
  });
1115
911
  /**
1116
912
  * Rubric
913
+ *
1117
914
  * This class represents a single Rubric.
1118
915
  */
1119
916
  export const zRubric = z.object({
@@ -1123,100 +920,133 @@ export const zRubric = z.object({
1123
920
  type: z.optional(z.union([z.string(), z.null()])),
1124
921
  });
1125
922
  /**
1126
- * Invocation
1127
- * Represents a single invocation.
923
+ * RubricScore
924
+ *
925
+ * The score obtained after applying the rubric to the Agent's response.
1128
926
  */
1129
- export const zInvocationInput = z.object({
1130
- invocationId: z.optional(z.string()).default(""),
1131
- userContent: zContentInput,
1132
- finalResponse: z.optional(z.union([zContentInput, z.null()])),
1133
- intermediateData: z.optional(z.union([zIntermediateDataInput, zInvocationEventsInput, z.null()])),
1134
- creationTimestamp: z.optional(z.number()).default(0),
1135
- rubrics: z.optional(z.union([z.array(zRubric), z.null()])),
1136
- appDetails: z.optional(z.union([zAppDetailsInput, z.null()])),
927
+ export const zRubricScore = z.object({
928
+ rubricId: z.string(),
929
+ rationale: z.optional(z.union([z.string(), z.null()])),
930
+ score: z.optional(z.union([z.number(), z.null()])),
1137
931
  });
1138
932
  /**
1139
- * SessionInput
1140
- * Values that help initialize a Session.
933
+ * EvalMetricResultDetails
1141
934
  */
1142
- export const zSessionInput = z.object({
1143
- appName: z.string(),
1144
- userId: z.string(),
1145
- state: z.optional(z.record(z.string(), z.unknown())),
935
+ export const zEvalMetricResultDetails = z.object({
936
+ rubricScores: z.optional(z.union([z.array(zRubricScore), z.null()])),
1146
937
  });
1147
938
  /**
1148
- * EvalCase
1149
- * An eval case.
939
+ * SafetySetting
940
+ *
941
+ * Safety settings.
1150
942
  */
1151
- export const zEvalCaseInput = z.object({
1152
- evalId: z.string(),
1153
- conversation: z.array(zInvocationInput),
1154
- sessionInput: z.optional(z.union([zSessionInput, z.null()])),
1155
- creationTimestamp: z.optional(z.number()).default(0),
1156
- rubrics: z.optional(z.union([z.array(zRubric), z.null()])),
943
+ export const zSafetySetting = z.object({
944
+ method: z.optional(z.union([zHarmBlockMethod, z.null()])),
945
+ category: z.optional(z.union([zHarmCategory, z.null()])),
946
+ threshold: z.optional(z.union([zHarmBlockThreshold, z.null()])),
1157
947
  });
1158
948
  /**
1159
- * EvalSet
1160
- * A set of eval cases.
949
+ * SandboxStatusInfo
950
+ *
951
+ * 沙盒状态信息
1161
952
  */
1162
- export const zEvalSetInput = z.object({
1163
- eval_set_id: z.string(),
1164
- name: z.optional(z.union([z.string(), z.null()])),
1165
- description: z.optional(z.union([z.string(), z.null()])),
1166
- eval_cases: z.array(zEvalCaseInput),
1167
- creation_timestamp: z.optional(z.number()).default(0),
953
+ export const zSandboxStatusInfo = z.object({
954
+ sandboxId: z.string(),
955
+ status: z.string(),
956
+ error: z.optional(z.union([z.string(), z.null()])),
1168
957
  });
1169
958
  /**
1170
- * CreateEvalSetRequest
959
+ * CheckSandboxStatusResponse
1171
960
  */
1172
- export const zCreateEvalSetRequest = z.object({
1173
- evalSet: zEvalSetInput,
961
+ export const zCheckSandboxStatusResponse = z.object({
962
+ results: z.optional(z.array(zSandboxStatusInfo)),
963
+ total_checked: z.int(),
1174
964
  });
1175
965
  /**
1176
- * RagChunkPageSpan
1177
- * Represents where the chunk starts and ends in the document.
966
+ * SearchEntryPoint
967
+ *
968
+ * Google search entry point.
1178
969
  */
1179
- export const zRagChunkPageSpan = z.object({
1180
- firstPage: z.optional(z.union([z.int(), z.null()])),
1181
- lastPage: z.optional(z.union([z.int(), z.null()])),
970
+ export const zSearchEntryPoint = z.object({
971
+ renderedContent: z.optional(z.union([z.string(), z.null()])),
972
+ sdkBlob: z.optional(z.union([z.string(), z.null()])),
1182
973
  });
1183
974
  /**
1184
- * RagChunk
1185
- * A RagChunk includes the content of a chunk of a RagFile, and associated metadata.
975
+ * SecuritySchemeType
1186
976
  */
1187
- export const zRagChunk = z.object({
1188
- pageSpan: z.optional(z.union([zRagChunkPageSpan, z.null()])),
1189
- text: z.optional(z.union([z.string(), z.null()])),
1190
- });
977
+ export const zSecuritySchemeType = z.enum([
978
+ "apiKey",
979
+ "http",
980
+ "oauth2",
981
+ "openIdConnect",
982
+ ]);
1191
983
  /**
1192
- * GroundingChunkRetrievedContext
1193
- * Chunk from context retrieved by the retrieval tools.
984
+ * APIKey
1194
985
  */
1195
- export const zGroundingChunkRetrievedContextInput = z.object({
1196
- ragChunk: z.optional(z.union([zRagChunk, z.null()])),
1197
- text: z.optional(z.union([z.string(), z.null()])),
1198
- title: z.optional(z.union([z.string(), z.null()])),
1199
- uri: z.optional(z.union([z.string(), z.null()])),
986
+ export const zApiKey = z.object({
987
+ type: z.optional(zSecuritySchemeType),
988
+ description: z.optional(z.union([z.string(), z.null()])),
989
+ in: zApiKeyIn,
990
+ name: z.string(),
1200
991
  });
1201
992
  /**
1202
- * GroundingChunkWeb
1203
- * Chunk from the web.
993
+ * HTTPBase
1204
994
  */
1205
- export const zGroundingChunkWeb = z.object({
1206
- domain: z.optional(z.union([z.string(), z.null()])),
1207
- title: z.optional(z.union([z.string(), z.null()])),
1208
- uri: z.optional(z.union([z.string(), z.null()])),
995
+ export const zHttpBase = z.object({
996
+ type: z.optional(zSecuritySchemeType),
997
+ description: z.optional(z.union([z.string(), z.null()])),
998
+ scheme: z.string(),
1209
999
  });
1210
1000
  /**
1211
- * GroundingChunk
1212
- * Grounding chunk.
1001
+ * HTTPBearer
1213
1002
  */
1214
- export const zGroundingChunkInput = z.object({
1215
- retrievedContext: z.optional(z.union([zGroundingChunkRetrievedContextInput, z.null()])),
1216
- web: z.optional(z.union([zGroundingChunkWeb, z.null()])),
1003
+ export const zHttpBearer = z.object({
1004
+ type: z.optional(zSecuritySchemeType),
1005
+ description: z.optional(z.union([z.string(), z.null()])),
1006
+ scheme: z.optional(z.literal("bearer")).default("bearer"),
1007
+ bearerFormat: z.optional(z.union([z.string(), z.null()])),
1008
+ });
1009
+ /**
1010
+ * OAuth2
1011
+ */
1012
+ export const zOAuth2Input = z.object({
1013
+ type: z.optional(zSecuritySchemeType),
1014
+ description: z.optional(z.union([z.string(), z.null()])),
1015
+ flows: zOAuthFlows,
1016
+ });
1017
+ /**
1018
+ * OAuth2
1019
+ */
1020
+ export const zOAuth2Output = z.object({
1021
+ type: z.optional(zSecuritySchemeType),
1022
+ description: z.optional(z.union([z.string(), z.null()])),
1023
+ flows: zOAuthFlows,
1024
+ });
1025
+ /**
1026
+ * OpenIdConnect
1027
+ */
1028
+ export const zOpenIdConnect = z.object({
1029
+ type: z.optional(zSecuritySchemeType),
1030
+ description: z.optional(z.union([z.string(), z.null()])),
1031
+ openIdConnectUrl: z.string(),
1032
+ });
1033
+ /**
1034
+ * OpenIdConnectWithConfig
1035
+ */
1036
+ export const zOpenIdConnectWithConfig = z.object({
1037
+ type: z.optional(zSecuritySchemeType),
1038
+ description: z.optional(z.union([z.string(), z.null()])),
1039
+ authorization_endpoint: z.string(),
1040
+ token_endpoint: z.string(),
1041
+ userinfo_endpoint: z.optional(z.union([z.string(), z.null()])),
1042
+ revocation_endpoint: z.optional(z.union([z.string(), z.null()])),
1043
+ token_endpoint_auth_methods_supported: z.optional(z.union([z.array(z.string()), z.null()])),
1044
+ grant_types_supported: z.optional(z.union([z.array(z.string()), z.null()])),
1045
+ scopes: z.optional(z.union([z.array(z.string()), z.null()])),
1217
1046
  });
1218
1047
  /**
1219
1048
  * Segment
1049
+ *
1220
1050
  * Segment of the content.
1221
1051
  */
1222
1052
  export const zSegment = z.object({
@@ -1227,6 +1057,7 @@ export const zSegment = z.object({
1227
1057
  });
1228
1058
  /**
1229
1059
  * GroundingSupport
1060
+ *
1230
1061
  * Grounding support.
1231
1062
  */
1232
1063
  export const zGroundingSupport = z.object({
@@ -1234,23 +1065,9 @@ export const zGroundingSupport = z.object({
1234
1065
  groundingChunkIndices: z.optional(z.union([z.array(z.int()), z.null()])),
1235
1066
  segment: z.optional(z.union([zSegment, z.null()])),
1236
1067
  });
1237
- /**
1238
- * RetrievalMetadata
1239
- * Metadata related to retrieval in the grounding flow.
1240
- */
1241
- export const zRetrievalMetadata = z.object({
1242
- googleSearchDynamicRetrievalScore: z.optional(z.union([z.number(), z.null()])),
1243
- });
1244
- /**
1245
- * SearchEntryPoint
1246
- * Google search entry point.
1247
- */
1248
- export const zSearchEntryPoint = z.object({
1249
- renderedContent: z.optional(z.union([z.string(), z.null()])),
1250
- sdkBlob: z.optional(z.union([z.string(), z.null()])),
1251
- });
1252
1068
  /**
1253
1069
  * GroundingMetadata
1070
+ *
1254
1071
  * Metadata returned to client when grounding is enabled.
1255
1072
  */
1256
1073
  export const zGroundingMetadataInput = z.object({
@@ -1262,228 +1079,302 @@ export const zGroundingMetadataInput = z.object({
1262
1079
  webSearchQueries: z.optional(z.union([z.array(z.string()), z.null()])),
1263
1080
  });
1264
1081
  /**
1265
- * FinishReason
1266
- * Output only. The reason why the model stopped generating tokens.
1082
+ * GroundingMetadata
1267
1083
  *
1268
- * If empty, the model has not stopped generating the tokens.
1269
- */
1270
- export const zFinishReason = z.enum([
1271
- "FINISH_REASON_UNSPECIFIED",
1272
- "STOP",
1273
- "MAX_TOKENS",
1274
- "SAFETY",
1275
- "RECITATION",
1276
- "LANGUAGE",
1277
- "OTHER",
1278
- "BLOCKLIST",
1279
- "PROHIBITED_CONTENT",
1280
- "SPII",
1281
- "MALFORMED_FUNCTION_CALL",
1282
- "IMAGE_SAFETY",
1283
- "UNEXPECTED_TOOL_CALL",
1284
- ]);
1285
- /**
1286
- * MediaModality
1287
- * Server content modalities.
1288
- */
1289
- export const zMediaModality = z.enum([
1290
- "MODALITY_UNSPECIFIED",
1291
- "TEXT",
1292
- "IMAGE",
1293
- "VIDEO",
1294
- "AUDIO",
1295
- "DOCUMENT",
1296
- ]);
1297
- /**
1298
- * ModalityTokenCount
1299
- * Represents token counting info for a single modality.
1084
+ * Metadata returned to client when grounding is enabled.
1300
1085
  */
1301
- export const zModalityTokenCount = z.object({
1302
- modality: z.optional(z.union([zMediaModality, z.null()])),
1303
- tokenCount: z.optional(z.union([z.int(), z.null()])),
1086
+ export const zGroundingMetadataOutput = z.object({
1087
+ groundingChunks: z.optional(z.union([z.array(zGroundingChunkOutput), z.null()])),
1088
+ groundingSupports: z.optional(z.union([z.array(zGroundingSupport), z.null()])),
1089
+ retrievalMetadata: z.optional(z.union([zRetrievalMetadata, z.null()])),
1090
+ retrievalQueries: z.optional(z.union([z.array(z.string()), z.null()])),
1091
+ searchEntryPoint: z.optional(z.union([zSearchEntryPoint, z.null()])),
1092
+ webSearchQueries: z.optional(z.union([z.array(z.string()), z.null()])),
1304
1093
  });
1305
1094
  /**
1306
- * TrafficType
1307
- * Output only.
1095
+ * ServiceAccountCredential
1308
1096
  *
1309
- * Traffic type. This shows whether a request consumes Pay-As-You-Go or
1310
- * Provisioned Throughput quota.
1311
- */
1312
- export const zTrafficType = z.enum([
1313
- "TRAFFIC_TYPE_UNSPECIFIED",
1314
- "ON_DEMAND",
1315
- "PROVISIONED_THROUGHPUT",
1316
- ]);
1317
- /**
1318
- * GenerateContentResponseUsageMetadata
1319
- * Usage metadata about response(s).
1320
- */
1321
- export const zGenerateContentResponseUsageMetadataInput = z.object({
1322
- cacheTokensDetails: z.optional(z.union([z.array(zModalityTokenCount), z.null()])),
1323
- cachedContentTokenCount: z.optional(z.union([z.int(), z.null()])),
1324
- candidatesTokenCount: z.optional(z.union([z.int(), z.null()])),
1325
- candidatesTokensDetails: z.optional(z.union([z.array(zModalityTokenCount), z.null()])),
1326
- promptTokenCount: z.optional(z.union([z.int(), z.null()])),
1327
- promptTokensDetails: z.optional(z.union([z.array(zModalityTokenCount), z.null()])),
1328
- thoughtsTokenCount: z.optional(z.union([z.int(), z.null()])),
1329
- toolUsePromptTokenCount: z.optional(z.union([z.int(), z.null()])),
1330
- toolUsePromptTokensDetails: z.optional(z.union([z.array(zModalityTokenCount), z.null()])),
1331
- totalTokenCount: z.optional(z.union([z.int(), z.null()])),
1332
- trafficType: z.optional(z.union([zTrafficType, z.null()])),
1333
- });
1334
- /**
1335
- * LiveServerSessionResumptionUpdate
1336
- * Update of the session resumption state.
1097
+ * Represents Google Service Account configuration.
1337
1098
  *
1338
- * Only sent if `session_resumption` was set in the connection config.
1339
- */
1340
- export const zLiveServerSessionResumptionUpdate = z.object({
1341
- newHandle: z.optional(z.union([z.string(), z.null()])),
1342
- resumable: z.optional(z.union([z.boolean(), z.null()])),
1343
- lastConsumedClientMessageIndex: z.optional(z.union([z.int(), z.null()])),
1344
- });
1345
- /**
1346
- * Transcription
1347
- * Audio transcription in Server Conent.
1348
- */
1349
- export const zTranscription = z.object({
1350
- text: z.optional(z.union([z.string(), z.null()])),
1351
- finished: z.optional(z.union([z.boolean(), z.null()])),
1352
- });
1353
- /**
1354
- * LogprobsResultCandidate
1355
- * Candidate for the logprobs token and score.
1356
- */
1357
- export const zLogprobsResultCandidate = z.object({
1358
- logProbability: z.optional(z.union([z.number(), z.null()])),
1359
- token: z.optional(z.union([z.string(), z.null()])),
1360
- tokenId: z.optional(z.union([z.int(), z.null()])),
1361
- });
1362
- /**
1363
- * LogprobsResultTopCandidates
1364
- * Candidates with top log probabilities at each decoding step.
1365
- */
1366
- export const zLogprobsResultTopCandidates = z.object({
1367
- candidates: z.optional(z.union([z.array(zLogprobsResultCandidate), z.null()])),
1368
- });
1369
- /**
1370
- * LogprobsResult
1371
- * Logprobs Result
1099
+ * Attributes:
1100
+ * type: The type should be "service_account".
1101
+ * project_id: The project ID.
1102
+ * private_key_id: The ID of the private key.
1103
+ * private_key: The private key.
1104
+ * client_email: The client email.
1105
+ * client_id: The client ID.
1106
+ * auth_uri: The authorization URI.
1107
+ * token_uri: The token URI.
1108
+ * auth_provider_x509_cert_url: URL for auth provider's X.509 cert.
1109
+ * client_x509_cert_url: URL for the client's X.509 cert.
1110
+ * universe_domain: The universe domain.
1111
+ *
1112
+ * Example:
1113
+ *
1114
+ * config = ServiceAccountCredential(
1115
+ * type_="service_account",
1116
+ * project_id="your_project_id",
1117
+ * private_key_id="your_private_key_id",
1118
+ * private_key="-----BEGIN PRIVATE KEY-----...",
1119
+ * client_email="...@....iam.gserviceaccount.com",
1120
+ * client_id="your_client_id",
1121
+ * auth_uri="https://accounts.google.com/o/oauth2/auth",
1122
+ * token_uri="https://oauth2.googleapis.com/token",
1123
+ * auth_provider_x509_cert_url="https://www.googleapis.com/oauth2/v1/certs",
1124
+ * client_x509_cert_url="https://www.googleapis.com/robot/v1/metadata/x509/...",
1125
+ * universe_domain="googleapis.com"
1126
+ * )
1127
+ *
1128
+ *
1129
+ * config = ServiceAccountConfig.model_construct(**{
1130
+ * ...service account config dict
1131
+ * })
1372
1132
  */
1373
- export const zLogprobsResultInput = z.object({
1374
- chosenCandidates: z.optional(z.union([z.array(zLogprobsResultCandidate), z.null()])),
1375
- topCandidates: z.optional(z.union([z.array(zLogprobsResultTopCandidates), z.null()])),
1133
+ export const zServiceAccountCredential = z.object({
1134
+ type: z.optional(z.string()).default(""),
1135
+ projectId: z.string(),
1136
+ privateKeyId: z.string(),
1137
+ privateKey: z.string(),
1138
+ clientEmail: z.string(),
1139
+ clientId: z.string(),
1140
+ authUri: z.string(),
1141
+ tokenUri: z.string(),
1142
+ authProviderX509CertUrl: z.string(),
1143
+ clientX509CertUrl: z.string(),
1144
+ universeDomain: z.string(),
1376
1145
  });
1377
1146
  /**
1378
- * HTTPBase
1147
+ * ServiceAccount
1148
+ *
1149
+ * Represents Google Service Account configuration.
1379
1150
  */
1380
- export const zHttpBase = z.object({
1381
- type: z.optional(zSecuritySchemeType),
1382
- description: z.optional(z.union([z.string(), z.null()])),
1383
- scheme: z.string(),
1151
+ export const zServiceAccount = z.object({
1152
+ serviceAccountCredential: z.optional(z.union([zServiceAccountCredential, z.null()])),
1153
+ scopes: z.array(z.string()),
1154
+ useDefaultCredential: z.optional(z.union([z.boolean(), z.null()])),
1384
1155
  });
1385
1156
  /**
1386
- * OAuthFlowImplicit
1157
+ * AuthCredential
1158
+ *
1159
+ * Data class representing an authentication credential.
1160
+ *
1161
+ * To exchange for the actual credential, please use
1162
+ * CredentialExchanger.exchange_credential().
1163
+ *
1164
+ * Examples: API Key Auth
1165
+ * AuthCredential(
1166
+ * auth_type=AuthCredentialTypes.API_KEY,
1167
+ * api_key="1234",
1168
+ * )
1169
+ *
1170
+ * Example: HTTP Auth
1171
+ * AuthCredential(
1172
+ * auth_type=AuthCredentialTypes.HTTP,
1173
+ * http=HttpAuth(
1174
+ * scheme="basic",
1175
+ * credentials=HttpCredentials(username="user", password="password"),
1176
+ * ),
1177
+ * )
1178
+ *
1179
+ * Example: OAuth2 Bearer Token in HTTP Header
1180
+ * AuthCredential(
1181
+ * auth_type=AuthCredentialTypes.HTTP,
1182
+ * http=HttpAuth(
1183
+ * scheme="bearer",
1184
+ * credentials=HttpCredentials(token="eyAkaknabna...."),
1185
+ * ),
1186
+ * )
1187
+ *
1188
+ * Example: OAuth2 Auth with Authorization Code Flow
1189
+ * AuthCredential(
1190
+ * auth_type=AuthCredentialTypes.OAUTH2,
1191
+ * oauth2=OAuth2Auth(
1192
+ * client_id="1234",
1193
+ * client_secret="secret",
1194
+ * ),
1195
+ * )
1196
+ *
1197
+ * Example: OpenID Connect Auth
1198
+ * AuthCredential(
1199
+ * auth_type=AuthCredentialTypes.OPEN_ID_CONNECT,
1200
+ * oauth2=OAuth2Auth(
1201
+ * client_id="1234",
1202
+ * client_secret="secret",
1203
+ * redirect_uri="https://example.com",
1204
+ * scopes=["scope1", "scope2"],
1205
+ * ),
1206
+ * )
1207
+ *
1208
+ * Example: Auth with resource reference
1209
+ * AuthCredential(
1210
+ * auth_type=AuthCredentialTypes.API_KEY,
1211
+ * resource_ref="projects/1234/locations/us-central1/resources/resource1",
1212
+ * )
1387
1213
  */
1388
- export const zOAuthFlowImplicit = z.object({
1389
- refreshUrl: z.optional(z.union([z.string(), z.null()])),
1390
- scopes: z.optional(z.record(z.string(), z.string())).default({}),
1391
- authorizationUrl: z.string(),
1214
+ export const zAuthCredentialInput = z.object({
1215
+ authType: zAuthCredentialTypes,
1216
+ resourceRef: z.optional(z.union([z.string(), z.null()])),
1217
+ apiKey: z.optional(z.union([z.string(), z.null()])),
1218
+ http: z.optional(z.union([zHttpAuth, z.null()])),
1219
+ serviceAccount: z.optional(z.union([zServiceAccount, z.null()])),
1220
+ oauth2: z.optional(z.union([zOAuth2Auth, z.null()])),
1392
1221
  });
1393
1222
  /**
1394
- * OAuthFlowPassword
1223
+ * AuthCredential
1224
+ *
1225
+ * Data class representing an authentication credential.
1226
+ *
1227
+ * To exchange for the actual credential, please use
1228
+ * CredentialExchanger.exchange_credential().
1229
+ *
1230
+ * Examples: API Key Auth
1231
+ * AuthCredential(
1232
+ * auth_type=AuthCredentialTypes.API_KEY,
1233
+ * api_key="1234",
1234
+ * )
1235
+ *
1236
+ * Example: HTTP Auth
1237
+ * AuthCredential(
1238
+ * auth_type=AuthCredentialTypes.HTTP,
1239
+ * http=HttpAuth(
1240
+ * scheme="basic",
1241
+ * credentials=HttpCredentials(username="user", password="password"),
1242
+ * ),
1243
+ * )
1244
+ *
1245
+ * Example: OAuth2 Bearer Token in HTTP Header
1246
+ * AuthCredential(
1247
+ * auth_type=AuthCredentialTypes.HTTP,
1248
+ * http=HttpAuth(
1249
+ * scheme="bearer",
1250
+ * credentials=HttpCredentials(token="eyAkaknabna...."),
1251
+ * ),
1252
+ * )
1253
+ *
1254
+ * Example: OAuth2 Auth with Authorization Code Flow
1255
+ * AuthCredential(
1256
+ * auth_type=AuthCredentialTypes.OAUTH2,
1257
+ * oauth2=OAuth2Auth(
1258
+ * client_id="1234",
1259
+ * client_secret="secret",
1260
+ * ),
1261
+ * )
1262
+ *
1263
+ * Example: OpenID Connect Auth
1264
+ * AuthCredential(
1265
+ * auth_type=AuthCredentialTypes.OPEN_ID_CONNECT,
1266
+ * oauth2=OAuth2Auth(
1267
+ * client_id="1234",
1268
+ * client_secret="secret",
1269
+ * redirect_uri="https://example.com",
1270
+ * scopes=["scope1", "scope2"],
1271
+ * ),
1272
+ * )
1273
+ *
1274
+ * Example: Auth with resource reference
1275
+ * AuthCredential(
1276
+ * auth_type=AuthCredentialTypes.API_KEY,
1277
+ * resource_ref="projects/1234/locations/us-central1/resources/resource1",
1278
+ * )
1395
1279
  */
1396
- export const zOAuthFlowPassword = z.object({
1397
- refreshUrl: z.optional(z.union([z.string(), z.null()])),
1398
- scopes: z.optional(z.record(z.string(), z.string())).default({}),
1399
- tokenUrl: z.string(),
1280
+ export const zAuthCredentialOutput = z.object({
1281
+ authType: zAuthCredentialTypes,
1282
+ resourceRef: z.optional(z.union([z.string(), z.null()])),
1283
+ apiKey: z.optional(z.union([z.string(), z.null()])),
1284
+ http: z.optional(z.union([zHttpAuth, z.null()])),
1285
+ serviceAccount: z.optional(z.union([zServiceAccount, z.null()])),
1286
+ oauth2: z.optional(z.union([zOAuth2Auth, z.null()])),
1400
1287
  });
1401
1288
  /**
1402
- * OAuthFlowClientCredentials
1289
+ * SessionInput
1290
+ *
1291
+ * Values that help initialize a Session.
1403
1292
  */
1404
- export const zOAuthFlowClientCredentials = z.object({
1405
- refreshUrl: z.optional(z.union([z.string(), z.null()])),
1406
- scopes: z.optional(z.record(z.string(), z.string())).default({}),
1407
- tokenUrl: z.string(),
1293
+ export const zSessionInput = z.object({
1294
+ appName: z.string(),
1295
+ userId: z.string(),
1296
+ state: z.optional(z.record(z.string(), z.unknown())),
1408
1297
  });
1409
1298
  /**
1410
- * OAuthFlowAuthorizationCode
1411
- */
1412
- export const zOAuthFlowAuthorizationCode = z.object({
1413
- refreshUrl: z.optional(z.union([z.string(), z.null()])),
1414
- scopes: z.optional(z.record(z.string(), z.string())).default({}),
1415
- authorizationUrl: z.string(),
1416
- tokenUrl: z.string(),
1299
+ * StartNapcatRequest
1300
+ *
1301
+ * 启动Napcat沙盒请求模型
1302
+ */
1303
+ export const zStartNapcatRequest = z.object({
1304
+ sandbox_type: z.string(),
1305
+ sandboxId: z.string(),
1417
1306
  });
1418
1307
  /**
1419
- * OAuthFlows
1308
+ * StartNapcatResponse
1309
+ *
1310
+ * 启动Napcat沙盒响应模型
1420
1311
  */
1421
- export const zOAuthFlows = z.object({
1422
- implicit: z.optional(z.union([zOAuthFlowImplicit, z.null()])),
1423
- password: z.optional(z.union([zOAuthFlowPassword, z.null()])),
1424
- clientCredentials: z.optional(z.union([zOAuthFlowClientCredentials, z.null()])),
1425
- authorizationCode: z.optional(z.union([zOAuthFlowAuthorizationCode, z.null()])),
1312
+ export const zStartNapcatResponse = z.object({
1313
+ sandboxId: z.string(),
1314
+ error: z.optional(z.union([z.string(), z.null()])),
1426
1315
  });
1427
1316
  /**
1428
- * OAuth2
1317
+ * ThinkingConfig
1318
+ *
1319
+ * The thinking features configuration.
1429
1320
  */
1430
- export const zOAuth2Input = z.object({
1431
- type: z.optional(zSecuritySchemeType),
1432
- description: z.optional(z.union([z.string(), z.null()])),
1433
- flows: zOAuthFlows,
1321
+ export const zThinkingConfig = z.object({
1322
+ includeThoughts: z.optional(z.union([z.boolean(), z.null()])),
1323
+ thinkingBudget: z.optional(z.union([z.int(), z.null()])),
1434
1324
  });
1435
1325
  /**
1436
- * OpenIdConnect
1326
+ * ToolAnnotations
1327
+ *
1328
+ * Additional properties describing a Tool to clients.
1329
+ *
1330
+ * NOTE: all properties in ToolAnnotations are **hints**.
1331
+ * They are not guaranteed to provide a faithful description of
1332
+ * tool behavior (including descriptive properties like `title`).
1333
+ *
1334
+ * Clients should never make tool use decisions based on ToolAnnotations
1335
+ * received from untrusted servers.
1437
1336
  */
1438
- export const zOpenIdConnect = z.object({
1439
- type: z.optional(zSecuritySchemeType),
1440
- description: z.optional(z.union([z.string(), z.null()])),
1441
- openIdConnectUrl: z.string(),
1337
+ export const zToolAnnotations = z.object({
1338
+ title: z.optional(z.union([z.string(), z.null()])),
1339
+ readOnlyHint: z.optional(z.union([z.boolean(), z.null()])),
1340
+ destructiveHint: z.optional(z.union([z.boolean(), z.null()])),
1341
+ idempotentHint: z.optional(z.union([z.boolean(), z.null()])),
1342
+ openWorldHint: z.optional(z.union([z.boolean(), z.null()])),
1442
1343
  });
1443
1344
  /**
1444
- * HTTPBearer
1345
+ * ToolCodeExecution
1346
+ *
1347
+ * Tool that executes code generated by the model, and automatically returns the result to the model.
1348
+ *
1349
+ * See also [ExecutableCode]and [CodeExecutionResult] which are input and output
1350
+ * to this tool.
1445
1351
  */
1446
- export const zHttpBearer = z.object({
1447
- type: z.optional(zSecuritySchemeType),
1448
- description: z.optional(z.union([z.string(), z.null()])),
1449
- scheme: z.optional(z.literal("bearer")).default("bearer"),
1450
- bearerFormat: z.optional(z.union([z.string(), z.null()])),
1451
- });
1352
+ export const zToolCodeExecution = z.record(z.string(), z.never());
1452
1353
  /**
1453
- * OpenIdConnectWithConfig
1354
+ * ToolConfig
1355
+ *
1356
+ * Tool config.
1357
+ *
1358
+ * This config is shared for all tools provided in the request.
1454
1359
  */
1455
- export const zOpenIdConnectWithConfig = z.object({
1456
- type: z.optional(zSecuritySchemeType),
1457
- description: z.optional(z.union([z.string(), z.null()])),
1458
- authorization_endpoint: z.string(),
1459
- token_endpoint: z.string(),
1460
- userinfo_endpoint: z.optional(z.union([z.string(), z.null()])),
1461
- revocation_endpoint: z.optional(z.union([z.string(), z.null()])),
1462
- token_endpoint_auth_methods_supported: z.optional(z.union([z.array(z.string()), z.null()])),
1463
- grant_types_supported: z.optional(z.union([z.array(z.string()), z.null()])),
1464
- scopes: z.optional(z.union([z.array(z.string()), z.null()])),
1360
+ export const zToolConfigInput = z.object({
1361
+ functionCallingConfig: z.optional(z.union([zFunctionCallingConfig, z.null()])),
1362
+ retrievalConfig: z.optional(z.union([zRetrievalConfig, z.null()])),
1465
1363
  });
1466
1364
  /**
1467
- * AuthConfig
1468
- * The auth config sent by tool asking client to collect auth credentials and
1365
+ * ToolConfig
1469
1366
  *
1470
- * adk and client will help to fill in the response
1367
+ * Tool config.
1368
+ *
1369
+ * This config is shared for all tools provided in the request.
1471
1370
  */
1472
- export const zGoogleAdkAuthAuthToolAuthConfigInput = z.object({
1473
- authScheme: z.union([
1474
- zApiKey,
1475
- zHttpBase,
1476
- zOAuth2Input,
1477
- zOpenIdConnect,
1478
- zHttpBearer,
1479
- zOpenIdConnectWithConfig,
1480
- ]),
1481
- rawAuthCredential: z.optional(z.union([zAuthCredentialInput, z.null()])),
1482
- exchangedAuthCredential: z.optional(z.union([zAuthCredentialInput, z.null()])),
1483
- credentialKey: z.optional(z.union([z.string(), z.null()])),
1371
+ export const zToolConfigOutput = z.object({
1372
+ functionCallingConfig: z.optional(z.union([zFunctionCallingConfig, z.null()])),
1373
+ retrievalConfig: z.optional(z.union([zRetrievalConfig, z.null()])),
1484
1374
  });
1485
1375
  /**
1486
1376
  * ToolConfirmation
1377
+ *
1487
1378
  * Represents a tool confirmation configuration.
1488
1379
  */
1489
1380
  export const zToolConfirmation = z.object({
@@ -1492,357 +1383,500 @@ export const zToolConfirmation = z.object({
1492
1383
  payload: z.optional(z.union([z.unknown(), z.null()])),
1493
1384
  });
1494
1385
  /**
1495
- * EventCompaction
1496
- * The compaction of the events.
1386
+ * TrafficType
1387
+ *
1388
+ * Output only.
1389
+ *
1390
+ * Traffic type. This shows whether a request consumes Pay-As-You-Go or
1391
+ * Provisioned Throughput quota.
1497
1392
  */
1498
- export const zEventCompactionInput = z.object({
1499
- startTimestamp: z.number(),
1500
- endTimestamp: z.number(),
1501
- compactedContent: zContentInput,
1393
+ export const zTrafficType = z.enum([
1394
+ "TRAFFIC_TYPE_UNSPECIFIED",
1395
+ "ON_DEMAND",
1396
+ "PROVISIONED_THROUGHPUT",
1397
+ ]);
1398
+ /**
1399
+ * GenerateContentResponseUsageMetadata
1400
+ *
1401
+ * Usage metadata about response(s).
1402
+ */
1403
+ export const zGenerateContentResponseUsageMetadataInput = z.object({
1404
+ cacheTokensDetails: z.optional(z.union([z.array(zModalityTokenCount), z.null()])),
1405
+ cachedContentTokenCount: z.optional(z.union([z.int(), z.null()])),
1406
+ candidatesTokenCount: z.optional(z.union([z.int(), z.null()])),
1407
+ candidatesTokensDetails: z.optional(z.union([z.array(zModalityTokenCount), z.null()])),
1408
+ promptTokenCount: z.optional(z.union([z.int(), z.null()])),
1409
+ promptTokensDetails: z.optional(z.union([z.array(zModalityTokenCount), z.null()])),
1410
+ thoughtsTokenCount: z.optional(z.union([z.int(), z.null()])),
1411
+ toolUsePromptTokenCount: z.optional(z.union([z.int(), z.null()])),
1412
+ toolUsePromptTokensDetails: z.optional(z.union([z.array(zModalityTokenCount), z.null()])),
1413
+ totalTokenCount: z.optional(z.union([z.int(), z.null()])),
1414
+ trafficType: z.optional(z.union([zTrafficType, z.null()])),
1502
1415
  });
1503
1416
  /**
1504
- * EventActions
1505
- * Represents the actions attached to an event.
1417
+ * GenerateContentResponseUsageMetadata
1418
+ *
1419
+ * Usage metadata about response(s).
1506
1420
  */
1507
- export const zEventActionsInput = z.object({
1508
- skipSummarization: z.optional(z.union([z.boolean(), z.null()])),
1509
- stateDelta: z.optional(z.record(z.string(), z.unknown())),
1510
- artifactDelta: z.optional(z.record(z.string(), z.int())),
1511
- transferToAgent: z.optional(z.union([z.string(), z.null()])),
1512
- escalate: z.optional(z.union([z.boolean(), z.null()])),
1513
- requestedAuthConfigs: z.optional(z.record(z.string(), zGoogleAdkAuthAuthToolAuthConfigInput)),
1514
- requestedToolConfirmations: z.optional(z.record(z.string(), zToolConfirmation)),
1515
- compaction: z.optional(z.union([zEventCompactionInput, z.null()])),
1421
+ export const zGenerateContentResponseUsageMetadataOutput = z.object({
1422
+ cacheTokensDetails: z.optional(z.union([z.array(zModalityTokenCount), z.null()])),
1423
+ cachedContentTokenCount: z.optional(z.union([z.int(), z.null()])),
1424
+ candidatesTokenCount: z.optional(z.union([z.int(), z.null()])),
1425
+ candidatesTokensDetails: z.optional(z.union([z.array(zModalityTokenCount), z.null()])),
1426
+ promptTokenCount: z.optional(z.union([z.int(), z.null()])),
1427
+ promptTokensDetails: z.optional(z.union([z.array(zModalityTokenCount), z.null()])),
1428
+ thoughtsTokenCount: z.optional(z.union([z.int(), z.null()])),
1429
+ toolUsePromptTokenCount: z.optional(z.union([z.int(), z.null()])),
1430
+ toolUsePromptTokensDetails: z.optional(z.union([z.array(zModalityTokenCount), z.null()])),
1431
+ totalTokenCount: z.optional(z.union([z.int(), z.null()])),
1432
+ trafficType: z.optional(z.union([zTrafficType, z.null()])),
1516
1433
  });
1517
1434
  /**
1518
- * Event
1519
- * Represents an event in a conversation between agents and users.
1435
+ * Transcription
1520
1436
  *
1521
- * It is used to store the content of the conversation, as well as the actions
1522
- * taken by the agents like function calls, etc.
1437
+ * Audio transcription in Server Conent.
1523
1438
  */
1524
- export const zEventInput = z.object({
1525
- content: z.optional(z.union([zContentInput, z.null()])),
1526
- groundingMetadata: z.optional(z.union([zGroundingMetadataInput, z.null()])),
1527
- partial: z.optional(z.union([z.boolean(), z.null()])),
1528
- turnComplete: z.optional(z.union([z.boolean(), z.null()])),
1529
- finishReason: z.optional(z.union([zFinishReason, z.null()])),
1530
- errorCode: z.optional(z.union([z.string(), z.null()])),
1531
- errorMessage: z.optional(z.union([z.string(), z.null()])),
1532
- interrupted: z.optional(z.union([z.boolean(), z.null()])),
1533
- customMetadata: z.optional(z.union([z.record(z.string(), z.unknown()), z.null()])),
1534
- usageMetadata: z.optional(z.union([zGenerateContentResponseUsageMetadataInput, z.null()])),
1535
- liveSessionResumptionUpdate: z.optional(z.union([zLiveServerSessionResumptionUpdate, z.null()])),
1536
- inputTranscription: z.optional(z.union([zTranscription, z.null()])),
1537
- outputTranscription: z.optional(z.union([zTranscription, z.null()])),
1538
- avgLogprobs: z.optional(z.union([z.number(), z.null()])),
1539
- logprobsResult: z.optional(z.union([zLogprobsResultInput, z.null()])),
1540
- cacheMetadata: z.optional(z.union([zCacheMetadata, z.null()])),
1541
- invocationId: z.optional(z.string()).default(""),
1542
- author: z.string(),
1543
- actions: z.optional(zEventActionsInput),
1544
- longRunningToolIds: z.optional(z.union([z.array(z.string()), z.null()])),
1545
- branch: z.optional(z.union([z.string(), z.null()])),
1546
- id: z.optional(z.string()).default(""),
1547
- timestamp: z.optional(z.number()),
1439
+ export const zTranscription = z.object({
1440
+ text: z.optional(z.union([z.string(), z.null()])),
1441
+ finished: z.optional(z.union([z.boolean(), z.null()])),
1442
+ });
1443
+ /**
1444
+ * Type
1445
+ *
1446
+ * Optional. The type of the data.
1447
+ */
1448
+ export const zType = z.enum([
1449
+ "TYPE_UNSPECIFIED",
1450
+ "STRING",
1451
+ "NUMBER",
1452
+ "INTEGER",
1453
+ "BOOLEAN",
1454
+ "ARRAY",
1455
+ "OBJECT",
1456
+ "NULL",
1457
+ ]);
1458
+ /**
1459
+ * Schema
1460
+ *
1461
+ * Schema is used to define the format of input/output data.
1462
+ *
1463
+ * Represents a select subset of an [OpenAPI 3.0 schema
1464
+ * object](https://spec.openapis.org/oas/v3.0.3#schema-object). More fields may
1465
+ * be added in the future as needed.
1466
+ */
1467
+ export const zSchemaInput = z.object({
1468
+ additionalProperties: z.optional(z.union([z.unknown(), z.null()])),
1469
+ defs: z.optional(z.union([
1470
+ z.record(z.string(), z.lazy(() => {
1471
+ return zSchemaInput;
1472
+ })),
1473
+ z.null(),
1474
+ ])),
1475
+ ref: z.optional(z.union([z.string(), z.null()])),
1476
+ anyOf: z.optional(z.union([
1477
+ z.array(z.lazy(() => {
1478
+ return zSchemaInput;
1479
+ })),
1480
+ z.null(),
1481
+ ])),
1482
+ default: z.optional(z.union([z.unknown(), z.null()])),
1483
+ description: z.optional(z.union([z.string(), z.null()])),
1484
+ enum: z.optional(z.union([z.array(z.string()), z.null()])),
1485
+ example: z.optional(z.union([z.unknown(), z.null()])),
1486
+ format: z.optional(z.union([z.string(), z.null()])),
1487
+ items: z.optional(z.union([
1488
+ z.lazy(() => {
1489
+ return zSchemaInput;
1490
+ }),
1491
+ z.null(),
1492
+ ])),
1493
+ maxItems: z.optional(z.union([z.int(), z.null()])),
1494
+ maxLength: z.optional(z.union([z.int(), z.null()])),
1495
+ maxProperties: z.optional(z.union([z.int(), z.null()])),
1496
+ maximum: z.optional(z.union([z.number(), z.null()])),
1497
+ minItems: z.optional(z.union([z.int(), z.null()])),
1498
+ minLength: z.optional(z.union([z.int(), z.null()])),
1499
+ minProperties: z.optional(z.union([z.int(), z.null()])),
1500
+ minimum: z.optional(z.union([z.number(), z.null()])),
1501
+ nullable: z.optional(z.union([z.boolean(), z.null()])),
1502
+ pattern: z.optional(z.union([z.string(), z.null()])),
1503
+ properties: z.optional(z.union([
1504
+ z.record(z.string(), z.lazy(() => {
1505
+ return zSchemaInput;
1506
+ })),
1507
+ z.null(),
1508
+ ])),
1509
+ propertyOrdering: z.optional(z.union([z.array(z.string()), z.null()])),
1510
+ required: z.optional(z.union([z.array(z.string()), z.null()])),
1511
+ title: z.optional(z.union([z.string(), z.null()])),
1512
+ type: z.optional(z.union([zType, z.null()])),
1548
1513
  });
1549
1514
  /**
1550
- * CreateSessionRequest
1515
+ * FunctionDeclaration
1516
+ *
1517
+ * Defines a function that the model can generate JSON inputs for.
1518
+ *
1519
+ * The inputs are based on `OpenAPI 3.0 specifications
1520
+ * <https://spec.openapis.org/oas/v3.0.3>`_.
1551
1521
  */
1552
- export const zCreateSessionRequest = z.object({
1553
- sessionId: z.optional(z.union([z.string(), z.null()])),
1554
- state: z.optional(z.union([z.record(z.string(), z.unknown()), z.null()])),
1555
- events: z.optional(z.union([z.array(zEventInput), z.null()])),
1522
+ export const zFunctionDeclarationInput = z.object({
1523
+ behavior: z.optional(z.union([zBehavior, z.null()])),
1524
+ description: z.optional(z.union([z.string(), z.null()])),
1525
+ name: z.optional(z.union([z.string(), z.null()])),
1526
+ parameters: z.optional(z.union([zSchemaInput, z.null()])),
1527
+ parametersJsonSchema: z.optional(z.union([z.unknown(), z.null()])),
1528
+ response: z.optional(z.union([zSchemaInput, z.null()])),
1529
+ responseJsonSchema: z.optional(z.union([z.unknown(), z.null()])),
1556
1530
  });
1557
1531
  /**
1558
- * IntermediateData
1559
- * Container for intermediate data that an agent would generate as it responds with a final answer.
1532
+ * Schema
1533
+ *
1534
+ * Schema is used to define the format of input/output data.
1535
+ *
1536
+ * Represents a select subset of an [OpenAPI 3.0 schema
1537
+ * object](https://spec.openapis.org/oas/v3.0.3#schema-object). More fields may
1538
+ * be added in the future as needed.
1560
1539
  */
1561
- export const zIntermediateDataOutput = z.object({
1562
- toolUses: z.optional(z.array(zFunctionCall)).default([]),
1563
- toolResponses: z.optional(z.array(zFunctionResponse)).default([]),
1564
- intermediateResponses: z
1565
- .optional(z.array(z.tuple([z.string(), z.array(zPartOutput)])))
1566
- .default([]),
1540
+ export const zSchemaOutput = z.object({
1541
+ additionalProperties: z.optional(z.union([z.unknown(), z.null()])),
1542
+ defs: z.optional(z.union([
1543
+ z.record(z.string(), z.lazy(() => {
1544
+ return zSchemaOutput;
1545
+ })),
1546
+ z.null(),
1547
+ ])),
1548
+ ref: z.optional(z.union([z.string(), z.null()])),
1549
+ anyOf: z.optional(z.union([
1550
+ z.array(z.lazy(() => {
1551
+ return zSchemaOutput;
1552
+ })),
1553
+ z.null(),
1554
+ ])),
1555
+ default: z.optional(z.union([z.unknown(), z.null()])),
1556
+ description: z.optional(z.union([z.string(), z.null()])),
1557
+ enum: z.optional(z.union([z.array(z.string()), z.null()])),
1558
+ example: z.optional(z.union([z.unknown(), z.null()])),
1559
+ format: z.optional(z.union([z.string(), z.null()])),
1560
+ items: z.optional(z.union([
1561
+ z.lazy(() => {
1562
+ return zSchemaOutput;
1563
+ }),
1564
+ z.null(),
1565
+ ])),
1566
+ maxItems: z.optional(z.union([z.int(), z.null()])),
1567
+ maxLength: z.optional(z.union([z.int(), z.null()])),
1568
+ maxProperties: z.optional(z.union([z.int(), z.null()])),
1569
+ maximum: z.optional(z.union([z.number(), z.null()])),
1570
+ minItems: z.optional(z.union([z.int(), z.null()])),
1571
+ minLength: z.optional(z.union([z.int(), z.null()])),
1572
+ minProperties: z.optional(z.union([z.int(), z.null()])),
1573
+ minimum: z.optional(z.union([z.number(), z.null()])),
1574
+ nullable: z.optional(z.union([z.boolean(), z.null()])),
1575
+ pattern: z.optional(z.union([z.string(), z.null()])),
1576
+ properties: z.optional(z.union([
1577
+ z.record(z.string(), z.lazy(() => {
1578
+ return zSchemaOutput;
1579
+ })),
1580
+ z.null(),
1581
+ ])),
1582
+ propertyOrdering: z.optional(z.union([z.array(z.string()), z.null()])),
1583
+ required: z.optional(z.union([z.array(z.string()), z.null()])),
1584
+ title: z.optional(z.union([z.string(), z.null()])),
1585
+ type: z.optional(z.union([zType, z.null()])),
1567
1586
  });
1568
1587
  /**
1569
- * InvocationEvent
1570
- * An immutable record representing a specific point in the agent's invocation.
1588
+ * FunctionDeclaration
1571
1589
  *
1572
- * It captures agent's replies, requests to use tools (function calls), and tool
1573
- * results.
1590
+ * Defines a function that the model can generate JSON inputs for.
1574
1591
  *
1575
- * This structure is a simple projection of the actual `Event` datamodel that
1576
- * is intended for the Eval System.
1592
+ * The inputs are based on `OpenAPI 3.0 specifications
1593
+ * <https://spec.openapis.org/oas/v3.0.3>`_.
1577
1594
  */
1578
- export const zInvocationEventOutput = z.object({
1579
- author: z.string(),
1580
- content: z.union([zContentOutput, z.null()]),
1595
+ export const zFunctionDeclarationOutput = z.object({
1596
+ behavior: z.optional(z.union([zBehavior, z.null()])),
1597
+ description: z.optional(z.union([z.string(), z.null()])),
1598
+ name: z.optional(z.union([z.string(), z.null()])),
1599
+ parameters: z.optional(z.union([zSchemaOutput, z.null()])),
1600
+ parametersJsonSchema: z.optional(z.union([z.unknown(), z.null()])),
1601
+ response: z.optional(z.union([zSchemaOutput, z.null()])),
1602
+ responseJsonSchema: z.optional(z.union([z.unknown(), z.null()])),
1581
1603
  });
1582
1604
  /**
1583
- * InvocationEvents
1584
- * A container for events that occur during the course of an invocation.
1605
+ * UrlContext
1606
+ *
1607
+ * Tool to support URL context retrieval.
1585
1608
  */
1586
- export const zInvocationEventsOutput = z.object({
1587
- invocationEvents: z.optional(z.array(zInvocationEventOutput)),
1588
- });
1609
+ export const zUrlContext = z.record(z.string(), z.never());
1589
1610
  /**
1590
- * Invocation
1591
- * Represents a single invocation.
1611
+ * ValidationError
1592
1612
  */
1593
- export const zInvocationOutput = z.object({
1594
- invocationId: z.optional(z.string()).default(""),
1595
- userContent: zContentOutput,
1596
- finalResponse: z.optional(z.union([zContentOutput, z.null()])),
1597
- intermediateData: z.optional(z.union([zIntermediateDataOutput, zInvocationEventsOutput, z.null()])),
1598
- creationTimestamp: z.optional(z.number()).default(0),
1599
- rubrics: z.optional(z.union([z.array(zRubric), z.null()])),
1600
- appDetails: z.optional(z.union([zAppDetailsOutput, z.null()])),
1613
+ export const zValidationError = z.object({
1614
+ loc: z.array(z.union([z.string(), z.int()])),
1615
+ msg: z.string(),
1616
+ type: z.string(),
1601
1617
  });
1602
1618
  /**
1603
- * EvalCase
1604
- * An eval case.
1619
+ * HTTPValidationError
1605
1620
  */
1606
- export const zEvalCaseOutput = z.object({
1607
- evalId: z.string(),
1608
- conversation: z.array(zInvocationOutput),
1609
- sessionInput: z.optional(z.union([zSessionInput, z.null()])),
1610
- creationTimestamp: z.optional(z.number()).default(0),
1611
- rubrics: z.optional(z.union([z.array(zRubric), z.null()])),
1621
+ export const zHttpValidationError = z.object({
1622
+ detail: z.optional(z.array(zValidationError)),
1612
1623
  });
1613
1624
  /**
1614
- * EvalStatus
1615
- */
1616
- export const zEvalStatus = z.unknown();
1617
- /**
1618
- * HttpRetryOptions
1619
- * HTTP retry options to be used in each of the requests.
1625
+ * VertexAISearchDataStoreSpec
1626
+ *
1627
+ * Define data stores within engine to filter on in a search call and configurations for those data stores.
1628
+ *
1629
+ * For more information, see
1630
+ * https://cloud.google.com/generative-ai-app-builder/docs/reference/rpc/google.cloud.discoveryengine.v1#datastorespec
1620
1631
  */
1621
- export const zHttpRetryOptions = z.object({
1622
- attempts: z.optional(z.union([z.int(), z.null()])),
1623
- initialDelay: z.optional(z.union([z.number(), z.null()])),
1624
- maxDelay: z.optional(z.union([z.number(), z.null()])),
1625
- expBase: z.optional(z.union([z.number(), z.null()])),
1626
- jitter: z.optional(z.union([z.number(), z.null()])),
1627
- httpStatusCodes: z.optional(z.union([z.array(z.int()), z.null()])),
1632
+ export const zVertexAiSearchDataStoreSpec = z.object({
1633
+ dataStore: z.optional(z.union([z.string(), z.null()])),
1634
+ filter: z.optional(z.union([z.string(), z.null()])),
1628
1635
  });
1629
1636
  /**
1630
- * HttpOptions
1631
- * HTTP options to be used in each of the requests.
1637
+ * VertexAISearch
1638
+ *
1639
+ * Retrieve from Vertex AI Search datastore or engine for grounding.
1640
+ *
1641
+ * datastore and engine are mutually exclusive. See
1642
+ * https://cloud.google.com/products/agent-builder
1632
1643
  */
1633
- export const zHttpOptions = z.object({
1634
- baseUrl: z.optional(z.union([z.string(), z.null()])),
1635
- apiVersion: z.optional(z.union([z.string(), z.null()])),
1636
- headers: z.optional(z.union([z.record(z.string(), z.string()), z.null()])),
1637
- timeout: z.optional(z.union([z.int(), z.null()])),
1638
- clientArgs: z.optional(z.union([z.record(z.string(), z.unknown()), z.null()])),
1639
- asyncClientArgs: z.optional(z.union([z.record(z.string(), z.unknown()), z.null()])),
1640
- extraBody: z.optional(z.union([z.record(z.string(), z.unknown()), z.null()])),
1641
- retryOptions: z.optional(z.union([zHttpRetryOptions, z.null()])),
1644
+ export const zVertexAiSearch = z.object({
1645
+ dataStoreSpecs: z.optional(z.union([z.array(zVertexAiSearchDataStoreSpec), z.null()])),
1646
+ datastore: z.optional(z.union([z.string(), z.null()])),
1647
+ engine: z.optional(z.union([z.string(), z.null()])),
1648
+ filter: z.optional(z.union([z.string(), z.null()])),
1649
+ maxResults: z.optional(z.union([z.int(), z.null()])),
1642
1650
  });
1643
1651
  /**
1644
- * FileState
1645
- * State for the lifecycle of a File.
1646
- */
1647
- export const zFileState = z.enum([
1648
- "STATE_UNSPECIFIED",
1649
- "PROCESSING",
1650
- "ACTIVE",
1651
- "FAILED",
1652
- ]);
1653
- /**
1654
- * FileSource
1655
- * Source of the File.
1652
+ * VertexRagStoreRagResource
1653
+ *
1654
+ * The definition of the Rag resource.
1656
1655
  */
1657
- export const zFileSource = z.enum([
1658
- "SOURCE_UNSPECIFIED",
1659
- "UPLOADED",
1660
- "GENERATED",
1661
- ]);
1656
+ export const zVertexRagStoreRagResource = z.object({
1657
+ ragCorpus: z.optional(z.union([z.string(), z.null()])),
1658
+ ragFileIds: z.optional(z.union([z.array(z.string()), z.null()])),
1659
+ });
1662
1660
  /**
1663
- * FileStatus
1664
- * Status of a File that uses a common error model.
1661
+ * VertexRagStore
1662
+ *
1663
+ * Retrieve from Vertex RAG Store for grounding.
1665
1664
  */
1666
- export const zFileStatus = z.object({
1667
- details: z.optional(z.union([z.array(z.record(z.string(), z.unknown())), z.null()])),
1668
- message: z.optional(z.union([z.string(), z.null()])),
1669
- code: z.optional(z.union([z.int(), z.null()])),
1665
+ export const zVertexRagStoreInput = z.object({
1666
+ ragCorpora: z.optional(z.union([z.array(z.string()), z.null()])),
1667
+ ragResources: z.optional(z.union([z.array(zVertexRagStoreRagResource), z.null()])),
1668
+ ragRetrievalConfig: z.optional(z.union([zRagRetrievalConfigInput, z.null()])),
1669
+ similarityTopK: z.optional(z.union([z.int(), z.null()])),
1670
+ storeContext: z.optional(z.union([z.boolean(), z.null()])),
1671
+ vectorDistanceThreshold: z.optional(z.union([z.number(), z.null()])),
1670
1672
  });
1671
1673
  /**
1672
- * File
1673
- * A file uploaded to the API.
1674
+ * Retrieval
1675
+ *
1676
+ * Defines a retrieval tool that model can call to access external knowledge.
1674
1677
  */
1675
- export const zFile = z.object({
1676
- name: z.optional(z.union([z.string(), z.null()])),
1677
- displayName: z.optional(z.union([z.string(), z.null()])),
1678
- mimeType: z.optional(z.union([z.string(), z.null()])),
1679
- sizeBytes: z.optional(z.union([z.int(), z.null()])),
1680
- createTime: z.optional(z.union([z.iso.datetime(), z.null()])),
1681
- expirationTime: z.optional(z.union([z.iso.datetime(), z.null()])),
1682
- updateTime: z.optional(z.union([z.iso.datetime(), z.null()])),
1683
- sha256Hash: z.optional(z.union([z.string(), z.null()])),
1684
- uri: z.optional(z.union([z.string(), z.null()])),
1685
- downloadUri: z.optional(z.union([z.string(), z.null()])),
1686
- state: z.optional(z.union([zFileState, z.null()])),
1687
- source: z.optional(z.union([zFileSource, z.null()])),
1688
- videoMetadata: z.optional(z.union([z.record(z.string(), z.unknown()), z.null()])),
1689
- error: z.optional(z.union([zFileStatus, z.null()])),
1678
+ export const zRetrievalInput = z.object({
1679
+ disableAttribution: z.optional(z.union([z.boolean(), z.null()])),
1680
+ vertexAiSearch: z.optional(z.union([zVertexAiSearch, z.null()])),
1681
+ vertexRagStore: z.optional(z.union([zVertexRagStoreInput, z.null()])),
1690
1682
  });
1691
1683
  /**
1692
- * GenerationConfigRoutingConfigAutoRoutingMode
1693
- * When automated routing is specified, the routing will be determined by the pretrained routing model and customer provided model routing preference.
1684
+ * VertexRagStore
1685
+ *
1686
+ * Retrieve from Vertex RAG Store for grounding.
1694
1687
  */
1695
- export const zGenerationConfigRoutingConfigAutoRoutingMode = z.object({
1696
- modelRoutingPreference: z.optional(z.union([
1697
- z.enum(["UNKNOWN", "PRIORITIZE_QUALITY", "BALANCED", "PRIORITIZE_COST"]),
1698
- z.null(),
1699
- ])),
1688
+ export const zVertexRagStoreOutput = z.object({
1689
+ ragCorpora: z.optional(z.union([z.array(z.string()), z.null()])),
1690
+ ragResources: z.optional(z.union([z.array(zVertexRagStoreRagResource), z.null()])),
1691
+ ragRetrievalConfig: z.optional(z.union([zRagRetrievalConfigOutput, z.null()])),
1692
+ similarityTopK: z.optional(z.union([z.int(), z.null()])),
1693
+ storeContext: z.optional(z.union([z.boolean(), z.null()])),
1694
+ vectorDistanceThreshold: z.optional(z.union([z.number(), z.null()])),
1700
1695
  });
1701
1696
  /**
1702
- * GenerationConfigRoutingConfigManualRoutingMode
1703
- * When manual routing is set, the specified model will be used directly.
1697
+ * Retrieval
1698
+ *
1699
+ * Defines a retrieval tool that model can call to access external knowledge.
1704
1700
  */
1705
- export const zGenerationConfigRoutingConfigManualRoutingMode = z.object({
1706
- modelName: z.optional(z.union([z.string(), z.null()])),
1701
+ export const zRetrievalOutput = z.object({
1702
+ disableAttribution: z.optional(z.union([z.boolean(), z.null()])),
1703
+ vertexAiSearch: z.optional(z.union([zVertexAiSearch, z.null()])),
1704
+ vertexRagStore: z.optional(z.union([zVertexRagStoreOutput, z.null()])),
1707
1705
  });
1708
1706
  /**
1709
- * GenerationConfigRoutingConfig
1710
- * The configuration for routing the request to a specific model.
1707
+ * VideoMetadata
1708
+ *
1709
+ * Describes how the video in the Part should be used by the model.
1711
1710
  */
1712
- export const zGenerationConfigRoutingConfig = z.object({
1713
- autoMode: z.optional(z.union([zGenerationConfigRoutingConfigAutoRoutingMode, z.null()])),
1714
- manualMode: z.optional(z.union([zGenerationConfigRoutingConfigManualRoutingMode, z.null()])),
1711
+ export const zVideoMetadata = z.object({
1712
+ fps: z.optional(z.union([z.number(), z.null()])),
1713
+ endOffset: z.optional(z.union([z.string(), z.null()])),
1714
+ startOffset: z.optional(z.union([z.string(), z.null()])),
1715
1715
  });
1716
1716
  /**
1717
- * FeatureSelectionPreference
1718
- * Options for feature selection preference.
1717
+ * Part
1718
+ *
1719
+ * A datatype containing media content.
1720
+ *
1721
+ * Exactly one field within a Part should be set, representing the specific type
1722
+ * of content being conveyed. Using multiple fields within the same `Part`
1723
+ * instance is considered invalid.
1719
1724
  */
1720
- export const zFeatureSelectionPreference = z.enum([
1721
- "FEATURE_SELECTION_PREFERENCE_UNSPECIFIED",
1722
- "PRIORITIZE_QUALITY",
1723
- "BALANCED",
1724
- "PRIORITIZE_COST",
1725
- ]);
1725
+ export const zPartInput = z.object({
1726
+ videoMetadata: z.optional(z.union([zVideoMetadata, z.null()])),
1727
+ thought: z.optional(z.union([z.boolean(), z.null()])),
1728
+ inlineData: z.optional(z.union([zBlob, z.null()])),
1729
+ fileData: z.optional(z.union([zFileData, z.null()])),
1730
+ thoughtSignature: z.optional(z.union([z.string(), z.null()])),
1731
+ codeExecutionResult: z.optional(z.union([zCodeExecutionResult, z.null()])),
1732
+ executableCode: z.optional(z.union([zExecutableCode, z.null()])),
1733
+ functionCall: z.optional(z.union([zFunctionCall, z.null()])),
1734
+ functionResponse: z.optional(z.union([zFunctionResponse, z.null()])),
1735
+ text: z.optional(z.union([z.string(), z.null()])),
1736
+ });
1726
1737
  /**
1727
- * ModelSelectionConfig
1728
- * Config for model selection.
1738
+ * Content
1739
+ *
1740
+ * Contains the multi-part content of a message.
1729
1741
  */
1730
- export const zModelSelectionConfig = z.object({
1731
- featureSelectionPreference: z.optional(z.union([zFeatureSelectionPreference, z.null()])),
1742
+ export const zContentInput = z.object({
1743
+ parts: z.optional(z.union([z.array(zPartInput), z.null()])),
1744
+ role: z.optional(z.union([z.string(), z.null()])),
1732
1745
  });
1733
1746
  /**
1734
- * HarmBlockMethod
1735
- * Optional.
1747
+ * EventCompaction
1736
1748
  *
1737
- * Specify if the threshold is used for probability or severity score. If not
1738
- * specified, the threshold is used for probability score.
1749
+ * The compaction of the events.
1739
1750
  */
1740
- export const zHarmBlockMethod = z.enum([
1741
- "HARM_BLOCK_METHOD_UNSPECIFIED",
1742
- "SEVERITY",
1743
- "PROBABILITY",
1744
- ]);
1751
+ export const zEventCompactionInput = z.object({
1752
+ startTimestamp: z.number(),
1753
+ endTimestamp: z.number(),
1754
+ compactedContent: zContentInput,
1755
+ });
1745
1756
  /**
1746
- * HarmCategory
1747
- * Required. Harm category.
1757
+ * IntermediateData
1758
+ *
1759
+ * Container for intermediate data that an agent would generate as it responds with a final answer.
1748
1760
  */
1749
- export const zHarmCategory = z.enum([
1750
- "HARM_CATEGORY_UNSPECIFIED",
1751
- "HARM_CATEGORY_HATE_SPEECH",
1752
- "HARM_CATEGORY_DANGEROUS_CONTENT",
1753
- "HARM_CATEGORY_HARASSMENT",
1754
- "HARM_CATEGORY_SEXUALLY_EXPLICIT",
1755
- "HARM_CATEGORY_CIVIC_INTEGRITY",
1756
- ]);
1761
+ export const zIntermediateDataInput = z.object({
1762
+ toolUses: z.optional(z.array(zFunctionCall)).default([]),
1763
+ toolResponses: z.optional(z.array(zFunctionResponse)).default([]),
1764
+ intermediateResponses: z
1765
+ .optional(z.array(z.tuple([z.string(), z.array(zPartInput)])))
1766
+ .default([]),
1767
+ });
1757
1768
  /**
1758
- * HarmBlockThreshold
1759
- * Required. The harm block threshold.
1769
+ * InvocationEvent
1770
+ *
1771
+ * An immutable record representing a specific point in the agent's invocation.
1772
+ *
1773
+ * It captures agent's replies, requests to use tools (function calls), and tool
1774
+ * results.
1775
+ *
1776
+ * This structure is a simple projection of the actual `Event` datamodel that
1777
+ * is intended for the Eval System.
1760
1778
  */
1761
- export const zHarmBlockThreshold = z.enum([
1762
- "HARM_BLOCK_THRESHOLD_UNSPECIFIED",
1763
- "BLOCK_LOW_AND_ABOVE",
1764
- "BLOCK_MEDIUM_AND_ABOVE",
1765
- "BLOCK_ONLY_HIGH",
1766
- "BLOCK_NONE",
1767
- "OFF",
1768
- ]);
1779
+ export const zInvocationEventInput = z.object({
1780
+ author: z.string(),
1781
+ content: z.union([zContentInput, z.null()]),
1782
+ });
1769
1783
  /**
1770
- * SafetySetting
1771
- * Safety settings.
1784
+ * InvocationEvents
1785
+ *
1786
+ * A container for events that occur during the course of an invocation.
1772
1787
  */
1773
- export const zSafetySetting = z.object({
1774
- method: z.optional(z.union([zHarmBlockMethod, z.null()])),
1775
- category: z.optional(z.union([zHarmCategory, z.null()])),
1776
- threshold: z.optional(z.union([zHarmBlockThreshold, z.null()])),
1788
+ export const zInvocationEventsInput = z.object({
1789
+ invocationEvents: z.optional(z.array(zInvocationEventInput)),
1777
1790
  });
1778
1791
  /**
1779
- * FunctionCallingConfigMode
1780
- * Config for the function calling config mode.
1792
+ * Part
1793
+ *
1794
+ * A datatype containing media content.
1795
+ *
1796
+ * Exactly one field within a Part should be set, representing the specific type
1797
+ * of content being conveyed. Using multiple fields within the same `Part`
1798
+ * instance is considered invalid.
1781
1799
  */
1782
- export const zFunctionCallingConfigMode = z.enum([
1783
- "MODE_UNSPECIFIED",
1784
- "AUTO",
1785
- "ANY",
1786
- "NONE",
1787
- ]);
1800
+ export const zPartOutput = z.object({
1801
+ videoMetadata: z.optional(z.union([zVideoMetadata, z.null()])),
1802
+ thought: z.optional(z.union([z.boolean(), z.null()])),
1803
+ inlineData: z.optional(z.union([zBlob, z.null()])),
1804
+ fileData: z.optional(z.union([zFileData, z.null()])),
1805
+ thoughtSignature: z.optional(z.union([z.string(), z.null()])),
1806
+ codeExecutionResult: z.optional(z.union([zCodeExecutionResult, z.null()])),
1807
+ executableCode: z.optional(z.union([zExecutableCode, z.null()])),
1808
+ functionCall: z.optional(z.union([zFunctionCall, z.null()])),
1809
+ functionResponse: z.optional(z.union([zFunctionResponse, z.null()])),
1810
+ text: z.optional(z.union([z.string(), z.null()])),
1811
+ });
1788
1812
  /**
1789
- * FunctionCallingConfig
1790
- * Function calling config.
1813
+ * Content
1814
+ *
1815
+ * Contains the multi-part content of a message.
1791
1816
  */
1792
- export const zFunctionCallingConfig = z.object({
1793
- mode: z.optional(z.union([zFunctionCallingConfigMode, z.null()])),
1794
- allowedFunctionNames: z.optional(z.union([z.array(z.string()), z.null()])),
1817
+ export const zContentOutput = z.object({
1818
+ parts: z.optional(z.union([z.array(zPartOutput), z.null()])),
1819
+ role: z.optional(z.union([z.string(), z.null()])),
1795
1820
  });
1796
1821
  /**
1797
- * LatLng
1798
- * An object that represents a latitude/longitude pair.
1822
+ * EventCompaction
1799
1823
  *
1800
- * This is expressed as a pair of doubles to represent degrees latitude and
1801
- * degrees longitude. Unless specified otherwise, this object must conform to the
1802
- * <a href="https://en.wikipedia.org/wiki/World_Geodetic_System#1984_version">
1803
- * WGS84 standard</a>. Values must be within normalized ranges.
1824
+ * The compaction of the events.
1804
1825
  */
1805
- export const zLatLng = z.object({
1806
- latitude: z.optional(z.union([z.number(), z.null()])),
1807
- longitude: z.optional(z.union([z.number(), z.null()])),
1826
+ export const zEventCompactionOutput = z.object({
1827
+ startTimestamp: z.number(),
1828
+ endTimestamp: z.number(),
1829
+ compactedContent: zContentOutput,
1808
1830
  });
1809
1831
  /**
1810
- * RetrievalConfig
1811
- * Retrieval config.
1832
+ * IntermediateData
1833
+ *
1834
+ * Container for intermediate data that an agent would generate as it responds with a final answer.
1812
1835
  */
1813
- export const zRetrievalConfig = z.object({
1814
- latLng: z.optional(z.union([zLatLng, z.null()])),
1815
- languageCode: z.optional(z.union([z.string(), z.null()])),
1836
+ export const zIntermediateDataOutput = z.object({
1837
+ toolUses: z.optional(z.array(zFunctionCall)).default([]),
1838
+ toolResponses: z.optional(z.array(zFunctionResponse)).default([]),
1839
+ intermediateResponses: z
1840
+ .optional(z.array(z.tuple([z.string(), z.array(zPartOutput)])))
1841
+ .default([]),
1816
1842
  });
1817
1843
  /**
1818
- * ToolConfig
1819
- * Tool config.
1844
+ * InvocationEvent
1820
1845
  *
1821
- * This config is shared for all tools provided in the request.
1846
+ * An immutable record representing a specific point in the agent's invocation.
1847
+ *
1848
+ * It captures agent's replies, requests to use tools (function calls), and tool
1849
+ * results.
1850
+ *
1851
+ * This structure is a simple projection of the actual `Event` datamodel that
1852
+ * is intended for the Eval System.
1822
1853
  */
1823
- export const zToolConfigOutput = z.object({
1824
- functionCallingConfig: z.optional(z.union([zFunctionCallingConfig, z.null()])),
1825
- retrievalConfig: z.optional(z.union([zRetrievalConfig, z.null()])),
1854
+ export const zInvocationEventOutput = z.object({
1855
+ author: z.string(),
1856
+ content: z.union([zContentOutput, z.null()]),
1826
1857
  });
1827
1858
  /**
1828
- * MediaResolution
1829
- * The media resolution to use.
1859
+ * InvocationEvents
1860
+ *
1861
+ * A container for events that occur during the course of an invocation.
1830
1862
  */
1831
- export const zMediaResolution = z.enum([
1832
- "MEDIA_RESOLUTION_UNSPECIFIED",
1833
- "MEDIA_RESOLUTION_LOW",
1834
- "MEDIA_RESOLUTION_MEDIUM",
1835
- "MEDIA_RESOLUTION_HIGH",
1836
- ]);
1863
+ export const zInvocationEventsOutput = z.object({
1864
+ invocationEvents: z.optional(z.array(zInvocationEventOutput)),
1865
+ });
1837
1866
  /**
1838
- * PrebuiltVoiceConfig
1839
- * The configuration for the prebuilt speaker to use.
1867
+ * RunAgentRequest
1840
1868
  */
1841
- export const zPrebuiltVoiceConfig = z.object({
1842
- voiceName: z.optional(z.union([z.string(), z.null()])),
1869
+ export const zRunAgentRequest = z.object({
1870
+ appName: z.string(),
1871
+ userId: z.string(),
1872
+ sessionId: z.string(),
1873
+ newMessage: zContentInput,
1874
+ streaming: z.optional(z.boolean()).default(false),
1875
+ stateDelta: z.optional(z.union([z.record(z.string(), z.unknown()), z.null()])),
1843
1876
  });
1844
1877
  /**
1845
1878
  * VoiceConfig
1879
+ *
1846
1880
  * The configuration for the voice to use.
1847
1881
  */
1848
1882
  export const zVoiceConfig = z.object({
@@ -1850,205 +1884,137 @@ export const zVoiceConfig = z.object({
1850
1884
  });
1851
1885
  /**
1852
1886
  * SpeakerVoiceConfig
1887
+ *
1853
1888
  * The configuration for the speaker to use.
1854
1889
  */
1855
- export const zSpeakerVoiceConfigOutput = z.object({
1890
+ export const zSpeakerVoiceConfigInput = z.object({
1856
1891
  speaker: z.optional(z.union([z.string(), z.null()])),
1857
1892
  voiceConfig: z.optional(z.union([zVoiceConfig, z.null()])),
1858
1893
  });
1859
1894
  /**
1860
1895
  * MultiSpeakerVoiceConfig
1896
+ *
1861
1897
  * The configuration for the multi-speaker setup.
1862
1898
  */
1863
- export const zMultiSpeakerVoiceConfigOutput = z.object({
1864
- speakerVoiceConfigs: z.optional(z.union([z.array(zSpeakerVoiceConfigOutput), z.null()])),
1899
+ export const zMultiSpeakerVoiceConfigInput = z.object({
1900
+ speakerVoiceConfigs: z.optional(z.union([z.array(zSpeakerVoiceConfigInput), z.null()])),
1865
1901
  });
1866
1902
  /**
1867
- * SpeechConfig
1868
- * The speech generation configuration.
1903
+ * SpeakerVoiceConfig
1904
+ *
1905
+ * The configuration for the speaker to use.
1869
1906
  */
1870
- export const zSpeechConfigOutput = z.object({
1907
+ export const zSpeakerVoiceConfigOutput = z.object({
1908
+ speaker: z.optional(z.union([z.string(), z.null()])),
1871
1909
  voiceConfig: z.optional(z.union([zVoiceConfig, z.null()])),
1872
- multiSpeakerVoiceConfig: z.optional(z.union([zMultiSpeakerVoiceConfigOutput, z.null()])),
1873
- languageCode: z.optional(z.union([z.string(), z.null()])),
1874
- });
1875
- /**
1876
- * ThinkingConfig
1877
- * The thinking features configuration.
1878
- */
1879
- export const zThinkingConfig = z.object({
1880
- includeThoughts: z.optional(z.union([z.boolean(), z.null()])),
1881
- thinkingBudget: z.optional(z.union([z.int(), z.null()])),
1882
1910
  });
1883
1911
  /**
1884
- * GenerateContentConfig
1885
- * Optional model configuration parameters.
1912
+ * MultiSpeakerVoiceConfig
1886
1913
  *
1887
- * For more information, see `Content generation parameters
1888
- * <https://cloud.google.com/vertex-ai/generative-ai/docs/multimodal/content-generation-parameters>`_.
1889
- */
1890
- export const zGenerateContentConfigOutput = z.object({
1891
- httpOptions: z.optional(z.union([zHttpOptions, z.null()])),
1892
- systemInstruction: z.optional(z.union([
1893
- zContentOutput,
1894
- z.array(z.union([zFile, zPartOutput, z.string()])),
1895
- zFile,
1896
- zPartOutput,
1897
- z.string(),
1898
- z.null(),
1899
- ])),
1900
- temperature: z.optional(z.union([z.number(), z.null()])),
1901
- topP: z.optional(z.union([z.number(), z.null()])),
1902
- topK: z.optional(z.union([z.number(), z.null()])),
1903
- candidateCount: z.optional(z.union([z.int(), z.null()])),
1904
- maxOutputTokens: z.optional(z.union([z.int(), z.null()])),
1905
- stopSequences: z.optional(z.union([z.array(z.string()), z.null()])),
1906
- responseLogprobs: z.optional(z.union([z.boolean(), z.null()])),
1907
- logprobs: z.optional(z.union([z.int(), z.null()])),
1908
- presencePenalty: z.optional(z.union([z.number(), z.null()])),
1909
- frequencyPenalty: z.optional(z.union([z.number(), z.null()])),
1910
- seed: z.optional(z.union([z.int(), z.null()])),
1911
- responseMimeType: z.optional(z.union([z.string(), z.null()])),
1912
- responseSchema: z.optional(z.union([z.record(z.string(), z.unknown()), zSchemaOutput, z.null()])),
1913
- responseJsonSchema: z.optional(z.union([z.unknown(), z.null()])),
1914
- routingConfig: z.optional(z.union([zGenerationConfigRoutingConfig, z.null()])),
1915
- modelSelectionConfig: z.optional(z.union([zModelSelectionConfig, z.null()])),
1916
- safetySettings: z.optional(z.union([z.array(zSafetySetting), z.null()])),
1917
- tools: z.optional(z.union([
1918
- z.array(z.union([zGoogleGenaiTypesToolOutput, zMcpTypesTool])),
1919
- z.null(),
1920
- ])),
1921
- toolConfig: z.optional(z.union([zToolConfigOutput, z.null()])),
1922
- labels: z.optional(z.union([z.record(z.string(), z.string()), z.null()])),
1923
- cachedContent: z.optional(z.union([z.string(), z.null()])),
1924
- responseModalities: z.optional(z.union([z.array(z.string()), z.null()])),
1925
- mediaResolution: z.optional(z.union([zMediaResolution, z.null()])),
1926
- speechConfig: z.optional(z.union([zSpeechConfigOutput, z.string(), z.null()])),
1927
- audioTimestamp: z.optional(z.union([z.boolean(), z.null()])),
1928
- automaticFunctionCalling: z.optional(z.union([zAutomaticFunctionCallingConfig, z.null()])),
1929
- thinkingConfig: z.optional(z.union([zThinkingConfig, z.null()])),
1930
- });
1931
- /**
1932
- * JudgeModelOptions
1933
- * Options for an eval metric's judge model.
1934
- */
1935
- export const zJudgeModelOptionsOutput = z.object({
1936
- judgeModel: z.optional(z.string()).default("gemini-2.5-flash"),
1937
- judgeModelConfig: z.optional(z.union([zGenerateContentConfigOutput, z.null()])),
1938
- numSamples: z.optional(z.int()).default(5),
1939
- });
1940
- /**
1941
- * EvalMetric
1942
- * A metric used to evaluate a particular aspect of an eval case.
1943
- */
1944
- export const zEvalMetricOutput = z.object({
1945
- metricName: z.string(),
1946
- threshold: z.number(),
1947
- judgeModelOptions: z.optional(z.union([zJudgeModelOptionsOutput, z.null()])),
1948
- criterion: z.optional(z.union([zBaseCriterion, z.null()])),
1949
- });
1950
- /**
1951
- * RubricScore
1952
- * The score obtained after applying the rubric to the Agent's response.
1953
- */
1954
- export const zRubricScore = z.object({
1955
- rubricId: z.string(),
1956
- rationale: z.optional(z.union([z.string(), z.null()])),
1957
- score: z.optional(z.union([z.number(), z.null()])),
1958
- });
1959
- /**
1960
- * EvalMetricResultDetails
1961
- */
1962
- export const zEvalMetricResultDetails = z.object({
1963
- rubricScores: z.optional(z.union([z.array(zRubricScore), z.null()])),
1964
- });
1965
- /**
1966
- * EvalMetricResult
1967
- * The actual computed score/value of a particular EvalMetric.
1968
- */
1969
- export const zEvalMetricResult = z.object({
1970
- metricName: z.string(),
1971
- threshold: z.number(),
1972
- judgeModelOptions: z.optional(z.union([zJudgeModelOptionsOutput, z.null()])),
1973
- criterion: z.optional(z.union([zBaseCriterion, z.null()])),
1974
- score: z.optional(z.union([z.number(), z.null()])),
1975
- evalStatus: zEvalStatus,
1976
- details: z.optional(zEvalMetricResultDetails),
1977
- });
1978
- /**
1979
- * EvalMetricResultPerInvocation
1980
- * Eval metric results per invocation.
1914
+ * The configuration for the multi-speaker setup.
1981
1915
  */
1982
- export const zEvalMetricResultPerInvocation = z.object({
1983
- actualInvocation: zInvocationOutput,
1984
- expectedInvocation: zInvocationOutput,
1985
- evalMetricResults: z.optional(z.array(zEvalMetricResult)).default([]),
1916
+ export const zMultiSpeakerVoiceConfigOutput = z.object({
1917
+ speakerVoiceConfigs: z.optional(z.union([z.array(zSpeakerVoiceConfigOutput), z.null()])),
1986
1918
  });
1987
1919
  /**
1988
- * GroundingChunkRetrievedContext
1989
- * Chunk from context retrieved by the retrieval tools.
1920
+ * SpeechConfig
1921
+ *
1922
+ * The speech generation configuration.
1990
1923
  */
1991
- export const zGroundingChunkRetrievedContextOutput = z.object({
1992
- ragChunk: z.optional(z.union([zRagChunk, z.null()])),
1993
- text: z.optional(z.union([z.string(), z.null()])),
1994
- title: z.optional(z.union([z.string(), z.null()])),
1995
- uri: z.optional(z.union([z.string(), z.null()])),
1924
+ export const zSpeechConfigInput = z.object({
1925
+ voiceConfig: z.optional(z.union([zVoiceConfig, z.null()])),
1926
+ multiSpeakerVoiceConfig: z.optional(z.union([zMultiSpeakerVoiceConfigInput, z.null()])),
1927
+ languageCode: z.optional(z.union([z.string(), z.null()])),
1996
1928
  });
1997
1929
  /**
1998
- * GroundingChunk
1999
- * Grounding chunk.
1930
+ * SpeechConfig
1931
+ *
1932
+ * The speech generation configuration.
2000
1933
  */
2001
- export const zGroundingChunkOutput = z.object({
2002
- retrievedContext: z.optional(z.union([zGroundingChunkRetrievedContextOutput, z.null()])),
2003
- web: z.optional(z.union([zGroundingChunkWeb, z.null()])),
1934
+ export const zSpeechConfigOutput = z.object({
1935
+ voiceConfig: z.optional(z.union([zVoiceConfig, z.null()])),
1936
+ multiSpeakerVoiceConfig: z.optional(z.union([zMultiSpeakerVoiceConfigOutput, z.null()])),
1937
+ languageCode: z.optional(z.union([z.string(), z.null()])),
2004
1938
  });
2005
1939
  /**
2006
- * GroundingMetadata
2007
- * Metadata returned to client when grounding is enabled.
1940
+ * AuthConfig
1941
+ *
1942
+ * The auth config sent by tool asking client to collect auth credentials and
1943
+ *
1944
+ * adk and client will help to fill in the response
2008
1945
  */
2009
- export const zGroundingMetadataOutput = z.object({
2010
- groundingChunks: z.optional(z.union([z.array(zGroundingChunkOutput), z.null()])),
2011
- groundingSupports: z.optional(z.union([z.array(zGroundingSupport), z.null()])),
2012
- retrievalMetadata: z.optional(z.union([zRetrievalMetadata, z.null()])),
2013
- retrievalQueries: z.optional(z.union([z.array(z.string()), z.null()])),
2014
- searchEntryPoint: z.optional(z.union([zSearchEntryPoint, z.null()])),
2015
- webSearchQueries: z.optional(z.union([z.array(z.string()), z.null()])),
1946
+ export const zGoogleAdkAuthAuthToolAuthConfigInput = z.object({
1947
+ authScheme: z.union([
1948
+ zApiKey,
1949
+ zHttpBase,
1950
+ zOAuth2Input,
1951
+ zOpenIdConnect,
1952
+ zHttpBearer,
1953
+ zOpenIdConnectWithConfig,
1954
+ ]),
1955
+ rawAuthCredential: z.optional(z.union([zAuthCredentialInput, z.null()])),
1956
+ exchangedAuthCredential: z.optional(z.union([zAuthCredentialInput, z.null()])),
1957
+ credentialKey: z.optional(z.union([z.string(), z.null()])),
2016
1958
  });
2017
1959
  /**
2018
- * GenerateContentResponseUsageMetadata
2019
- * Usage metadata about response(s).
1960
+ * EventActions
1961
+ *
1962
+ * Represents the actions attached to an event.
2020
1963
  */
2021
- export const zGenerateContentResponseUsageMetadataOutput = z.object({
2022
- cacheTokensDetails: z.optional(z.union([z.array(zModalityTokenCount), z.null()])),
2023
- cachedContentTokenCount: z.optional(z.union([z.int(), z.null()])),
2024
- candidatesTokenCount: z.optional(z.union([z.int(), z.null()])),
2025
- candidatesTokensDetails: z.optional(z.union([z.array(zModalityTokenCount), z.null()])),
2026
- promptTokenCount: z.optional(z.union([z.int(), z.null()])),
2027
- promptTokensDetails: z.optional(z.union([z.array(zModalityTokenCount), z.null()])),
2028
- thoughtsTokenCount: z.optional(z.union([z.int(), z.null()])),
2029
- toolUsePromptTokenCount: z.optional(z.union([z.int(), z.null()])),
2030
- toolUsePromptTokensDetails: z.optional(z.union([z.array(zModalityTokenCount), z.null()])),
2031
- totalTokenCount: z.optional(z.union([z.int(), z.null()])),
2032
- trafficType: z.optional(z.union([zTrafficType, z.null()])),
1964
+ export const zEventActionsInput = z.object({
1965
+ skipSummarization: z.optional(z.union([z.boolean(), z.null()])),
1966
+ stateDelta: z.optional(z.record(z.string(), z.unknown())),
1967
+ artifactDelta: z.optional(z.record(z.string(), z.int())),
1968
+ transferToAgent: z.optional(z.union([z.string(), z.null()])),
1969
+ escalate: z.optional(z.union([z.boolean(), z.null()])),
1970
+ requestedAuthConfigs: z.optional(z.record(z.string(), zGoogleAdkAuthAuthToolAuthConfigInput)),
1971
+ requestedToolConfirmations: z.optional(z.record(z.string(), zToolConfirmation)),
1972
+ compaction: z.optional(z.union([zEventCompactionInput, z.null()])),
2033
1973
  });
2034
1974
  /**
2035
- * LogprobsResult
2036
- * Logprobs Result
1975
+ * Event
1976
+ *
1977
+ * Represents an event in a conversation between agents and users.
1978
+ *
1979
+ * It is used to store the content of the conversation, as well as the actions
1980
+ * taken by the agents like function calls, etc.
2037
1981
  */
2038
- export const zLogprobsResultOutput = z.object({
2039
- chosenCandidates: z.optional(z.union([z.array(zLogprobsResultCandidate), z.null()])),
2040
- topCandidates: z.optional(z.union([z.array(zLogprobsResultTopCandidates), z.null()])),
1982
+ export const zEventInput = z.object({
1983
+ content: z.optional(z.union([zContentInput, z.null()])),
1984
+ groundingMetadata: z.optional(z.union([zGroundingMetadataInput, z.null()])),
1985
+ partial: z.optional(z.union([z.boolean(), z.null()])),
1986
+ turnComplete: z.optional(z.union([z.boolean(), z.null()])),
1987
+ finishReason: z.optional(z.union([zFinishReason, z.null()])),
1988
+ errorCode: z.optional(z.union([z.string(), z.null()])),
1989
+ errorMessage: z.optional(z.union([z.string(), z.null()])),
1990
+ interrupted: z.optional(z.union([z.boolean(), z.null()])),
1991
+ customMetadata: z.optional(z.union([z.record(z.string(), z.unknown()), z.null()])),
1992
+ usageMetadata: z.optional(z.union([zGenerateContentResponseUsageMetadataInput, z.null()])),
1993
+ liveSessionResumptionUpdate: z.optional(z.union([zLiveServerSessionResumptionUpdate, z.null()])),
1994
+ inputTranscription: z.optional(z.union([zTranscription, z.null()])),
1995
+ outputTranscription: z.optional(z.union([zTranscription, z.null()])),
1996
+ avgLogprobs: z.optional(z.union([z.number(), z.null()])),
1997
+ logprobsResult: z.optional(z.union([zLogprobsResultInput, z.null()])),
1998
+ cacheMetadata: z.optional(z.union([zCacheMetadata, z.null()])),
1999
+ invocationId: z.optional(z.string()).default(""),
2000
+ author: z.string(),
2001
+ actions: z.optional(zEventActionsInput),
2002
+ longRunningToolIds: z.optional(z.union([z.array(z.string()), z.null()])),
2003
+ branch: z.optional(z.union([z.string(), z.null()])),
2004
+ id: z.optional(z.string()).default(""),
2005
+ timestamp: z.optional(z.number()),
2041
2006
  });
2042
2007
  /**
2043
- * OAuth2
2008
+ * CreateSessionRequest
2044
2009
  */
2045
- export const zOAuth2Output = z.object({
2046
- type: z.optional(zSecuritySchemeType),
2047
- description: z.optional(z.union([z.string(), z.null()])),
2048
- flows: zOAuthFlows,
2010
+ export const zCreateSessionRequest = z.object({
2011
+ sessionId: z.optional(z.union([z.string(), z.null()])),
2012
+ state: z.optional(z.union([z.record(z.string(), z.unknown()), z.null()])),
2013
+ events: z.optional(z.union([z.array(zEventInput), z.null()])),
2049
2014
  });
2050
2015
  /**
2051
2016
  * AuthConfig
2017
+ *
2052
2018
  * The auth config sent by tool asking client to collect auth credentials and
2053
2019
  *
2054
2020
  * adk and client will help to fill in the response
@@ -2066,17 +2032,9 @@ export const zGoogleAdkAuthAuthToolAuthConfigOutput = z.object({
2066
2032
  exchangedAuthCredential: z.optional(z.union([zAuthCredentialOutput, z.null()])),
2067
2033
  credentialKey: z.optional(z.union([z.string(), z.null()])),
2068
2034
  });
2069
- /**
2070
- * EventCompaction
2071
- * The compaction of the events.
2072
- */
2073
- export const zEventCompactionOutput = z.object({
2074
- startTimestamp: z.number(),
2075
- endTimestamp: z.number(),
2076
- compactedContent: zContentOutput,
2077
- });
2078
2035
  /**
2079
2036
  * EventActions
2037
+ *
2080
2038
  * Represents the actions attached to an event.
2081
2039
  */
2082
2040
  export const zEventActionsOutput = z.object({
@@ -2091,6 +2049,7 @@ export const zEventActionsOutput = z.object({
2091
2049
  });
2092
2050
  /**
2093
2051
  * Event
2052
+ *
2094
2053
  * Represents an event in a conversation between agents and users.
2095
2054
  *
2096
2055
  * It is used to store the content of the conversation, as well as the actions
@@ -2123,6 +2082,7 @@ export const zEventOutput = z.object({
2123
2082
  });
2124
2083
  /**
2125
2084
  * Session
2085
+ *
2126
2086
  * Represents a series of interactions between a user and agents.
2127
2087
  */
2128
2088
  export const zSession = z.object({
@@ -2134,60 +2094,181 @@ export const zSession = z.object({
2134
2094
  lastUpdateTime: z.optional(z.number()).default(0),
2135
2095
  });
2136
2096
  /**
2137
- * EvalCaseResult
2138
- * Case level evaluation results.
2097
+ * Interval
2098
+ *
2099
+ * Represents a range of numeric values, e.g. [0 ,1] or (2,3) or [-1, 6).
2139
2100
  */
2140
- export const zEvalCaseResult = z.object({
2141
- evalSetFile: z.optional(z.union([z.string(), z.null()])),
2142
- evalSetId: z.optional(z.string()).default(""),
2143
- evalId: z.optional(z.string()).default(""),
2144
- finalEvalStatus: zEvalStatus,
2145
- evalMetricResults: z.optional(z.union([
2146
- z.array(z.tuple([zEvalMetricOutput, zEvalMetricResult])),
2147
- z.null(),
2148
- ])),
2149
- overallEvalMetricResults: z.array(zEvalMetricResult),
2150
- evalMetricResultPerInvocation: z.array(zEvalMetricResultPerInvocation),
2151
- sessionId: z.string(),
2152
- sessionDetails: z.optional(z.union([zSession, z.null()])),
2153
- userId: z.optional(z.union([z.string(), z.null()])),
2101
+ export const zGoogleAdkEvaluationEvalMetricsInterval = z.object({
2102
+ minValue: z.number(),
2103
+ openAtMin: z.optional(z.boolean()).default(false),
2104
+ maxValue: z.number(),
2105
+ openAtMax: z.optional(z.boolean()).default(false),
2154
2106
  });
2155
2107
  /**
2156
- * ToolConfig
2157
- * Tool config.
2108
+ * MetricValueInfo
2158
2109
  *
2159
- * This config is shared for all tools provided in the request.
2110
+ * Information about the type of metric value.
2160
2111
  */
2161
- export const zToolConfigInput = z.object({
2162
- functionCallingConfig: z.optional(z.union([zFunctionCallingConfig, z.null()])),
2163
- retrievalConfig: z.optional(z.union([zRetrievalConfig, z.null()])),
2112
+ export const zMetricValueInfo = z.object({
2113
+ interval: z.optional(z.union([zGoogleAdkEvaluationEvalMetricsInterval, z.null()])),
2164
2114
  });
2165
2115
  /**
2166
- * SpeakerVoiceConfig
2167
- * The configuration for the speaker to use.
2116
+ * MetricInfo
2117
+ *
2118
+ * Information about the metric that are used for Evals.
2168
2119
  */
2169
- export const zSpeakerVoiceConfigInput = z.object({
2170
- speaker: z.optional(z.union([z.string(), z.null()])),
2171
- voiceConfig: z.optional(z.union([zVoiceConfig, z.null()])),
2120
+ export const zMetricInfo = z.object({
2121
+ metricName: z.string(),
2122
+ description: z.optional(z.string()),
2123
+ metricValueInfo: zMetricValueInfo,
2172
2124
  });
2173
2125
  /**
2174
- * MultiSpeakerVoiceConfig
2175
- * The configuration for the multi-speaker setup.
2126
+ * ListMetricsInfoResponse
2176
2127
  */
2177
- export const zMultiSpeakerVoiceConfigInput = z.object({
2178
- speakerVoiceConfigs: z.optional(z.union([z.array(zSpeakerVoiceConfigInput), z.null()])),
2128
+ export const zListMetricsInfoResponse = z.object({
2129
+ metricsInfo: z.array(zMetricInfo),
2179
2130
  });
2180
2131
  /**
2181
- * SpeechConfig
2182
- * The speech generation configuration.
2132
+ * AuthConfig
2133
+ *
2134
+ * Auth configuration to run the extension.
2183
2135
  */
2184
- export const zSpeechConfigInput = z.object({
2185
- voiceConfig: z.optional(z.union([zVoiceConfig, z.null()])),
2186
- multiSpeakerVoiceConfig: z.optional(z.union([zMultiSpeakerVoiceConfigInput, z.null()])),
2187
- languageCode: z.optional(z.union([z.string(), z.null()])),
2136
+ export const zGoogleGenaiTypesAuthConfig = z.object({
2137
+ apiKeyConfig: z.optional(z.union([zApiKeyConfig, z.null()])),
2138
+ authType: z.optional(z.union([zAuthType, z.null()])),
2139
+ googleServiceAccountConfig: z.optional(z.union([zAuthConfigGoogleServiceAccountConfig, z.null()])),
2140
+ httpBasicAuthConfig: z.optional(z.union([zAuthConfigHttpBasicAuthConfig, z.null()])),
2141
+ oauthConfig: z.optional(z.union([zAuthConfigOauthConfig, z.null()])),
2142
+ oidcConfig: z.optional(z.union([zAuthConfigOidcConfig, z.null()])),
2143
+ });
2144
+ /**
2145
+ * GoogleMaps
2146
+ *
2147
+ * Tool to support Google Maps in Model.
2148
+ */
2149
+ export const zGoogleMapsInput = z.object({
2150
+ authConfig: z.optional(z.union([zGoogleGenaiTypesAuthConfig, z.null()])),
2151
+ });
2152
+ /**
2153
+ * GoogleMaps
2154
+ *
2155
+ * Tool to support Google Maps in Model.
2156
+ */
2157
+ export const zGoogleMapsOutput = z.object({
2158
+ authConfig: z.optional(z.union([zGoogleGenaiTypesAuthConfig, z.null()])),
2159
+ });
2160
+ /**
2161
+ * Interval
2162
+ *
2163
+ * Represents a time interval, encoded as a start time (inclusive) and an end time (exclusive).
2164
+ *
2165
+ * The start time must be less than or equal to the end time.
2166
+ * When the start equals the end time, the interval is an empty interval.
2167
+ * (matches no time)
2168
+ * When both start and end are unspecified, the interval matches any time.
2169
+ */
2170
+ export const zGoogleGenaiTypesInterval = z.object({
2171
+ startTime: z.optional(z.union([z.iso.datetime(), z.null()])),
2172
+ endTime: z.optional(z.union([z.iso.datetime(), z.null()])),
2173
+ });
2174
+ /**
2175
+ * GoogleSearch
2176
+ *
2177
+ * Tool to support Google Search in Model. Powered by Google.
2178
+ */
2179
+ export const zGoogleSearchOutput = z.object({
2180
+ timeRangeFilter: z.optional(z.union([zGoogleGenaiTypesInterval, z.null()])),
2181
+ });
2182
+ /**
2183
+ * Tool
2184
+ *
2185
+ * Tool details of a tool that the model may use to generate a response.
2186
+ */
2187
+ export const zGoogleGenaiTypesToolInput = z.object({
2188
+ functionDeclarations: z.optional(z.union([z.array(zFunctionDeclarationInput), z.null()])),
2189
+ retrieval: z.optional(z.union([zRetrievalInput, z.null()])),
2190
+ googleSearch: z.optional(z.union([zGoogleSearchInput, z.null()])),
2191
+ googleSearchRetrieval: z.optional(z.union([zGoogleSearchRetrievalInput, z.null()])),
2192
+ enterpriseWebSearch: z.optional(z.union([zEnterpriseWebSearch, z.null()])),
2193
+ googleMaps: z.optional(z.union([zGoogleMapsInput, z.null()])),
2194
+ urlContext: z.optional(z.union([zUrlContext, z.null()])),
2195
+ codeExecution: z.optional(z.union([zToolCodeExecution, z.null()])),
2196
+ });
2197
+ /**
2198
+ * Tool
2199
+ *
2200
+ * Tool details of a tool that the model may use to generate a response.
2201
+ */
2202
+ export const zGoogleGenaiTypesToolOutput = z.object({
2203
+ functionDeclarations: z.optional(z.union([z.array(zFunctionDeclarationOutput), z.null()])),
2204
+ retrieval: z.optional(z.union([zRetrievalOutput, z.null()])),
2205
+ googleSearch: z.optional(z.union([zGoogleSearchOutput, z.null()])),
2206
+ googleSearchRetrieval: z.optional(z.union([zGoogleSearchRetrievalOutput, z.null()])),
2207
+ enterpriseWebSearch: z.optional(z.union([zEnterpriseWebSearch, z.null()])),
2208
+ googleMaps: z.optional(z.union([zGoogleMapsOutput, z.null()])),
2209
+ urlContext: z.optional(z.union([zUrlContext, z.null()])),
2210
+ codeExecution: z.optional(z.union([zToolCodeExecution, z.null()])),
2211
+ });
2212
+ /**
2213
+ * Tool
2214
+ *
2215
+ * Definition for a tool the client can call.
2216
+ */
2217
+ export const zMcpTypesTool = z.object({
2218
+ name: z.string(),
2219
+ description: z.optional(z.union([z.string(), z.null()])),
2220
+ inputSchema: z.record(z.string(), z.unknown()),
2221
+ annotations: z.optional(z.union([zToolAnnotations, z.null()])),
2222
+ });
2223
+ /**
2224
+ * AgentDetails
2225
+ *
2226
+ * Details about the individual agent in the App.
2227
+ *
2228
+ * This could be a root agent or the sub-agents in the Agent Tree.
2229
+ */
2230
+ export const zAgentDetailsInput = z.object({
2231
+ name: z.string(),
2232
+ instructions: z.optional(z.string()).default(""),
2233
+ toolDeclarations: z.optional(z.array(z.union([zGoogleGenaiTypesToolInput, zMcpTypesTool]))),
2234
+ });
2235
+ /**
2236
+ * AgentDetails
2237
+ *
2238
+ * Details about the individual agent in the App.
2239
+ *
2240
+ * This could be a root agent or the sub-agents in the Agent Tree.
2241
+ */
2242
+ export const zAgentDetailsOutput = z.object({
2243
+ name: z.string(),
2244
+ instructions: z.optional(z.string()).default(""),
2245
+ toolDeclarations: z.optional(z.array(z.union([zGoogleGenaiTypesToolOutput, zMcpTypesTool]))),
2246
+ });
2247
+ /**
2248
+ * AppDetails
2249
+ *
2250
+ * Contains details about the App (the agentic system).
2251
+ *
2252
+ * This structure is only a projection of the acutal app. Only details
2253
+ * that are relevant to the Eval System are captured here.
2254
+ */
2255
+ export const zAppDetailsInput = z.object({
2256
+ agentDetails: z.optional(z.record(z.string(), zAgentDetailsInput)),
2257
+ });
2258
+ /**
2259
+ * AppDetails
2260
+ *
2261
+ * Contains details about the App (the agentic system).
2262
+ *
2263
+ * This structure is only a projection of the acutal app. Only details
2264
+ * that are relevant to the Eval System are captured here.
2265
+ */
2266
+ export const zAppDetailsOutput = z.object({
2267
+ agentDetails: z.optional(z.record(z.string(), zAgentDetailsOutput)),
2188
2268
  });
2189
2269
  /**
2190
2270
  * GenerateContentConfig
2271
+ *
2191
2272
  * Optional model configuration parameters.
2192
2273
  *
2193
2274
  * For more information, see `Content generation parameters
@@ -2235,138 +2316,248 @@ export const zGenerateContentConfigInput = z.object({
2235
2316
  thinkingConfig: z.optional(z.union([zThinkingConfig, z.null()])),
2236
2317
  });
2237
2318
  /**
2238
- * JudgeModelOptions
2239
- * Options for an eval metric's judge model.
2240
- */
2241
- export const zJudgeModelOptionsInput = z.object({
2242
- judgeModel: z.optional(z.string()).default("gemini-2.5-flash"),
2243
- judgeModelConfig: z.optional(z.union([zGenerateContentConfigInput, z.null()])),
2244
- numSamples: z.optional(z.int()).default(5),
2245
- });
2246
- /**
2247
- * EvalMetric
2248
- * A metric used to evaluate a particular aspect of an eval case.
2319
+ * GenerateContentConfig
2320
+ *
2321
+ * Optional model configuration parameters.
2322
+ *
2323
+ * For more information, see `Content generation parameters
2324
+ * <https://cloud.google.com/vertex-ai/generative-ai/docs/multimodal/content-generation-parameters>`_.
2325
+ */
2326
+ export const zGenerateContentConfigOutput = z.object({
2327
+ httpOptions: z.optional(z.union([zHttpOptions, z.null()])),
2328
+ systemInstruction: z.optional(z.union([
2329
+ zContentOutput,
2330
+ z.array(z.union([zFile, zPartOutput, z.string()])),
2331
+ zFile,
2332
+ zPartOutput,
2333
+ z.string(),
2334
+ z.null(),
2335
+ ])),
2336
+ temperature: z.optional(z.union([z.number(), z.null()])),
2337
+ topP: z.optional(z.union([z.number(), z.null()])),
2338
+ topK: z.optional(z.union([z.number(), z.null()])),
2339
+ candidateCount: z.optional(z.union([z.int(), z.null()])),
2340
+ maxOutputTokens: z.optional(z.union([z.int(), z.null()])),
2341
+ stopSequences: z.optional(z.union([z.array(z.string()), z.null()])),
2342
+ responseLogprobs: z.optional(z.union([z.boolean(), z.null()])),
2343
+ logprobs: z.optional(z.union([z.int(), z.null()])),
2344
+ presencePenalty: z.optional(z.union([z.number(), z.null()])),
2345
+ frequencyPenalty: z.optional(z.union([z.number(), z.null()])),
2346
+ seed: z.optional(z.union([z.int(), z.null()])),
2347
+ responseMimeType: z.optional(z.union([z.string(), z.null()])),
2348
+ responseSchema: z.optional(z.union([z.record(z.string(), z.unknown()), zSchemaOutput, z.null()])),
2349
+ responseJsonSchema: z.optional(z.union([z.unknown(), z.null()])),
2350
+ routingConfig: z.optional(z.union([zGenerationConfigRoutingConfig, z.null()])),
2351
+ modelSelectionConfig: z.optional(z.union([zModelSelectionConfig, z.null()])),
2352
+ safetySettings: z.optional(z.union([z.array(zSafetySetting), z.null()])),
2353
+ tools: z.optional(z.union([
2354
+ z.array(z.union([zGoogleGenaiTypesToolOutput, zMcpTypesTool])),
2355
+ z.null(),
2356
+ ])),
2357
+ toolConfig: z.optional(z.union([zToolConfigOutput, z.null()])),
2358
+ labels: z.optional(z.union([z.record(z.string(), z.string()), z.null()])),
2359
+ cachedContent: z.optional(z.union([z.string(), z.null()])),
2360
+ responseModalities: z.optional(z.union([z.array(z.string()), z.null()])),
2361
+ mediaResolution: z.optional(z.union([zMediaResolution, z.null()])),
2362
+ speechConfig: z.optional(z.union([zSpeechConfigOutput, z.string(), z.null()])),
2363
+ audioTimestamp: z.optional(z.union([z.boolean(), z.null()])),
2364
+ automaticFunctionCalling: z.optional(z.union([zAutomaticFunctionCallingConfig, z.null()])),
2365
+ thinkingConfig: z.optional(z.union([zThinkingConfig, z.null()])),
2366
+ });
2367
+ /**
2368
+ * Invocation
2369
+ *
2370
+ * Represents a single invocation.
2249
2371
  */
2250
- export const zEvalMetricInput = z.object({
2251
- metricName: z.string(),
2252
- threshold: z.number(),
2253
- judgeModelOptions: z.optional(z.union([zJudgeModelOptionsInput, z.null()])),
2254
- criterion: z.optional(z.union([zBaseCriterion, z.null()])),
2372
+ export const zInvocationInput = z.object({
2373
+ invocationId: z.optional(z.string()).default(""),
2374
+ userContent: zContentInput,
2375
+ finalResponse: z.optional(z.union([zContentInput, z.null()])),
2376
+ intermediateData: z.optional(z.union([zIntermediateDataInput, zInvocationEventsInput, z.null()])),
2377
+ creationTimestamp: z.optional(z.number()).default(0),
2378
+ rubrics: z.optional(z.union([z.array(zRubric), z.null()])),
2379
+ appDetails: z.optional(z.union([zAppDetailsInput, z.null()])),
2255
2380
  });
2256
2381
  /**
2257
- * EvalResult
2258
- * This class has no field intentionally.
2382
+ * EvalCase
2259
2383
  *
2260
- * The goal here is to just give a new name to the class to align with the API
2261
- * endpoint.
2384
+ * An eval case.
2262
2385
  */
2263
- export const zEvalResult = z.object({
2264
- evalSetResultId: z.string(),
2265
- evalSetResultName: z.optional(z.union([z.string(), z.null()])),
2266
- evalSetId: z.string(),
2267
- evalCaseResults: z.optional(z.array(zEvalCaseResult)),
2386
+ export const zEvalCaseInput = z.object({
2387
+ evalId: z.string(),
2388
+ conversation: z.array(zInvocationInput),
2389
+ sessionInput: z.optional(z.union([zSessionInput, z.null()])),
2268
2390
  creationTimestamp: z.optional(z.number()).default(0),
2391
+ rubrics: z.optional(z.union([z.array(zRubric), z.null()])),
2269
2392
  });
2270
2393
  /**
2271
2394
  * EvalSet
2395
+ *
2272
2396
  * A set of eval cases.
2273
2397
  */
2274
- export const zEvalSetOutput = z.object({
2398
+ export const zEvalSetInput = z.object({
2275
2399
  eval_set_id: z.string(),
2276
2400
  name: z.optional(z.union([z.string(), z.null()])),
2277
2401
  description: z.optional(z.union([z.string(), z.null()])),
2278
- eval_cases: z.array(zEvalCaseOutput),
2402
+ eval_cases: z.array(zEvalCaseInput),
2279
2403
  creation_timestamp: z.optional(z.number()).default(0),
2280
2404
  });
2281
2405
  /**
2282
- * EvalSetResult
2283
- * Eval set level evaluation results.
2406
+ * CreateEvalSetRequest
2284
2407
  */
2285
- export const zEvalSetResult = z.object({
2286
- evalSetResultId: z.string(),
2287
- evalSetResultName: z.optional(z.union([z.string(), z.null()])),
2288
- evalSetId: z.string(),
2289
- evalCaseResults: z.optional(z.array(zEvalCaseResult)),
2290
- creationTimestamp: z.optional(z.number()).default(0),
2408
+ export const zCreateEvalSetRequest = z.object({
2409
+ evalSet: zEvalSetInput,
2291
2410
  });
2292
2411
  /**
2293
- * ValidationError
2412
+ * Invocation
2413
+ *
2414
+ * Represents a single invocation.
2294
2415
  */
2295
- export const zValidationError = z.object({
2296
- loc: z.array(z.union([z.string(), z.int()])),
2297
- msg: z.string(),
2298
- type: z.string(),
2416
+ export const zInvocationOutput = z.object({
2417
+ invocationId: z.optional(z.string()).default(""),
2418
+ userContent: zContentOutput,
2419
+ finalResponse: z.optional(z.union([zContentOutput, z.null()])),
2420
+ intermediateData: z.optional(z.union([zIntermediateDataOutput, zInvocationEventsOutput, z.null()])),
2421
+ creationTimestamp: z.optional(z.number()).default(0),
2422
+ rubrics: z.optional(z.union([z.array(zRubric), z.null()])),
2423
+ appDetails: z.optional(z.union([zAppDetailsOutput, z.null()])),
2299
2424
  });
2300
2425
  /**
2301
- * HTTPValidationError
2426
+ * EvalCase
2427
+ *
2428
+ * An eval case.
2302
2429
  */
2303
- export const zHttpValidationError = z.object({
2304
- detail: z.optional(z.array(zValidationError)),
2430
+ export const zEvalCaseOutput = z.object({
2431
+ evalId: z.string(),
2432
+ conversation: z.array(zInvocationOutput),
2433
+ sessionInput: z.optional(z.union([zSessionInput, z.null()])),
2434
+ creationTimestamp: z.optional(z.number()).default(0),
2435
+ rubrics: z.optional(z.union([z.array(zRubric), z.null()])),
2305
2436
  });
2306
2437
  /**
2307
- * Item
2438
+ * EvalSet
2439
+ *
2440
+ * A set of eval cases.
2308
2441
  */
2309
- export const zItem = z.object({
2310
- id: z.int(),
2311
- name: z.string(),
2442
+ export const zEvalSetOutput = z.object({
2443
+ eval_set_id: z.string(),
2444
+ name: z.optional(z.union([z.string(), z.null()])),
2312
2445
  description: z.optional(z.union([z.string(), z.null()])),
2313
- price: z.number(),
2314
- tags: z.optional(z.array(z.string())).default([]),
2446
+ eval_cases: z.array(zEvalCaseOutput),
2447
+ creation_timestamp: z.optional(z.number()).default(0),
2315
2448
  });
2316
2449
  /**
2317
- * ListEvalResultsResponse
2450
+ * JudgeModelOptions
2451
+ *
2452
+ * Options for an eval metric's judge model.
2318
2453
  */
2319
- export const zListEvalResultsResponse = z.object({
2320
- evalResultIds: z.array(z.string()),
2454
+ export const zJudgeModelOptionsInput = z.object({
2455
+ judgeModel: z.optional(z.string()).default("gemini-2.5-flash"),
2456
+ judgeModelConfig: z.optional(z.union([zGenerateContentConfigInput, z.null()])),
2457
+ numSamples: z.optional(z.int()).default(5),
2321
2458
  });
2322
2459
  /**
2323
- * ListEvalSetsResponse
2460
+ * EvalMetric
2461
+ *
2462
+ * A metric used to evaluate a particular aspect of an eval case.
2324
2463
  */
2325
- export const zListEvalSetsResponse = z.object({
2326
- evalSetIds: z.array(z.string()),
2464
+ export const zEvalMetricInput = z.object({
2465
+ metricName: z.string(),
2466
+ threshold: z.number(),
2467
+ judgeModelOptions: z.optional(z.union([zJudgeModelOptionsInput, z.null()])),
2468
+ criterion: z.optional(z.union([zBaseCriterion, z.null()])),
2327
2469
  });
2328
2470
  /**
2329
- * Interval
2330
- * Represents a range of numeric values, e.g. [0 ,1] or (2,3) or [-1, 6).
2471
+ * JudgeModelOptions
2472
+ *
2473
+ * Options for an eval metric's judge model.
2331
2474
  */
2332
- export const zGoogleAdkEvaluationEvalMetricsInterval = z.object({
2333
- minValue: z.number(),
2334
- openAtMin: z.optional(z.boolean()).default(false),
2335
- maxValue: z.number(),
2336
- openAtMax: z.optional(z.boolean()).default(false),
2475
+ export const zJudgeModelOptionsOutput = z.object({
2476
+ judgeModel: z.optional(z.string()).default("gemini-2.5-flash"),
2477
+ judgeModelConfig: z.optional(z.union([zGenerateContentConfigOutput, z.null()])),
2478
+ numSamples: z.optional(z.int()).default(5),
2337
2479
  });
2338
2480
  /**
2339
- * MetricValueInfo
2340
- * Information about the type of metric value.
2481
+ * EvalMetric
2482
+ *
2483
+ * A metric used to evaluate a particular aspect of an eval case.
2341
2484
  */
2342
- export const zMetricValueInfo = z.object({
2343
- interval: z.optional(z.union([zGoogleAdkEvaluationEvalMetricsInterval, z.null()])),
2485
+ export const zEvalMetricOutput = z.object({
2486
+ metricName: z.string(),
2487
+ threshold: z.number(),
2488
+ judgeModelOptions: z.optional(z.union([zJudgeModelOptionsOutput, z.null()])),
2489
+ criterion: z.optional(z.union([zBaseCriterion, z.null()])),
2344
2490
  });
2345
2491
  /**
2346
- * MetricInfo
2347
- * Information about the metric that are used for Evals.
2492
+ * EvalMetricResult
2493
+ *
2494
+ * The actual computed score/value of a particular EvalMetric.
2348
2495
  */
2349
- export const zMetricInfo = z.object({
2496
+ export const zEvalMetricResult = z.object({
2350
2497
  metricName: z.string(),
2351
- description: z.optional(z.string()),
2352
- metricValueInfo: zMetricValueInfo,
2498
+ threshold: z.number(),
2499
+ judgeModelOptions: z.optional(z.union([zJudgeModelOptionsOutput, z.null()])),
2500
+ criterion: z.optional(z.union([zBaseCriterion, z.null()])),
2501
+ score: z.optional(z.union([z.number(), z.null()])),
2502
+ evalStatus: zEvalStatus,
2503
+ details: z.optional(zEvalMetricResultDetails),
2353
2504
  });
2354
2505
  /**
2355
- * ListMetricsInfoResponse
2506
+ * EvalMetricResultPerInvocation
2507
+ *
2508
+ * Eval metric results per invocation.
2356
2509
  */
2357
- export const zListMetricsInfoResponse = z.object({
2358
- metricsInfo: z.array(zMetricInfo),
2510
+ export const zEvalMetricResultPerInvocation = z.object({
2511
+ actualInvocation: zInvocationOutput,
2512
+ expectedInvocation: zInvocationOutput,
2513
+ evalMetricResults: z.optional(z.array(zEvalMetricResult)).default([]),
2359
2514
  });
2360
2515
  /**
2361
- * RunAgentRequest
2516
+ * EvalCaseResult
2517
+ *
2518
+ * Case level evaluation results.
2362
2519
  */
2363
- export const zRunAgentRequest = z.object({
2364
- appName: z.string(),
2365
- userId: z.string(),
2520
+ export const zEvalCaseResult = z.object({
2521
+ evalSetFile: z.optional(z.union([z.string(), z.null()])),
2522
+ evalSetId: z.optional(z.string()).default(""),
2523
+ evalId: z.optional(z.string()).default(""),
2524
+ finalEvalStatus: zEvalStatus,
2525
+ evalMetricResults: z.optional(z.union([
2526
+ z.array(z.tuple([zEvalMetricOutput, zEvalMetricResult])),
2527
+ z.null(),
2528
+ ])),
2529
+ overallEvalMetricResults: z.array(zEvalMetricResult),
2530
+ evalMetricResultPerInvocation: z.array(zEvalMetricResultPerInvocation),
2366
2531
  sessionId: z.string(),
2367
- newMessage: zContentInput,
2368
- streaming: z.optional(z.boolean()).default(false),
2369
- stateDelta: z.optional(z.union([z.record(z.string(), z.unknown()), z.null()])),
2532
+ sessionDetails: z.optional(z.union([zSession, z.null()])),
2533
+ userId: z.optional(z.union([z.string(), z.null()])),
2534
+ });
2535
+ /**
2536
+ * EvalResult
2537
+ *
2538
+ * This class has no field intentionally.
2539
+ *
2540
+ * The goal here is to just give a new name to the class to align with the API
2541
+ * endpoint.
2542
+ */
2543
+ export const zEvalResult = z.object({
2544
+ evalSetResultId: z.string(),
2545
+ evalSetResultName: z.optional(z.union([z.string(), z.null()])),
2546
+ evalSetId: z.string(),
2547
+ evalCaseResults: z.optional(z.array(zEvalCaseResult)),
2548
+ creationTimestamp: z.optional(z.number()).default(0),
2549
+ });
2550
+ /**
2551
+ * EvalSetResult
2552
+ *
2553
+ * Eval set level evaluation results.
2554
+ */
2555
+ export const zEvalSetResult = z.object({
2556
+ evalSetResultId: z.string(),
2557
+ evalSetResultName: z.optional(z.union([z.string(), z.null()])),
2558
+ evalSetId: z.string(),
2559
+ evalCaseResults: z.optional(z.array(zEvalCaseResult)),
2560
+ creationTimestamp: z.optional(z.number()).default(0),
2370
2561
  });
2371
2562
  /**
2372
2563
  * RunEvalRequest
@@ -2398,22 +2589,6 @@ export const zRunEvalResult = z.object({
2398
2589
  export const zRunEvalResponse = z.object({
2399
2590
  runEvalResults: z.array(zRunEvalResult),
2400
2591
  });
2401
- /**
2402
- * StartNapcatRequest
2403
- * 启动Napcat沙盒请求模型
2404
- */
2405
- export const zStartNapcatRequest = z.object({
2406
- sandbox_type: z.string(),
2407
- sandboxId: z.string(),
2408
- });
2409
- /**
2410
- * StartNapcatResponse
2411
- * 启动Napcat沙盒响应模型
2412
- */
2413
- export const zStartNapcatResponse = z.object({
2414
- sandboxId: z.string(),
2415
- error: z.optional(z.union([z.string(), z.null()])),
2416
- });
2417
2592
  export const zListAppsData = z.object({
2418
2593
  body: z.optional(z.never()),
2419
2594
  path: z.optional(z.never()),
@@ -2421,6 +2596,7 @@ export const zListAppsData = z.object({
2421
2596
  });
2422
2597
  /**
2423
2598
  * Response List Apps
2599
+ *
2424
2600
  * Successful Response
2425
2601
  */
2426
2602
  export const zListAppsResponse = z.array(z.string());
@@ -2449,6 +2625,7 @@ export const zDeleteSessionData = z.object({
2449
2625
  });
2450
2626
  /**
2451
2627
  * Response Delete Session
2628
+ *
2452
2629
  * Successful Response
2453
2630
  */
2454
2631
  export const zDeleteSessionResponse = z.null();
@@ -2488,6 +2665,7 @@ export const zListSessionsData = z.object({
2488
2665
  });
2489
2666
  /**
2490
2667
  * Response List Sessions
2668
+ *
2491
2669
  * Successful Response
2492
2670
  */
2493
2671
  export const zListSessionsResponse = z.array(zSession);
@@ -2542,6 +2720,7 @@ export const zEvaluationListEvalSetsLegacyData = z.object({
2542
2720
  });
2543
2721
  /**
2544
2722
  * Response Evaluation-List Eval Sets Legacy
2723
+ *
2545
2724
  * Successful Response
2546
2725
  */
2547
2726
  export const zEvaluationListEvalSetsLegacyResponse = z.array(z.string());
@@ -2563,6 +2742,7 @@ export const zEvaluationListEvalsInEvalSetData = z.object({
2563
2742
  });
2564
2743
  /**
2565
2744
  * Response Evaluation-List Evals In Eval Set
2745
+ *
2566
2746
  * Successful Response
2567
2747
  */
2568
2748
  export const zEvaluationListEvalsInEvalSetResponse = z.array(z.string());
@@ -2577,6 +2757,7 @@ export const zEvaluationDeleteEvalData = z.object({
2577
2757
  });
2578
2758
  /**
2579
2759
  * Response Evaluation-Delete Eval
2760
+ *
2580
2761
  * Successful Response
2581
2762
  */
2582
2763
  export const zEvaluationDeleteEvalResponse = z.null();
@@ -2612,6 +2793,7 @@ export const zEvaluationRunEvalLegacyData = z.object({
2612
2793
  });
2613
2794
  /**
2614
2795
  * Response Evaluation-Run Eval Legacy
2796
+ *
2615
2797
  * Successful Response
2616
2798
  */
2617
2799
  export const zEvaluationRunEvalLegacyResponse = z.array(zRunEvalResult);
@@ -2671,6 +2853,7 @@ export const zEvaluationListEvalResultsLegacyData = z.object({
2671
2853
  });
2672
2854
  /**
2673
2855
  * Response Evaluation-List Eval Results Legacy
2856
+ *
2674
2857
  * Successful Response
2675
2858
  */
2676
2859
  export const zEvaluationListEvalResultsLegacyResponse = z.array(z.string());
@@ -2697,6 +2880,7 @@ export const zDeleteArtifactData = z.object({
2697
2880
  });
2698
2881
  /**
2699
2882
  * Response Delete Artifact
2883
+ *
2700
2884
  * Successful Response
2701
2885
  */
2702
2886
  export const zDeleteArtifactResponse = z.null();
@@ -2714,6 +2898,7 @@ export const zLoadArtifactData = z.object({
2714
2898
  });
2715
2899
  /**
2716
2900
  * Response Load Artifact
2901
+ *
2717
2902
  * Successful Response
2718
2903
  */
2719
2904
  export const zLoadArtifactResponse = z.union([zPartOutput, z.null()]);
@@ -2730,6 +2915,7 @@ export const zLoadArtifactVersionData = z.object({
2730
2915
  });
2731
2916
  /**
2732
2917
  * Response Load Artifact Version
2918
+ *
2733
2919
  * Successful Response
2734
2920
  */
2735
2921
  export const zLoadArtifactVersionResponse = z.union([zPartOutput, z.null()]);
@@ -2744,6 +2930,7 @@ export const zListArtifactNamesData = z.object({
2744
2930
  });
2745
2931
  /**
2746
2932
  * Response List Artifact Names
2933
+ *
2747
2934
  * Successful Response
2748
2935
  */
2749
2936
  export const zListArtifactNamesResponse = z.array(z.string());
@@ -2759,6 +2946,7 @@ export const zListArtifactVersionsData = z.object({
2759
2946
  });
2760
2947
  /**
2761
2948
  * Response List Artifact Versions
2949
+ *
2762
2950
  * Successful Response
2763
2951
  */
2764
2952
  export const zListArtifactVersionsResponse = z.array(z.int());
@@ -2769,6 +2957,7 @@ export const zRunAgentData = z.object({
2769
2957
  });
2770
2958
  /**
2771
2959
  * Response Run Agent
2960
+ *
2772
2961
  * Successful Response
2773
2962
  */
2774
2963
  export const zRunAgentResponse = z.array(zEventOutput);
@@ -2804,6 +2993,7 @@ export const zBuilderBuildData = z.object({
2804
2993
  });
2805
2994
  /**
2806
2995
  * Response Builder Build
2996
+ *
2807
2997
  * Successful Response
2808
2998
  */
2809
2999
  export const zBuilderBuildResponse = z.boolean();
@@ -2877,6 +3067,7 @@ export const zListItemsData = z.object({
2877
3067
  });
2878
3068
  /**
2879
3069
  * Response List Items
3070
+ *
2880
3071
  * Successful Response
2881
3072
  */
2882
3073
  export const zListItemsResponse = z.array(zItem);
@@ -2930,6 +3121,7 @@ export const zSearchItemsData = z.object({
2930
3121
  });
2931
3122
  /**
2932
3123
  * Response Search Items
3124
+ *
2933
3125
  * Successful Response
2934
3126
  */
2935
3127
  export const zSearchItemsResponse = z.array(zItem);