From 32c4f914c41da022de207867e25cb927da94e985 Mon Sep 17 00:00:00 2001 From: Mark Backman Date: Sat, 20 Dec 2025 08:06:39 -0500 Subject: [PATCH] Add event handling and class for response.function_call_arguments.delta --- src/pipecat/services/grok/realtime/events.py | 21 ++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/pipecat/services/grok/realtime/events.py b/src/pipecat/services/grok/realtime/events.py index 513e4f287..7bc92b87f 100644 --- a/src/pipecat/services/grok/realtime/events.py +++ b/src/pipecat/services/grok/realtime/events.py @@ -633,6 +633,26 @@ class ResponseAudioDone(ServerEvent): item_id: str +class ResponseFunctionCallArgumentsDelta(ServerEvent): + """Event containing incremental function call arguments. + + Parameters: + type: Event type, always "response.function_call_arguments.delta". + response_id: ID of the response. + item_id: ID of the conversation item. + call_id: ID of the function call. + delta: Incremental function arguments as JSON. + previous_item_id: ID of the previous item, if any. + """ + + type: Literal["response.function_call_arguments.delta"] + response_id: Optional[str] = None + item_id: Optional[str] = None + call_id: str + delta: str + previous_item_id: Optional[str] = None + + class ResponseFunctionCallArgumentsDone(ServerEvent): """Event indicating function call arguments are complete. @@ -824,6 +844,7 @@ _server_event_types = { "response.output_audio_transcript.done": ResponseAudioTranscriptDone, "response.output_audio.delta": ResponseAudioDelta, "response.output_audio.done": ResponseAudioDone, + "response.function_call_arguments.delta": ResponseFunctionCallArgumentsDelta, "response.function_call_arguments.done": ResponseFunctionCallArgumentsDone, "response.done": ResponseDone, }