Skip to content

Commit 39ebdfb

Browse files
committed
refine design
1 parent 0cd9f37 commit 39ebdfb

File tree

2 files changed

+56
-5
lines changed

2 files changed

+56
-5
lines changed

common/api-review/vertexai.api.md

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,18 @@ import { FirebaseApp } from '@firebase/app';
99
import { FirebaseAuthTokenData } from '@firebase/auth-interop-types';
1010
import { FirebaseError } from '@firebase/util';
1111

12+
// @public (undocumented)
13+
export class ArraySchema extends Schema {
14+
// Warning: (ae-forgotten-export) The symbol "SchemaParams" needs to be exported by the entry point index.d.ts
15+
constructor(schemaParams: SchemaParams, items: TypedSchema);
16+
// (undocumented)
17+
items: TypedSchema;
18+
// Warning: (ae-forgotten-export) The symbol "_SchemaRequest" needs to be exported by the entry point index.d.ts
19+
//
20+
// (undocumented)
21+
toJSON(): _SchemaRequest;
22+
}
23+
1224
// @public
1325
export class ArraySchema extends Schema {
1426
constructor(schemaParams: SchemaParams, items: TypedSchema);
@@ -34,6 +46,11 @@ export enum BlockReason {
3446
SAFETY = "SAFETY"
3547
}
3648

49+
// @public (undocumented)
50+
export class BooleanSchema extends Schema {
51+
constructor(schemaParams?: SchemaParams);
52+
}
53+
3754
// @public
3855
export class BooleanSchema extends Schema {
3956
constructor(schemaParams?: SchemaParams);
@@ -442,6 +459,11 @@ export interface InlineDataPart {
442459
videoMetadata?: VideoMetadata;
443460
}
444461

462+
// @public (undocumented)
463+
export class IntegerSchema extends Schema {
464+
constructor(schemaParams?: SchemaParams);
465+
}
466+
445467
// @public
446468
export class IntegerSchema extends Schema {
447469
constructor(schemaParams?: SchemaParams);
@@ -459,6 +481,24 @@ export interface ModelParams extends BaseParams {
459481
tools?: Tool[];
460482
}
461483

484+
// @public (undocumented)
485+
export class NumberSchema extends Schema {
486+
constructor(schemaParams?: SchemaParams);
487+
}
488+
489+
// @public (undocumented)
490+
export class ObjectSchema extends Schema {
491+
constructor(schemaParams: SchemaParams, properties: {
492+
[k: string]: TypedSchema;
493+
});
494+
// (undocumented)
495+
properties: {
496+
[k: string]: TypedSchema;
497+
};
498+
// (undocumented)
499+
toJSON(): _SchemaRequest;
500+
}
501+
462502
// @public
463503
export class NumberSchema extends Schema {
464504
constructor(schemaParams?: SchemaParams);
@@ -644,6 +684,15 @@ export interface StartChatParams extends BaseParams {
644684
tools?: Tool[];
645685
}
646686

687+
// @public (undocumented)
688+
export class StringSchema extends Schema {
689+
constructor(schemaParams?: SchemaParams, enumValues?: string[]);
690+
// (undocumented)
691+
enum?: string[];
692+
// (undocumented)
693+
toJSON(): _SchemaRequest;
694+
}
695+
647696
// @public
648697
export class StringSchema extends Schema {
649698
constructor(schemaParams?: SchemaParams, enumValues?: string[]);
@@ -674,6 +723,9 @@ export interface ToolConfig {
674723
functionCallingConfig?: FunctionCallingConfig;
675724
}
676725

726+
// @public (undocumented)
727+
export type TypedSchema = IntegerSchema | NumberSchema | StringSchema | BooleanSchema | ObjectSchema | ArraySchema;
728+
677729
// @public
678730
export type TypedSchema = IntegerSchema | NumberSchema | StringSchema | BooleanSchema | ObjectSchema | ArraySchema;
679731

packages/vertexai/src/requests/schema-builder.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -212,13 +212,12 @@ export class StringSchema extends Schema {
212212
return obj as SchemaRequest;
213213
}
214214

215-
toJSON(): Record<string, unknown> {
215+
toJSON(): _SchemaRequest {
216216
const obj = super.toJSON();
217-
if (this.enumValues) {
218-
obj['enum'] = this.enumValues;
219-
delete obj.enumValues;
217+
if (this.enum) {
218+
obj['enum'] = this.enum;
220219
}
221-
return obj;
220+
return obj as _SchemaRequest;
222221
}
223222
}
224223

0 commit comments

Comments
 (0)