Spaces:
Sleeping
Sleeping
Commit ·
4b89ce5
1
Parent(s): 51a3d33
Refactor get_summaries and chat endpoints to improve logging and remove unnecessary whitespace
Browse files
app.py
CHANGED
|
@@ -70,7 +70,6 @@ async def save_summary(request: Request):
|
|
| 70 |
|
| 71 |
@app.post("/summaries")
|
| 72 |
async def get_summaries(request: Request):
|
| 73 |
-
|
| 74 |
|
| 75 |
data = await request.json()
|
| 76 |
print(data)
|
|
@@ -86,9 +85,15 @@ async def get_summaries(request: Request):
|
|
| 86 |
@app.post("/chat")
|
| 87 |
async def chat(request: Request):
|
| 88 |
data = await request.json()
|
|
|
|
|
|
|
|
|
|
| 89 |
user_input = data.get("message", "")
|
| 90 |
chat_history = data.get("chat_history", [])
|
| 91 |
|
|
|
|
|
|
|
|
|
|
| 92 |
# Invoke the RAG chatbot graph
|
| 93 |
result = rag_graph.invoke({
|
| 94 |
"user_input": user_input,
|
|
|
|
| 70 |
|
| 71 |
@app.post("/summaries")
|
| 72 |
async def get_summaries(request: Request):
|
|
|
|
| 73 |
|
| 74 |
data = await request.json()
|
| 75 |
print(data)
|
|
|
|
| 85 |
@app.post("/chat")
|
| 86 |
async def chat(request: Request):
|
| 87 |
data = await request.json()
|
| 88 |
+
|
| 89 |
+
print(f"Chat request data: {data}")
|
| 90 |
+
|
| 91 |
user_input = data.get("message", "")
|
| 92 |
chat_history = data.get("chat_history", [])
|
| 93 |
|
| 94 |
+
print(f"User input: {user_input}")
|
| 95 |
+
print(f"Chat history: {chat_history}")
|
| 96 |
+
|
| 97 |
# Invoke the RAG chatbot graph
|
| 98 |
result = rag_graph.invoke({
|
| 99 |
"user_input": user_input,
|