Skip to content

Commit 0225c28

Browse files
author
Sebastian BURGIN-FIX (ext)
committed
wip
1 parent 55dca1e commit 0225c28

7 files changed

Lines changed: 21 additions & 42 deletions

File tree

app/Enums/AiModelLicenseEnum.php

Lines changed: 0 additions & 29 deletions
This file was deleted.

app/Models/AiModel.php

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,14 @@
33
namespace App\Models;
44

55
use App\Enums\AiModelCategoryEnum;
6-
use App\Enums\AiModelLicenseEnum;
76
use Illuminate\Database\Eloquent\Model;
87
use Illuminate\Database\Eloquent\Relations\BelongsTo;
98

109
class AiModel extends Model
1110
{
1211
protected $casts = [
1312
'category' => AiModelCategoryEnum::class,
14-
'license' => AiModelLicenseEnum::class,
1513
'role' => 'json',
16-
'in_evaluation' => 'boolean',
1714
'archived_at' => 'date',
1815
];
1916

@@ -26,4 +23,23 @@ public function localizedRole(string $locale): ?string
2623
{
2724
return $this->role[substr($locale, 0, 2)] ?? null;
2825
}
26+
27+
public function licenseLabel(string $locale): ?string
28+
{
29+
return $this->license ? __('components.ai_llm.licenses.'.$this->licenseKey().'.label', locale: $locale) : null;
30+
}
31+
32+
public function licenseTooltip(string $locale): ?string
33+
{
34+
return $this->license ? __('components.ai_llm.licenses.'.$this->licenseKey().'.tooltip', locale: $locale) : null;
35+
}
36+
37+
private function licenseKey(): string
38+
{
39+
return match ($this->license) {
40+
'MIT' => 'mit',
41+
'Apache-2.0' => 'apache',
42+
'Gemma' => 'gemma',
43+
};
44+
}
2945
}

database/migrations/2026_07_21_134448_create_ai_models_table.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ public function up(): void
2020
$table->string('ram')->nullable();
2121
$table->string('license')->nullable();
2222
$table->json('role')->nullable();
23-
$table->boolean('in_evaluation')->default(false);
2423
$table->string('link_label')->nullable();
2524
$table->string('link_url')->nullable();
2625
$table->date('archived_at')->nullable();

database/seeders/Codebar/AiModelsTableSeeder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ private function active(): void
154154
foreach ($models as $model) {
155155
AiModel::updateOrCreate(
156156
['name' => $model['name']],
157-
array_merge(['in_evaluation' => false, 'archived_at' => null, 'replaced_by_id' => null], $model)
157+
array_merge(['archived_at' => null, 'replaced_by_id' => null], $model)
158158
);
159159
}
160160
}

lang/de_CH/components.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,8 @@
6060
'tooltips' => [
6161
'provider' => 'Wer dieses Modell entwickelt',
6262
'ram' => 'Arbeitsspeicher, den das Modell auf unserem Server benötigt',
63-
'status' => 'Dieses Modell testen wir derzeit',
6463
'link' => 'Woher wir das Modell beziehen',
6564
],
66-
'status_label' => 'in Evaluation',
6765
'licenses' => [
6866
'mit' => [
6967
'label' => 'MIT',

lang/en_CH/components.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,8 @@
5858
'tooltips' => [
5959
'provider' => 'Who develops this model',
6060
'ram' => 'Memory the model needs on our server',
61-
'status' => 'We are currently evaluating this model',
6261
'link' => 'Where we get the model from',
6362
],
64-
'status_label' => 'evaluating',
6563
'licenses' => [
6664
'mit' => [
6765
'label' => 'MIT',

resources/views/components/ai-llm/model-row.blade.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,7 @@
1111
<div class="flex flex-wrap gap-2">
1212
<x-badge :label="$model->provider" :title="__('components.ai_llm.tooltips.provider')" class-attributes="text-xs"/>
1313
<x-badge :label="$model->ram" :title="__('components.ai_llm.tooltips.ram')" class-attributes="text-xs"/>
14-
<x-badge :label="$model->license->label($locale)" :title="$model->license->tooltip($locale)" class-attributes="text-xs"/>
15-
@if($model->in_evaluation)
16-
<x-badge-transparent :label="__('components.ai_llm.status_label')" :title="__('components.ai_llm.tooltips.status')" class-attributes="text-xs"/>
17-
@endif
14+
<x-badge :label="$model->licenseLabel($locale)" :title="$model->licenseTooltip($locale)" class-attributes="text-xs"/>
1815
</div>
1916
</div>
2017
<div class="sm:justify-self-end">

0 commit comments

Comments
 (0)