Skip to content

Commit 7738937

Browse files
committed
fix openai tool call without arguments
1 parent 3472ab4 commit 7738937

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/Providers/OpenAI/MessageMapper.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
use NeuronAI\Exceptions\ProviderException;
1919
use NeuronAI\Providers\MessageMapperInterface;
2020
use NeuronAI\Tools\ToolInterface;
21+
use stdClass;
2122

2223
use function array_filter;
2324
use function array_is_list;
@@ -121,7 +122,7 @@ protected function mapToolCall(ToolCallMessage $message): array
121122
'type' => 'function',
122123
'function' => [
123124
'name' => $tool->getName(),
124-
'arguments' => json_encode($tool->getInputs() === [] ? new \stdClass() : $tool->getInputs()),
125+
'arguments' => json_encode($tool->getInputs() === [] ? new stdClass() : $tool->getInputs()),
125126
],
126127
], $message->getTools())
127128
];

0 commit comments

Comments
 (0)