File tree Expand file tree Collapse file tree 2 files changed +3
-8
lines changed Expand file tree Collapse file tree 2 files changed +3
-8
lines changed Original file line number Diff line number Diff line change @@ -54,16 +54,13 @@ async function createNonStreamingMultipartContent(
5454  console . log ( request . contents [ 0 ] . parts [ 1 ] . text ) ; 
5555
5656  console . log ( 'Non-Streaming Response Text:' ) ; 
57-   // Create the response stream 
58-   const  responseStream  = 
59-     await  generativeVisionModel . generateContentStream ( request ) ; 
6057
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 ) ; 
6360
6461  // Select the text from the response 
6562  const  fullTextResponse  = 
66-     aggregatedResponse . candidates [ 0 ] . content . parts [ 0 ] . text ; 
63+     response . response . candidates [ 0 ] . content . parts [ 0 ] . text ; 
6764
6865  console . log ( fullTextResponse ) ; 
6966} 
Original file line number Diff line number Diff line change 1212// See the License for the specific language governing permissions and 
1313// limitations under the License. 
1414
15- // [START generativeaionvertexai_gemini_get_started] 
1615// [START aiplatform_gemini_get_started] 
1716const  { VertexAI}  =  require ( '@google-cloud/vertexai' ) ; 
1817
@@ -64,7 +63,6 @@ async function createStreamMultipartContent(
6463  } 
6564} 
6665// [END aiplatform_gemini_get_started] 
67- // [END generativeaionvertexai_gemini_get_started] 
6866
6967createStreamMultipartContent ( ...process . argv . slice ( 2 ) ) . catch ( err  =>  { 
7068  console . error ( err . message ) ; 
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments