mirror of
https://github.com/appwrite/appwrite.git
synced 2026-05-26 13:51:13 +00:00
40 lines
1015 B
PHP
40 lines
1015 B
PHP
<?php
|
|
|
|
namespace Appwrite\Utopia\Response\Model;
|
|
|
|
use Appwrite\Utopia\Response\Model;
|
|
|
|
class Embedding extends Model
|
|
{
|
|
public function getName(): string
|
|
{
|
|
return 'Embedding';
|
|
}
|
|
|
|
public function getType(): string
|
|
{
|
|
return 'embedding';
|
|
}
|
|
|
|
public function __construct()
|
|
{
|
|
$this
|
|
->addRule('model', [
|
|
'type' => self::TYPE_STRING,
|
|
'description' => 'Embedding model used to generate embeddings.',
|
|
'example' => 'embeddinggemma'
|
|
])
|
|
->addRule('dimensions', [
|
|
'type' => self::TYPE_INTEGER,
|
|
'description' => 'Number of dimensions for each embedding vector.',
|
|
'example' => 768
|
|
])
|
|
->addRule('embeddings', [
|
|
'type' => self::TYPE_FLOAT,
|
|
'array' => true,
|
|
'description' => 'Embedding vector values.',
|
|
'example' => [0.01, 0.02, 0.03]
|
|
]);
|
|
}
|
|
}
|