Spaces:
Sleeping
Sleeping
Commit
·
1e5dfc2
1
Parent(s):
89ef32e
Update Gemini model version
Browse files
app/config/settings.py
CHANGED
|
@@ -17,6 +17,8 @@ os.makedirs(TMP_DIR, exist_ok=True)
|
|
| 17 |
|
| 18 |
# Gemini API Key (for text normalization)
|
| 19 |
GEMINI_API_KEY = os.getenv("GEMINI_API_KEY", "")
|
|
|
|
|
|
|
| 20 |
# External services
|
| 21 |
NOTE_SERVICE_URL = os.getenv(
|
| 22 |
"NOTE_SERVICE_URL",
|
|
|
|
| 17 |
|
| 18 |
# Gemini API Key (for text normalization)
|
| 19 |
GEMINI_API_KEY = os.getenv("GEMINI_API_KEY", "")
|
| 20 |
+
GEMINI_MODEL = os.getenv("GEMINI_MODEL", "")
|
| 21 |
+
|
| 22 |
# External services
|
| 23 |
NOTE_SERVICE_URL = os.getenv(
|
| 24 |
"NOTE_SERVICE_URL",
|
app/services/nlp_postprocess.py
CHANGED
|
@@ -4,7 +4,7 @@ import logging
|
|
| 4 |
|
| 5 |
from app.infra.redis_client import redis_client
|
| 6 |
from app.utils.hashing import sha256
|
| 7 |
-
from app.config.settings import GEMINI_API_KEY
|
| 8 |
|
| 9 |
# New official client
|
| 10 |
try:
|
|
@@ -20,7 +20,7 @@ CACHE_TTL = 60 * 60 * 24 * 3 # 3 days
|
|
| 20 |
|
| 21 |
# Tạo client Gemini nếu có API key
|
| 22 |
_gemini_client = None
|
| 23 |
-
_GEMINI_MODEL =
|
| 24 |
|
| 25 |
if GEMINI_API_KEY and genai is not None:
|
| 26 |
try:
|
|
|
|
| 4 |
|
| 5 |
from app.infra.redis_client import redis_client
|
| 6 |
from app.utils.hashing import sha256
|
| 7 |
+
from app.config.settings import GEMINI_API_KEY, GEMINI_MODEL
|
| 8 |
|
| 9 |
# New official client
|
| 10 |
try:
|
|
|
|
| 20 |
|
| 21 |
# Tạo client Gemini nếu có API key
|
| 22 |
_gemini_client = None
|
| 23 |
+
_GEMINI_MODEL = GEMINI_MODEL
|
| 24 |
|
| 25 |
if GEMINI_API_KEY and genai is not None:
|
| 26 |
try:
|
app/services/text_normalizer.py
CHANGED
|
@@ -15,10 +15,10 @@ except Exception:
|
|
| 15 |
class GoogleAPIError(Exception):
|
| 16 |
pass
|
| 17 |
|
| 18 |
-
from app.config.settings import GEMINI_API_KEY
|
| 19 |
|
| 20 |
_gemini_client = None
|
| 21 |
-
_GEMINI_MODEL =
|
| 22 |
|
| 23 |
if GEMINI_API_KEY and genai is not None:
|
| 24 |
try:
|
|
|
|
| 15 |
class GoogleAPIError(Exception):
|
| 16 |
pass
|
| 17 |
|
| 18 |
+
from app.config.settings import GEMINI_API_KEY, GEMINI_MODEL
|
| 19 |
|
| 20 |
_gemini_client = None
|
| 21 |
+
_GEMINI_MODEL = GEMINI_MODEL
|
| 22 |
|
| 23 |
if GEMINI_API_KEY and genai is not None:
|
| 24 |
try:
|