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 @@ -280,7 +280,7 @@ export interface FunctionCallPart {
280
280
export interface FunctionDeclaration {
281
281
description: string ;
282
282
name: string ;
283
- parameters? : ObjectSchemaInterface ;
283
+ parameters? : ObjectSchema | ObjectSchemaRequest ;
284
284
}
285
285
286
286
// @public
@@ -701,9 +701,8 @@ export class ObjectSchema extends Schema {
701
701
}
702
702
703
703
// @public
704
- export interface ObjectSchemaInterface extends SchemaInterface {
705
- // (undocumented)
706
- optionalProperties? : string [];
704
+ export interface ObjectSchemaRequest extends SchemaRequest {
705
+ optionalProperties? : never ;
707
706
// (undocumented)
708
707
type: SchemaType .OBJECT ;
709
708
}
Original file line number Diff line number Diff line change @@ -21,8 +21,7 @@ import {
21
21
SchemaInterface ,
22
22
SchemaType ,
23
23
SchemaParams ,
24
- SchemaRequest ,
25
- ObjectSchemaInterface
24
+ SchemaRequest
26
25
} from '../types/schema' ;
27
26
28
27
/**
@@ -292,7 +291,7 @@ export class ObjectSchema extends Schema {
292
291
if ( required . length > 0 ) {
293
292
obj . required = required ;
294
293
}
295
- delete ( obj as ObjectSchemaInterface ) . optionalProperties ;
294
+ delete obj . optionalProperties ;
296
295
return obj as SchemaRequest ;
297
296
}
298
297
}
Original file line number Diff line number Diff line change 15
15
* limitations under the License.
16
16
*/
17
17
18
- import { TypedSchema } from '../requests/schema-builder' ;
18
+ import { ObjectSchema , TypedSchema } from '../requests/schema-builder' ;
19
19
import { Content , Part } from './content' ;
20
20
import {
21
21
FunctionCallingMode ,
@@ -24,7 +24,7 @@ import {
24
24
HarmCategory ,
25
25
ResponseModality
26
26
} from './enums' ;
27
- import { ObjectSchemaInterface , SchemaRequest } from './schema' ;
27
+ import { ObjectSchemaRequest , SchemaRequest } from './schema' ;
28
28
29
29
/**
30
30
* Base parameters for a number of methods.
@@ -193,7 +193,7 @@ export declare interface FunctionDeclaration {
193
193
* format. Reflects the Open API 3.03 Parameter Object. Parameter names are
194
194
* case-sensitive. For a function with no parameters, this can be left unset.
195
195
*/
196
- parameters ?: ObjectSchemaInterface ;
196
+ parameters ?: ObjectSchema | ObjectSchemaRequest ;
197
197
}
198
198
199
199
/**
Original file line number Diff line number Diff line change @@ -114,10 +114,16 @@ export interface SchemaInterface extends SchemaShared<SchemaInterface> {
114
114
}
115
115
116
116
/**
117
- * Interface for {@link ObjectSchema} class.
117
+ * Interface for JSON parameters in {@link SchemaType.OBJECT} format when
118
+ * not using the {@link ObjectSchema} helper.
118
119
* @public
119
120
*/
120
- export interface ObjectSchemaInterface extends SchemaInterface {
121
+ export interface ObjectSchemaRequest extends SchemaRequest {
121
122
type : SchemaType . OBJECT ;
122
- optionalProperties ?: string [ ] ;
123
+ /**
124
+ * This is not a property accepted in the final request to the backend, but is
125
+ * a client-side convenience property that is only usable by constructing
126
+ * a schema through the `Schema.object()` helper method.
127
+ */
128
+ optionalProperties ?: never ;
123
129
}
You can’t perform that action at this time.
0 commit comments