Skip to content

Commit 83fc604

Browse files
Merge pull request #21 from bootstrapguru/dev
Renaming Fixes with Dexor
2 parents 4d0a1c4 + 050f589 commit 83fc604

File tree

9 files changed

+14
-9
lines changed

9 files changed

+14
-9
lines changed
File renamed without changes.

app/Integrations/Ollama/Requests/ChatRequest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,4 +62,4 @@ public function createDtoFromResponse(Response $response): MessageData
6262
$data = $response->json();
6363
return MessageData::from($data['message'] ?? []);
6464
}
65-
}
65+
}

app/Integrations/OpenAI/Requests/ChatRequest.php

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
namespace App\Integrations\OpenAI\Requests;
44

55
use App\Data\MessageData;
6+
use App\Data\ToolCallData;
67
use App\Models\Thread;
78
use Saloon\Contracts\Body\HasBody;
89
use Saloon\Enums\Method;
@@ -51,7 +52,16 @@ private function formatMessages($assistant): array
5152
public function createDtoFromResponse(Response $response): MessageData
5253
{
5354
$data = $response->json();
54-
$choice = $data['choices'][0] ?? [];
55-
return MessageData::from($choice['message'] ?? []);
55+
$message = $data['choices'][0]['message'] ?? [];
56+
$tools = collect([]);
57+
if (isset($message['tool_calls'])) {
58+
foreach ($message['tool_calls'] as $toolCall) {
59+
$tools->push(ToolCallData::from($toolCall));
60+
}
61+
62+
$message['tool_calls'] = $tools;
63+
}
64+
65+
return MessageData::from($message ?? []);
5666
}
57-
}
67+
}

app/Models/Message.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,4 @@ public function thread()
2626
{
2727
return $this->belongsTo(Thread::class);
2828
}
29-
30-
public function tool()
31-
{
32-
return $this->belongsTo(Tool::class);
33-
}
3429
}

builds/dexor

109 Bytes
Binary file not shown.

builds/droid

-13 MB
Binary file not shown.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)