diff --git a/src/Responses/Chat/CreateResponseToolCall.php b/src/Responses/Chat/CreateResponseToolCall.php index b14a0776..17560b2e 100644 --- a/src/Responses/Chat/CreateResponseToolCall.php +++ b/src/Responses/Chat/CreateResponseToolCall.php @@ -13,13 +13,13 @@ private function __construct( ) {} /** - * @param array{id: string, type: string, function: array{name: string, arguments: string}} $attributes + * @param array{id: string, type?: string, function: array{name: string, arguments: string}} $attributes */ public static function from(array $attributes): self { return new self( $attributes['id'], - $attributes['type'], + $attributes['type'] ?? 'function', CreateResponseToolCallFunction::from($attributes['function']), ); }