mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-05-12 09:12:40 +02:00
Expand orchestration gate coverage to resume and regenerate flows.
This commit is contained in:
parent
52593d88db
commit
0f40279d95
3 changed files with 128 additions and 8 deletions
|
|
@ -101,8 +101,38 @@ async def stream_resume(
|
|||
filesystem_selection: FilesystemSelection | None = None,
|
||||
request_id: str | None = None,
|
||||
disabled_tools: list[str] | None = None,
|
||||
orchestration_input: StreamExecutionInput | None = None,
|
||||
) -> AsyncGenerator[str, None]:
|
||||
"""Resume an interrupted chat turn through the current production pipeline."""
|
||||
if orchestration_input is not None:
|
||||
result = StreamOutput(
|
||||
request_id=request_id,
|
||||
turn_id=f"{chat_id}:orchestrator-resume",
|
||||
filesystem_mode=(
|
||||
filesystem_selection.mode.value if filesystem_selection else "cloud"
|
||||
),
|
||||
client_platform=(
|
||||
filesystem_selection.client_platform.value
|
||||
if filesystem_selection
|
||||
else "web"
|
||||
),
|
||||
)
|
||||
async for frame in stream_agent_events(
|
||||
agent=orchestration_input.agent,
|
||||
config=orchestration_input.config,
|
||||
input_data=orchestration_input.input_data,
|
||||
streaming_service=orchestration_input.streaming_service,
|
||||
result=result,
|
||||
step_prefix=orchestration_input.step_prefix,
|
||||
initial_step_id=orchestration_input.initial_step_id,
|
||||
initial_step_title=orchestration_input.initial_step_title,
|
||||
initial_step_items=orchestration_input.initial_step_items,
|
||||
content_builder=orchestration_input.content_builder,
|
||||
runtime_context=orchestration_input.runtime_context,
|
||||
):
|
||||
yield frame
|
||||
return
|
||||
|
||||
async for chunk in stream_resume_chat(
|
||||
chat_id=chat_id,
|
||||
search_space_id=search_space_id,
|
||||
|
|
@ -136,8 +166,38 @@ async def stream_regenerate(
|
|||
request_id: str | None = None,
|
||||
user_image_data_urls: list[str] | None = None,
|
||||
flow: Literal["new", "regenerate"] = "regenerate",
|
||||
orchestration_input: StreamExecutionInput | None = None,
|
||||
) -> AsyncGenerator[str, None]:
|
||||
"""Regenerate an assistant turn through the current production pipeline."""
|
||||
if orchestration_input is not None:
|
||||
result = StreamOutput(
|
||||
request_id=request_id,
|
||||
turn_id=f"{chat_id}:orchestrator-regenerate",
|
||||
filesystem_mode=(
|
||||
filesystem_selection.mode.value if filesystem_selection else "cloud"
|
||||
),
|
||||
client_platform=(
|
||||
filesystem_selection.client_platform.value
|
||||
if filesystem_selection
|
||||
else "web"
|
||||
),
|
||||
)
|
||||
async for frame in stream_agent_events(
|
||||
agent=orchestration_input.agent,
|
||||
config=orchestration_input.config,
|
||||
input_data=orchestration_input.input_data,
|
||||
streaming_service=orchestration_input.streaming_service,
|
||||
result=result,
|
||||
step_prefix=orchestration_input.step_prefix,
|
||||
initial_step_id=orchestration_input.initial_step_id,
|
||||
initial_step_title=orchestration_input.initial_step_title,
|
||||
initial_step_items=orchestration_input.initial_step_items,
|
||||
content_builder=orchestration_input.content_builder,
|
||||
runtime_context=orchestration_input.runtime_context,
|
||||
):
|
||||
yield frame
|
||||
return
|
||||
|
||||
async for chunk in stream_new_chat(
|
||||
user_query=user_query,
|
||||
search_space_id=search_space_id,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue