@google/generative-ai
Advanced tools
Comparing version 0.16.0 to 0.17.0
# @google/generative-ai | ||
## 0.17.0 | ||
### Minor Changes | ||
- 3b5daae: Fix `Schema` type to reference itself and not a derived type in its `items` array and `properties` map. | ||
## 0.16.0 | ||
@@ -4,0 +10,0 @@ |
@@ -99,4 +99,4 @@ /** | ||
* Fields set in the optional {@link SingleRequestOptions} parameter will | ||
* take precedence over the {@link RequestOptions} values provided at the | ||
* time of the {@link GoogleAIFileManager} initialization. | ||
* take precedence over the {@link RequestOptions} values provided to | ||
* {@link GoogleGenerativeAI.getGenerativeModel }. | ||
*/ | ||
@@ -110,4 +110,4 @@ sendMessage(request: string | Array<string | Part>, requestOptions?: SingleRequestOptions): Promise<GenerateContentResult>; | ||
* Fields set in the optional {@link SingleRequestOptions} parameter will | ||
* take precedence over the {@link RequestOptions} values provided at the | ||
* time of the {@link GoogleAIFileManager} initialization. | ||
* take precedence over the {@link RequestOptions} values provided to | ||
* {@link GoogleGenerativeAI.getGenerativeModel }. | ||
*/ | ||
@@ -454,3 +454,3 @@ sendMessageStream(request: string | Array<string | Part>, requestOptions?: SingleRequestOptions): Promise<GenerateContentStreamResult>; | ||
/** The type of the parameter. */ | ||
type: FunctionDeclarationSchemaType; | ||
type: SchemaType; | ||
/** The format of the parameter. */ | ||
@@ -474,22 +474,2 @@ properties: { | ||
/** | ||
* Contains the list of OpenAPI data types | ||
* as defined by https://swagger.io/docs/specification/data-models/data-types/ | ||
* @public | ||
*/ | ||
export declare enum FunctionDeclarationSchemaType { | ||
/** String type. */ | ||
STRING = "STRING", | ||
/** Number type. */ | ||
NUMBER = "NUMBER", | ||
/** Integer type. */ | ||
INTEGER = "INTEGER", | ||
/** Boolean type. */ | ||
BOOLEAN = "BOOLEAN", | ||
/** Array type. */ | ||
ARRAY = "ARRAY", | ||
/** Object type. */ | ||
OBJECT = "OBJECT" | ||
} | ||
/** | ||
* A FunctionDeclarationsTool is a piece of code that enables the system to | ||
@@ -675,4 +655,4 @@ * interact with external systems to perform an action, or set of actions, | ||
* Fields set in the optional {@link SingleRequestOptions} parameter will | ||
* take precedence over the {@link RequestOptions} values provided at the | ||
* time of the {@link GoogleAIFileManager} initialization. | ||
* take precedence over the {@link RequestOptions} values provided to | ||
* {@link GoogleGenerativeAI.getGenerativeModel }. | ||
*/ | ||
@@ -687,4 +667,4 @@ generateContent(request: GenerateContentRequest | string | Array<string | Part>, requestOptions?: SingleRequestOptions): Promise<GenerateContentResult>; | ||
* Fields set in the optional {@link SingleRequestOptions} parameter will | ||
* take precedence over the {@link RequestOptions} values provided at the | ||
* time of the {@link GoogleAIFileManager} initialization. | ||
* take precedence over the {@link RequestOptions} values provided to | ||
* {@link GoogleGenerativeAI.getGenerativeModel }. | ||
*/ | ||
@@ -701,4 +681,4 @@ generateContentStream(request: GenerateContentRequest | string | Array<string | Part>, requestOptions?: SingleRequestOptions): Promise<GenerateContentStreamResult>; | ||
* Fields set in the optional {@link SingleRequestOptions} parameter will | ||
* take precedence over the {@link RequestOptions} values provided at the | ||
* time of the {@link GoogleAIFileManager} initialization. | ||
* take precedence over the {@link RequestOptions} values provided to | ||
* {@link GoogleGenerativeAI.getGenerativeModel }. | ||
*/ | ||
@@ -710,4 +690,4 @@ countTokens(request: CountTokensRequest | string | Array<string | Part>, requestOptions?: SingleRequestOptions): Promise<CountTokensResponse>; | ||
* Fields set in the optional {@link SingleRequestOptions} parameter will | ||
* take precedence over the {@link RequestOptions} values provided at the | ||
* time of the {@link GoogleAIFileManager} initialization. | ||
* take precedence over the {@link RequestOptions} values provided to | ||
* {@link GoogleGenerativeAI.getGenerativeModel }. | ||
*/ | ||
@@ -719,4 +699,4 @@ embedContent(request: EmbedContentRequest | string | Array<string | Part>, requestOptions?: SingleRequestOptions): Promise<EmbedContentResponse>; | ||
* Fields set in the optional {@link SingleRequestOptions} parameter will | ||
* take precedence over the {@link RequestOptions} values provided at the | ||
* time of the {@link GoogleAIFileManager} initialization. | ||
* take precedence over the {@link RequestOptions} values provided to | ||
* {@link GoogleGenerativeAI.getGenerativeModel }. | ||
*/ | ||
@@ -953,5 +933,5 @@ batchEmbedContents(batchEmbedContentRequest: BatchEmbedContentsRequest, requestOptions?: SingleRequestOptions): Promise<BatchEmbedContentsResponse>; | ||
* Optional. The type of the property. {@link | ||
* FunctionDeclarationSchemaType}. | ||
* SchemaType}. | ||
*/ | ||
type?: FunctionDeclarationSchemaType; | ||
type?: SchemaType; | ||
/** Optional. The format of the property. */ | ||
@@ -963,9 +943,9 @@ format?: string; | ||
nullable?: boolean; | ||
/** Optional. The items of the property. {@link FunctionDeclarationSchema} */ | ||
items?: FunctionDeclarationSchema; | ||
/** Optional. The items of the property. */ | ||
items?: Schema; | ||
/** Optional. The enum of the property. */ | ||
enum?: string[]; | ||
/** Optional. Map of {@link FunctionDeclarationSchema}. */ | ||
/** Optional. Map of {@link Schema}. */ | ||
properties?: { | ||
[k: string]: FunctionDeclarationSchema; | ||
[k: string]: Schema; | ||
}; | ||
@@ -979,2 +959,22 @@ /** Optional. Array of required property. */ | ||
/** | ||
* Contains the list of OpenAPI data types | ||
* as defined by https://swagger.io/docs/specification/data-models/data-types/ | ||
* @public | ||
*/ | ||
export declare enum SchemaType { | ||
/** String type. */ | ||
STRING = "STRING", | ||
/** Number type. */ | ||
NUMBER = "NUMBER", | ||
/** Integer type. */ | ||
INTEGER = "INTEGER", | ||
/** Boolean type. */ | ||
BOOLEAN = "BOOLEAN", | ||
/** Array type. */ | ||
ARRAY = "ARRAY", | ||
/** Object type. */ | ||
OBJECT = "OBJECT" | ||
} | ||
/** | ||
* Params passed to atomic asynchronous operations. | ||
@@ -981,0 +981,0 @@ * @public |
@@ -8,17 +8,17 @@ 'use strict'; | ||
*/ | ||
exports.FunctionDeclarationSchemaType = void 0; | ||
(function (FunctionDeclarationSchemaType) { | ||
exports.SchemaType = void 0; | ||
(function (SchemaType) { | ||
/** String type. */ | ||
FunctionDeclarationSchemaType["STRING"] = "STRING"; | ||
SchemaType["STRING"] = "STRING"; | ||
/** Number type. */ | ||
FunctionDeclarationSchemaType["NUMBER"] = "NUMBER"; | ||
SchemaType["NUMBER"] = "NUMBER"; | ||
/** Integer type. */ | ||
FunctionDeclarationSchemaType["INTEGER"] = "INTEGER"; | ||
SchemaType["INTEGER"] = "INTEGER"; | ||
/** Boolean type. */ | ||
FunctionDeclarationSchemaType["BOOLEAN"] = "BOOLEAN"; | ||
SchemaType["BOOLEAN"] = "BOOLEAN"; | ||
/** Array type. */ | ||
FunctionDeclarationSchemaType["ARRAY"] = "ARRAY"; | ||
SchemaType["ARRAY"] = "ARRAY"; | ||
/** Object type. */ | ||
FunctionDeclarationSchemaType["OBJECT"] = "OBJECT"; | ||
})(exports.FunctionDeclarationSchemaType || (exports.FunctionDeclarationSchemaType = {})); | ||
SchemaType["OBJECT"] = "OBJECT"; | ||
})(exports.SchemaType || (exports.SchemaType = {})); | ||
@@ -287,3 +287,3 @@ /** | ||
*/ | ||
const PACKAGE_VERSION = "0.16.0"; | ||
const PACKAGE_VERSION = "0.17.0"; | ||
const PACKAGE_LOG_HEADER = "genai-js"; | ||
@@ -1092,4 +1092,4 @@ var Task; | ||
* Fields set in the optional {@link SingleRequestOptions} parameter will | ||
* take precedence over the {@link RequestOptions} values provided at the | ||
* time of the {@link GoogleAIFileManager} initialization. | ||
* take precedence over the {@link RequestOptions} values provided to | ||
* {@link GoogleGenerativeAI.getGenerativeModel }. | ||
*/ | ||
@@ -1141,4 +1141,4 @@ async sendMessage(request, requestOptions = {}) { | ||
* Fields set in the optional {@link SingleRequestOptions} parameter will | ||
* take precedence over the {@link RequestOptions} values provided at the | ||
* time of the {@link GoogleAIFileManager} initialization. | ||
* take precedence over the {@link RequestOptions} values provided to | ||
* {@link GoogleGenerativeAI.getGenerativeModel }. | ||
*/ | ||
@@ -1293,4 +1293,4 @@ async sendMessageStream(request, requestOptions = {}) { | ||
* Fields set in the optional {@link SingleRequestOptions} parameter will | ||
* take precedence over the {@link RequestOptions} values provided at the | ||
* time of the {@link GoogleAIFileManager} initialization. | ||
* take precedence over the {@link RequestOptions} values provided to | ||
* {@link GoogleGenerativeAI.getGenerativeModel }. | ||
*/ | ||
@@ -1310,4 +1310,4 @@ async generateContent(request, requestOptions = {}) { | ||
* Fields set in the optional {@link SingleRequestOptions} parameter will | ||
* take precedence over the {@link RequestOptions} values provided at the | ||
* time of the {@link GoogleAIFileManager} initialization. | ||
* take precedence over the {@link RequestOptions} values provided to | ||
* {@link GoogleGenerativeAI.getGenerativeModel }. | ||
*/ | ||
@@ -1332,4 +1332,4 @@ async generateContentStream(request, requestOptions = {}) { | ||
* Fields set in the optional {@link SingleRequestOptions} parameter will | ||
* take precedence over the {@link RequestOptions} values provided at the | ||
* time of the {@link GoogleAIFileManager} initialization. | ||
* take precedence over the {@link RequestOptions} values provided to | ||
* {@link GoogleGenerativeAI.getGenerativeModel }. | ||
*/ | ||
@@ -1353,4 +1353,4 @@ async countTokens(request, requestOptions = {}) { | ||
* Fields set in the optional {@link SingleRequestOptions} parameter will | ||
* take precedence over the {@link RequestOptions} values provided at the | ||
* time of the {@link GoogleAIFileManager} initialization. | ||
* take precedence over the {@link RequestOptions} values provided to | ||
* {@link GoogleGenerativeAI.getGenerativeModel }. | ||
*/ | ||
@@ -1366,4 +1366,4 @@ async embedContent(request, requestOptions = {}) { | ||
* Fields set in the optional {@link SingleRequestOptions} parameter will | ||
* take precedence over the {@link RequestOptions} values provided at the | ||
* time of the {@link GoogleAIFileManager} initialization. | ||
* take precedence over the {@link RequestOptions} values provided to | ||
* {@link GoogleGenerativeAI.getGenerativeModel }. | ||
*/ | ||
@@ -1370,0 +1370,0 @@ async batchEmbedContents(batchEmbedContentRequest, requestOptions = {}) { |
@@ -72,3 +72,3 @@ 'use strict'; | ||
*/ | ||
const PACKAGE_VERSION = "0.16.0"; | ||
const PACKAGE_VERSION = "0.17.0"; | ||
const PACKAGE_LOG_HEADER = "genai-js"; | ||
@@ -586,17 +586,17 @@ var Task; | ||
*/ | ||
exports.FunctionDeclarationSchemaType = void 0; | ||
(function (FunctionDeclarationSchemaType) { | ||
exports.SchemaType = void 0; | ||
(function (SchemaType) { | ||
/** String type. */ | ||
FunctionDeclarationSchemaType["STRING"] = "STRING"; | ||
SchemaType["STRING"] = "STRING"; | ||
/** Number type. */ | ||
FunctionDeclarationSchemaType["NUMBER"] = "NUMBER"; | ||
SchemaType["NUMBER"] = "NUMBER"; | ||
/** Integer type. */ | ||
FunctionDeclarationSchemaType["INTEGER"] = "INTEGER"; | ||
SchemaType["INTEGER"] = "INTEGER"; | ||
/** Boolean type. */ | ||
FunctionDeclarationSchemaType["BOOLEAN"] = "BOOLEAN"; | ||
SchemaType["BOOLEAN"] = "BOOLEAN"; | ||
/** Array type. */ | ||
FunctionDeclarationSchemaType["ARRAY"] = "ARRAY"; | ||
SchemaType["ARRAY"] = "ARRAY"; | ||
/** Object type. */ | ||
FunctionDeclarationSchemaType["OBJECT"] = "OBJECT"; | ||
})(exports.FunctionDeclarationSchemaType || (exports.FunctionDeclarationSchemaType = {})); | ||
SchemaType["OBJECT"] = "OBJECT"; | ||
})(exports.SchemaType || (exports.SchemaType = {})); | ||
@@ -603,0 +603,0 @@ /** |
@@ -361,3 +361,3 @@ /** | ||
/** The type of the parameter. */ | ||
type: FunctionDeclarationSchemaType; | ||
type: SchemaType; | ||
/** The format of the parameter. */ | ||
@@ -381,22 +381,2 @@ properties: { | ||
/** | ||
* Contains the list of OpenAPI data types | ||
* as defined by https://swagger.io/docs/specification/data-models/data-types/ | ||
* @public | ||
*/ | ||
export declare enum FunctionDeclarationSchemaType { | ||
/** String type. */ | ||
STRING = "STRING", | ||
/** Number type. */ | ||
NUMBER = "NUMBER", | ||
/** Integer type. */ | ||
INTEGER = "INTEGER", | ||
/** Boolean type. */ | ||
BOOLEAN = "BOOLEAN", | ||
/** Array type. */ | ||
ARRAY = "ARRAY", | ||
/** Object type. */ | ||
OBJECT = "OBJECT" | ||
} | ||
/** | ||
* A FunctionDeclarationsTool is a piece of code that enables the system to | ||
@@ -661,5 +641,5 @@ * interact with external systems to perform an action, or set of actions, | ||
* Optional. The type of the property. {@link | ||
* FunctionDeclarationSchemaType}. | ||
* SchemaType}. | ||
*/ | ||
type?: FunctionDeclarationSchemaType; | ||
type?: SchemaType; | ||
/** Optional. The format of the property. */ | ||
@@ -671,9 +651,9 @@ format?: string; | ||
nullable?: boolean; | ||
/** Optional. The items of the property. {@link FunctionDeclarationSchema} */ | ||
items?: FunctionDeclarationSchema; | ||
/** Optional. The items of the property. */ | ||
items?: Schema; | ||
/** Optional. The enum of the property. */ | ||
enum?: string[]; | ||
/** Optional. Map of {@link FunctionDeclarationSchema}. */ | ||
/** Optional. Map of {@link Schema}. */ | ||
properties?: { | ||
[k: string]: FunctionDeclarationSchema; | ||
[k: string]: Schema; | ||
}; | ||
@@ -687,6 +667,26 @@ /** Optional. Array of required property. */ | ||
/** | ||
* Contains the list of OpenAPI data types | ||
* as defined by https://swagger.io/docs/specification/data-models/data-types/ | ||
* @public | ||
*/ | ||
export declare enum SchemaType { | ||
/** String type. */ | ||
STRING = "STRING", | ||
/** Number type. */ | ||
NUMBER = "NUMBER", | ||
/** Integer type. */ | ||
INTEGER = "INTEGER", | ||
/** Boolean type. */ | ||
BOOLEAN = "BOOLEAN", | ||
/** Array type. */ | ||
ARRAY = "ARRAY", | ||
/** Object type. */ | ||
OBJECT = "OBJECT" | ||
} | ||
/** | ||
* Params passed to atomic asynchronous operations. | ||
* @public | ||
*/ | ||
declare interface SingleRequestOptions extends RequestOptions { | ||
export declare interface SingleRequestOptions extends RequestOptions { | ||
/** | ||
@@ -693,0 +693,0 @@ * An object that may be used to abort asynchronous requests. The request may |
@@ -43,4 +43,4 @@ /** | ||
* Fields set in the optional {@link SingleRequestOptions} parameter will | ||
* take precedence over the {@link RequestOptions} values provided at the | ||
* time of the {@link GoogleAIFileManager} initialization. | ||
* take precedence over the {@link RequestOptions} values provided to | ||
* {@link GoogleGenerativeAI.getGenerativeModel }. | ||
*/ | ||
@@ -54,6 +54,6 @@ sendMessage(request: string | Array<string | Part>, requestOptions?: SingleRequestOptions): Promise<GenerateContentResult>; | ||
* Fields set in the optional {@link SingleRequestOptions} parameter will | ||
* take precedence over the {@link RequestOptions} values provided at the | ||
* time of the {@link GoogleAIFileManager} initialization. | ||
* take precedence over the {@link RequestOptions} values provided to | ||
* {@link GoogleGenerativeAI.getGenerativeModel }. | ||
*/ | ||
sendMessageStream(request: string | Array<string | Part>, requestOptions?: SingleRequestOptions): Promise<GenerateContentStreamResult>; | ||
} |
@@ -40,4 +40,4 @@ /** | ||
* Fields set in the optional {@link SingleRequestOptions} parameter will | ||
* take precedence over the {@link RequestOptions} values provided at the | ||
* time of the {@link GoogleAIFileManager} initialization. | ||
* take precedence over the {@link RequestOptions} values provided to | ||
* {@link GoogleGenerativeAI.getGenerativeModel }. | ||
*/ | ||
@@ -52,4 +52,4 @@ generateContent(request: GenerateContentRequest | string | Array<string | Part>, requestOptions?: SingleRequestOptions): Promise<GenerateContentResult>; | ||
* Fields set in the optional {@link SingleRequestOptions} parameter will | ||
* take precedence over the {@link RequestOptions} values provided at the | ||
* time of the {@link GoogleAIFileManager} initialization. | ||
* take precedence over the {@link RequestOptions} values provided to | ||
* {@link GoogleGenerativeAI.getGenerativeModel }. | ||
*/ | ||
@@ -66,4 +66,4 @@ generateContentStream(request: GenerateContentRequest | string | Array<string | Part>, requestOptions?: SingleRequestOptions): Promise<GenerateContentStreamResult>; | ||
* Fields set in the optional {@link SingleRequestOptions} parameter will | ||
* take precedence over the {@link RequestOptions} values provided at the | ||
* time of the {@link GoogleAIFileManager} initialization. | ||
* take precedence over the {@link RequestOptions} values provided to | ||
* {@link GoogleGenerativeAI.getGenerativeModel }. | ||
*/ | ||
@@ -75,4 +75,4 @@ countTokens(request: CountTokensRequest | string | Array<string | Part>, requestOptions?: SingleRequestOptions): Promise<CountTokensResponse>; | ||
* Fields set in the optional {@link SingleRequestOptions} parameter will | ||
* take precedence over the {@link RequestOptions} values provided at the | ||
* time of the {@link GoogleAIFileManager} initialization. | ||
* take precedence over the {@link RequestOptions} values provided to | ||
* {@link GoogleGenerativeAI.getGenerativeModel }. | ||
*/ | ||
@@ -84,6 +84,6 @@ embedContent(request: EmbedContentRequest | string | Array<string | Part>, requestOptions?: SingleRequestOptions): Promise<EmbedContentResponse>; | ||
* Fields set in the optional {@link SingleRequestOptions} parameter will | ||
* take precedence over the {@link RequestOptions} values provided at the | ||
* time of the {@link GoogleAIFileManager} initialization. | ||
* take precedence over the {@link RequestOptions} values provided to | ||
* {@link GoogleGenerativeAI.getGenerativeModel }. | ||
*/ | ||
batchEmbedContents(batchEmbedContentRequest: BatchEmbedContentsRequest, requestOptions?: SingleRequestOptions): Promise<BatchEmbedContentsResponse>; | ||
} |
@@ -84,3 +84,3 @@ /** | ||
*/ | ||
export declare enum FunctionDeclarationSchemaType { | ||
export declare enum SchemaType { | ||
/** String type. */ | ||
@@ -108,5 +108,5 @@ STRING = "STRING", | ||
* Optional. The type of the property. {@link | ||
* FunctionDeclarationSchemaType}. | ||
* SchemaType}. | ||
*/ | ||
type?: FunctionDeclarationSchemaType; | ||
type?: SchemaType; | ||
/** Optional. The format of the property. */ | ||
@@ -118,9 +118,9 @@ format?: string; | ||
nullable?: boolean; | ||
/** Optional. The items of the property. {@link FunctionDeclarationSchema} */ | ||
items?: FunctionDeclarationSchema; | ||
/** Optional. The items of the property. */ | ||
items?: Schema; | ||
/** Optional. The enum of the property. */ | ||
enum?: string[]; | ||
/** Optional. Map of {@link FunctionDeclarationSchema}. */ | ||
/** Optional. Map of {@link Schema}. */ | ||
properties?: { | ||
[k: string]: FunctionDeclarationSchema; | ||
[k: string]: Schema; | ||
}; | ||
@@ -138,3 +138,3 @@ /** Optional. Array of required property. */ | ||
/** The type of the parameter. */ | ||
type: FunctionDeclarationSchemaType; | ||
type: SchemaType; | ||
/** The format of the parameter. */ | ||
@@ -141,0 +141,0 @@ properties: { |
@@ -20,4 +20,4 @@ /** | ||
export * from "./shared"; | ||
export { RequestOptions, Tool, CodeExecutionTool } from "../../types/requests"; | ||
export { RequestOptions, Tool, CodeExecutionTool, SingleRequestOptions, } from "../../types/requests"; | ||
export * from "../../types/content"; | ||
export { FunctionCallingMode } from "../../types/enums"; |
@@ -43,4 +43,4 @@ /** | ||
* Fields set in the optional {@link SingleRequestOptions} parameter will | ||
* take precedence over the {@link RequestOptions} values provided at the | ||
* time of the {@link GoogleAIFileManager} initialization. | ||
* take precedence over the {@link RequestOptions} values provided to | ||
* {@link GoogleGenerativeAI.getGenerativeModel }. | ||
*/ | ||
@@ -54,6 +54,6 @@ sendMessage(request: string | Array<string | Part>, requestOptions?: SingleRequestOptions): Promise<GenerateContentResult>; | ||
* Fields set in the optional {@link SingleRequestOptions} parameter will | ||
* take precedence over the {@link RequestOptions} values provided at the | ||
* time of the {@link GoogleAIFileManager} initialization. | ||
* take precedence over the {@link RequestOptions} values provided to | ||
* {@link GoogleGenerativeAI.getGenerativeModel }. | ||
*/ | ||
sendMessageStream(request: string | Array<string | Part>, requestOptions?: SingleRequestOptions): Promise<GenerateContentStreamResult>; | ||
} |
@@ -40,4 +40,4 @@ /** | ||
* Fields set in the optional {@link SingleRequestOptions} parameter will | ||
* take precedence over the {@link RequestOptions} values provided at the | ||
* time of the {@link GoogleAIFileManager} initialization. | ||
* take precedence over the {@link RequestOptions} values provided to | ||
* {@link GoogleGenerativeAI.getGenerativeModel }. | ||
*/ | ||
@@ -52,4 +52,4 @@ generateContent(request: GenerateContentRequest | string | Array<string | Part>, requestOptions?: SingleRequestOptions): Promise<GenerateContentResult>; | ||
* Fields set in the optional {@link SingleRequestOptions} parameter will | ||
* take precedence over the {@link RequestOptions} values provided at the | ||
* time of the {@link GoogleAIFileManager} initialization. | ||
* take precedence over the {@link RequestOptions} values provided to | ||
* {@link GoogleGenerativeAI.getGenerativeModel }. | ||
*/ | ||
@@ -66,4 +66,4 @@ generateContentStream(request: GenerateContentRequest | string | Array<string | Part>, requestOptions?: SingleRequestOptions): Promise<GenerateContentStreamResult>; | ||
* Fields set in the optional {@link SingleRequestOptions} parameter will | ||
* take precedence over the {@link RequestOptions} values provided at the | ||
* time of the {@link GoogleAIFileManager} initialization. | ||
* take precedence over the {@link RequestOptions} values provided to | ||
* {@link GoogleGenerativeAI.getGenerativeModel }. | ||
*/ | ||
@@ -75,4 +75,4 @@ countTokens(request: CountTokensRequest | string | Array<string | Part>, requestOptions?: SingleRequestOptions): Promise<CountTokensResponse>; | ||
* Fields set in the optional {@link SingleRequestOptions} parameter will | ||
* take precedence over the {@link RequestOptions} values provided at the | ||
* time of the {@link GoogleAIFileManager} initialization. | ||
* take precedence over the {@link RequestOptions} values provided to | ||
* {@link GoogleGenerativeAI.getGenerativeModel }. | ||
*/ | ||
@@ -84,6 +84,6 @@ embedContent(request: EmbedContentRequest | string | Array<string | Part>, requestOptions?: SingleRequestOptions): Promise<EmbedContentResponse>; | ||
* Fields set in the optional {@link SingleRequestOptions} parameter will | ||
* take precedence over the {@link RequestOptions} values provided at the | ||
* time of the {@link GoogleAIFileManager} initialization. | ||
* take precedence over the {@link RequestOptions} values provided to | ||
* {@link GoogleGenerativeAI.getGenerativeModel }. | ||
*/ | ||
batchEmbedContents(batchEmbedContentRequest: BatchEmbedContentsRequest, requestOptions?: SingleRequestOptions): Promise<BatchEmbedContentsResponse>; | ||
} |
@@ -84,3 +84,3 @@ /** | ||
*/ | ||
export declare enum FunctionDeclarationSchemaType { | ||
export declare enum SchemaType { | ||
/** String type. */ | ||
@@ -108,5 +108,5 @@ STRING = "STRING", | ||
* Optional. The type of the property. {@link | ||
* FunctionDeclarationSchemaType}. | ||
* SchemaType}. | ||
*/ | ||
type?: FunctionDeclarationSchemaType; | ||
type?: SchemaType; | ||
/** Optional. The format of the property. */ | ||
@@ -118,9 +118,9 @@ format?: string; | ||
nullable?: boolean; | ||
/** Optional. The items of the property. {@link FunctionDeclarationSchema} */ | ||
items?: FunctionDeclarationSchema; | ||
/** Optional. The items of the property. */ | ||
items?: Schema; | ||
/** Optional. The enum of the property. */ | ||
enum?: string[]; | ||
/** Optional. Map of {@link FunctionDeclarationSchema}. */ | ||
/** Optional. Map of {@link Schema}. */ | ||
properties?: { | ||
[k: string]: FunctionDeclarationSchema; | ||
[k: string]: Schema; | ||
}; | ||
@@ -138,3 +138,3 @@ /** Optional. Array of required property. */ | ||
/** The type of the parameter. */ | ||
type: FunctionDeclarationSchemaType; | ||
type: SchemaType; | ||
/** The format of the parameter. */ | ||
@@ -141,0 +141,0 @@ properties: { |
@@ -20,4 +20,4 @@ /** | ||
export * from "./shared"; | ||
export { RequestOptions, Tool, CodeExecutionTool } from "../../types/requests"; | ||
export { RequestOptions, Tool, CodeExecutionTool, SingleRequestOptions, } from "../../types/requests"; | ||
export * from "../../types/content"; | ||
export { FunctionCallingMode } from "../../types/enums"; |
{ | ||
"name": "@google/generative-ai", | ||
"version": "0.16.0", | ||
"version": "0.17.0", | ||
"description": "Google AI JavaScript SDK", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -77,4 +77,4 @@ /** | ||
* Fields set in the optional {@link SingleRequestOptions} parameter will | ||
* take precedence over the {@link RequestOptions} values provided at the | ||
* time of the {@link GoogleAIFileManager} initialization. | ||
* take precedence over the {@link RequestOptions} values provided to | ||
* {@link GoogleGenerativeAI.getGenerativeModel }. | ||
*/ | ||
@@ -144,4 +144,4 @@ async sendMessage( | ||
* Fields set in the optional {@link SingleRequestOptions} parameter will | ||
* take precedence over the {@link RequestOptions} values provided at the | ||
* time of the {@link GoogleAIFileManager} initialization. | ||
* take precedence over the {@link RequestOptions} values provided to | ||
* {@link GoogleGenerativeAI.getGenerativeModel }. | ||
*/ | ||
@@ -148,0 +148,0 @@ async sendMessageStream( |
@@ -23,5 +23,5 @@ /** | ||
FunctionCallingMode, | ||
FunctionDeclarationSchemaType, | ||
HarmBlockThreshold, | ||
HarmCategory, | ||
SchemaType, | ||
} from "../../types"; | ||
@@ -60,6 +60,6 @@ import { getMockResponse } from "../../test-utils/mock-response"; | ||
responseSchema: { | ||
type: FunctionDeclarationSchemaType.OBJECT, | ||
type: SchemaType.OBJECT, | ||
properties: { | ||
testField: { | ||
type: FunctionDeclarationSchemaType.STRING, | ||
type: SchemaType.STRING, | ||
properties: {}, | ||
@@ -91,7 +91,7 @@ }, | ||
expect(genModel.generationConfig?.responseSchema.type).to.equal( | ||
FunctionDeclarationSchemaType.OBJECT, | ||
SchemaType.OBJECT, | ||
); | ||
expect( | ||
genModel.generationConfig?.responseSchema.properties.testField.type, | ||
).to.equal(FunctionDeclarationSchemaType.STRING); | ||
).to.equal(SchemaType.STRING); | ||
expect(genModel.safetySettings?.length).to.equal(1); | ||
@@ -163,6 +163,6 @@ expect(genModel.tools?.length).to.equal(1); | ||
responseSchema: { | ||
type: FunctionDeclarationSchemaType.OBJECT, | ||
type: SchemaType.OBJECT, | ||
properties: { | ||
testField: { | ||
type: FunctionDeclarationSchemaType.STRING, | ||
type: SchemaType.STRING, | ||
properties: {}, | ||
@@ -198,6 +198,6 @@ }, | ||
responseSchema: { | ||
type: FunctionDeclarationSchemaType.OBJECT, | ||
type: SchemaType.OBJECT, | ||
properties: { | ||
newTestField: { | ||
type: FunctionDeclarationSchemaType.STRING, | ||
type: SchemaType.STRING, | ||
properties: {}, | ||
@@ -317,6 +317,6 @@ }, | ||
responseSchema: { | ||
type: FunctionDeclarationSchemaType.OBJECT, | ||
type: SchemaType.OBJECT, | ||
properties: { | ||
testField: { | ||
type: FunctionDeclarationSchemaType.STRING, | ||
type: SchemaType.STRING, | ||
properties: {}, | ||
@@ -358,6 +358,6 @@ }, | ||
responseSchema: { | ||
type: FunctionDeclarationSchemaType.OBJECT, | ||
type: SchemaType.OBJECT, | ||
properties: { | ||
testField: { | ||
type: FunctionDeclarationSchemaType.STRING, | ||
type: SchemaType.STRING, | ||
properties: {}, | ||
@@ -390,6 +390,6 @@ }, | ||
responseSchema: { | ||
type: FunctionDeclarationSchemaType.OBJECT, | ||
type: SchemaType.OBJECT, | ||
properties: { | ||
newTestField: { | ||
type: FunctionDeclarationSchemaType.STRING, | ||
type: SchemaType.STRING, | ||
properties: {}, | ||
@@ -396,0 +396,0 @@ }, |
@@ -95,4 +95,4 @@ /** | ||
* Fields set in the optional {@link SingleRequestOptions} parameter will | ||
* take precedence over the {@link RequestOptions} values provided at the | ||
* time of the {@link GoogleAIFileManager} initialization. | ||
* take precedence over the {@link RequestOptions} values provided to | ||
* {@link GoogleGenerativeAI.getGenerativeModel }. | ||
*/ | ||
@@ -131,4 +131,4 @@ async generateContent( | ||
* Fields set in the optional {@link SingleRequestOptions} parameter will | ||
* take precedence over the {@link RequestOptions} values provided at the | ||
* time of the {@link GoogleAIFileManager} initialization. | ||
* take precedence over the {@link RequestOptions} values provided to | ||
* {@link GoogleGenerativeAI.getGenerativeModel }. | ||
*/ | ||
@@ -185,4 +185,4 @@ async generateContentStream( | ||
* Fields set in the optional {@link SingleRequestOptions} parameter will | ||
* take precedence over the {@link RequestOptions} values provided at the | ||
* time of the {@link GoogleAIFileManager} initialization. | ||
* take precedence over the {@link RequestOptions} values provided to | ||
* {@link GoogleGenerativeAI.getGenerativeModel }. | ||
*/ | ||
@@ -218,4 +218,4 @@ async countTokens( | ||
* Fields set in the optional {@link SingleRequestOptions} parameter will | ||
* take precedence over the {@link RequestOptions} values provided at the | ||
* time of the {@link GoogleAIFileManager} initialization. | ||
* take precedence over the {@link RequestOptions} values provided to | ||
* {@link GoogleGenerativeAI.getGenerativeModel }. | ||
*/ | ||
@@ -243,4 +243,4 @@ async embedContent( | ||
* Fields set in the optional {@link SingleRequestOptions} parameter will | ||
* take precedence over the {@link RequestOptions} values provided at the | ||
* time of the {@link GoogleAIFileManager} initialization. | ||
* take precedence over the {@link RequestOptions} values provided to | ||
* {@link GoogleGenerativeAI.getGenerativeModel }. | ||
*/ | ||
@@ -247,0 +247,0 @@ async batchEmbedContents( |
@@ -285,3 +285,3 @@ ## API Report File for "@google/generative-ai" | ||
required?: string[]; | ||
type: FunctionDeclarationSchemaType; | ||
type: SchemaType; | ||
} | ||
@@ -294,12 +294,2 @@ | ||
// @public | ||
export enum FunctionDeclarationSchemaType { | ||
ARRAY = "ARRAY", | ||
BOOLEAN = "BOOLEAN", | ||
INTEGER = "INTEGER", | ||
NUMBER = "NUMBER", | ||
OBJECT = "OBJECT", | ||
STRING = "STRING" | ||
} | ||
// @public | ||
export interface FunctionDeclarationsTool { | ||
@@ -361,3 +351,2 @@ functionDeclarations?: FunctionDeclaration[]; | ||
getFile(fileId: string, requestOptions?: SingleRequestOptions): Promise<FileMetadataResponse>; | ||
// Warning: (ae-forgotten-export) The symbol "SingleRequestOptions" needs to be exported by the entry point index.d.ts | ||
listFiles(listParams?: ListParams, requestOptions?: SingleRequestOptions): Promise<ListFilesResponse>; | ||
@@ -446,12 +435,27 @@ uploadFile(filePath: string, fileMetadata: FileMetadata): Promise<UploadFileResponse>; | ||
format?: string; | ||
items?: FunctionDeclarationSchema; | ||
items?: Schema; | ||
nullable?: boolean; | ||
properties?: { | ||
[k: string]: FunctionDeclarationSchema; | ||
[k: string]: Schema; | ||
}; | ||
required?: string[]; | ||
type?: FunctionDeclarationSchemaType; | ||
type?: SchemaType; | ||
} | ||
// @public | ||
export enum SchemaType { | ||
ARRAY = "ARRAY", | ||
BOOLEAN = "BOOLEAN", | ||
INTEGER = "INTEGER", | ||
NUMBER = "NUMBER", | ||
OBJECT = "OBJECT", | ||
STRING = "STRING" | ||
} | ||
// @public | ||
export interface SingleRequestOptions extends RequestOptions { | ||
signal?: AbortSignal; | ||
} | ||
// @public | ||
export interface TextPart { | ||
@@ -458,0 +462,0 @@ // (undocumented) |
@@ -332,3 +332,3 @@ ## API Report File for "@google/generative-ai" | ||
required?: string[]; | ||
type: FunctionDeclarationSchemaType; | ||
type: SchemaType; | ||
} | ||
@@ -341,12 +341,2 @@ | ||
// @public | ||
export enum FunctionDeclarationSchemaType { | ||
ARRAY = "ARRAY", | ||
BOOLEAN = "BOOLEAN", | ||
INTEGER = "INTEGER", | ||
NUMBER = "NUMBER", | ||
OBJECT = "OBJECT", | ||
STRING = "STRING" | ||
} | ||
// @public | ||
export interface FunctionDeclarationsTool { | ||
@@ -661,12 +651,22 @@ functionDeclarations?: FunctionDeclaration[]; | ||
format?: string; | ||
items?: FunctionDeclarationSchema; | ||
items?: Schema; | ||
nullable?: boolean; | ||
properties?: { | ||
[k: string]: FunctionDeclarationSchema; | ||
[k: string]: Schema; | ||
}; | ||
required?: string[]; | ||
type?: FunctionDeclarationSchemaType; | ||
type?: SchemaType; | ||
} | ||
// @public | ||
export enum SchemaType { | ||
ARRAY = "ARRAY", | ||
BOOLEAN = "BOOLEAN", | ||
INTEGER = "INTEGER", | ||
NUMBER = "NUMBER", | ||
OBJECT = "OBJECT", | ||
STRING = "STRING" | ||
} | ||
// @public | ||
export interface SingleRequestOptions extends RequestOptions { | ||
@@ -673,0 +673,0 @@ signal?: AbortSignal; |
@@ -20,3 +20,3 @@ /** | ||
import * as chaiAsPromised from "chai-as-promised"; | ||
import { FunctionDeclarationSchemaType, GoogleGenerativeAI } from "../.."; | ||
import { GoogleGenerativeAI, SchemaType } from "../.."; | ||
import { Content } from "../../types"; | ||
@@ -48,6 +48,6 @@ | ||
parameters: { | ||
type: FunctionDeclarationSchemaType.OBJECT, | ||
type: SchemaType.OBJECT, | ||
properties: { | ||
location: { | ||
type: FunctionDeclarationSchemaType.STRING, | ||
type: SchemaType.STRING, | ||
description: | ||
@@ -57,3 +57,3 @@ "The city and state, e.g. San Francisco, CA or a zip code e.g. 95616", | ||
description: { | ||
type: FunctionDeclarationSchemaType.STRING, | ||
type: SchemaType.STRING, | ||
description: | ||
@@ -71,6 +71,6 @@ "Any kind of description including category or genre, title words, attributes, etc.", | ||
parameters: { | ||
type: FunctionDeclarationSchemaType.OBJECT, | ||
type: SchemaType.OBJECT, | ||
properties: { | ||
location: { | ||
type: FunctionDeclarationSchemaType.STRING, | ||
type: SchemaType.STRING, | ||
description: | ||
@@ -80,3 +80,3 @@ "The city and state, e.g. San Francisco, CA or a zip code e.g. 95616", | ||
movie: { | ||
type: FunctionDeclarationSchemaType.STRING, | ||
type: SchemaType.STRING, | ||
description: "Any movie title", | ||
@@ -93,6 +93,6 @@ }, | ||
parameters: { | ||
type: FunctionDeclarationSchemaType.OBJECT, | ||
type: SchemaType.OBJECT, | ||
properties: { | ||
location: { | ||
type: FunctionDeclarationSchemaType.STRING, | ||
type: SchemaType.STRING, | ||
description: | ||
@@ -102,11 +102,11 @@ "The city and state, e.g. San Francisco, CA or a zip code e.g. 95616", | ||
movie: { | ||
type: FunctionDeclarationSchemaType.STRING, | ||
type: SchemaType.STRING, | ||
description: "Any movie title", | ||
}, | ||
theater: { | ||
type: FunctionDeclarationSchemaType.STRING, | ||
type: SchemaType.STRING, | ||
description: "Name of the theater", | ||
}, | ||
date: { | ||
type: FunctionDeclarationSchemaType.STRING, | ||
type: SchemaType.STRING, | ||
description: "Date for requested showtime", | ||
@@ -204,5 +204,5 @@ }, | ||
parameters: { | ||
type: FunctionDeclarationSchemaType.OBJECT, | ||
type: SchemaType.OBJECT, | ||
properties: { | ||
city: { type: FunctionDeclarationSchemaType.STRING }, | ||
city: { type: SchemaType.STRING }, | ||
}, | ||
@@ -209,0 +209,0 @@ required: ["city"], |
@@ -21,6 +21,6 @@ /** | ||
import { | ||
FunctionDeclarationSchemaType, | ||
GoogleGenerativeAI, | ||
HarmBlockThreshold, | ||
HarmCategory, | ||
SchemaType, | ||
Tool, | ||
@@ -45,5 +45,5 @@ } from "../.."; | ||
parameters: { | ||
type: FunctionDeclarationSchemaType.OBJECT, | ||
type: SchemaType.OBJECT, | ||
properties: { | ||
city: { type: FunctionDeclarationSchemaType.STRING }, | ||
city: { type: SchemaType.STRING }, | ||
}, | ||
@@ -50,0 +50,0 @@ required: ["city"], |
@@ -87,3 +87,3 @@ /** | ||
*/ | ||
export enum FunctionDeclarationSchemaType { | ||
export enum SchemaType { | ||
/** String type. */ | ||
@@ -112,5 +112,5 @@ STRING = "STRING", | ||
* Optional. The type of the property. {@link | ||
* FunctionDeclarationSchemaType}. | ||
* SchemaType}. | ||
*/ | ||
type?: FunctionDeclarationSchemaType; | ||
type?: SchemaType; | ||
/** Optional. The format of the property. */ | ||
@@ -122,8 +122,8 @@ format?: string; | ||
nullable?: boolean; | ||
/** Optional. The items of the property. {@link FunctionDeclarationSchema} */ | ||
items?: FunctionDeclarationSchema; | ||
/** Optional. The items of the property. */ | ||
items?: Schema; | ||
/** Optional. The enum of the property. */ | ||
enum?: string[]; | ||
/** Optional. Map of {@link FunctionDeclarationSchema}. */ | ||
properties?: { [k: string]: FunctionDeclarationSchema }; | ||
/** Optional. Map of {@link Schema}. */ | ||
properties?: { [k: string]: Schema }; | ||
/** Optional. Array of required property. */ | ||
@@ -141,3 +141,3 @@ required?: string[]; | ||
/** The type of the parameter. */ | ||
type: FunctionDeclarationSchemaType; | ||
type: SchemaType; | ||
/** The format of the parameter. */ | ||
@@ -144,0 +144,0 @@ properties: { [k: string]: FunctionDeclarationSchemaProperty }; |
@@ -22,4 +22,9 @@ /** | ||
export { RequestOptions, Tool, CodeExecutionTool } from "../../types/requests"; | ||
export { | ||
RequestOptions, | ||
Tool, | ||
CodeExecutionTool, | ||
SingleRequestOptions, | ||
} from "../../types/requests"; | ||
export * from "../../types/content"; | ||
export { FunctionCallingMode } from "../../types/enums"; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
34506
1584273