@@ -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.
@@ -877,6 +880,7 @@ def stream_http_error_event(
877880 Args:
878881 error: An AbstractErrorResponse instance representing the error.
879882 media_type: The media type for the response format. Defaults to MEDIA_TYPE_JSON if None.
883+
880884 Returns:
881885 str: A Server-Sent Events (SSE) formatted error message containing
882886 the serialized error details.
@@ -903,9 +907,11 @@ def format_stream_data(d: dict) -> str:
903907 Create a response generator function for Responses API streaming.
904908
905909 Parameters:
910+ ----------
906911 d (dict): The data to be formatted as an SSE event.
907912
908913 Returns:
914+ -------
909915 str: The formatted SSE data string.
910916 """
911917 data = json .dumps (d )
@@ -920,11 +926,13 @@ def stream_start_event(conversation_id: str, request_id: str) -> str:
920926 use the request ID to issue an interrupt if needed.
921927
922928 Parameters:
929+ ----------
923930 conversation_id (str): Unique identifier for the conversation.
924931 request_id (str): Unique SUID for this streaming request,
925932 returned to the client for interrupt support.
926933
927934 Returns:
935+ -------
928936 str: SSE-formatted string representing the start event.
929937 """
930938 return format_stream_data (
@@ -946,9 +954,11 @@ def stream_interrupted_event(request_id: str) -> str:
946954 from an unexpected connection drop.
947955
948956 Parameters:
957+ ----------
949958 request_id (str): Unique identifier for the interrupted request.
950959
951960 Returns:
961+ -------
952962 str: SSE-formatted string representing the interrupted event.
953963 """
954964 return format_stream_data (
@@ -974,12 +984,14 @@ def stream_end_event(
974984 including referenced document metadata and token usage information.
975985
976986 Parameters:
987+ ----------
977988 token_usage (TokenCounter): Token usage information.
978989 available_quotas (dict[str, int]): Available quotas for the user.
979990 referenced_documents (list[ReferencedDocument]): List of referenced documents.
980991 media_type (str): The media type for the response format.
981992
982993 Returns:
994+ -------
983995 str: A Server-Sent Events (SSE) formatted string
984996 representing the end of the data stream.
985997 """
0 commit comments