File tree Expand file tree Collapse file tree 10 files changed +552
-5
lines changed Expand file tree Collapse file tree 10 files changed +552
-5
lines changed Original file line number Diff line number Diff line change 324
324
ConversationTextResponse ,
325
325
UserStartedSpeakingResponse ,
326
326
AgentThinkingResponse ,
327
+ FunctionCall ,
327
328
FunctionCallRequest ,
328
329
AgentStartedSpeakingResponse ,
329
330
AgentAudioDoneResponse ,
Original file line number Diff line number Diff line change 338
338
ConversationTextResponse ,
339
339
UserStartedSpeakingResponse ,
340
340
AgentThinkingResponse ,
341
+ FunctionCall ,
341
342
FunctionCallRequest ,
342
343
AgentStartedSpeakingResponse ,
343
344
AgentAudioDoneResponse ,
Original file line number Diff line number Diff line change 347
347
ConversationTextResponse ,
348
348
UserStartedSpeakingResponse ,
349
349
AgentThinkingResponse ,
350
+ FunctionCall ,
350
351
FunctionCallRequest ,
351
352
AgentStartedSpeakingResponse ,
352
353
AgentAudioDoneResponse ,
Original file line number Diff line number Diff line change 22
22
ConversationTextResponse ,
23
23
UserStartedSpeakingResponse ,
24
24
AgentThinkingResponse ,
25
+ FunctionCall ,
25
26
FunctionCallRequest ,
26
27
AgentStartedSpeakingResponse ,
27
28
AgentAudioDoneResponse ,
Original file line number Diff line number Diff line change 21
21
ConversationTextResponse as LatestConversationTextResponse ,
22
22
UserStartedSpeakingResponse as LatestUserStartedSpeakingResponse ,
23
23
AgentThinkingResponse as LatestAgentThinkingResponse ,
24
+ FunctionCall as LatestFunctionCall ,
24
25
FunctionCallRequest as LatestFunctionCallRequest ,
25
26
AgentStartedSpeakingResponse as LatestAgentStartedSpeakingResponse ,
26
27
AgentAudioDoneResponse as LatestAgentAudioDoneResponse ,
70
71
ConversationTextResponse = LatestConversationTextResponse
71
72
UserStartedSpeakingResponse = LatestUserStartedSpeakingResponse
72
73
AgentThinkingResponse = LatestAgentThinkingResponse
74
+ FunctionCall = LatestFunctionCall
73
75
FunctionCallRequest = LatestFunctionCallRequest
74
76
AgentStartedSpeakingResponse = LatestAgentStartedSpeakingResponse
75
77
AgentAudioDoneResponse = LatestAgentAudioDoneResponse
Original file line number Diff line number Diff line change 26
26
ConversationTextResponse ,
27
27
UserStartedSpeakingResponse ,
28
28
AgentThinkingResponse ,
29
+ FunctionCall ,
29
30
FunctionCallRequest ,
30
31
AgentStartedSpeakingResponse ,
31
32
AgentAudioDoneResponse ,
Original file line number Diff line number Diff line change 18
18
ConversationTextResponse ,
19
19
UserStartedSpeakingResponse ,
20
20
AgentThinkingResponse ,
21
+ FunctionCall ,
21
22
FunctionCallRequest ,
22
23
AgentStartedSpeakingResponse ,
23
24
AgentAudioDoneResponse ,
Original file line number Diff line number Diff line change @@ -448,8 +448,9 @@ class FunctionCallResponse(BaseResponse):
448
448
"""
449
449
450
450
type : str = "FunctionCallResponse"
451
- function_call_id : str = field (default = "" )
452
- output : str = field (default = "" )
451
+ id : str = field (default = "" )
452
+ name : str = field (default = "" )
453
+ content : str = field (default = "" )
453
454
454
455
455
456
# Agent Keep Alive
Original file line number Diff line number Diff line change @@ -68,16 +68,43 @@ class AgentThinkingResponse(BaseResponse):
68
68
content : str
69
69
70
70
71
+ @dataclass
72
+ class FunctionCall (BaseResponse ):
73
+ """
74
+ Individual function call within a FunctionCallRequest.
75
+ """
76
+
77
+ id : str
78
+ name : str
79
+ arguments : str
80
+ client_side : bool
81
+
82
+
71
83
@dataclass
72
84
class FunctionCallRequest (BaseResponse ):
73
85
"""
74
86
The FunctionCallRequest message is used to call a function from the server to the client.
75
87
"""
76
88
77
89
type : str
78
- function_name : str
79
- function_call_id : str
80
- input : str
90
+ functions : List [FunctionCall ]
91
+
92
+ def __post_init__ (self ):
93
+ """Convert dict functions to FunctionCall objects if needed."""
94
+ if self .functions :
95
+ self .functions = [
96
+ FunctionCall .from_dict (func ) if isinstance (func , dict ) else func
97
+ for func in self .functions
98
+ ]
99
+
100
+ def __getitem__ (self , key ):
101
+ _dict = self .to_dict ()
102
+ if "functions" in _dict and isinstance (_dict ["functions" ], list ):
103
+ _dict ["functions" ] = [
104
+ FunctionCall .from_dict (func ) if isinstance (func , dict ) else func
105
+ for func in _dict ["functions" ]
106
+ ]
107
+ return _dict [key ]
81
108
82
109
83
110
@dataclass
You can’t perform that action at this time.
0 commit comments