Skip to content

Commit

Permalink
Merge pull request #21 from bootstrapguru/dev
Browse files Browse the repository at this point in the history
Renaming Fixes with Dexor
  • Loading branch information
vijaythecoder authored Jul 15, 2024
2 parents 4d0a1c4 + 050f589 commit 83fc604
Show file tree
Hide file tree
Showing 9 changed files with 14 additions and 9 deletions.
File renamed without changes.
2 changes: 1 addition & 1 deletion app/Integrations/Ollama/Requests/ChatRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,4 @@ public function createDtoFromResponse(Response $response): MessageData
$data = $response->json();
return MessageData::from($data['message'] ?? []);
}
}
}
16 changes: 13 additions & 3 deletions app/Integrations/OpenAI/Requests/ChatRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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 ?? []);
}
}
}
5 changes: 0 additions & 5 deletions app/Models/Message.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,4 @@ public function thread()
{
return $this->belongsTo(Thread::class);
}

public function tool()
{
return $this->belongsTo(Tool::class);
}
}
Binary file modified builds/dexor
Binary file not shown.
Binary file removed builds/droid
Binary file not shown.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 83fc604

Please sign in to comment.