diff --git a/.changeset/angry-scissors-sit.md b/.changeset/angry-scissors-sit.md new file mode 100644 index 00000000000..8aeb7dcaf52 --- /dev/null +++ b/.changeset/angry-scissors-sit.md @@ -0,0 +1,6 @@ +--- +'firebase': minor +'@firebase/ai': minor +--- + +Add support for `minItems` and `maxItems` to `Schema`. diff --git a/common/api-review/ai.api.md b/common/api-review/ai.api.md index 523b51d7533..23c13688fb1 100644 --- a/common/api-review/ai.api.md +++ b/common/api-review/ai.api.md @@ -791,6 +791,9 @@ export abstract class Schema implements SchemaInterface { format?: string; // (undocumented) static integer(integerParams?: SchemaParams): IntegerSchema; + items?: SchemaInterface; + maxItems?: number; + minItems?: number; nullable: boolean; // (undocumented) static number(numberParams?: SchemaParams): NumberSchema; @@ -833,7 +836,9 @@ export interface SchemaShared { format?: string; items?: T; maximum?: number; + maxItems?: number; minimum?: number; + minItems?: number; nullable?: boolean; properties?: { [k: string]: T; diff --git a/docs-devsite/ai.schema.md b/docs-devsite/ai.schema.md index b0681b0cdf3..fa1225c91e5 100644 --- a/docs-devsite/ai.schema.md +++ b/docs-devsite/ai.schema.md @@ -32,6 +32,9 @@ export declare abstract class Schema implements SchemaInterface | [description](./ai.schema.md#schemadescription) | | string | Optional. The description of the property. | | [example](./ai.schema.md#schemaexample) | | unknown | Optional. The example of the property. | | [format](./ai.schema.md#schemaformat) | | string | Optional. The format of the property. Supported formats:
| +| [items](./ai.schema.md#schemaitems) | | [SchemaInterface](./ai.schemainterface.md#schemainterface_interface) | Optional. The items of the property. | +| [maxItems](./ai.schema.md#schemamaxitems) | | number | The maximum number of items (elements) in a schema of type [SchemaType.ARRAY](./ai.md#schematypearray_enummember). | +| [minItems](./ai.schema.md#schemaminitems) | | number | The minimum number of items (elements) in a schema of type [SchemaType.ARRAY](./ai.md#schematypearray_enummember). | | [nullable](./ai.schema.md#schemanullable) | | boolean | Optional. Whether the property is nullable. Defaults to false. | | [type](./ai.schema.md#schematype) | | [SchemaType](./ai.md#schematype) | Optional. The type of the property. [SchemaType](./ai.md#schematype). | @@ -93,6 +96,36 @@ Optional. The format of the property. Supported formats: