Spaces:
Runtime error
Runtime error
add logging for llm output
Browse files
main.py
CHANGED
@@ -365,9 +365,13 @@ async def search_assistant(query: SearchQueryModel, api_key: str = Depends(verif
|
|
365 |
raise HTTPException(status_code=500, detail="Failed to fetch search data")
|
366 |
|
367 |
def process_response():
|
|
|
|
|
368 |
for content in chat_with_llama_stream(messages, model=query.model_id):
|
|
|
369 |
yield content
|
370 |
logger.info(f"Completed search assistant response for query: {query.query}")
|
|
|
371 |
|
372 |
return StreamingResponse(process_response(), media_type="text/event-stream")
|
373 |
|
|
|
365 |
raise HTTPException(status_code=500, detail="Failed to fetch search data")
|
366 |
|
367 |
def process_response():
|
368 |
+
logger.info(f"Generating response using LLM: {messages}")
|
369 |
+
full_response = ""
|
370 |
for content in chat_with_llama_stream(messages, model=query.model_id):
|
371 |
+
full_response+=content
|
372 |
yield content
|
373 |
logger.info(f"Completed search assistant response for query: {query.query}")
|
374 |
+
logger.info(f"LLM Response: {full_response}")
|
375 |
|
376 |
return StreamingResponse(process_response(), media_type="text/event-stream")
|
377 |
|