Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .changeset/tricky-years-pump.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'firebase': minor
'@firebase/ai': minor
---

Add `title`, `maximum`, `minimum`, `propertyOrdering` to Schema builder
4 changes: 4 additions & 0 deletions common/api-review/ai.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -831,10 +831,14 @@ export interface SchemaShared<T> {
example?: unknown;
format?: string;
items?: T;
maximum?: number;
minimum?: number;
nullable?: boolean;
properties?: {
[k: string]: T;
};
propertyOrdering?: string[];
title?: string;
}

// @public
Expand Down
44 changes: 44 additions & 0 deletions docs-devsite/ai.schemashared.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,12 @@ export interface SchemaShared<T>
| [example](./ai.schemashared.md#schemasharedexample) | unknown | Optional. The example of the property. |
| [format](./ai.schemashared.md#schemasharedformat) | string | Optional. The format of the property. When using the Gemini Developer API ([GoogleAIBackend](./ai.googleaibackend.md#googleaibackend_class)<!-- -->), this must be either <code>'enum'</code> or <code>'date-time'</code>, otherwise requests will fail. |
| [items](./ai.schemashared.md#schemashareditems) | T | Optional. The items of the property. |
| [maximum](./ai.schemashared.md#schemasharedmaximum) | number | The maximum value of a numeric type. |
| [minimum](./ai.schemashared.md#schemasharedminimum) | number | The minimum value of a numeric type. |
| [nullable](./ai.schemashared.md#schemasharednullable) | boolean | Optional. Whether the property is nullable. |
| [properties](./ai.schemashared.md#schemasharedproperties) | { \[k: string\]: T; } | Optional. Map of <code>Schema</code> objects. |
| [propertyOrdering](./ai.schemashared.md#schemasharedpropertyordering) | string\[\] | A hint to the gemini model, suggesting the order in which the keys should appear in the generated JSON string. |
| [title](./ai.schemashared.md#schemasharedtitle) | 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. |

## SchemaShared.description

Expand Down Expand Up @@ -80,6 +84,26 @@ Optional. The items of the property.
items?: T;
```

## SchemaShared.maximum

The maximum value of a numeric type.

<b>Signature:</b>

```typescript
maximum?: number;
```

## SchemaShared.minimum

The minimum value of a numeric type.

<b>Signature:</b>

```typescript
minimum?: number;
```

## SchemaShared.nullable

Optional. Whether the property is nullable.
Expand All @@ -101,3 +125,23 @@ properties?: {
[k: string]: T;
};
```

## SchemaShared.propertyOrdering

A hint to the gemini model, 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;
```
Loading
Loading