@firebase/ai 1.4.1-canary.5200f7bb7 → 1.4.1-canary.cb19688bf
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ai-public.d.ts +11 -34
- package/dist/ai.d.ts +11 -37
- package/dist/esm/index.esm.js +2 -40
- package/dist/esm/index.esm.js.map +1 -1
- package/dist/esm/src/requests/schema-builder.d.ts +4 -23
- package/dist/esm/src/types/requests.d.ts +1 -1
- package/dist/esm/src/types/schema.d.ts +6 -12
- package/dist/index.cjs.js +1 -40
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.node.cjs.js +1 -40
- package/dist/index.node.cjs.js.map +1 -1
- package/dist/index.node.mjs +2 -40
- package/dist/index.node.mjs.map +1 -1
- package/dist/src/requests/schema-builder.d.ts +4 -23
- package/dist/src/types/requests.d.ts +1 -1
- package/dist/src/types/schema.d.ts +6 -12
- package/package.json +8 -8
|
@@ -24,11 +24,10 @@ import { SchemaInterface, SchemaType, SchemaParams, SchemaRequest } from '../typ
|
|
|
24
24
|
*/
|
|
25
25
|
export declare abstract class Schema implements SchemaInterface {
|
|
26
26
|
/**
|
|
27
|
-
* Optional. The type of the property.
|
|
28
|
-
*
|
|
29
|
-
* explicit type in the {@link https://swagger.io/docs/specification/v3_0/data-models/data-types/#any-type | OpenAPI specification}.
|
|
27
|
+
* Optional. The type of the property. {@link
|
|
28
|
+
* (SchemaType:type)}.
|
|
30
29
|
*/
|
|
31
|
-
type
|
|
30
|
+
type: SchemaType;
|
|
32
31
|
/** Optional. The format of the property.
|
|
33
32
|
* Supported formats:<br/>
|
|
34
33
|
* <ul>
|
|
@@ -78,15 +77,12 @@ export declare abstract class Schema implements SchemaInterface {
|
|
|
78
77
|
static integer(integerParams?: SchemaParams): IntegerSchema;
|
|
79
78
|
static number(numberParams?: SchemaParams): NumberSchema;
|
|
80
79
|
static boolean(booleanParams?: SchemaParams): BooleanSchema;
|
|
81
|
-
static anyOf(anyOfParams: SchemaParams & {
|
|
82
|
-
anyOf: TypedSchema[];
|
|
83
|
-
}): AnyOfSchema;
|
|
84
80
|
}
|
|
85
81
|
/**
|
|
86
82
|
* A type that includes all specific Schema types.
|
|
87
83
|
* @public
|
|
88
84
|
*/
|
|
89
|
-
export type TypedSchema = IntegerSchema | NumberSchema | StringSchema | BooleanSchema | ObjectSchema | ArraySchema
|
|
85
|
+
export type TypedSchema = IntegerSchema | NumberSchema | StringSchema | BooleanSchema | ObjectSchema | ArraySchema;
|
|
90
86
|
/**
|
|
91
87
|
* Schema class for "integer" types.
|
|
92
88
|
* @public
|
|
@@ -153,18 +149,3 @@ export declare class ObjectSchema extends Schema {
|
|
|
153
149
|
*/
|
|
154
150
|
toJSON(): SchemaRequest;
|
|
155
151
|
}
|
|
156
|
-
/**
|
|
157
|
-
* Schema class representing a value that can conform to any of the provided sub-schemas. This is
|
|
158
|
-
* useful when a field can accept multiple distinct types or structures.
|
|
159
|
-
* @public
|
|
160
|
-
*/
|
|
161
|
-
export declare class AnyOfSchema extends Schema {
|
|
162
|
-
anyOf: TypedSchema[];
|
|
163
|
-
constructor(schemaParams: SchemaParams & {
|
|
164
|
-
anyOf: TypedSchema[];
|
|
165
|
-
});
|
|
166
|
-
/**
|
|
167
|
-
* @internal
|
|
168
|
-
*/
|
|
169
|
-
toJSON(): SchemaRequest;
|
|
170
|
-
}
|
|
@@ -87,7 +87,7 @@ export interface GenerationConfig {
|
|
|
87
87
|
* value can be a class generated with a {@link Schema} static method
|
|
88
88
|
* like `Schema.string()` or `Schema.object()` or it can be a plain
|
|
89
89
|
* JS object matching the {@link SchemaRequest} interface.
|
|
90
|
-
* <br/>Note: This only applies when the specified `
|
|
90
|
+
* <br/>Note: This only applies when the specified `responseMIMEType` supports a schema; currently
|
|
91
91
|
* this is limited to `application/json` and `text/x.enum`.
|
|
92
92
|
*/
|
|
93
93
|
responseSchema?: TypedSchema | SchemaRequest;
|
|
@@ -47,12 +47,6 @@ export type SchemaType = (typeof SchemaType)[keyof typeof SchemaType];
|
|
|
47
47
|
* @public
|
|
48
48
|
*/
|
|
49
49
|
export interface SchemaShared<T> {
|
|
50
|
-
/**
|
|
51
|
-
* An array of {@link Schema}. The generated data must be valid against any of the schemas
|
|
52
|
-
* listed in this array. This allows specifying multiple possible structures or types for a
|
|
53
|
-
* single field.
|
|
54
|
-
*/
|
|
55
|
-
anyOf?: T[];
|
|
56
50
|
/** Optional. The format of the property.
|
|
57
51
|
* When using the Gemini Developer API ({@link GoogleAIBackend}), this must be either `'enum'` or
|
|
58
52
|
* `'date-time'`, otherwise requests will fail.
|
|
@@ -103,10 +97,10 @@ export interface SchemaParams extends SchemaShared<SchemaInterface> {
|
|
|
103
97
|
*/
|
|
104
98
|
export interface SchemaRequest extends SchemaShared<SchemaRequest> {
|
|
105
99
|
/**
|
|
106
|
-
* The type of the property.
|
|
107
|
-
*
|
|
100
|
+
* The type of the property. {@link
|
|
101
|
+
* (SchemaType:type)}.
|
|
108
102
|
*/
|
|
109
|
-
type
|
|
103
|
+
type: SchemaType;
|
|
110
104
|
/** Optional. Array of required property. */
|
|
111
105
|
required?: string[];
|
|
112
106
|
}
|
|
@@ -116,10 +110,10 @@ export interface SchemaRequest extends SchemaShared<SchemaRequest> {
|
|
|
116
110
|
*/
|
|
117
111
|
export interface SchemaInterface extends SchemaShared<SchemaInterface> {
|
|
118
112
|
/**
|
|
119
|
-
* The type of the property.
|
|
120
|
-
*
|
|
113
|
+
* The type of the property. {@link
|
|
114
|
+
* (SchemaType:type)}.
|
|
121
115
|
*/
|
|
122
|
-
type
|
|
116
|
+
type: SchemaType;
|
|
123
117
|
}
|
|
124
118
|
/**
|
|
125
119
|
* Interface for JSON parameters in a schema of {@link SchemaType}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@firebase/ai",
|
|
3
|
-
"version": "1.4.1-canary.
|
|
3
|
+
"version": "1.4.1-canary.cb19688bf",
|
|
4
4
|
"description": "The Firebase AI SDK",
|
|
5
5
|
"author": "Firebase <firebase-support@google.com> (https://firebase.google.com/)",
|
|
6
6
|
"engines": {
|
|
@@ -45,19 +45,19 @@
|
|
|
45
45
|
"trusted-type-check": "tsec -p tsconfig.json --noEmit"
|
|
46
46
|
},
|
|
47
47
|
"peerDependencies": {
|
|
48
|
-
"@firebase/app": "0.13.2-canary.
|
|
49
|
-
"@firebase/app-types": "0.9.3-canary.
|
|
48
|
+
"@firebase/app": "0.13.2-canary.cb19688bf",
|
|
49
|
+
"@firebase/app-types": "0.9.3-canary.cb19688bf"
|
|
50
50
|
},
|
|
51
51
|
"dependencies": {
|
|
52
|
-
"@firebase/app-check-interop-types": "0.3.3-canary.
|
|
53
|
-
"@firebase/component": "0.6.18-canary.
|
|
54
|
-
"@firebase/logger": "0.4.4-canary.
|
|
55
|
-
"@firebase/util": "1.12.1-canary.
|
|
52
|
+
"@firebase/app-check-interop-types": "0.3.3-canary.cb19688bf",
|
|
53
|
+
"@firebase/component": "0.6.18-canary.cb19688bf",
|
|
54
|
+
"@firebase/logger": "0.4.4-canary.cb19688bf",
|
|
55
|
+
"@firebase/util": "1.12.1-canary.cb19688bf",
|
|
56
56
|
"tslib": "^2.1.0"
|
|
57
57
|
},
|
|
58
58
|
"license": "Apache-2.0",
|
|
59
59
|
"devDependencies": {
|
|
60
|
-
"@firebase/app": "0.13.2-canary.
|
|
60
|
+
"@firebase/app": "0.13.2-canary.cb19688bf",
|
|
61
61
|
"@rollup/plugin-json": "6.1.0",
|
|
62
62
|
"rollup": "2.79.2",
|
|
63
63
|
"rollup-plugin-replace": "2.2.0",
|