@@ -70,10 +70,30 @@ internal LiveGenerativeModel(FirebaseApp firebaseApp,
7070 }
7171
7272 private string GetURL ( ) {
73- return "wss://firebasevertexai.googleapis.com/ws" +
74- "/google.firebase.vertexai.v1beta.LlmBidiService/BidiGenerateContent" +
75- $ "/locations/{ _backend . Location } " +
76- $ "?key={ _firebaseApp . Options . ApiKey } ";
73+ if ( _backend . Provider == FirebaseAI . Backend . InternalProvider . VertexAI ) {
74+ return "wss://firebasevertexai.googleapis.com/ws" +
75+ "/google.firebase.vertexai.v1beta.LlmBidiService/BidiGenerateContent" +
76+ $ "/locations/{ _backend . Location } " +
77+ $ "?key={ _firebaseApp . Options . ApiKey } ";
78+ } else if ( _backend . Provider == FirebaseAI . Backend . InternalProvider . GoogleAI ) {
79+ return "wss://firebasevertexai.googleapis.com/ws" +
80+ "/google.firebase.vertexai.v1beta.GenerativeService/BidiGenerateContent" +
81+ $ "?key={ _firebaseApp . Options . ApiKey } ";
82+ } else {
83+ throw new NotSupportedException ( $ "Missing support for backend: { _backend . Provider } ") ;
84+ }
85+ }
86+
87+ private string GetModelName ( ) {
88+ if ( _backend . Provider == FirebaseAI . Backend . InternalProvider . VertexAI ) {
89+ return $ "projects/{ _firebaseApp . Options . ProjectId } /locations/{ _backend . Location } " +
90+ $ "/publishers/google/models/{ _modelName } ";
91+ } else if ( _backend . Provider == FirebaseAI . Backend . InternalProvider . GoogleAI ) {
92+ return $ "projects/{ _firebaseApp . Options . ProjectId } " +
93+ $ "/models/{ _modelName } ";
94+ } else {
95+ throw new NotSupportedException ( $ "Missing support for backend: { _backend . Provider } ") ;
96+ }
7797 }
7898
7999 /// <summary>
0 commit comments