Skip to content

Commit 8c4d191

Browse files
author
Guiners
committed
adding samples, test, lints
1 parent edfbd5a commit 8c4d191

5 files changed

Lines changed: 9 additions & 9 deletions

File tree

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ 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-
async function generateContent(
23+
async function deleteContentCache(
2424
projectId = GOOGLE_CLOUD_PROJECT,
2525
location = GOOGLE_CLOUD_LOCATION,
2626
cacheName = 'example-cache'
@@ -48,5 +48,5 @@ async function generateContent(
4848
// [END googlegenaisdk_contentcache_delete]
4949

5050
module.exports = {
51-
generateContent,
51+
deleteContentCache,
5252
};

genai/content-cache/content-cache-list.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ const {GoogleGenAI} = require('@google/genai');
2020

2121
const GOOGLE_CLOUD_PROJECT = process.env.GOOGLE_CLOUD_PROJECT;
2222
const GOOGLE_CLOUD_LOCATION = process.env.GOOGLE_CLOUD_LOCATION || 'global';
23-
async function generateContent(
23+
async function listContentCaches(
2424
projectId = GOOGLE_CLOUD_PROJECT,
2525
location = GOOGLE_CLOUD_LOCATION
2626
) {
@@ -60,5 +60,5 @@ async function generateContent(
6060
// [END googlegenaisdk_contentcache_list]
6161

6262
module.exports = {
63-
generateContent,
63+
listContentCaches,
6464
};

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ 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-
async function generateContent(
24+
async function updateContentCache(
2525
projectId = GOOGLE_CLOUD_PROJECT,
2626
location = GOOGLE_CLOUD_LOCATION,
2727
cacheName = 'example-cache'
@@ -73,5 +73,5 @@ async function generateContent(
7373
// [END googlegenaisdk_contentcache_update]
7474

7575
module.exports = {
76-
generateContent,
76+
updateContentCache,
7777
};

genai/test/content-cache-create-use-update-delete.test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ describe('content-cache-create-use-update-delete', async function () {
3939
});
4040

4141
it('should update content cache', async () => {
42-
await updateSample.generateContent(projectId, undefined, contentCacheName);
42+
await updateSample.updateContentCache(projectId, undefined, contentCacheName);
4343
});
4444

4545
it('should use content cache', async () => {
@@ -52,6 +52,6 @@ describe('content-cache-create-use-update-delete', async function () {
5252
});
5353

5454
it('should delete content cache', async () => {
55-
await deleteSample.generateContent(projectId, undefined, contentCacheName);
55+
await deleteSample.deleteContentCache(projectId, undefined, contentCacheName);
5656
});
5757
});

genai/test/content-cache-list.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ const sample = require('../content-cache/content-cache-list.js');
2222

2323
describe('contentcache-list', async () => {
2424
it('should return object with names of catches', async () => {
25-
const output = await sample.generateContent(projectId);
25+
const output = await sample.listContentCaches(projectId);
2626
assert.isArray(output);
2727
});
2828
});

0 commit comments

Comments
 (0)