@@ -438,6 +438,7 @@ async def _persist_interrupted_turn(
438438 and updated when ready.
439439
440440 Parameters:
441+ ----------
441442 context: The response generator context.
442443 responses_params: The Responses API parameters.
443444 turn_summary: TurnSummary with llm_response already set to the
@@ -507,11 +508,13 @@ def _register_interrupt_callback(
507508 both persist the same turn.
508509
509510 Parameters:
511+ ----------
510512 context: The response generator context.
511513 responses_params: The Responses API parameters.
512514 turn_summary: TurnSummary populated during streaming.
513515
514516 Returns:
517+ -------
515518 A mutable list ``[False]`` used as a persist-done guard; the
516519 caller should check ``guard[0]`` before persisting and set
517520 it to ``True`` afterwards.
@@ -904,9 +907,11 @@ def format_stream_data(d: dict) -> str:
904907 Create a response generator function for Responses API streaming.
905908
906909 Parameters:
910+ ----------
907911 d (dict): The data to be formatted as an SSE event.
908912
909913 Returns:
914+ -------
910915 str: The formatted SSE data string.
911916 """
912917 data = json .dumps (d )
@@ -921,11 +926,13 @@ def stream_start_event(conversation_id: str, request_id: str) -> str:
921926 use the request ID to issue an interrupt if needed.
922927
923928 Parameters:
929+ ----------
924930 conversation_id (str): Unique identifier for the conversation.
925931 request_id (str): Unique SUID for this streaming request,
926932 returned to the client for interrupt support.
927933
928934 Returns:
935+ -------
929936 str: SSE-formatted string representing the start event.
930937 """
931938 return format_stream_data (
@@ -947,9 +954,11 @@ def stream_interrupted_event(request_id: str) -> str:
947954 from an unexpected connection drop.
948955
949956 Parameters:
957+ ----------
950958 request_id (str): Unique identifier for the interrupted request.
951959
952960 Returns:
961+ -------
953962 str: SSE-formatted string representing the interrupted event.
954963 """
955964 return format_stream_data (
@@ -975,12 +984,14 @@ def stream_end_event(
975984 including referenced document metadata and token usage information.
976985
977986 Parameters:
987+ ----------
978988 token_usage (TokenCounter): Token usage information.
979989 available_quotas (dict[str, int]): Available quotas for the user.
980990 referenced_documents (list[ReferencedDocument]): List of referenced documents.
981991 media_type (str): The media type for the response format.
982992
983993 Returns:
994+ -------
984995 str: A Server-Sent Events (SSE) formatted string
985996 representing the end of the data stream.
986997 """
0 commit comments