Skip to content

Commit

Permalink
fix: include cachedContent in generate request (#469)
Browse files Browse the repository at this point in the history
  • Loading branch information
cabljac authored Nov 27, 2024
1 parent 3f9eee6 commit a16b9d4
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/models/chat_session.ts
Original file line number Diff line number Diff line change
Expand Up @@ -339,20 +339,21 @@ export class ChatSessionPreview {
): Promise<GenerateContentResult> {
const newContent: Content[] =
formulateNewContentFromSendMessageRequest(request);
const generateContentrequest: GenerateContentRequest = {
const generateContentRequest: GenerateContentRequest = {
contents: this.historyInternal.concat(newContent),
safetySettings: this.safetySettings,
generationConfig: this.generationConfig,
tools: this.tools,
toolConfig: this.toolConfig,
systemInstruction: this.systemInstruction,
cachedContent: this.cachedContent,
};

const generateContentResult: GenerateContentResult = await generateContent(
this.location,
this.resourcePath,
this.fetchToken(),
generateContentrequest,
generateContentRequest,
this.apiEndpoint,
this.generationConfig,
this.safetySettings,
Expand Down

0 comments on commit a16b9d4

Please sign in to comment.