Skip to content

Commit

Permalink
Fix styling
Browse files Browse the repository at this point in the history
  • Loading branch information
ashleyhindle authored and github-actions[bot] committed Sep 7, 2024
1 parent 7881526 commit 77cef63
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 14 deletions.
4 changes: 2 additions & 2 deletions src/AiAutofill.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@

namespace AshleyHindle\AiAutofill;

use Illuminate\Database\Eloquent\Model;
use AshleyHindle\AiAutofill\Jobs\AiAutofillJob;
use Illuminate\Database\Eloquent\Model;

trait AiAutofill
{
public static function bootAiAutofill()
{
static::saved(function (Model $model) {
if (!isset($model->autofill) || empty($model->autofill) || !$model->isDirty()) {
if (! isset($model->autofill) || empty($model->autofill) || ! $model->isDirty()) {
return;
}

Expand Down
2 changes: 1 addition & 1 deletion src/AiAutofillServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

namespace AshleyHindle\AiAutofill;

use Spatie\LaravelPackageTools\Commands\InstallCommand;
use Spatie\LaravelPackageTools\Package;
use Spatie\LaravelPackageTools\PackageServiceProvider;
use Spatie\LaravelPackageTools\Commands\InstallCommand;

class AiAutofillServiceProvider extends PackageServiceProvider
{
Expand Down
18 changes: 9 additions & 9 deletions src/Jobs/AiAutofillJob.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

namespace AshleyHindle\AiAutofill\Jobs;

use Illuminate\Foundation\Queue\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Database\Eloquent\Model;
use OpenAI\Laravel\Facades\OpenAI;
use Illuminate\Foundation\Queue\Queueable;
use Illuminate\Queue\Middleware\WithoutOverlapping;
use OpenAI\Laravel\Facades\OpenAI;

class AiAutofillJob implements ShouldQueue
{
Expand Down Expand Up @@ -58,13 +58,13 @@ public function handle()
'type' => 'object',
'strict' => true,
'properties' => $schemaProperties,
'required' => array_keys($this->autofill)
]
]
'required' => array_keys($this->autofill),
],
],
],
'temperature' => 0.35,
'messages' => [
['role' => 'system', 'content' => $systemPrompt]
['role' => 'system', 'content' => $systemPrompt],
],
]);

Expand All @@ -76,7 +76,7 @@ public function handle()

if (isset($message->refusal)) {
// TODO: handle refusal
} elseif (!isset($message->content)) {
} elseif (! isset($message->content)) {
// TODO: handle no content
}

Expand All @@ -93,10 +93,10 @@ public function handle()
public function middleware(): array
{
return [
(new WithoutOverlapping(self::class . ':' . $this->model->id))
(new WithoutOverlapping(self::class.':'.$this->model->id))
->expireAfter(40)
->releaseAfter(40)
->dontRelease()
->dontRelease(),
];
}
}
4 changes: 2 additions & 2 deletions tests/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

namespace AshleyHindle\AiAutofill\Tests;

use AshleyHindle\AiAutofill\AiAutofillServiceProvider;
use Illuminate\Database\Eloquent\Factories\Factory;
use Orchestra\Testbench\TestCase as Orchestra;
use AshleyHindle\AiAutofill\AiAutofillServiceProvider;

class TestCase extends Orchestra
{
Expand All @@ -13,7 +13,7 @@ protected function setUp(): void
parent::setUp();

Factory::guessFactoryNamesUsing(
fn(string $modelName) => 'AshleyHindle\\AiAutofill\\Database\\Factories\\' . class_basename($modelName) . 'Factory'
fn (string $modelName) => 'AshleyHindle\\AiAutofill\\Database\\Factories\\'.class_basename($modelName).'Factory'
);
}

Expand Down

0 comments on commit 77cef63

Please sign in to comment.