mirror of
https://github.com/MODSetter/SurfSense.git
synced 2025-09-02 02:29:08 +00:00
Updated section streaming for report sections.
This commit is contained in:
parent
92781e726c
commit
ef761f1a43
1 changed files with 7 additions and 7 deletions
|
@ -1066,6 +1066,13 @@ async def process_sections(state: State, config: RunnableConfig, writer: StreamW
|
||||||
final_report.append(content)
|
final_report.append(content)
|
||||||
final_report.append("\n")
|
final_report.append("\n")
|
||||||
|
|
||||||
|
# Stream each section with its title
|
||||||
|
writer(
|
||||||
|
{
|
||||||
|
"yield_value": state.streaming_service.format_text_chunk(f"# {section.section_title}\n\n{content}")
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
# Join all sections with newlines
|
# Join all sections with newlines
|
||||||
final_written_report = "\n".join(final_report)
|
final_written_report = "\n".join(final_report)
|
||||||
|
@ -1219,13 +1226,6 @@ async def process_section_with_documents(
|
||||||
complete_answer.extend(content_lines)
|
complete_answer.extend(content_lines)
|
||||||
complete_answer.append("") # Empty line after content
|
complete_answer.append("") # Empty line after content
|
||||||
|
|
||||||
# Update answer in UI in real-time
|
|
||||||
state.streaming_service.only_update_answer(complete_answer)
|
|
||||||
writer(
|
|
||||||
{
|
|
||||||
"yield_value": state.streaming_service._format_annotations()
|
|
||||||
}
|
|
||||||
)
|
|
||||||
|
|
||||||
# Set default if no content was received
|
# Set default if no content was received
|
||||||
if not complete_content:
|
if not complete_content:
|
||||||
|
|
Loading…
Add table
Reference in a new issue