File tree 2 files changed +3
-8
lines changed
2 files changed +3
-8
lines changed Original file line number Diff line number Diff line change @@ -54,16 +54,13 @@ async function createNonStreamingMultipartContent(
54
54
console . log ( request . contents [ 0 ] . parts [ 1 ] . text ) ;
55
55
56
56
console . log ( 'Non-Streaming Response Text:' ) ;
57
- // Create the response stream
58
- const responseStream =
59
- await generativeVisionModel . generateContentStream ( request ) ;
60
57
61
- // Wait for the response stream to complete
62
- const aggregatedResponse = await responseStream . response ;
58
+ // Generate a response
59
+ const response = await generativeVisionModel . generateContent ( request ) ;
63
60
64
61
// Select the text from the response
65
62
const fullTextResponse =
66
- aggregatedResponse . candidates [ 0 ] . content . parts [ 0 ] . text ;
63
+ response . response . candidates [ 0 ] . content . parts [ 0 ] . text ;
67
64
68
65
console . log ( fullTextResponse ) ;
69
66
}
Original file line number Diff line number Diff line change 12
12
// See the License for the specific language governing permissions and
13
13
// limitations under the License.
14
14
15
- // [START generativeaionvertexai_gemini_get_started]
16
15
// [START aiplatform_gemini_get_started]
17
16
const { VertexAI} = require ( '@google-cloud/vertexai' ) ;
18
17
@@ -64,7 +63,6 @@ async function createStreamMultipartContent(
64
63
}
65
64
}
66
65
// [END aiplatform_gemini_get_started]
67
- // [END generativeaionvertexai_gemini_get_started]
68
66
69
67
createStreamMultipartContent ( ...process . argv . slice ( 2 ) ) . catch ( err => {
70
68
console . error ( err . message ) ;
You can’t perform that action at this time.
0 commit comments