Browse Source

check the precense of the api key before trying to initialize cohere

jnfrati 4 năm trước cách đây
mục cha
commit
b66ec815a5
1 tập tin đã thay đổi với 1 bổ sung1 xóa
  1. 1 1
      dashboard/src/index.tsx

+ 1 - 1
dashboard/src/index.tsx

@@ -14,7 +14,7 @@ declare global {
   }
   }
 }
 }
 
 
-if (process.env.ENABLE_COHERE) {
+if (process.env.ENABLE_COHERE && process.env.COHERE_API_KEY) {
   Cohere.init(process.env.COHERE_API_KEY);
   Cohere.init(process.env.COHERE_API_KEY);
 }
 }