Skip to content

Commit

Permalink
Prevent variable shadowing
Browse files Browse the repository at this point in the history
  • Loading branch information
thekid committed Oct 19, 2024
1 parent 5eadffc commit 89851bf
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,19 +142,19 @@ if ('tool_calls' === ($result['choices'][0]['finish_reason'] ?? null)) {

foreach ($result['choices'][0]['message']['tool_calls'] as $call) {
try {
$result= $functions->invoke(
$return= $functions->invoke(
$call['function']['name'],
json_decode($call['function']['arguments'], true)
);
} catch (Throwable $t) {
$t->printStackTrace();
$result= ['error' => $t->compoundMessage()];
$return= ['error' => $t->compoundMessage()];
}

$payload['messages'][]= [
'role' => 'tool',
'tool_call_id' => $call['id'],
'content' => json_encode($result),
'content' => json_encode($return),
];
}

Expand Down

0 comments on commit 89851bf

Please sign in to comment.