@@ -56,9 +56,9 @@ struct GenerativeAIService {
5656
5757 // Verify the status code is 200
5858 guard response. statusCode == 200 else {
59- Logging . default. error ( " [GoogleGenerativeAI ] The server responded with an error: \( response) " )
59+ Logging . default. error ( " [FirebaseVertexAI ] The server responded with an error: \( response) " )
6060 if let responseString = String ( data: data, encoding: . utf8) {
61- Logging . network. error ( " [GoogleGenerativeAI ] Response payload: \( responseString) " )
61+ Logging . network. error ( " [FirebaseVertexAI ] Response payload: \( responseString) " )
6262 }
6363
6464 throw parseError ( responseData: data)
@@ -105,13 +105,13 @@ struct GenerativeAIService {
105105 // Verify the status code is 200
106106 guard response. statusCode == 200 else {
107107 Logging . default
108- . error ( " [GoogleGenerativeAI ] The server responded with an error: \( response) " )
108+ . error ( " [FirebaseVertexAI ] The server responded with an error: \( response) " )
109109 var responseBody = " "
110110 for try await line in stream. lines {
111111 responseBody += line + " \n "
112112 }
113113
114- Logging . network. error ( " [GoogleGenerativeAI ] Response payload: \( responseBody) " )
114+ Logging . network. error ( " [FirebaseVertexAI ] Response payload: \( responseBody) " )
115115 continuation. finish ( throwing: parseError ( responseBody: responseBody) )
116116
117117 return
@@ -123,7 +123,7 @@ struct GenerativeAIService {
123123 let decoder = JSONDecoder ( )
124124 decoder. keyDecodingStrategy = . convertFromSnakeCase
125125 for try await line in stream. lines {
126- Logging . network. debug ( " [GoogleGenerativeAI ] Stream response: \( line) " )
126+ Logging . network. debug ( " [FirebaseVertexAI ] Stream response: \( line) " )
127127
128128 if line. hasPrefix ( " data: " ) {
129129 // We can assume 5 characters since it's utf-8 encoded, removing `data:`.
@@ -176,7 +176,7 @@ struct GenerativeAIService {
176176 urlRequest. setValue ( tokenResult. token, forHTTPHeaderField: " X-Firebase-AppCheck " )
177177 if let error = tokenResult. error {
178178 Logging . default
179- . debug ( " [GoogleGenerativeAI ] Failed to fetch AppCheck token. Error: \( error) " )
179+ . debug ( " [FirebaseVertexAI ] Failed to fetch AppCheck token. Error: \( error) " )
180180 }
181181 }
182182
@@ -200,7 +200,7 @@ struct GenerativeAIService {
200200 guard let response = urlResponse as? HTTPURLResponse else {
201201 Logging . default
202202 . error (
203- " [GoogleGenerativeAI ] Response wasn't an HTTP response, internal error \( urlResponse) "
203+ " [FirebaseVertexAI ] Response wasn't an HTTP response, internal error \( urlResponse) "
204204 )
205205 throw NSError (
206206 domain: " com.google.generative-ai " ,
@@ -248,9 +248,9 @@ struct GenerativeAIService {
248248 return try JSONDecoder ( ) . decode ( type, from: data)
249249 } catch {
250250 if let json = String ( data: data, encoding: . utf8) {
251- Logging . network. error ( " [GoogleGenerativeAI ] JSON response: \( json) " )
251+ Logging . network. error ( " [FirebaseVertexAI ] JSON response: \( json) " )
252252 }
253- Logging . default. error ( " [GoogleGenerativeAI ] Error decoding server JSON: \( error) " )
253+ Logging . default. error ( " [FirebaseVertexAI ] Error decoding server JSON: \( error) " )
254254 throw error
255255 }
256256 }
@@ -278,7 +278,7 @@ struct GenerativeAIService {
278278 private func printCURLCommand( from request: URLRequest ) {
279279 let command = cURLCommand ( from: request)
280280 Logging . verbose. debug ( """
281- [GoogleGenerativeAI ] Creating request with the equivalent cURL command:
281+ [FirebaseVertexAI ] Creating request with the equivalent cURL command:
282282 ----- cURL command -----
283283 \( command, privacy: . private)
284284 ------------------------
0 commit comments