@@ -70,10 +70,30 @@ internal LiveGenerativeModel(FirebaseApp firebaseApp,
70
70
}
71
71
72
72
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
+ }
77
97
}
78
98
79
99
/// <summary>
0 commit comments