Spaces:
Running
Running
Charles Grandjean
commited on
Commit
·
787df05
1
Parent(s):
08e396b
logging the request
Browse files- agent_api.py +3 -0
agent_api.py
CHANGED
|
@@ -20,9 +20,11 @@ import secrets
|
|
| 20 |
from langraph_agent import CyberLegalAgent
|
| 21 |
from agent_state import ConversationManager
|
| 22 |
from utils import validate_query
|
|
|
|
| 23 |
|
| 24 |
# Load environment variables
|
| 25 |
load_dotenv(dotenv_path=".env", override=False)
|
|
|
|
| 26 |
|
| 27 |
# Initialize FastAPI app
|
| 28 |
app = FastAPI(
|
|
@@ -93,6 +95,7 @@ class CyberLegalAPI:
|
|
| 93 |
raise HTTPException(status_code=400, detail=error_msg)
|
| 94 |
|
| 95 |
# Convert conversation history format
|
|
|
|
| 96 |
conversation_history = []
|
| 97 |
for msg in request.conversationHistory or []:
|
| 98 |
conversation_history.append({
|
|
|
|
| 20 |
from langraph_agent import CyberLegalAgent
|
| 21 |
from agent_state import ConversationManager
|
| 22 |
from utils import validate_query
|
| 23 |
+
import logging
|
| 24 |
|
| 25 |
# Load environment variables
|
| 26 |
load_dotenv(dotenv_path=".env", override=False)
|
| 27 |
+
logger = logging.getLogger(__name__)
|
| 28 |
|
| 29 |
# Initialize FastAPI app
|
| 30 |
app = FastAPI(
|
|
|
|
| 95 |
raise HTTPException(status_code=400, detail=error_msg)
|
| 96 |
|
| 97 |
# Convert conversation history format
|
| 98 |
+
logger.info(f"Received this request: {request}")
|
| 99 |
conversation_history = []
|
| 100 |
for msg in request.conversationHistory or []:
|
| 101 |
conversation_history.append({
|