Skip to content

Commit

Permalink
Enhance classifier route to generate unique user IDs using UUID
Browse files Browse the repository at this point in the history
  • Loading branch information
Luisotee committed Dec 9, 2024
1 parent 98a479b commit 626084a
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions apps/ai_api/eda_ai_api/api/routes/classifier.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import os
from typing import Any, Dict, Optional
import uuid

from fastapi import APIRouter, File, Form, UploadFile
from llama_index.core import PromptTemplate
Expand Down Expand Up @@ -97,15 +98,16 @@ async def classifier_route(
message: Optional[str] = Form(default=None),
audio: Optional[UploadFile] = File(default=None),
session_id: Optional[str] = Form(default=None),
user_id: Optional[str] = Form(default=None),
) -> ClassifierResponse:
"""Main route handler with conversation memory"""
try:
logger.info(f"New request - Session: {session_id}, User: {user_id}")
logger.info(
f"New request - Session: {session_id}, User: {session_id + uuid.uuid4().hex}"
)

zep = ZepConversationManager()
session_id = await zep.get_or_create_session(
user_id=user_id, session_id=session_id
user_id=session_id + uuid.uuid4().hex, session_id=session_id
)

# Process inputs
Expand Down

0 comments on commit 626084a

Please sign in to comment.