@dataclouder/nest-vertex 0.0.52 → 0.0.53
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -28,14 +28,14 @@ let GoogleGenaiService = GoogleGenaiService_1 = class GoogleGenaiService {
|
|
|
28
28
|
}
|
|
29
29
|
async getGoogleGenAIClient(request) {
|
|
30
30
|
this.logger.warn('⚖️ getGoogleGenAIClient() Requesting key from Balancer 🗝️ ');
|
|
31
|
-
if (process.env.KEY_BALANCER_HOST
|
|
31
|
+
if (process.env.KEY_BALANCER_HOST) {
|
|
32
32
|
const balancedKey = await this.keyBalancerClient.getBestKey({
|
|
33
33
|
provider: 'google',
|
|
34
34
|
service: request.model,
|
|
35
35
|
tierType: request.keyTierType,
|
|
36
36
|
}, null);
|
|
37
37
|
if (balancedKey?.key) {
|
|
38
|
-
this.logger.debug(`⚖️ Using balanced key: ${balancedKey.name} ${balancedKey.
|
|
38
|
+
this.logger.debug(`⚖️ Using balanced key: ${balancedKey.id}) ${balancedKey.name} - ${balancedKey.key} `);
|
|
39
39
|
return { client: new genai_1.GoogleGenAI({ apiKey: balancedKey.key }), balancedKey };
|
|
40
40
|
}
|
|
41
41
|
}
|
|
@@ -105,6 +105,7 @@ let GeminiChatService = GeminiChatService_1 = class GeminiChatService {
|
|
|
105
105
|
};
|
|
106
106
|
}
|
|
107
107
|
catch (error) {
|
|
108
|
+
this.logger.error(`First Error Gemini Gemini {${balancedKey?.key} chat.sendMessage failed: ${error.message}`);
|
|
108
109
|
if (error instanceof nest_core_1.AppException) {
|
|
109
110
|
throw error;
|
|
110
111
|
}
|