File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed 
firebase-vertexai/src/main/kotlin/com/google/firebase/vertexai Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -106,13 +106,23 @@ internal constructor(
106106   * @return The initialized [LiveGenerativeModel] instance. 
107107   */  
108108  @JvmOverloads
109+   @PublicPreviewAPI
109110  public  fun  liveModel (
110111    modelName :  String ,
111112    generationConfig :  LiveGenerationConfig ?  = null,
112113    tools :  List <Tool >?  = null,
113114    systemInstruction :  Content ?  = null,
114115    requestOptions :  RequestOptions  = RequestOptions (),
115116  ): LiveGenerativeModel  {
117+     if  (! modelName.startsWith(GEMINI_MODEL_NAME_PREFIX )) {
118+       Log .w(
119+         TAG ,
120+         """ Unsupported Gemini model "${modelName} "; see
121+       https://firebase.google.com/docs/vertex-ai/models for a list supported Gemini model names. 
122+       """  
123+           .trimIndent()
124+       )
125+     }
116126    if  (location.trim().isEmpty() ||  location.contains(" /"  )) {
117127      throw  InvalidLocationException (location)
118128    }
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments