38 lines
785 B
PHP
38 lines
785 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Database\Factories\EmbeddingEntryFactory;
|
|
use Illuminate\Database\Eloquent\Attributes\Fillable;
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
#[Fillable([
|
|
'source_text',
|
|
'content_hash',
|
|
'embedding',
|
|
'embedding_dimensions',
|
|
'provider',
|
|
'model',
|
|
'tokens',
|
|
])]
|
|
class EmbeddingEntry extends Model
|
|
{
|
|
/** @use HasFactory<EmbeddingEntryFactory> */
|
|
use HasFactory;
|
|
|
|
/**
|
|
* Get the attributes that should be cast.
|
|
*
|
|
* @return array<string, string>
|
|
*/
|
|
protected function casts(): array
|
|
{
|
|
return [
|
|
'embedding' => 'array',
|
|
'embedding_dimensions' => 'integer',
|
|
'tokens' => 'integer',
|
|
];
|
|
}
|
|
}
|