Create core/aiConfig.js
Browse files- 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 };
|