phanquocdat123 commited on
Commit
511c028
·
verified ·
1 Parent(s): af26f4f

Create core /aiConfig.js

Browse files
Files changed (1) hide show
  1. core /aiConfig.js +12 -0
core /aiConfig.js ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // core/aiConfig.js
2
+ const { GoogleGenerativeAI } = require("@google/generative-ai");
3
+
4
+ // Khởi tạo Google AI với API Key từ file .env
5
+ const genAI = new GoogleGenerativeAI(process.env.GEMINI_API_KEY);
6
+
7
+ // Cấu hình Model Gemma 3 (Hoặc Gemini tùy theo key của Đạt)
8
+ const model = genAI.getGenerativeModel({
9
+ model: "gemini-1.5-flash", // Hoặc "gemma-3-flash" nếu Đạt đã có quyền truy cập sớm
10
+ });
11
+
12
+ module.exports = { model };