Skip to content

Commit 42cea48

Browse files
authored
Convert enum comments to JSDoc comments (#8742)
1 parent 058afa2 commit 42cea48

File tree

3 files changed

+101
-77
lines changed

3 files changed

+101
-77
lines changed

common/api-review/vertexai.api.md

-24
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,8 @@ export interface BaseParams {
2929
// @public
3030
export enum BlockReason {
3131
BLOCKLIST = "BLOCKLIST",
32-
// (undocumented)
3332
OTHER = "OTHER",
3433
PROHIBITED_CONTENT = "PROHIBITED_CONTENT",
35-
// (undocumented)
3634
SAFETY = "SAFETY"
3735
}
3836

@@ -162,17 +160,12 @@ export interface FileDataPart {
162160
export enum FinishReason {
163161
BLOCKLIST = "BLOCKLIST",
164162
MALFORMED_FUNCTION_CALL = "MALFORMED_FUNCTION_CALL",
165-
// (undocumented)
166163
MAX_TOKENS = "MAX_TOKENS",
167-
// (undocumented)
168164
OTHER = "OTHER",
169165
PROHIBITED_CONTENT = "PROHIBITED_CONTENT",
170-
// (undocumented)
171166
RECITATION = "RECITATION",
172-
// (undocumented)
173167
SAFETY = "SAFETY",
174168
SPII = "SPII",
175-
// (undocumented)
176169
STOP = "STOP"
177170
}
178171

@@ -194,11 +187,8 @@ export interface FunctionCallingConfig {
194187

195188
// @public (undocumented)
196189
export enum FunctionCallingMode {
197-
// (undocumented)
198190
ANY = "ANY",
199-
// (undocumented)
200191
AUTO = "AUTO",
201-
// (undocumented)
202192
NONE = "NONE"
203193
}
204194

@@ -383,21 +373,15 @@ export interface GroundingMetadata {
383373

384374
// @public (undocumented)
385375
export enum HarmBlockMethod {
386-
// (undocumented)
387376
PROBABILITY = "PROBABILITY",
388-
// (undocumented)
389377
SEVERITY = "SEVERITY"
390378
}
391379

392380
// @public
393381
export enum HarmBlockThreshold {
394-
// (undocumented)
395382
BLOCK_LOW_AND_ABOVE = "BLOCK_LOW_AND_ABOVE",
396-
// (undocumented)
397383
BLOCK_MEDIUM_AND_ABOVE = "BLOCK_MEDIUM_AND_ABOVE",
398-
// (undocumented)
399384
BLOCK_NONE = "BLOCK_NONE",
400-
// (undocumented)
401385
BLOCK_ONLY_HIGH = "BLOCK_ONLY_HIGH"
402386
}
403387

@@ -415,25 +399,17 @@ export enum HarmCategory {
415399

416400
// @public
417401
export enum HarmProbability {
418-
// (undocumented)
419402
HIGH = "HIGH",
420-
// (undocumented)
421403
LOW = "LOW",
422-
// (undocumented)
423404
MEDIUM = "MEDIUM",
424-
// (undocumented)
425405
NEGLIGIBLE = "NEGLIGIBLE"
426406
}
427407

428408
// @public
429409
export enum HarmSeverity {
430-
// (undocumented)
431410
HARM_SEVERITY_HIGH = "HARM_SEVERITY_HIGH",
432-
// (undocumented)
433411
HARM_SEVERITY_LOW = "HARM_SEVERITY_LOW",
434-
// (undocumented)
435412
HARM_SEVERITY_MEDIUM = "HARM_SEVERITY_MEDIUM",
436-
// (undocumented)
437413
HARM_SEVERITY_NEGLIGIBLE = "HARM_SEVERITY_NEGLIGIBLE"
438414
}
439415

docs-devsite/vertexai.md

+24-24
Original file line numberDiff line numberDiff line change
@@ -278,9 +278,9 @@ export declare enum BlockReason
278278
| Member | Value | Description |
279279
| --- | --- | --- |
280280
| BLOCKLIST | <code>&quot;BLOCKLIST&quot;</code> | Content was blocked because it contained terms from the terminology blocklist. |
281-
| OTHER | <code>&quot;OTHER&quot;</code> | |
281+
| OTHER | <code>&quot;OTHER&quot;</code> | Content was blocked, but the reason is uncategorized. |
282282
| PROHIBITED\_CONTENT | <code>&quot;PROHIBITED_CONTENT&quot;</code> | Content was blocked due to prohibited content. |
283-
| SAFETY | <code>&quot;SAFETY&quot;</code> | |
283+
| SAFETY | <code>&quot;SAFETY&quot;</code> | Content was blocked by safety settings. |
284284

285285
## FinishReason
286286

@@ -298,13 +298,13 @@ export declare enum FinishReason
298298
| --- | --- | --- |
299299
| BLOCKLIST | <code>&quot;BLOCKLIST&quot;</code> | The candidate content contained forbidden terms. |
300300
| MALFORMED\_FUNCTION\_CALL | <code>&quot;MALFORMED_FUNCTION_CALL&quot;</code> | The function call generated by the model was invalid. |
301-
| MAX\_TOKENS | <code>&quot;MAX_TOKENS&quot;</code> | |
302-
| OTHER | <code>&quot;OTHER&quot;</code> | |
301+
| MAX\_TOKENS | <code>&quot;MAX_TOKENS&quot;</code> | The maximum number of tokens as specified in the request was reached. |
302+
| OTHER | <code>&quot;OTHER&quot;</code> | Unknown reason. |
303303
| PROHIBITED\_CONTENT | <code>&quot;PROHIBITED_CONTENT&quot;</code> | The candidate content potentially contained prohibited content. |
304-
| RECITATION | <code>&quot;RECITATION&quot;</code> | |
305-
| SAFETY | <code>&quot;SAFETY&quot;</code> | |
304+
| RECITATION | <code>&quot;RECITATION&quot;</code> | The candidate content was flagged for recitation reasons. |
305+
| SAFETY | <code>&quot;SAFETY&quot;</code> | The candidate content was flagged for safety reasons. |
306306
| SPII | <code>&quot;SPII&quot;</code> | The candidate content potentially contained Sensitive Personally Identifiable Information (SPII). |
307-
| STOP | <code>&quot;STOP&quot;</code> | |
307+
| STOP | <code>&quot;STOP&quot;</code> | Natural stop point of the model or provided stop sequence. |
308308

309309
## FunctionCallingMode
310310

@@ -319,9 +319,9 @@ export declare enum FunctionCallingMode
319319

320320
| Member | Value | Description |
321321
| --- | --- | --- |
322-
| ANY | <code>&quot;ANY&quot;</code> | |
323-
| AUTO | <code>&quot;AUTO&quot;</code> | |
324-
| NONE | <code>&quot;NONE&quot;</code> | |
322+
| ANY | <code>&quot;ANY&quot;</code> | Model is constrained to always predicting a function call only. If <code>allowed_function_names</code> is set, the predicted function call will be limited to any one of <code>allowed_function_names</code>, else the predicted function call will be any one of the provided <code>function_declarations</code>. |
323+
| AUTO | <code>&quot;AUTO&quot;</code> | Default model behavior; model decides to predict either a function call or a natural language response. |
324+
| NONE | <code>&quot;NONE&quot;</code> | Model will not predict any function call. Model behavior is same as when not passing any function declarations. |
325325

326326
## HarmBlockMethod
327327

@@ -336,8 +336,8 @@ export declare enum HarmBlockMethod
336336

337337
| Member | Value | Description |
338338
| --- | --- | --- |
339-
| PROBABILITY | <code>&quot;PROBABILITY&quot;</code> | |
340-
| SEVERITY | <code>&quot;SEVERITY&quot;</code> | |
339+
| PROBABILITY | <code>&quot;PROBABILITY&quot;</code> | The harm block method uses the probability score. |
340+
| SEVERITY | <code>&quot;SEVERITY&quot;</code> | The harm block method uses both probability and severity scores. |
341341

342342
## HarmBlockThreshold
343343

@@ -353,10 +353,10 @@ export declare enum HarmBlockThreshold
353353

354354
| Member | Value | Description |
355355
| --- | --- | --- |
356-
| BLOCK\_LOW\_AND\_ABOVE | <code>&quot;BLOCK_LOW_AND_ABOVE&quot;</code> | |
357-
| BLOCK\_MEDIUM\_AND\_ABOVE | <code>&quot;BLOCK_MEDIUM_AND_ABOVE&quot;</code> | |
358-
| BLOCK\_NONE | <code>&quot;BLOCK_NONE&quot;</code> | |
359-
| BLOCK\_ONLY\_HIGH | <code>&quot;BLOCK_ONLY_HIGH&quot;</code> | |
356+
| BLOCK\_LOW\_AND\_ABOVE | <code>&quot;BLOCK_LOW_AND_ABOVE&quot;</code> | Content with <code>NEGLIGIBLE</code> will be allowed. |
357+
| BLOCK\_MEDIUM\_AND\_ABOVE | <code>&quot;BLOCK_MEDIUM_AND_ABOVE&quot;</code> | Content with <code>NEGLIGIBLE</code> and <code>LOW</code> will be allowed. |
358+
| BLOCK\_NONE | <code>&quot;BLOCK_NONE&quot;</code> | All content will be allowed. |
359+
| BLOCK\_ONLY\_HIGH | <code>&quot;BLOCK_ONLY_HIGH&quot;</code> | Content with <code>NEGLIGIBLE</code>, <code>LOW</code>, and <code>MEDIUM</code> will be allowed. |
360360

361361
## HarmCategory
362362

@@ -391,10 +391,10 @@ export declare enum HarmProbability
391391

392392
| Member | Value | Description |
393393
| --- | --- | --- |
394-
| HIGH | <code>&quot;HIGH&quot;</code> | |
395-
| LOW | <code>&quot;LOW&quot;</code> | |
396-
| MEDIUM | <code>&quot;MEDIUM&quot;</code> | |
397-
| NEGLIGIBLE | <code>&quot;NEGLIGIBLE&quot;</code> | |
394+
| HIGH | <code>&quot;HIGH&quot;</code> | Content has a high chance of being unsafe. |
395+
| LOW | <code>&quot;LOW&quot;</code> | Content has a low chance of being unsafe. |
396+
| MEDIUM | <code>&quot;MEDIUM&quot;</code> | Content has a medium chance of being unsafe. |
397+
| NEGLIGIBLE | <code>&quot;NEGLIGIBLE&quot;</code> | Content has a negligible chance of being unsafe. |
398398

399399
## HarmSeverity
400400

@@ -410,10 +410,10 @@ export declare enum HarmSeverity
410410

411411
| Member | Value | Description |
412412
| --- | --- | --- |
413-
| HARM\_SEVERITY\_HIGH | <code>&quot;HARM_SEVERITY_HIGH&quot;</code> | |
414-
| HARM\_SEVERITY\_LOW | <code>&quot;HARM_SEVERITY_LOW&quot;</code> | |
415-
| HARM\_SEVERITY\_MEDIUM | <code>&quot;HARM_SEVERITY_MEDIUM&quot;</code> | |
416-
| HARM\_SEVERITY\_NEGLIGIBLE | <code>&quot;HARM_SEVERITY_NEGLIGIBLE&quot;</code> | |
413+
| HARM\_SEVERITY\_HIGH | <code>&quot;HARM_SEVERITY_HIGH&quot;</code> | High level of harm severity. |
414+
| HARM\_SEVERITY\_LOW | <code>&quot;HARM_SEVERITY_LOW&quot;</code> | Low level of harm severity. |
415+
| HARM\_SEVERITY\_MEDIUM | <code>&quot;HARM_SEVERITY_MEDIUM&quot;</code> | Medium level of harm severity. |
416+
| HARM\_SEVERITY\_NEGLIGIBLE | <code>&quot;HARM_SEVERITY_NEGLIGIBLE&quot;</code> | Negligible level of harm severity. |
417417

418418
## ImagenAspectRatio
419419

packages/vertexai/src/types/enums.ts

+77-29
Original file line numberDiff line numberDiff line change
@@ -43,23 +43,35 @@ export enum HarmCategory {
4343
* @public
4444
*/
4545
export enum HarmBlockThreshold {
46-
// Content with NEGLIGIBLE will be allowed.
46+
/**
47+
* Content with `NEGLIGIBLE` will be allowed.
48+
*/
4749
BLOCK_LOW_AND_ABOVE = 'BLOCK_LOW_AND_ABOVE',
48-
// Content with NEGLIGIBLE and LOW will be allowed.
50+
/**
51+
* Content with `NEGLIGIBLE` and `LOW` will be allowed.
52+
*/
4953
BLOCK_MEDIUM_AND_ABOVE = 'BLOCK_MEDIUM_AND_ABOVE',
50-
// Content with NEGLIGIBLE, LOW, and MEDIUM will be allowed.
54+
/**
55+
* Content with `NEGLIGIBLE`, `LOW`, and `MEDIUM` will be allowed.
56+
*/
5157
BLOCK_ONLY_HIGH = 'BLOCK_ONLY_HIGH',
52-
// All content will be allowed.
58+
/**
59+
* All content will be allowed.
60+
*/
5361
BLOCK_NONE = 'BLOCK_NONE'
5462
}
5563

5664
/**
5765
* @public
5866
*/
5967
export enum HarmBlockMethod {
60-
// The harm block method uses both probability and severity scores.
68+
/**
69+
* The harm block method uses both probability and severity scores.
70+
*/
6171
SEVERITY = 'SEVERITY',
62-
// The harm block method uses the probability score.
72+
/**
73+
* The harm block method uses the probability score.
74+
*/
6375
PROBABILITY = 'PROBABILITY'
6476
}
6577

@@ -68,13 +80,21 @@ export enum HarmBlockMethod {
6880
* @public
6981
*/
7082
export enum HarmProbability {
71-
// Content has a negligible chance of being unsafe.
83+
/**
84+
* Content has a negligible chance of being unsafe.
85+
*/
7286
NEGLIGIBLE = 'NEGLIGIBLE',
73-
// Content has a low chance of being unsafe.
87+
/**
88+
* Content has a low chance of being unsafe.
89+
*/
7490
LOW = 'LOW',
75-
// Content has a medium chance of being unsafe.
91+
/**
92+
* Content has a medium chance of being unsafe.
93+
*/
7694
MEDIUM = 'MEDIUM',
77-
// Content has a high chance of being unsafe.
95+
/**
96+
* Content has a high chance of being unsafe.
97+
*/
7898
HIGH = 'HIGH'
7999
}
80100

@@ -83,13 +103,21 @@ export enum HarmProbability {
83103
* @public
84104
*/
85105
export enum HarmSeverity {
86-
// Negligible level of harm severity.
106+
/**
107+
* Negligible level of harm severity.
108+
*/
87109
HARM_SEVERITY_NEGLIGIBLE = 'HARM_SEVERITY_NEGLIGIBLE',
88-
// Low level of harm severity.
110+
/**
111+
* Low level of harm severity.
112+
*/
89113
HARM_SEVERITY_LOW = 'HARM_SEVERITY_LOW',
90-
// Medium level of harm severity.
114+
/**
115+
* Medium level of harm severity.
116+
*/
91117
HARM_SEVERITY_MEDIUM = 'HARM_SEVERITY_MEDIUM',
92-
// High level of harm severity.
118+
/**
119+
* High level of harm severity.
120+
*/
93121
HARM_SEVERITY_HIGH = 'HARM_SEVERITY_HIGH'
94122
}
95123

@@ -98,9 +126,13 @@ export enum HarmSeverity {
98126
* @public
99127
*/
100128
export enum BlockReason {
101-
// Content was blocked by safety settings.
129+
/**
130+
* Content was blocked by safety settings.
131+
*/
102132
SAFETY = 'SAFETY',
103-
// Content was blocked, but the reason is uncategorized.
133+
/**
134+
* Content was blocked, but the reason is uncategorized.
135+
*/
104136
OTHER = 'OTHER',
105137
/**
106138
* Content was blocked because it contained terms from the terminology blocklist.
@@ -117,15 +149,25 @@ export enum BlockReason {
117149
* @public
118150
*/
119151
export enum FinishReason {
120-
// Natural stop point of the model or provided stop sequence.
152+
/**
153+
* Natural stop point of the model or provided stop sequence.
154+
*/
121155
STOP = 'STOP',
122-
// The maximum number of tokens as specified in the request was reached.
156+
/**
157+
* The maximum number of tokens as specified in the request was reached.
158+
*/
123159
MAX_TOKENS = 'MAX_TOKENS',
124-
// The candidate content was flagged for safety reasons.
160+
/**
161+
* The candidate content was flagged for safety reasons.
162+
*/
125163
SAFETY = 'SAFETY',
126-
// The candidate content was flagged for recitation reasons.
164+
/**
165+
* The candidate content was flagged for recitation reasons.
166+
*/
127167
RECITATION = 'RECITATION',
128-
// Unknown reason.
168+
/**
169+
* Unknown reason.
170+
*/
129171
OTHER = 'OTHER',
130172
/**
131173
* The candidate content contained forbidden terms.
@@ -149,16 +191,22 @@ export enum FinishReason {
149191
* @public
150192
*/
151193
export enum FunctionCallingMode {
152-
// Default model behavior, model decides to predict either a function call
153-
// or a natural language response.
194+
/**
195+
* Default model behavior; model decides to predict either a function call
196+
* or a natural language response.
197+
*/
154198
AUTO = 'AUTO',
155-
// Model is constrained to always predicting a function call only.
156-
// If "allowed_function_names" is set, the predicted function call will be
157-
// limited to any one of "allowed_function_names", else the predicted
158-
// function call will be any one of the provided "function_declarations".
199+
/**
200+
* Model is constrained to always predicting a function call only.
201+
* If `allowed_function_names` is set, the predicted function call will be
202+
* limited to any one of `allowed_function_names`, else the predicted
203+
* function call will be any one of the provided `function_declarations`.
204+
*/
159205
ANY = 'ANY',
160-
// Model will not predict any function call. Model behavior is same as when
161-
// not passing any function declarations.
206+
/**
207+
* Model will not predict any function call. Model behavior is same as when
208+
* not passing any function declarations.
209+
*/
162210
NONE = 'NONE'
163211
}
164212

0 commit comments

Comments
 (0)