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 {
211
211
export interface FunctionDeclaration {
212
212
description: string ;
213
213
name: string ;
214
- parameters? : ObjectSchemaInterface ;
214
+ parameters? : ObjectSchema | ObjectSchemaRequest ;
215
215
}
216
216
217
217
// @public
@@ -567,9 +567,8 @@ export class ObjectSchema extends Schema {
567
567
}
568
568
569
569
// @public
570
- export interface ObjectSchemaInterface extends SchemaInterface {
571
- // (undocumented)
572
- optionalProperties? : string [];
570
+ export interface ObjectSchemaRequest extends SchemaRequest {
571
+ optionalProperties? : never ;
573
572
// (undocumented)
574
573
type: SchemaType .OBJECT ;
575
574
}
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
/**
@@ -286,7 +285,7 @@ export class ObjectSchema extends Schema {
286
285
if ( required . length > 0 ) {
287
286
obj . required = required ;
288
287
}
289
- delete ( obj as ObjectSchemaInterface ) . optionalProperties ;
288
+ delete obj . optionalProperties ;
290
289
return obj as SchemaRequest ;
291
290
}
292
291
}
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 ,
22
22
HarmBlockMethod ,
23
23
HarmBlockThreshold ,
24
24
HarmCategory
25
25
} from './enums' ;
26
- import { ObjectSchemaInterface , SchemaRequest } from './schema' ;
26
+ import { ObjectSchemaRequest , SchemaRequest } from './schema' ;
27
27
28
28
/**
29
29
* Base parameters for a number of methods.
@@ -175,7 +175,7 @@ export declare interface FunctionDeclaration {
175
175
* format. Reflects the Open API 3.03 Parameter Object. Parameter names are
176
176
* case-sensitive. For a function with no parameters, this can be left unset.
177
177
*/
178
- parameters ?: ObjectSchemaInterface ;
178
+ parameters ?: ObjectSchema | ObjectSchemaRequest ;
179
179
}
180
180
181
181
/**
Original file line number Diff line number Diff line change @@ -95,10 +95,16 @@ export interface SchemaInterface extends SchemaShared<SchemaInterface> {
95
95
}
96
96
97
97
/**
98
- * Interface for {@link ObjectSchema} class.
98
+ * Interface for JSON parameters in {@link SchemaType.OBJECT} format when
99
+ * not using the {@link ObjectSchema} helper.
99
100
* @public
100
101
*/
101
- export interface ObjectSchemaInterface extends SchemaInterface {
102
+ export interface ObjectSchemaRequest extends SchemaRequest {
102
103
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 ;
104
110
}
You can’t perform that action at this time.
0 commit comments