15
15
*/
16
16
'use strict' ;
17
17
18
- function main ( project , location , model = 'text-bison@ 001' ) {
18
+ async function main ( project , location , model = 'text-bison- 001' ) {
19
19
// [START aiplatform_list_tuned_models]
20
20
/**
21
21
* TODO(developer): Uncomment these variables before running the sample.\
@@ -34,7 +34,7 @@ function main(project, location, model = 'text-bison@001') {
34
34
// Instantiate the service client.
35
35
const modelServiceClient = new ModelServiceClient ( clientOptions ) ;
36
36
37
- function listTunedModels ( ) {
37
+ async function listTunedModels ( ) {
38
38
// Configure the parent resource
39
39
const parent = `projects/${ project } /locations/${ location } ` ;
40
40
const filter = `labels.google-vertex-llm-tuning-base-model-id=${ model } ` ;
@@ -44,14 +44,14 @@ function main(project, location, model = 'text-bison@001') {
44
44
filter,
45
45
} ;
46
46
47
- const [ response ] = modelServiceClient . listModels ( request ) ;
47
+ const [ response ] = await modelServiceClient . listModels ( request ) ;
48
48
console . log ( 'List Tuned Models response' ) ;
49
49
for ( const model of response ) {
50
50
console . log ( `\tModel name: ${ model . name } ` ) ;
51
51
console . log ( `\tDisplay name: ${ model . displayName } ` ) ;
52
52
}
53
53
}
54
- listTunedModels ( ) ;
54
+ await listTunedModels ( ) ;
55
55
// [END aiplatform_list_tuned_models]
56
56
}
57
57
0 commit comments