docs-devsite/ai.schemashared.md
Project: /docs/reference/js/_project.yaml Book: /docs/reference/_book.yaml page_type: reference
{% comment %} DO NOT EDIT THIS FILE! This is generated by the JS SDK team, and any local changes will be overwritten. Changes should be made in the source code at https://github.com/firebase/firebase-js-sdk {% endcomment %}
Basic Schema properties shared across several Schema-related types.
<b>Signature:</b>
export interface SchemaShared<T>
| Property | Type | Description |
|---|---|---|
| anyOf | T[] | An array of Schema<!-- -->. The generated data must be valid against any of the schemas listed in this array. This allows specifying multiple possible structures or types for a single field. |
| description | string | Optional. The description of the property. |
| enum | string[] | Optional. The enum of the property. |
| example | unknown | Optional. The example of the property. |
| format | string | Optional. The format of the property. When using the Gemini Developer API (GoogleAIBackend<!-- -->), this must be either <code>'enum'</code> or <code>'date-time'</code>, otherwise requests will fail. |
| items | T | Optional. The items of the property. |
| maximum | number | The maximum value of a numeric type. |
| maxItems | number | The maximum number of items (elements) in a schema of SchemaType <code>array</code>. |
| minimum | number | The minimum value of a numeric type. |
| minItems | number | The minimum number of items (elements) in a schema of SchemaType <code>array</code>. |
| nullable | boolean | Optional. Whether the property is nullable. |
| properties | { [k: string]: T; } | Optional. Map of <code>Schema</code> objects. |
| propertyOrdering | string[] | A hint suggesting the order in which the keys should appear in the generated JSON string. |
| title | string | The title of the property. This helps document the schema's purpose but does not typically constrain the generated value. It can subtly guide the model by clarifying the intent of a field. |
An array of Schema<!-- -->. The generated data must be valid against any of the schemas listed in this array. This allows specifying multiple possible structures or types for a single field.
<b>Signature:</b>
anyOf?: T[];
Optional. The description of the property.
<b>Signature:</b>
description?: string;
Optional. The enum of the property.
<b>Signature:</b>
enum?: string[];
Optional. The example of the property.
<b>Signature:</b>
example?: unknown;
Optional. The format of the property. When using the Gemini Developer API (GoogleAIBackend<!-- -->), this must be either 'enum' or 'date-time'<!-- -->, otherwise requests will fail.
<b>Signature:</b>
format?: string;
Optional. The items of the property.
<b>Signature:</b>
items?: T;
The maximum value of a numeric type.
<b>Signature:</b>
maximum?: number;
The maximum number of items (elements) in a schema of SchemaType array<!-- -->.
<b>Signature:</b>
maxItems?: number;
The minimum value of a numeric type.
<b>Signature:</b>
minimum?: number;
The minimum number of items (elements) in a schema of SchemaType array<!-- -->.
<b>Signature:</b>
minItems?: number;
Optional. Whether the property is nullable.
<b>Signature:</b>
nullable?: boolean;
Optional. Map of Schema objects.
<b>Signature:</b>
properties?: {
[k: string]: T;
};
A hint suggesting the order in which the keys should appear in the generated JSON string.
<b>Signature:</b>
propertyOrdering?: string[];
The title of the property. This helps document the schema's purpose but does not typically constrain the generated value. It can subtly guide the model by clarifying the intent of a field.
<b>Signature:</b>
title?: string;