This commit is contained in:
ct
2025-06-20 20:16:34 +08:00
parent b502120091
commit 8f6fb3787a
14 changed files with 493 additions and 22 deletions

View File

@@ -0,0 +1,38 @@
<?php
/**
* Created by Reliese Model.
*/
namespace App\Models;
use Carbon\Carbon;
use Illuminate\Database\Eloquent\Model;
use Pgvector\Laravel\Vector;
/**
* Class KeywordEmbedding
*
* @property int $id
* @property string $keyword
* @property USER-DEFINED $embedding
* @property string|null $tag
* @property Carbon|null $created_at
* @property Carbon|null $updated_at
*
* @package App\Models
*/
class KeywordEmbedding extends Model
{
protected $table = 'keyword_embeddings';
protected $casts = [
'embedding' => Vector::class,
];
protected $fillable = [
'keyword',
'embedding',
'tag'
];
}

View File

@@ -69,6 +69,7 @@ class Meme extends Model
'action_keywords',
'emotion_keywords',
'misc_keywords',
'primary_keyword_type',
];
public function meme_media()

View File

@@ -0,0 +1,51 @@
<?php
/**
* Created by Reliese Model.
*/
namespace App\Models;
use Carbon\Carbon;
use Illuminate\Database\Eloquent\Model;
use Pgvector\Laravel\HasNeighbors;
use Pgvector\Laravel\Vector;
/**
* Class MemeMediaEmbedding
*
* @property int $id
* @property int $meme_media_id
* @property string $keyword
* @property Vector $embedding
* @property string|null $tag
* @property Carbon|null $created_at
* @property Carbon|null $updated_at
*
* @property MemeMedia $meme_media
*
* @package App\Models
*/
class MemeMediaEmbedding extends Model
{
use HasNeighbors;
protected $table = 'meme_media_embeddings';
protected $casts = [
'meme_media_id' => 'int',
'embedding' => Vector::class,
];
protected $fillable = [
'meme_media_id',
'keyword',
'embedding',
'tag'
];
public function meme_media()
{
return $this->belongsTo(MemeMedia::class);
}
}