Fix #359: Fix conversation storage error in summarize mode#400
Fix #359: Fix conversation storage error in summarize mode#400veeceey wants to merge 1 commit intonlweb-ai:mainfrom
Conversation
…versationExchange The storeConversationExchange method referenced handler.return_value['content'] which no longer exists. In summarize mode, handler.summary is a plain string, so calling .get() on it caused the error. Changes: - Use handler.final_ranked_answers instead of handler.return_value['content'] - Handle summarize mode by using handler.summary directly - Fix response serialization to extract from final_ranked_answers
5a75af6 to
ef3735f
Compare
Manual Test Results - Fix VerifiedTested locally with Ollama (gemma3:12b) + Qdrant local storage. Test 1: Normal mode (list) via Chat SSEQuery: Result: 1 result returned ("A Matter of Life and Death", score 78), conversation stored successfully. {
"user_id": "test-user-123",
"query": "what are the best sci-fi movies",
"conversation_id": "conv_test1770362590",
"summary": "The query about best sci-fi movies yielded a single, highly-regarded film: A Matter of Life and Death...",
"main_topics": ["British cinema", "World War II", "Fantasy", "Romance"],
"response_items": 1,
"response_names": ["A Matter of Life and Death"]
}No errors. Test 2: Summarize mode via Chat SSEQuery: Result: 2 results returned + LLM-generated summary. Conversation stored successfully. {
"user_id": "test-user-456",
"query": "tell me about classic sci-fi movies",
"conversation_id": "conv_summ1770362649",
"summary": "Classic sci-fi movies include \"A Matter of Life and Death\" (1946)... and \"Manhunt of Mystery Island\" (1945)...",
"response_items": 2,
"response_names": ["A Matter of Life and Death", "Manhunt of Mystery Island"]
}No errors. The summarize mode Conversation Storage Proof2 conversations successfully stored in Qdrant (
Error CheckThe fix correctly uses |
|
All checks passing ✓ CodeQL Advanced: SUCCESS | Mergeable: YES. Manual test evidence provided in PR description. Ready for maintainer review and merge. |
|
Hi maintainers, friendly ping on this PR. All checks are passing and manual test evidence has been provided. Would appreciate a review when you get a chance. Thank you! |
Summary
'str' object has no attribute 'get'error instoreConversationExchangehandler.return_value['content']which no longer existshandler.summaryis a plain string, causing.get()to fail on string charactersChanges
handler.final_ranked_answersfor result iteration instead of removedreturn_value['content']handler.summarydirectly as the conversation summaryfinal_ranked_answersTest plan
final_ranked_answersstructure inranking.py(list of dicts with url, name, ranking, schema_object keys)handler.summaryis a string set bySummarizeResultsinpost_ranking.py