From f25a80d4556b2d4cfcd8ecdbc6ffa5716ff5432e Mon Sep 17 00:00:00 2001 From: A Vertex SDK engineer Date: Fri, 13 Dec 2024 12:57:49 -0800 Subject: [PATCH] fix: a typo in chat session and missed toolConfig on chat start PiperOrigin-RevId: 705975446 --- src/models/chat_session.ts | 4 ++-- src/models/generative_models.ts | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/models/chat_session.ts b/src/models/chat_session.ts index 9527b961..431f9ee4 100644 --- a/src/models/chat_session.ts +++ b/src/models/chat_session.ts @@ -128,7 +128,7 @@ export class ChatSession { ): Promise { const newContent: Content[] = formulateNewContentFromSendMessageRequest(request); - const generateContentrequest: GenerateContentRequest = { + const generateContentRequest: GenerateContentRequest = { contents: this.historyInternal.concat(newContent), safetySettings: this.safetySettings, generationConfig: this.generationConfig, @@ -141,7 +141,7 @@ export class ChatSession { this.location, this.resourcePath, this.fetchToken(), - generateContentrequest, + generateContentRequest, this.apiEndpoint, this.generationConfig, this.safetySettings, diff --git a/src/models/generative_models.ts b/src/models/generative_models.ts index 17a75cf2..1e2820e9 100644 --- a/src/models/generative_models.ts +++ b/src/models/generative_models.ts @@ -268,6 +268,7 @@ export class GenerativeModel { startChatRequest.safetySettings = request.safetySettings ?? this.safetySettings; startChatRequest.tools = request.tools ?? this.tools; + startChatRequest.toolConfig = request.toolConfig ?? this.toolConfig; startChatRequest.apiEndpoint = request.apiEndpoint ?? this.apiEndpoint; startChatRequest.systemInstruction = request.systemInstruction ?? this.systemInstruction; @@ -492,6 +493,7 @@ export class GenerativeModelPreview { publisherModelEndpoint: this.publisherModelEndpoint, resourcePath: this.resourcePath, tools: this.tools, + toolConfig: this.toolConfig, systemInstruction: this.systemInstruction, cachedContent: this.cachedContent?.name, }; @@ -503,6 +505,7 @@ export class GenerativeModelPreview { startChatRequest.safetySettings = request.safetySettings ?? this.safetySettings; startChatRequest.tools = request.tools ?? this.tools; + startChatRequest.toolConfig = request.toolConfig ?? this.toolConfig; startChatRequest.systemInstruction = request.systemInstruction ?? this.systemInstruction; startChatRequest.cachedContent =