18 lines
490 B
Python
18 lines
490 B
Python
"""
|
|
|
|
"""
|
|
from langgraph.runtime import Runtime
|
|
from typing import List, Dict, Any
|
|
|
|
from app.chat_qa_query.query_qa_state import QueryQAState
|
|
|
|
|
|
async def answer_output(state: QueryQAState, runtime: Runtime):
|
|
writer = runtime.stream_writer
|
|
qa_pairs = state.get("qa_pairs", [])
|
|
|
|
if qa_pairs and isinstance(qa_pairs, list):
|
|
content_list = [item.get("content", "") for item in qa_pairs if item.get("content")][:2]
|
|
writer(content_list)
|
|
else:
|
|
writer([]) |