File tree Expand file tree Collapse file tree 2 files changed +8
-3
lines changed
Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -23,6 +23,8 @@ const sample = require('../text-generation/textgen-with-txt.js');
2323describe ( 'textgen-with-txt' , async ( ) => {
2424 it ( 'should generate text content from a text prompt' , async ( ) => {
2525 const output = await sample . generateContent ( projectId ) ;
26- assert ( output . length > 0 ) ;
26+ assert (
27+ output . length > 0 && output . includes ( 'AI' ) && output . includes ( 'models' )
28+ ) ;
2729 } ) ;
2830} ) ;
Original file line number Diff line number Diff line change 1717// [START googlegenaisdk_textgen_with_txt]
1818const { GoogleGenAI} = require ( '@google/genai' ) ;
1919
20+ const GOOGLE_CLOUD_PROJECT = process . env . GOOGLE_CLOUD_PROJECT ;
21+ const GOOGLE_CLOUD_LOCATION = process . env . GOOGLE_CLOUD_LOCATION || 'global' ;
22+
2023async function generateContent (
21- projectId = process . env . GOOGLE_CLOUD_PROJECT ,
22- location = process . env . GOOGLE_CLOUD_LOCATION || 'global'
24+ projectId = GOOGLE_CLOUD_PROJECT ,
25+ location = GOOGLE_CLOUD_LOCATION
2326) {
2427 const ai = new GoogleGenAI ( {
2528 vertexai : true ,
You can’t perform that action at this time.
0 commit comments