Spaces:
Sleeping

axeronis commited on
Commit
6170320
·
1 Parent(s): e30a117

Fix: Remove GEMINI_API_KEY references, use GROQ_API_KEY

Browse files
backend/app/api/webhook.py CHANGED
@@ -447,7 +447,6 @@ async def process_ai_response_background(
447
  conversation_history=conversation_history
448
  )
449
 
450
- # Save AI message
451
  ai_message = Message(
452
  tenant_id=tenant.id,
453
  conversation_id=conversation.id,
@@ -455,7 +454,7 @@ async def process_ai_response_background(
455
  content=ai_response["text"],
456
  prompt_tokens=ai_response["prompt_tokens"],
457
  completion_tokens=ai_response["completion_tokens"],
458
- model_used=settings.GEMINI_MODEL
459
  )
460
  session.add(ai_message)
461
  await session.commit()
 
447
  conversation_history=conversation_history
448
  )
449
 
 
450
  ai_message = Message(
451
  tenant_id=tenant.id,
452
  conversation_id=conversation.id,
 
454
  content=ai_response["text"],
455
  prompt_tokens=ai_response["prompt_tokens"],
456
  completion_tokens=ai_response["completion_tokens"],
457
+ model_used="llama-3.1-70b-versatile" # Groq model
458
  )
459
  session.add(ai_message)
460
  await session.commit()
backend/app/main.py CHANGED
@@ -184,9 +184,9 @@ app.include_router(team.router, prefix="/api/v1") # Team Management (owner only
184
  async def on_startup():
185
  """Initialize application on startup."""
186
  # Validate critical environment variables
187
- if not settings.GEMINI_API_KEY or len(settings.GEMINI_API_KEY) < 20:
188
- logger.error("Invalid or missing GEMINI_API_KEY")
189
- raise RuntimeError("GEMINI_API_KEY must be configured")
190
 
191
  if not settings.SECRET_KEY or len(settings.SECRET_KEY) < 32:
192
  logger.error("Invalid or missing SECRET_KEY")
 
184
  async def on_startup():
185
  """Initialize application on startup."""
186
  # Validate critical environment variables
187
+ if not settings.GROQ_API_KEY or len(settings.GROQ_API_KEY) < 20:
188
+ logger.error("Invalid or missing GROQ_API_KEY")
189
+ raise RuntimeError("GROQ_API_KEY must be configured")
190
 
191
  if not settings.SECRET_KEY or len(settings.SECRET_KEY) < 32:
192
  logger.error("Invalid or missing SECRET_KEY")