1616def chat_text_example (project_id : str , location : str ) -> str :
1717 # [START aiplatform_gemini_multiturn_chat]
1818 import vertexai
19- from vertexai .preview . generative_models import GenerativeModel , ChatSession
19+ from vertexai .generative_models import GenerativeModel , ChatSession
2020
2121 # TODO(developer): Update and un-comment below lines
2222 # project_id = "PROJECT_ID"
2323 # location = "us-central1"
2424 vertexai .init (project = project_id , location = location )
2525
26- model = GenerativeModel ("gemini-pro" )
26+ model = GenerativeModel ("gemini-1.0- pro" )
2727 chat = model .start_chat ()
2828
2929 def get_chat_response (chat : ChatSession , prompt : str ) -> str :
@@ -45,13 +45,13 @@ def get_chat_response(chat: ChatSession, prompt: str) -> str:
4545def chat_stream_example (project_id : str , location : str ) -> str :
4646 # [START aiplatform_gemini_multiturn_chat_stream]
4747 import vertexai
48- from vertexai .preview . generative_models import GenerativeModel , ChatSession
48+ from vertexai .generative_models import GenerativeModel , ChatSession
4949
5050 # TODO(developer): Update and un-comment below lines
5151 # project_id = "PROJECT_ID"
5252 # location = "us-central1"
5353 vertexai .init (project = project_id , location = location )
54- model = GenerativeModel ("gemini-pro" )
54+ model = GenerativeModel ("gemini-1.0- pro" )
5555 chat = model .start_chat ()
5656
5757 def get_chat_response (chat : ChatSession , prompt : str ) -> str :
0 commit comments