From 991e871018499757c4b17785069456503c73f004 Mon Sep 17 00:00:00 2001 From: ewan-nrp Date: Fri, 13 Mar 2026 23:49:15 -0400 Subject: [PATCH] fix: when calling tools on xai provider with no parameters causing an api error --- src/Providers/XAI/Maps/ToolMap.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Providers/XAI/Maps/ToolMap.php b/src/Providers/XAI/Maps/ToolMap.php index 59ef7466e..cb82bf8ba 100644 --- a/src/Providers/XAI/Maps/ToolMap.php +++ b/src/Providers/XAI/Maps/ToolMap.php @@ -5,6 +5,7 @@ namespace Prism\Prism\Providers\XAI\Maps; use Prism\Prism\Tool; +use stdClass; class ToolMap { @@ -21,7 +22,7 @@ public static function Map(array $tools): array 'description' => $tool->description(), 'parameters' => [ 'type' => 'object', - 'properties' => $tool->parametersAsArray(), + 'properties' => $tool->parametersAsArray() ?: new stdClass(), 'required' => $tool->requiredParameters(), ], ],