File tree Expand file tree Collapse file tree 5 files changed +22
-13
lines changed
Expand file tree Collapse file tree 5 files changed +22
-13
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ ' @firebase/vertexai ' : patch
3+ ---
4+
5+ Fix typings for functionDeclaration.parameters.
Original file line number Diff line number Diff line change @@ -211,7 +211,7 @@ export interface FunctionCallPart {
211211export interface FunctionDeclaration {
212212 description: string ;
213213 name: string ;
214- parameters? : ObjectSchemaInterface ;
214+ parameters? : ObjectSchema | ObjectSchemaRequest ;
215215}
216216
217217// @public
@@ -567,9 +567,8 @@ export class ObjectSchema extends Schema {
567567}
568568
569569// @public
570- export interface ObjectSchemaInterface extends SchemaInterface {
571- // (undocumented)
572- optionalProperties? : string [];
570+ export interface ObjectSchemaRequest extends SchemaRequest {
571+ optionalProperties? : never ;
573572 // (undocumented)
574573 type: SchemaType .OBJECT ;
575574}
Original file line number Diff line number Diff line change @@ -21,8 +21,7 @@ import {
2121 SchemaInterface ,
2222 SchemaType ,
2323 SchemaParams ,
24- SchemaRequest ,
25- ObjectSchemaInterface
24+ SchemaRequest
2625} from '../types/schema' ;
2726
2827/**
@@ -286,7 +285,7 @@ export class ObjectSchema extends Schema {
286285 if ( required . length > 0 ) {
287286 obj . required = required ;
288287 }
289- delete ( obj as ObjectSchemaInterface ) . optionalProperties ;
288+ delete obj . optionalProperties ;
290289 return obj as SchemaRequest ;
291290 }
292291}
Original file line number Diff line number Diff line change 1515 * limitations under the License.
1616 */
1717
18- import { TypedSchema } from '../requests/schema-builder' ;
18+ import { ObjectSchema , TypedSchema } from '../requests/schema-builder' ;
1919import { Content , Part } from './content' ;
2020import {
2121 FunctionCallingMode ,
2222 HarmBlockMethod ,
2323 HarmBlockThreshold ,
2424 HarmCategory
2525} from './enums' ;
26- import { ObjectSchemaInterface , SchemaRequest } from './schema' ;
26+ import { ObjectSchemaRequest , SchemaRequest } from './schema' ;
2727
2828/**
2929 * Base parameters for a number of methods.
@@ -175,7 +175,7 @@ export declare interface FunctionDeclaration {
175175 * format. Reflects the Open API 3.03 Parameter Object. Parameter names are
176176 * case-sensitive. For a function with no parameters, this can be left unset.
177177 */
178- parameters ?: ObjectSchemaInterface ;
178+ parameters ?: ObjectSchema | ObjectSchemaRequest ;
179179}
180180
181181/**
Original file line number Diff line number Diff line change @@ -95,10 +95,16 @@ export interface SchemaInterface extends SchemaShared<SchemaInterface> {
9595}
9696
9797/**
98- * Interface for {@link ObjectSchema} class.
98+ * Interface for JSON parameters in {@link SchemaType.OBJECT} format when
99+ * not using the {@link ObjectSchema} helper.
99100 * @public
100101 */
101- export interface ObjectSchemaInterface extends SchemaInterface {
102+ export interface ObjectSchemaRequest extends SchemaRequest {
102103 type : SchemaType . OBJECT ;
103- optionalProperties ?: string [ ] ;
104+ /**
105+ * This is not a property accepted in the final request to the backend, but is
106+ * a client-side convenience property that is only usable by constructing
107+ * a schema through the `Schema.object()` helper method.
108+ */
109+ optionalProperties ?: never ;
104110}
You can’t perform that action at this time.
0 commit comments