-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from LlmLaraHub/ReplaceWithFunction
Get Tools/Functions working on Claude, OpenAi and maybe even Ollama!
- Loading branch information
Showing
51 changed files
with
1,515 additions
and
159 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
<?php | ||
|
||
namespace App\Events; | ||
|
||
use App\Models\Chat; | ||
use App\Models\Collection; | ||
use Illuminate\Broadcasting\InteractsWithSockets; | ||
use Illuminate\Broadcasting\PrivateChannel; | ||
use Illuminate\Contracts\Broadcasting\ShouldBroadcast; | ||
use Illuminate\Foundation\Events\Dispatchable; | ||
use Illuminate\Queue\SerializesModels; | ||
|
||
class ChatUiUpdateEvent implements ShouldBroadcast | ||
{ | ||
use Dispatchable, InteractsWithSockets, SerializesModels; | ||
|
||
/** | ||
* Create a new event instance. | ||
*/ | ||
public function __construct(public Collection $collection, public Chat $chat, public string $updateMessage) | ||
{ | ||
// | ||
} | ||
|
||
/** | ||
* Get the channels the event should broadcast on. | ||
* | ||
* @return array<int, \Illuminate\Broadcasting\Channel> | ||
*/ | ||
public function broadcastOn(): array | ||
{ | ||
return [ | ||
new PrivateChannel('collection.chat.'.$this->collection->id.'.'.$this->chat->id), | ||
]; | ||
} | ||
|
||
/** | ||
* The event's broadcast name. | ||
*/ | ||
public function broadcastAs(): string | ||
{ | ||
return 'update'; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,15 @@ | ||
<?php | ||
|
||
namespace App\LlmDriver; | ||
namespace App\LlmDriver\Functions; | ||
|
||
use Spatie\LaravelData\Casts\Cast; | ||
use Spatie\LaravelData\Casts\Castable; | ||
use Spatie\LaravelData\Support\Creation\CreationContext; | ||
use Spatie\LaravelData\Support\DataProperty; | ||
|
||
class ArgumentCaster implements Castable | ||
class ArgumentCaster implements Cast | ||
{ | ||
public static function dataCastUsing(...$arguments): Cast | ||
public function cast(DataProperty $property, mixed $value, array $properties, CreationContext $context): array | ||
{ | ||
return new class implements Cast | ||
{ | ||
public function cast(DataProperty $property, mixed $value, array $properties, CreationContext $context): mixed | ||
{ | ||
return json_decode($value, true); | ||
} | ||
}; | ||
return json_decode($value, true); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.