@firebase/ai 1.3.0 → 1.4.0

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.
@@ -75,7 +75,7 @@ declare const enum AIErrorCode {
75
75
  INVALID_SCHEMA = "invalid-schema",
76
76
  /** An error occurred due to a missing Firebase API key. */
77
77
  NO_API_KEY = "no-api-key",
78
- /** An error occured due to a missing Firebase app ID. */
78
+ /** An error occurred due to a missing Firebase app ID. */
79
79
  NO_APP_ID = "no-app-id",
80
80
  /** An error occurred due to a model name not being specified during initialization. */
81
81
  NO_MODEL = "no-model",
@@ -83,7 +83,7 @@ declare const enum AIErrorCode {
83
83
  NO_PROJECT_ID = "no-project-id",
84
84
  /** An error occurred while parsing. */
85
85
  PARSE_FAILED = "parse-failed",
86
- /** An error occured due an attempt to use an unsupported feature. */
86
+ /** An error occurred due an attempt to use an unsupported feature. */
87
87
  UNSUPPORTED = "unsupported"
88
88
  }
89
89
  export { AIErrorCode }
@@ -918,7 +918,12 @@ export declare enum HarmBlockThreshold {
918
918
  /**
919
919
  * All content will be allowed.
920
920
  */
921
- BLOCK_NONE = "BLOCK_NONE"
921
+ BLOCK_NONE = "BLOCK_NONE",
922
+ /**
923
+ * All content will be allowed. This is the same as `BLOCK_NONE`, but the metadata corresponding
924
+ * to the {@link HarmCategory} will not be present in the response.
925
+ */
926
+ OFF = "OFF"
922
927
  }
923
928
 
924
929
  /**
@@ -1674,6 +1679,12 @@ export declare abstract class Schema implements SchemaInterface {
1674
1679
  format?: string;
1675
1680
  /** Optional. The description of the property. */
1676
1681
  description?: string;
1682
+ /** Optional. The items of the property. */
1683
+ items?: SchemaInterface;
1684
+ /** The minimum number of items (elements) in a schema of type {@link SchemaType.ARRAY}. */
1685
+ minItems?: number;
1686
+ /** The maximum number of items (elements) in a schema of type {@link SchemaType.ARRAY}. */
1687
+ maxItems?: number;
1677
1688
  /** Optional. Whether the property is nullable. Defaults to false. */
1678
1689
  nullable: boolean;
1679
1690
  /** Optional. The example of the property. */
@@ -1750,18 +1761,34 @@ export declare interface SchemaShared<T> {
1750
1761
  format?: string;
1751
1762
  /** Optional. The description of the property. */
1752
1763
  description?: string;
1764
+ /**
1765
+ * The title of the property. This helps document the schema's purpose but does not typically
1766
+ * constrain the generated value. It can subtly guide the model by clarifying the intent of a
1767
+ * field.
1768
+ */
1769
+ title?: string;
1753
1770
  /** Optional. The items of the property. */
1754
1771
  items?: T;
1772
+ /** The minimum number of items (elements) in a schema of type {@link SchemaType.ARRAY}. */
1773
+ minItems?: number;
1774
+ /** The maximum number of items (elements) in a schema of type {@link SchemaType.ARRAY}. */
1775
+ maxItems?: number;
1755
1776
  /** Optional. Map of `Schema` objects. */
1756
1777
  properties?: {
1757
1778
  [k: string]: T;
1758
1779
  };
1780
+ /** A hint suggesting the order in which the keys should appear in the generated JSON string. */
1781
+ propertyOrdering?: string[];
1759
1782
  /** Optional. The enum of the property. */
1760
1783
  enum?: string[];
1761
1784
  /** Optional. The example of the property. */
1762
1785
  example?: unknown;
1763
1786
  /** Optional. Whether the property is nullable. */
1764
1787
  nullable?: boolean;
1788
+ /** The minimum value of a numeric type. */
1789
+ minimum?: number;
1790
+ /** The maximum value of a numeric type. */
1791
+ maximum?: number;
1765
1792
  [key: string]: unknown;
1766
1793
  }
1767
1794
 
package/dist/ai.d.ts CHANGED
@@ -75,7 +75,7 @@ declare const enum AIErrorCode {
75
75
  INVALID_SCHEMA = "invalid-schema",
76
76
  /** An error occurred due to a missing Firebase API key. */
77
77
  NO_API_KEY = "no-api-key",
78
- /** An error occured due to a missing Firebase app ID. */
78
+ /** An error occurred due to a missing Firebase app ID. */
79
79
  NO_APP_ID = "no-app-id",
80
80
  /** An error occurred due to a model name not being specified during initialization. */
81
81
  NO_MODEL = "no-model",
@@ -83,7 +83,7 @@ declare const enum AIErrorCode {
83
83
  NO_PROJECT_ID = "no-project-id",
84
84
  /** An error occurred while parsing. */
85
85
  PARSE_FAILED = "parse-failed",
86
- /** An error occured due an attempt to use an unsupported feature. */
86
+ /** An error occurred due an attempt to use an unsupported feature. */
87
87
  UNSUPPORTED = "unsupported"
88
88
  }
89
89
  export { AIErrorCode }
@@ -989,7 +989,12 @@ export declare enum HarmBlockThreshold {
989
989
  /**
990
990
  * All content will be allowed.
991
991
  */
992
- BLOCK_NONE = "BLOCK_NONE"
992
+ BLOCK_NONE = "BLOCK_NONE",
993
+ /**
994
+ * All content will be allowed. This is the same as `BLOCK_NONE`, but the metadata corresponding
995
+ * to the {@link HarmCategory} will not be present in the response.
996
+ */
997
+ OFF = "OFF"
993
998
  }
994
999
 
995
1000
  /**
@@ -1767,6 +1772,12 @@ export declare abstract class Schema implements SchemaInterface {
1767
1772
  format?: string;
1768
1773
  /** Optional. The description of the property. */
1769
1774
  description?: string;
1775
+ /** Optional. The items of the property. */
1776
+ items?: SchemaInterface;
1777
+ /** The minimum number of items (elements) in a schema of type {@link SchemaType.ARRAY}. */
1778
+ minItems?: number;
1779
+ /** The maximum number of items (elements) in a schema of type {@link SchemaType.ARRAY}. */
1780
+ maxItems?: number;
1770
1781
  /** Optional. Whether the property is nullable. Defaults to false. */
1771
1782
  nullable: boolean;
1772
1783
  /** Optional. The example of the property. */
@@ -1848,18 +1859,34 @@ export declare interface SchemaShared<T> {
1848
1859
  format?: string;
1849
1860
  /** Optional. The description of the property. */
1850
1861
  description?: string;
1862
+ /**
1863
+ * The title of the property. This helps document the schema's purpose but does not typically
1864
+ * constrain the generated value. It can subtly guide the model by clarifying the intent of a
1865
+ * field.
1866
+ */
1867
+ title?: string;
1851
1868
  /** Optional. The items of the property. */
1852
1869
  items?: T;
1870
+ /** The minimum number of items (elements) in a schema of type {@link SchemaType.ARRAY}. */
1871
+ minItems?: number;
1872
+ /** The maximum number of items (elements) in a schema of type {@link SchemaType.ARRAY}. */
1873
+ maxItems?: number;
1853
1874
  /** Optional. Map of `Schema` objects. */
1854
1875
  properties?: {
1855
1876
  [k: string]: T;
1856
1877
  };
1878
+ /** A hint suggesting the order in which the keys should appear in the generated JSON string. */
1879
+ propertyOrdering?: string[];
1857
1880
  /** Optional. The enum of the property. */
1858
1881
  enum?: string[];
1859
1882
  /** Optional. The example of the property. */
1860
1883
  example?: unknown;
1861
1884
  /** Optional. Whether the property is nullable. */
1862
1885
  nullable?: boolean;
1886
+ /** The minimum value of a numeric type. */
1887
+ minimum?: number;
1888
+ /** The maximum value of a numeric type. */
1889
+ maximum?: number;
1863
1890
  [key: string]: unknown;
1864
1891
  }
1865
1892
 
@@ -5,7 +5,7 @@ import { Logger } from '@firebase/logger';
5
5
  import { __asyncGenerator, __await } from 'tslib';
6
6
 
7
7
  var name = "@firebase/ai";
8
- var version = "1.3.0";
8
+ var version = "1.4.0";
9
9
 
10
10
  /**
11
11
  * @license
@@ -85,6 +85,11 @@ var HarmBlockThreshold;
85
85
  * All content will be allowed.
86
86
  */
87
87
  HarmBlockThreshold["BLOCK_NONE"] = "BLOCK_NONE";
88
+ /**
89
+ * All content will be allowed. This is the same as `BLOCK_NONE`, but the metadata corresponding
90
+ * to the {@link HarmCategory} will not be present in the response.
91
+ */
92
+ HarmBlockThreshold["OFF"] = "OFF";
88
93
  })(HarmBlockThreshold || (HarmBlockThreshold = {}));
89
94
  /**
90
95
  * This property is not supported in the Gemini Developer API ({@link GoogleAIBackend}).