init project
This commit is contained in:
46
app/Models/EmbeddingUsageEvent.php
Normal file
46
app/Models/EmbeddingUsageEvent.php
Normal file
@@ -0,0 +1,46 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Database\Factories\EmbeddingUsageEventFactory;
|
||||
use Illuminate\Database\Eloquent\Attributes\Fillable;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
|
||||
#[Fillable([
|
||||
'user_id',
|
||||
'tool',
|
||||
'provider',
|
||||
'model',
|
||||
'embedding_dimensions',
|
||||
'input_count',
|
||||
'result_count',
|
||||
'tokens',
|
||||
])]
|
||||
class EmbeddingUsageEvent extends Model
|
||||
{
|
||||
/** @use HasFactory<EmbeddingUsageEventFactory> */
|
||||
use HasFactory;
|
||||
|
||||
/**
|
||||
* @return BelongsTo<User, $this>
|
||||
*/
|
||||
public function user(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(User::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<string, string>
|
||||
*/
|
||||
protected function casts(): array
|
||||
{
|
||||
return [
|
||||
'embedding_dimensions' => 'integer',
|
||||
'input_count' => 'integer',
|
||||
'result_count' => 'integer',
|
||||
'tokens' => 'integer',
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user