Skip to content

Commit 8b27bc5

Browse files
committed
bug #816 Fix json_decode calls (VincentLanglet)
This PR was merged into the main branch. Discussion ---------- Fix json_decode calls | Q | A | ------------- | --- | Bug fix? | yes | New feature? | no <!-- please update src/**/CHANGELOG.md files --> | Docs? | no <!-- required for new features --> | Issues | Fix #... <!-- prefix each issue number with "Fix #", no need to create an issue if none exist, explain below instead --> | License | MIT `JSON_THROW_ON_ERROR` was passed as the third arg instead of the fourth one. Commits ------- d442058 Fix json_decode calls
2 parents 5b694df + d442058 commit 8b27bc5

File tree

5 files changed

+5
-5
lines changed

5 files changed

+5
-5
lines changed

src/platform/src/Bridge/DeepSeek/ResultConverter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ private function convertChoice(array $choice): ToolCallResult|TextResult
169169
*/
170170
private function convertToolCall(array $toolCall): ToolCall
171171
{
172-
$arguments = json_decode($toolCall['function']['arguments'], true, \JSON_THROW_ON_ERROR);
172+
$arguments = json_decode($toolCall['function']['arguments'], true, flags: \JSON_THROW_ON_ERROR);
173173

174174
return new ToolCall($toolCall['id'], $toolCall['function']['name'], $arguments);
175175
}

src/platform/src/Bridge/DockerModelRunner/Completions/ResultConverter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ private function convertChoice(array $choice): ToolCallResult|TextResult
177177
*/
178178
private function convertToolCall(array $toolCall): ToolCall
179179
{
180-
$arguments = json_decode($toolCall['function']['arguments'], true, \JSON_THROW_ON_ERROR);
180+
$arguments = json_decode($toolCall['function']['arguments'], true, flags: \JSON_THROW_ON_ERROR);
181181

182182
return new ToolCall($toolCall['id'], $toolCall['function']['name'], $arguments);
183183
}

src/platform/src/Bridge/Mistral/Llm/ResultConverter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ private function convertChoice(array $choice): ToolCallResult|TextResult
170170
*/
171171
private function convertToolCall(array $toolCall): ToolCall
172172
{
173-
$arguments = json_decode((string) $toolCall['function']['arguments'], true, \JSON_THROW_ON_ERROR);
173+
$arguments = json_decode((string) $toolCall['function']['arguments'], true, flags: \JSON_THROW_ON_ERROR);
174174

175175
return new ToolCall($toolCall['id'], $toolCall['function']['name'], $arguments);
176176
}

src/platform/src/Bridge/OpenAi/Gpt/ResultConverter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ private function convertChoice(array $choice): ToolCallResult|TextResult
195195
*/
196196
private function convertToolCall(array $toolCall): ToolCall
197197
{
198-
$arguments = json_decode($toolCall['function']['arguments'], true, \JSON_THROW_ON_ERROR);
198+
$arguments = json_decode($toolCall['function']['arguments'], true, flags: \JSON_THROW_ON_ERROR);
199199

200200
return new ToolCall($toolCall['id'], $toolCall['function']['name'], $arguments);
201201
}

src/platform/src/Bridge/Scaleway/Llm/ResultConverter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ private function convertChoice(array $choice): ToolCallResult|TextResult
164164
*/
165165
private function convertToolCall(array $toolCall): ToolCall
166166
{
167-
$arguments = json_decode($toolCall['function']['arguments'], true, \JSON_THROW_ON_ERROR);
167+
$arguments = json_decode($toolCall['function']['arguments'], true, flags: \JSON_THROW_ON_ERROR);
168168

169169
return new ToolCall($toolCall['id'], $toolCall['function']['name'], $arguments);
170170
}

0 commit comments

Comments
 (0)