Skip to content

Commit 3472ab4

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

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Providers/OpenAI/MessageMapper.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ protected function mapToolCall(ToolCallMessage $message): array
121121
'type' => 'function',
122122
'function' => [
123123
'name' => $tool->getName(),
124-
...($tool->getInputs() === [] ? [] : ['arguments' => json_encode($tool->getInputs())]),
124+
'arguments' => json_encode($tool->getInputs() === [] ? new \stdClass() : $tool->getInputs()),
125125
],
126126
], $message->getTools())
127127
];

0 commit comments

Comments
 (0)