Commit
·
15ebcb5
1
Parent(s):
1b4c061
update requirements
Browse files- .gitignore +1 -1
- ai_agent.py +4 -2
.gitignore
CHANGED
|
@@ -1 +1 @@
|
|
| 1 |
-
.env
|
|
|
|
| 1 |
+
# .env
|
ai_agent.py
CHANGED
|
@@ -47,11 +47,13 @@ def translate_back(text, target_lang):
|
|
| 47 |
return text
|
| 48 |
|
| 49 |
def load_llm():
|
| 50 |
-
|
|
|
|
|
|
|
| 51 |
return ChatGoogleGenerativeAI(
|
| 52 |
model="gemini-1.5-flash",
|
| 53 |
temperature=0.7,
|
| 54 |
-
google_api_key=
|
| 55 |
)
|
| 56 |
|
| 57 |
# def load_llm():
|
|
|
|
| 47 |
return text
|
| 48 |
|
| 49 |
def load_llm():
|
| 50 |
+
key = os.environ.get("GEMINI_API_KEY")
|
| 51 |
+
if not key:
|
| 52 |
+
raise ValueError("❌ GEMINI_API_KEY chưa được thiết lập trong biến môi trường.")
|
| 53 |
return ChatGoogleGenerativeAI(
|
| 54 |
model="gemini-1.5-flash",
|
| 55 |
temperature=0.7,
|
| 56 |
+
google_api_key=key
|
| 57 |
)
|
| 58 |
|
| 59 |
# def load_llm():
|