@@ -140,16 +140,15 @@ export class BooleanSchema extends Schema {
140140}
141141
142142// @public
143- export class ChatSession {
143+ export class ChatSession extends ChatSessionBase < StartChatParams , GenerateContentRequest , FunctionDeclarationsTool > {
144144 // Warning: (ae-incompatible-release-tags) The symbol "__constructor" is marked as @public, but its signature references "ChromeAdapter" which is marked as @beta
145145 constructor (apiSettings : ApiSettings , model : string , chromeAdapter ? : ChromeAdapter | undefined , params ? : StartChatParams | undefined , requestOptions ? : RequestOptions | undefined );
146146 // @internal
147- _callFunctionsAsNeeded( functionCalls : FunctionCall [] ): Promise <FunctionResponsePart [] >;
147+ _callGenerateContent( formattedRequest : GenerateContentRequest , singleRequestOptions ? : RequestOptions ): Promise <GenerateContentResult >;
148148 // @internal
149- _formatRequest( incomingContent : Content , tempHistory : Content [] ): GenerateContentRequest ;
149+ _callGenerateContentStream( formattedRequest : GenerateContentRequest , singleRequestOptions ? : RequestOptions ): Promise < GenerateContentStreamResult > ;
150150 // @internal
151- _getCallableFunctionCalls(response ? : GenerateContentResponse ): FunctionCall [] | undefined ;
152- getHistory(): Promise <Content []>;
151+ _formatRequest(incomingContent : Content , tempHistory : Content []): GenerateContentRequest ;
153152 // (undocumented)
154153 model: string ;
155154 // (undocumented)
@@ -158,7 +157,40 @@ export class ChatSession {
158157 requestOptions? : RequestOptions | undefined ;
159158 sendMessage(request : string | Array <string | Part >, singleRequestOptions ? : SingleRequestOptions ): Promise <GenerateContentResult >;
160159 sendMessageStream(request : string | Array <string | Part >, singleRequestOptions ? : SingleRequestOptions ): Promise <GenerateContentStreamResult >;
161- }
160+ }
161+
162+ // Warning: (ae-incompatible-release-tags) The symbol "ChatSessionBase" is marked as @public, but its signature references "StartTemplateChatParams" which is marked as @beta
163+ // Warning: (ae-incompatible-release-tags) The symbol "ChatSessionBase" is marked as @public, but its signature references "TemplateFunctionDeclarationsTool" which is marked as @beta
164+ //
165+ // @public
166+ export abstract class ChatSessionBase <ParamsType extends StartChatParams | StartTemplateChatParams , RequestType , FunctionDeclarationsToolType extends FunctionDeclarationsTool | TemplateFunctionDeclarationsTool > {
167+ constructor (apiSettings : ApiSettings , params ? : ParamsType | undefined , requestOptions ? : RequestOptions | undefined );
168+ // (undocumented)
169+ protected _apiSettings: ApiSettings ;
170+ // @internal
171+ _callFunctionsAsNeeded(functionCalls : FunctionCall []): Promise <FunctionResponsePart []>;
172+ // @internal
173+ abstract _callGenerateContent(formattedRequest : RequestType , singleRequestOptions ? : RequestOptions ): Promise <GenerateContentResult >;
174+ // @internal
175+ abstract _callGenerateContentStream(formattedRequest : RequestType , singleRequestOptions ? : RequestOptions ): Promise <GenerateContentStreamResult >;
176+ // @internal
177+ abstract _formatRequest(incomingContent : Content , tempHistory : Content []): RequestType ;
178+ // @internal
179+ _getCallableFunctionCalls(response ? : GenerateContentResponse ): FunctionCall [] | undefined ;
180+ getHistory(): Promise <Content []>;
181+ // (undocumented)
182+ protected _history: Content [];
183+ // (undocumented)
184+ params? : ParamsType | undefined ;
185+ // (undocumented)
186+ requestOptions? : RequestOptions | undefined ;
187+ // @internal
188+ _sendMessage(request : string | Array <string | Part >, singleRequestOptions ? : SingleRequestOptions ): Promise <GenerateContentResult >;
189+ // @internal
190+ _sendMessageStream(request : string | Array <string | Part >, singleRequestOptions ? : SingleRequestOptions ): Promise <GenerateContentStreamResult >;
191+ // @internal
192+ protected _sendPromise: Promise <void >;
193+ }
162194
163195// @beta
164196export interface ChromeAdapter {
@@ -1157,7 +1189,7 @@ export interface PromptFeedback {
11571189// @public
11581190export interface RequestOptions {
11591191 baseUrl? : string ;
1160- maxSequentalFunctionCalls ? : number ;
1192+ maxSequentialFunctionCalls ? : number ;
11611193 timeout? : number ;
11621194}
11631195
@@ -1340,6 +1372,14 @@ export interface StartChatParams extends BaseParams {
13401372 tools? : Tool [];
13411373}
13421374
1375+ // @beta
1376+ export interface StartTemplateChatParams extends Omit <StartChatParams , ' tools' > {
1377+ templateId: string ;
1378+ templateVariables? : Record <string , unknown >;
1379+ // (undocumented)
1380+ tools? : TemplateTool [];
1381+ }
1382+
13431383// @public
13441384export class StringSchema extends Schema {
13451385 constructor (schemaParams ? : SchemaParams , enumValues ? : string []);
@@ -1349,14 +1389,76 @@ export class StringSchema extends Schema {
13491389 toJSON(): SchemaRequest ;
13501390}
13511391
1392+ // Warning: (ae-incompatible-release-tags) The symbol "TemplateChatSession" is marked as @beta, but its signature references "TemplateRequestInternal" which is marked as @internal
1393+ //
1394+ // @beta
1395+ export class TemplateChatSession extends ChatSessionBase <StartTemplateChatParams , TemplateRequestInternal , TemplateFunctionDeclarationsTool > {
1396+ constructor (apiSettings : ApiSettings , params : StartTemplateChatParams , requestOptions ? : RequestOptions | undefined );
1397+ // @internal
1398+ _callGenerateContent(formattedRequest : TemplateRequestInternal , singleRequestOptions ? : RequestOptions ): Promise <GenerateContentResult >;
1399+ // @internal
1400+ _callGenerateContentStream(formattedRequest : TemplateRequestInternal , singleRequestOptions ? : RequestOptions ): Promise <GenerateContentStreamResult >;
1401+ // @internal
1402+ _formatRequest(incomingContent : Content , tempHistory : Content []): TemplateRequestInternal ;
1403+ // (undocumented)
1404+ params: StartTemplateChatParams ;
1405+ // (undocumented)
1406+ requestOptions? : RequestOptions | undefined ;
1407+ sendMessage(request : string | Array <string | Part >, singleRequestOptions ? : SingleRequestOptions ): Promise <GenerateContentResult >;
1408+ sendMessageStream(request : string | Array <string | Part >, singleRequestOptions ? : SingleRequestOptions ): Promise <GenerateContentStreamResult >;
1409+ }
1410+
1411+ // @beta
1412+ export interface TemplateFunctionDeclaration {
1413+ description? : never ;
1414+ functionReference? : Function ;
1415+ name: string ;
1416+ parameters? : ObjectSchema | ObjectSchemaRequest ;
1417+ }
1418+
1419+ // Warning: (ae-internal-missing-underscore) The name "TemplateFunctionDeclarationInternal" should be prefixed with an underscore because the declaration is marked as @internal
1420+ //
1421+ // @internal (undocumented)
1422+ export interface TemplateFunctionDeclarationInternal extends Omit <TemplateFunctionDeclaration , ' parameters' > {
1423+ // (undocumented)
1424+ inputSchema? : ObjectSchema | ObjectSchemaRequest ;
1425+ }
1426+
1427+ // @beta
1428+ export interface TemplateFunctionDeclarationsTool {
1429+ functionDeclarations? : TemplateFunctionDeclaration [];
1430+ }
1431+
1432+ // Warning: (ae-internal-missing-underscore) The name "TemplateFunctionDeclarationsToolInternal" should be prefixed with an underscore because the declaration is marked as @internal
1433+ //
1434+ // @internal
1435+ export interface TemplateFunctionDeclarationsToolInternal {
1436+ templateFunctions? : TemplateFunctionDeclarationInternal [];
1437+ }
1438+
1439+ // @beta
1440+ export interface TemplateGenerateContentRequest {
1441+ // (undocumented)
1442+ [key : string ]: unknown ;
1443+ // (undocumented)
1444+ history? : Content [];
1445+ // (undocumented)
1446+ inputs? : Record <string , unknown >;
1447+ // (undocumented)
1448+ toolConfig? : ToolConfig ;
1449+ // (undocumented)
1450+ tools? : TemplateFunctionDeclarationsTool [];
1451+ }
1452+
13521453// @beta
13531454export class TemplateGenerativeModel {
13541455 constructor (ai : AI , requestOptions ? : RequestOptions );
13551456 // @internal (undocumented)
13561457 _apiSettings: ApiSettings ;
1357- generateContent(templateId : string , templateVariables : object , singleRequestOptions ? : SingleRequestOptions ): Promise <GenerateContentResult >;
1358- generateContentStream(templateId : string , templateVariables : object , singleRequestOptions ? : SingleRequestOptions ): Promise <GenerateContentStreamResult >;
1458+ generateContent(templateId : string , templateVariables : Record < string , unknown > , singleRequestOptions ? : SingleRequestOptions ): Promise <GenerateContentResult >;
1459+ generateContentStream(templateId : string , templateVariables : Record < string , unknown > , singleRequestOptions ? : SingleRequestOptions ): Promise <GenerateContentStreamResult >;
13591460 requestOptions? : RequestOptions ;
1461+ startChat(params : StartTemplateChatParams ): TemplateChatSession ;
13601462}
13611463
13621464// @public @deprecated
@@ -1369,6 +1471,17 @@ export class TemplateImagenModel {
13691471 requestOptions? : RequestOptions ;
13701472}
13711473
1474+ // Warning: (ae-internal-missing-underscore) The name "TemplateRequestInternal" should be prefixed with an underscore because the declaration is marked as @internal
1475+ //
1476+ // @internal
1477+ export interface TemplateRequestInternal extends Omit <TemplateGenerateContentRequest , ' tools' > {
1478+ // (undocumented)
1479+ tools? : TemplateFunctionDeclarationsToolInternal [];
1480+ }
1481+
1482+ // @beta
1483+ export type TemplateTool = TemplateFunctionDeclarationsTool ;
1484+
13721485// @public
13731486export interface TextPart {
13741487 // (undocumented)
0 commit comments