Skip to content

Commit a2fccb5

Browse files
author
Guiners
committed
content-cache code with tests
1 parent 52fde9f commit a2fccb5

File tree

3 files changed

+3
-10
lines changed

3 files changed

+3
-10
lines changed

genai/content-cache/content-cache-delete.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,10 @@ const {GoogleGenAI} = require('@google/genai');
2020
const GOOGLE_CLOUD_PROJECT = process.env.GOOGLE_CLOUD_PROJECT;
2121
const GOOGLE_CLOUD_LOCATION = process.env.GOOGLE_CLOUD_LOCATION || 'global';
2222

23-
const CACHE_NAME =
24-
'projects/448220130128/locations/us-central1/cachedContents/4839555542676406272';
25-
2623
async function generateContent(
2724
projectId = GOOGLE_CLOUD_PROJECT,
2825
location = GOOGLE_CLOUD_LOCATION,
29-
cacheName = CACHE_NAME
26+
cacheName
3027
) {
3128
const ai = new GoogleGenAI({
3229
vertexai: true,

genai/content-cache/content-cache-update.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,11 @@ const {DateTime} = require('luxon');
2121
const GOOGLE_CLOUD_PROJECT = process.env.GOOGLE_CLOUD_PROJECT;
2222
const GOOGLE_CLOUD_LOCATION = process.env.GOOGLE_CLOUD_LOCATION || 'global';
2323

24-
const CACHE_NAME =
25-
'projects/448220130128/locations/us-central1/cachedContents/4839555542676406272';
2624

2725
async function generateContent(
2826
projectId = GOOGLE_CLOUD_PROJECT,
2927
location = GOOGLE_CLOUD_LOCATION,
30-
cacheName = CACHE_NAME
28+
cacheName
3129
) {
3230
const ai = new GoogleGenAI({
3331
vertexai: true,

genai/content-cache/content-cache-use-with-txt.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,11 @@ const {GoogleGenAI} = require('@google/genai');
2121
const GOOGLE_CLOUD_PROJECT = process.env.GOOGLE_CLOUD_PROJECT;
2222
const GOOGLE_CLOUD_LOCATION = process.env.GOOGLE_CLOUD_LOCATION || 'global';
2323

24-
const CACHE_NAME =
25-
'projects/448220130128/locations/us-central1/cachedContents/8186785596975349760';
2624

2725
async function generateContent(
2826
projectId = GOOGLE_CLOUD_PROJECT,
2927
location = GOOGLE_CLOUD_LOCATION,
30-
cacheName = CACHE_NAME
28+
cacheName
3129
) {
3230
const ai = new GoogleGenAI({
3331
vertexai: true,

0 commit comments

Comments
 (0)