Back to Firebase Js Sdk

SchemaShared interface

docs-devsite/ai.schemashared.md

12.12.15.2 KB
Original Source

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 %}

SchemaShared interface

Basic Schema properties shared across several Schema-related types.

<b>Signature:</b>

typescript
export interface SchemaShared<T> 

Properties

PropertyTypeDescription
anyOfT[]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.
descriptionstringOptional. The description of the property.
enumstring[]Optional. The enum of the property.
exampleunknownOptional. The example of the property.
formatstringOptional. 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.
itemsTOptional. The items of the property.
maximumnumberThe maximum value of a numeric type.
maxItemsnumberThe maximum number of items (elements) in a schema of SchemaType <code>array</code>.
minimumnumberThe minimum value of a numeric type.
minItemsnumberThe minimum number of items (elements) in a schema of SchemaType <code>array</code>.
nullablebooleanOptional. Whether the property is nullable.
properties{ [k: string]: T; }Optional. Map of <code>Schema</code> objects.
propertyOrderingstring[]A hint suggesting the order in which the keys should appear in the generated JSON string.
titlestringThe 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.

SchemaShared.anyOf

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>

typescript
anyOf?: T[];

SchemaShared.description

Optional. The description of the property.

<b>Signature:</b>

typescript
description?: string;

SchemaShared.enum

Optional. The enum of the property.

<b>Signature:</b>

typescript
enum?: string[];

SchemaShared.example

Optional. The example of the property.

<b>Signature:</b>

typescript
example?: unknown;

SchemaShared.format

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>

typescript
format?: string;

SchemaShared.items

Optional. The items of the property.

<b>Signature:</b>

typescript
items?: T;

SchemaShared.maximum

The maximum value of a numeric type.

<b>Signature:</b>

typescript
maximum?: number;

SchemaShared.maxItems

The maximum number of items (elements) in a schema of SchemaType array<!-- -->.

<b>Signature:</b>

typescript
maxItems?: number;

SchemaShared.minimum

The minimum value of a numeric type.

<b>Signature:</b>

typescript
minimum?: number;

SchemaShared.minItems

The minimum number of items (elements) in a schema of SchemaType array<!-- -->.

<b>Signature:</b>

typescript
minItems?: number;

SchemaShared.nullable

Optional. Whether the property is nullable.

<b>Signature:</b>

typescript
nullable?: boolean;

SchemaShared.properties

Optional. Map of Schema objects.

<b>Signature:</b>

typescript
properties?: {
        [k: string]: T;
    };

SchemaShared.propertyOrdering

A hint suggesting the order in which the keys should appear in the generated JSON string.

<b>Signature:</b>

typescript
propertyOrdering?: string[];

SchemaShared.title

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>

typescript
title?: string;