File tree Expand file tree Collapse file tree 1 file changed +2
-3
lines changed Expand file tree Collapse file tree 1 file changed +2
-3
lines changed Original file line number Diff line number Diff line change @@ -267,14 +267,13 @@ public static function fromArray(array $array): MessagePart
267
267
}
268
268
$ functionCallData = $ array ['functionCall ' ];
269
269
return new self (FunctionCall::fromArray ($ functionCallData ));
270
- } elseif ($ type ->isFunctionResponse ()) {
270
+ } else {
271
+ // Function response is the only remaining option
271
272
if (!isset ($ array ['functionResponse ' ])) {
272
273
throw new \InvalidArgumentException ('Function response message part requires functionResponse field. ' );
273
274
}
274
275
$ functionResponseData = $ array ['functionResponse ' ];
275
276
return new self (FunctionResponse::fromArray ($ functionResponseData ));
276
277
}
277
-
278
- throw new \InvalidArgumentException (sprintf ('Unknown message part type: %s ' , $ array ['type ' ]));
279
278
}
280
279
}
You can’t perform that action at this time.
0 commit comments