Spaces:
Running
Running
axeronis commited on
Commit ·
cc60d0c
1
Parent(s): a0c82c7
Standardize Gemini Model to 2.5 Flash across config, client, and logs
Browse files
backend/app/api/evolution_webhook.py
CHANGED
|
@@ -328,7 +328,7 @@ async def process_evolution_message(
|
|
| 328 |
status=MessageStatus.PENDING, # Init as PENDING
|
| 329 |
prompt_tokens=response["prompt_tokens"],
|
| 330 |
completion_tokens=response["completion_tokens"],
|
| 331 |
-
model_used=
|
| 332 |
)
|
| 333 |
session.add(ai_message)
|
| 334 |
|
|
|
|
| 328 |
status=MessageStatus.PENDING, # Init as PENDING
|
| 329 |
prompt_tokens=response["prompt_tokens"],
|
| 330 |
completion_tokens=response["completion_tokens"],
|
| 331 |
+
model_used=settings.GEMINI_MODEL
|
| 332 |
)
|
| 333 |
session.add(ai_message)
|
| 334 |
|
backend/app/api/telegram_webhook.py
CHANGED
|
@@ -204,7 +204,7 @@ async def process_telegram_message(
|
|
| 204 |
content=response["text"],
|
| 205 |
prompt_tokens=response["prompt_tokens"],
|
| 206 |
completion_tokens=response["completion_tokens"],
|
| 207 |
-
model_used=
|
| 208 |
)
|
| 209 |
session.add(ai_msg)
|
| 210 |
lead.processing_status = "idle"
|
|
|
|
| 204 |
content=response["text"],
|
| 205 |
prompt_tokens=response["prompt_tokens"],
|
| 206 |
completion_tokens=response["completion_tokens"],
|
| 207 |
+
model_used=settings.GEMINI_MODEL
|
| 208 |
)
|
| 209 |
session.add(ai_msg)
|
| 210 |
lead.processing_status = "idle"
|
backend/app/api/webhook.py
CHANGED
|
@@ -683,7 +683,7 @@ async def process_ai_response_background(
|
|
| 683 |
status=MessageStatus.PENDING, # Initialize as PENDING
|
| 684 |
prompt_tokens=ai_response["prompt_tokens"],
|
| 685 |
completion_tokens=ai_response["completion_tokens"],
|
| 686 |
-
model_used=
|
| 687 |
)
|
| 688 |
session.add(ai_message)
|
| 689 |
await session.commit()
|
|
|
|
| 683 |
status=MessageStatus.PENDING, # Initialize as PENDING
|
| 684 |
prompt_tokens=ai_response["prompt_tokens"],
|
| 685 |
completion_tokens=ai_response["completion_tokens"],
|
| 686 |
+
model_used=settings.GEMINI_MODEL
|
| 687 |
)
|
| 688 |
session.add(ai_message)
|
| 689 |
await session.commit()
|
backend/app/core/config.py
CHANGED
|
@@ -25,7 +25,7 @@ class Settings(BaseSettings):
|
|
| 25 |
|
| 26 |
# Google Gemini AI
|
| 27 |
GEMINI_API_KEY: Optional[str] = None
|
| 28 |
-
GEMINI_MODEL: str = "gemini-flash"
|
| 29 |
|
| 30 |
# OpenAI API (Embeddings & LLM)
|
| 31 |
OPENAI_API_KEY: Optional[str] = None
|
|
|
|
| 25 |
|
| 26 |
# Google Gemini AI
|
| 27 |
GEMINI_API_KEY: Optional[str] = None
|
| 28 |
+
GEMINI_MODEL: str = "gemini-2.5-flash"
|
| 29 |
|
| 30 |
# OpenAI API (Embeddings & LLM)
|
| 31 |
OPENAI_API_KEY: Optional[str] = None
|
backend/app/services/llm_client.py
CHANGED
|
@@ -35,8 +35,8 @@ class GeminiLLMClient:
|
|
| 35 |
else:
|
| 36 |
genai.configure(api_key=settings.GEMINI_API_KEY)
|
| 37 |
|
| 38 |
-
# Using
|
| 39 |
-
self.default_model_name =
|
| 40 |
self.ai_queue = get_ai_queue() # Rate limiting queue
|
| 41 |
|
| 42 |
logger.info(f"✅ Gemini LLM client initialized (model: {self.default_model_name})")
|
|
|
|
| 35 |
else:
|
| 36 |
genai.configure(api_key=settings.GEMINI_API_KEY)
|
| 37 |
|
| 38 |
+
# Using model from settings with context caching support
|
| 39 |
+
self.default_model_name = settings.GEMINI_MODEL
|
| 40 |
self.ai_queue = get_ai_queue() # Rate limiting queue
|
| 41 |
|
| 42 |
logger.info(f"✅ Gemini LLM client initialized (model: {self.default_model_name})")
|