diff --git a/app/Commands/DroidCommand.php b/app/Commands/DexorCommand.php similarity index 100% rename from app/Commands/DroidCommand.php rename to app/Commands/DexorCommand.php diff --git a/app/Integrations/Ollama/Requests/ChatRequest.php b/app/Integrations/Ollama/Requests/ChatRequest.php index 76bce7d..8741a8e 100644 --- a/app/Integrations/Ollama/Requests/ChatRequest.php +++ b/app/Integrations/Ollama/Requests/ChatRequest.php @@ -62,4 +62,4 @@ public function createDtoFromResponse(Response $response): MessageData $data = $response->json(); return MessageData::from($data['message'] ?? []); } -} \ No newline at end of file +} diff --git a/app/Integrations/OpenAI/Requests/ChatRequest.php b/app/Integrations/OpenAI/Requests/ChatRequest.php index 19c507a..84f322c 100644 --- a/app/Integrations/OpenAI/Requests/ChatRequest.php +++ b/app/Integrations/OpenAI/Requests/ChatRequest.php @@ -3,6 +3,7 @@ namespace App\Integrations\OpenAI\Requests; use App\Data\MessageData; +use App\Data\ToolCallData; use App\Models\Thread; use Saloon\Contracts\Body\HasBody; use Saloon\Enums\Method; @@ -51,7 +52,16 @@ private function formatMessages($assistant): array public function createDtoFromResponse(Response $response): MessageData { $data = $response->json(); - $choice = $data['choices'][0] ?? []; - return MessageData::from($choice['message'] ?? []); + $message = $data['choices'][0]['message'] ?? []; + $tools = collect([]); + if (isset($message['tool_calls'])) { + foreach ($message['tool_calls'] as $toolCall) { + $tools->push(ToolCallData::from($toolCall)); + } + + $message['tool_calls'] = $tools; + } + + return MessageData::from($message ?? []); } -} \ No newline at end of file +} diff --git a/app/Models/Message.php b/app/Models/Message.php index 7220254..602d79e 100644 --- a/app/Models/Message.php +++ b/app/Models/Message.php @@ -26,9 +26,4 @@ public function thread() { return $this->belongsTo(Thread::class); } - - public function tool() - { - return $this->belongsTo(Tool::class); - } } diff --git a/builds/dexor b/builds/dexor index 366b5ab..9dce4f9 100755 Binary files a/builds/dexor and b/builds/dexor differ diff --git a/builds/droid b/builds/droid deleted file mode 100755 index 2b0c06b..0000000 Binary files a/builds/droid and /dev/null differ diff --git a/config/droid.php b/config/dexor.php similarity index 100% rename from config/droid.php rename to config/dexor.php diff --git a/docs/what-is-droid-dev.md b/docs/what-is-dexor-dev.md similarity index 100% rename from docs/what-is-droid-dev.md rename to docs/what-is-dexor-dev.md diff --git a/resources/images/droid.webp b/resources/images/dexor.webp similarity index 100% rename from resources/images/droid.webp rename to resources/images/dexor.webp