42 lines
1.3 KiB
PHP
42 lines
1.3 KiB
PHP
<?php
|
|
|
|
namespace App\Domain\Repository;
|
|
|
|
use App\Domain\Model\Embedding\Embedding;
|
|
use App\Domain\Model\Embedding\LargeEmbeddingVector;
|
|
use App\Domain\Model\Embedding\SmallEmbeddingVector;
|
|
use App\Domain\Model\EmbeddingCollection;
|
|
use App\Domain\Model\Id\EmbeddingIdCollection;
|
|
|
|
interface EmbeddingRepository
|
|
{
|
|
public function save(Embedding $embedding): void;
|
|
|
|
public function delete(Embedding $embedding): void;
|
|
|
|
/**
|
|
* @param LargeEmbeddingVector $embeddingVector
|
|
* @param int $limit
|
|
* @return EmbeddingCollection
|
|
*/
|
|
public function searchByLargeEmbeddingVector(LargeEmbeddingVector $embeddingVector, int $limit = 100): EmbeddingCollection;
|
|
|
|
/**
|
|
* @param SmallEmbeddingVector $vector
|
|
* @param int $limit
|
|
* @return EmbeddingCollection
|
|
*/
|
|
public function searchBySmallEmbeddingVector(SmallEmbeddingVector $vector, int $limit = 100): EmbeddingCollection;
|
|
|
|
/**
|
|
* @param string $phrase
|
|
* @return Embedding|null
|
|
*/
|
|
public function findByPhrase(string $phrase): ?Embedding;
|
|
|
|
/**
|
|
* @param EmbeddingIdCollection $embeddingIdCollection
|
|
* @return EmbeddingCollection
|
|
*/
|
|
public function findByEmbeddingIdCollection(EmbeddingIdCollection $embeddingIdCollection): EmbeddingCollection;
|
|
} |