Skip to content

Commit

Permalink
fix: a typo in chat session and missed toolConfig on chat start
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 705975446
  • Loading branch information
vertex-sdk-bot authored and copybara-github committed Dec 13, 2024
1 parent 029eb24 commit 03398ab
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/models/chat_session.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ export class ChatSession {
): Promise<GenerateContentResult> {
const newContent: Content[] =
formulateNewContentFromSendMessageRequest(request);
const generateContentrequest: GenerateContentRequest = {
const generateContentRequest: GenerateContentRequest = {
contents: this.historyInternal.concat(newContent),
safetySettings: this.safetySettings,
generationConfig: this.generationConfig,
Expand All @@ -141,7 +141,7 @@ export class ChatSession {
this.location,
this.resourcePath,
this.fetchToken(),
generateContentrequest,
generateContentRequest,
this.apiEndpoint,
this.generationConfig,
this.safetySettings,
Expand Down
3 changes: 3 additions & 0 deletions src/models/generative_models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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,
};
Expand All @@ -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 =
Expand Down

0 comments on commit 03398ab

Please sign in to comment.