File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change 71
71
->message ->content ->toBe ('Hi, there! ' )
72
72
8000
->message ->role ->toBe ('assistant ' );
73
73
});
74
+
75
+ test ('fake with function call ' , function () {
76
+ $ response = CreateResponse::fake ([
77
+ 'id ' => 'chatcmpl-111 ' ,
78
+ 'choices ' => [
79
+ [
80
+ 'message ' => [
81
+ 'function_call ' => [
82
+ 'name ' => 'get_current_weather ' ,
83
+ 'arguments ' => "{ \n \"location \": \"Boston, MA \"\n} " ,
84
+ ],
85
+ ],
86
+ 'finish_reason ' => 'function_call ' ,
87
+ ],
88
+ ],
89
+ ]);
90
+
91
+ expect ($ response )
92
+ ->id ->toBe ('chatcmpl-111 ' )
93
+ ->and ($ response ->choices [0 ])
94
+ ->message ->functionCall ->name ->toBe ('get_current_weather ' )
95
+ ->message ->functionCall ->arguments ->toBe ("{ \n \"location \": \"Boston, MA \"\n} " )
96
+ ->finishReason ->toBe ('function_call ' );
97
+ });
You can’t perform that action at this time.
0 commit comments