@firebase/ai 2.11.0 → 2.11.1
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 +15 -24
- package/dist/ai.d.ts +15 -28
- package/dist/esm/index.esm.js +4 -4
- package/dist/esm/index.esm.js.map +1 -1
- package/dist/esm/src/api.d.ts +1 -1
- package/dist/esm/src/methods/template-chat-session.d.ts +2 -1
- package/dist/esm/src/models/template-generative-model.d.ts +1 -2
- package/dist/esm/src/public-types.d.ts +29 -0
- package/dist/esm/src/types/requests.d.ts +4 -5
- package/dist/index.cjs.js +3 -4
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.node.cjs.js +3 -4
- package/dist/index.node.cjs.js.map +1 -1
- package/dist/index.node.mjs +4 -4
- package/dist/index.node.mjs.map +1 -1
- package/dist/src/api.d.ts +1 -1
- package/dist/src/methods/template-chat-session.d.ts +2 -1
- package/dist/src/models/template-generative-model.d.ts +1 -2
- package/dist/src/public-types.d.ts +29 -0
- package/dist/src/types/requests.d.ts +4 -5
- package/package.json +1 -1
package/dist/ai-public.d.ts
CHANGED
|
@@ -462,11 +462,10 @@ export declare interface CodeExecutionResultPart {
|
|
|
462
462
|
/**
|
|
463
463
|
* A tool that enables the model to use code execution.
|
|
464
464
|
*
|
|
465
|
-
* @
|
|
465
|
+
* @public
|
|
466
466
|
*/
|
|
467
467
|
export declare interface CodeExecutionTool {
|
|
468
468
|
/**
|
|
469
|
-
* Specifies the Google Search configuration.
|
|
470
469
|
* Currently, this is an empty object, but it's reserved for future configuration options.
|
|
471
470
|
*/
|
|
472
471
|
codeExecution: {};
|
|
@@ -3153,19 +3152,15 @@ export declare class StringSchema extends Schema {
|
|
|
3153
3152
|
}
|
|
3154
3153
|
|
|
3155
3154
|
/**
|
|
3156
|
-
* `ChatSession` class for use with server
|
|
3157
|
-
* enables sending chat messages and stores
|
|
3158
|
-
* received messages so far.
|
|
3155
|
+
* Interface representing a `ChatSession` class for use with server
|
|
3156
|
+
* prompt templates that enables sending chat messages and stores
|
|
3157
|
+
* history of sent and received messages so far.
|
|
3159
3158
|
*
|
|
3160
3159
|
* @beta
|
|
3161
3160
|
*/
|
|
3162
|
-
export declare
|
|
3161
|
+
export declare interface TemplateChatSession {
|
|
3163
3162
|
params: StartTemplateChatParams;
|
|
3164
|
-
requestOptions?: RequestOptions
|
|
3165
|
-
constructor(apiSettings: ApiSettings, params: StartTemplateChatParams, requestOptions?: RequestOptions | undefined);
|
|
3166
|
-
/* Excluded from this release type: _formatRequest */
|
|
3167
|
-
/* Excluded from this release type: _callGenerateContent */
|
|
3168
|
-
/* Excluded from this release type: _callGenerateContentStream */
|
|
3163
|
+
requestOptions?: RequestOptions;
|
|
3169
3164
|
/**
|
|
3170
3165
|
* Sends a chat message and receives a non-streaming
|
|
3171
3166
|
* {@link GenerateContentResult}
|
|
@@ -3177,6 +3172,12 @@ export declare class TemplateChatSession extends ChatSessionBase<StartTemplateCh
|
|
|
3177
3172
|
* and a response promise.
|
|
3178
3173
|
*/
|
|
3179
3174
|
sendMessageStream(request: string | Array<string | Part>, singleRequestOptions?: SingleRequestOptions): Promise<GenerateContentStreamResult>;
|
|
3175
|
+
/**
|
|
3176
|
+
* Gets the chat history so far. Blocked prompts are not added to history.
|
|
3177
|
+
* Neither blocked candidates nor the prompts that generated them are added
|
|
3178
|
+
* to history.
|
|
3179
|
+
*/
|
|
3180
|
+
getHistory(): Promise<Content[]>;
|
|
3180
3181
|
}
|
|
3181
3182
|
|
|
3182
3183
|
/**
|
|
@@ -3227,17 +3228,7 @@ export declare interface TemplateFunctionDeclarationsTool {
|
|
|
3227
3228
|
|
|
3228
3229
|
/* Excluded from this release type: TemplateFunctionDeclarationsToolInternal */
|
|
3229
3230
|
|
|
3230
|
-
|
|
3231
|
-
* Request sent through {@link TemplateGenerativeModel.generateContent}
|
|
3232
|
-
* @beta
|
|
3233
|
-
*/
|
|
3234
|
-
export declare interface TemplateGenerateContentRequest {
|
|
3235
|
-
inputs?: Record<string, unknown>;
|
|
3236
|
-
history?: Content[];
|
|
3237
|
-
tools?: TemplateFunctionDeclarationsTool[];
|
|
3238
|
-
toolConfig?: ToolConfig;
|
|
3239
|
-
[key: string]: unknown;
|
|
3240
|
-
}
|
|
3231
|
+
/* Excluded from this release type: TemplateGenerateContentRequest */
|
|
3241
3232
|
|
|
3242
3233
|
/**
|
|
3243
3234
|
* {@link GenerativeModel} APIs that execute on a server-side template.
|
|
@@ -3469,7 +3460,7 @@ export declare type TypedSchema = IntegerSchema | NumberSchema | StringSchema |
|
|
|
3469
3460
|
/**
|
|
3470
3461
|
* Specifies the URL Context configuration.
|
|
3471
3462
|
*
|
|
3472
|
-
* @
|
|
3463
|
+
* @public
|
|
3473
3464
|
*/
|
|
3474
3465
|
export declare interface URLContext {
|
|
3475
3466
|
}
|
|
@@ -3491,7 +3482,7 @@ export declare interface URLContextMetadata {
|
|
|
3491
3482
|
* URLs. By including URLs in your request, the Gemini model will access the content from those
|
|
3492
3483
|
* pages to inform and enhance its response.
|
|
3493
3484
|
*
|
|
3494
|
-
* @
|
|
3485
|
+
* @public
|
|
3495
3486
|
*/
|
|
3496
3487
|
export declare interface URLContextTool {
|
|
3497
3488
|
/**
|
package/dist/ai.d.ts
CHANGED
|
@@ -576,11 +576,10 @@ export declare interface CodeExecutionResultPart {
|
|
|
576
576
|
/**
|
|
577
577
|
* A tool that enables the model to use code execution.
|
|
578
578
|
*
|
|
579
|
-
* @
|
|
579
|
+
* @public
|
|
580
580
|
*/
|
|
581
581
|
export declare interface CodeExecutionTool {
|
|
582
582
|
/**
|
|
583
|
-
* Specifies the Google Search configuration.
|
|
584
583
|
* Currently, this is an empty object, but it's reserved for future configuration options.
|
|
585
584
|
*/
|
|
586
585
|
codeExecution: {};
|
|
@@ -3366,33 +3365,15 @@ export declare class StringSchema extends Schema {
|
|
|
3366
3365
|
}
|
|
3367
3366
|
|
|
3368
3367
|
/**
|
|
3369
|
-
* `ChatSession` class for use with server
|
|
3370
|
-
* enables sending chat messages and stores
|
|
3371
|
-
* received messages so far.
|
|
3368
|
+
* Interface representing a `ChatSession` class for use with server
|
|
3369
|
+
* prompt templates that enables sending chat messages and stores
|
|
3370
|
+
* history of sent and received messages so far.
|
|
3372
3371
|
*
|
|
3373
3372
|
* @beta
|
|
3374
3373
|
*/
|
|
3375
|
-
export declare
|
|
3374
|
+
export declare interface TemplateChatSession {
|
|
3376
3375
|
params: StartTemplateChatParams;
|
|
3377
|
-
requestOptions?: RequestOptions
|
|
3378
|
-
constructor(apiSettings: ApiSettings, params: StartTemplateChatParams, requestOptions?: RequestOptions | undefined);
|
|
3379
|
-
/**
|
|
3380
|
-
* Format the internal state to the body payload for `templateGenerateContent`.
|
|
3381
|
-
* @internal
|
|
3382
|
-
*/
|
|
3383
|
-
_formatRequest(incomingContent: Content, tempHistory: Content[]): TemplateRequestInternal;
|
|
3384
|
-
/**
|
|
3385
|
-
* Calls the specific templateGenerateContent() function needed for
|
|
3386
|
-
* this specialized TemplateChatSession.
|
|
3387
|
-
* @internal
|
|
3388
|
-
*/
|
|
3389
|
-
_callGenerateContent(formattedRequest: TemplateRequestInternal, singleRequestOptions?: RequestOptions): Promise<GenerateContentResult>;
|
|
3390
|
-
/**
|
|
3391
|
-
* Calls the specific templateGenerateContentStream() function needed for
|
|
3392
|
-
* this specialized TemplateChatSession.
|
|
3393
|
-
* @internal
|
|
3394
|
-
*/
|
|
3395
|
-
_callGenerateContentStream(formattedRequest: TemplateRequestInternal, singleRequestOptions?: RequestOptions): Promise<GenerateContentStreamResult>;
|
|
3376
|
+
requestOptions?: RequestOptions;
|
|
3396
3377
|
/**
|
|
3397
3378
|
* Sends a chat message and receives a non-streaming
|
|
3398
3379
|
* {@link GenerateContentResult}
|
|
@@ -3404,6 +3385,12 @@ export declare class TemplateChatSession extends ChatSessionBase<StartTemplateCh
|
|
|
3404
3385
|
* and a response promise.
|
|
3405
3386
|
*/
|
|
3406
3387
|
sendMessageStream(request: string | Array<string | Part>, singleRequestOptions?: SingleRequestOptions): Promise<GenerateContentStreamResult>;
|
|
3388
|
+
/**
|
|
3389
|
+
* Gets the chat history so far. Blocked prompts are not added to history.
|
|
3390
|
+
* Neither blocked candidates nor the prompts that generated them are added
|
|
3391
|
+
* to history.
|
|
3392
|
+
*/
|
|
3393
|
+
getHistory(): Promise<Content[]>;
|
|
3407
3394
|
}
|
|
3408
3395
|
|
|
3409
3396
|
/**
|
|
@@ -3471,7 +3458,7 @@ export declare interface TemplateFunctionDeclarationsToolInternal {
|
|
|
3471
3458
|
|
|
3472
3459
|
/**
|
|
3473
3460
|
* Request sent through {@link TemplateGenerativeModel.generateContent}
|
|
3474
|
-
* @
|
|
3461
|
+
* @internal
|
|
3475
3462
|
*/
|
|
3476
3463
|
export declare interface TemplateGenerateContentRequest {
|
|
3477
3464
|
inputs?: Record<string, unknown>;
|
|
@@ -3726,7 +3713,7 @@ export declare type TypedSchema = IntegerSchema | NumberSchema | StringSchema |
|
|
|
3726
3713
|
/**
|
|
3727
3714
|
* Specifies the URL Context configuration.
|
|
3728
3715
|
*
|
|
3729
|
-
* @
|
|
3716
|
+
* @public
|
|
3730
3717
|
*/
|
|
3731
3718
|
export declare interface URLContext {
|
|
3732
3719
|
}
|
|
@@ -3748,7 +3735,7 @@ export declare interface URLContextMetadata {
|
|
|
3748
3735
|
* URLs. By including URLs in your request, the Gemini model will access the content from those
|
|
3749
3736
|
* pages to inform and enhance its response.
|
|
3750
3737
|
*
|
|
3751
|
-
* @
|
|
3738
|
+
* @public
|
|
3752
3739
|
*/
|
|
3753
3740
|
export declare interface URLContextTool {
|
|
3754
3741
|
/**
|
package/dist/esm/index.esm.js
CHANGED
|
@@ -4,7 +4,7 @@ import { FirebaseError, Deferred, getModularInstance } from '@firebase/util';
|
|
|
4
4
|
import { Logger } from '@firebase/logger';
|
|
5
5
|
|
|
6
6
|
var name = "@firebase/ai";
|
|
7
|
-
var version = "2.11.
|
|
7
|
+
var version = "2.11.1";
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* @license
|
|
@@ -3931,7 +3931,7 @@ class WebSocketHandlerImpl {
|
|
|
3931
3931
|
*
|
|
3932
3932
|
* @beta
|
|
3933
3933
|
*/
|
|
3934
|
-
class
|
|
3934
|
+
class TemplateChatSessionImpl extends ChatSessionBase {
|
|
3935
3935
|
constructor(apiSettings, params, requestOptions) {
|
|
3936
3936
|
super(apiSettings, params, requestOptions);
|
|
3937
3937
|
this.params = params;
|
|
@@ -4089,7 +4089,7 @@ class TemplateGenerativeModel {
|
|
|
4089
4089
|
* @beta
|
|
4090
4090
|
*/
|
|
4091
4091
|
startChat(params) {
|
|
4092
|
-
return new
|
|
4092
|
+
return new TemplateChatSessionImpl(this._apiSettings, params, this.requestOptions);
|
|
4093
4093
|
}
|
|
4094
4094
|
}
|
|
4095
4095
|
|
|
@@ -5011,5 +5011,5 @@ function registerAI() {
|
|
|
5011
5011
|
}
|
|
5012
5012
|
registerAI();
|
|
5013
5013
|
|
|
5014
|
-
export { AIError, AIErrorCode, AIModel, AnyOfSchema, ArraySchema, Backend, BackendType, BlockReason, BooleanSchema, ChatSession, ChatSessionBase, FinishReason, FunctionCallingMode, GenerativeModel, GoogleAIBackend, HarmBlockMethod, HarmBlockThreshold, HarmCategory, HarmProbability, HarmSeverity, ImagenAspectRatio, ImagenImageFormat, ImagenModel, ImagenPersonFilterLevel, ImagenSafetyFilterLevel, InferenceMode, InferenceSource, IntegerSchema, Language, LiveGenerativeModel, LiveResponseType, LiveSession, Modality, NumberSchema, ObjectSchema, Outcome, POSSIBLE_ROLES, ResponseModality, Schema, SchemaType, StringSchema,
|
|
5014
|
+
export { AIError, AIErrorCode, AIModel, AnyOfSchema, ArraySchema, Backend, BackendType, BlockReason, BooleanSchema, ChatSession, ChatSessionBase, FinishReason, FunctionCallingMode, GenerativeModel, GoogleAIBackend, HarmBlockMethod, HarmBlockThreshold, HarmCategory, HarmProbability, HarmSeverity, ImagenAspectRatio, ImagenImageFormat, ImagenModel, ImagenPersonFilterLevel, ImagenSafetyFilterLevel, InferenceMode, InferenceSource, IntegerSchema, Language, LiveGenerativeModel, LiveResponseType, LiveSession, Modality, NumberSchema, ObjectSchema, Outcome, POSSIBLE_ROLES, ResponseModality, Schema, SchemaType, StringSchema, TemplateGenerativeModel, TemplateImagenModel, ThinkingLevel, URLRetrievalStatus, VertexAIBackend, getAI, getGenerativeModel, getImagenModel, getLiveGenerativeModel, getTemplateGenerativeModel, getTemplateImagenModel, startAudioConversation };
|
|
5015
5015
|
//# sourceMappingURL=index.esm.js.map
|