Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?php

/**
* @copyright Copyright (C) Ibexa AS. All rights reserved.
* @license For full copyright and license information view LICENSE file distributed with this source code.
*/
declare(strict_types=1);

namespace Ibexa\Contracts\Core\Search\Embedding;

use Throwable;

interface EmbeddingProviderExceptionInterface extends Throwable
{
}
2 changes: 2 additions & 0 deletions src/contracts/Search/Embedding/EmbeddingProviderInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ interface EmbeddingProviderInterface
{
/**
* @return float[]
*
* @throws \Ibexa\Contracts\Core\Search\Embedding\EmbeddingProviderExceptionInterface
*/
public function getEmbedding(string $content, ?string $model = null, ?int $maxTokens = null): array;
}
21 changes: 21 additions & 0 deletions src/lib/Search/Embedding/EmbeddingProviderException.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?php

/**
* @copyright Copyright (C) Ibexa AS. All rights reserved.
* @license For full copyright and license information view LICENSE file distributed with this source code.
*/
declare(strict_types=1);

namespace Ibexa\Core\Search\Embedding;

use Ibexa\Contracts\Core\Search\Embedding\EmbeddingProviderExceptionInterface;
use RuntimeException;
use Throwable;

final class EmbeddingProviderException extends RuntimeException implements EmbeddingProviderExceptionInterface
{
public static function fromThrowable(Throwable $previous, string $message): self
{
return new self($message, 0, $previous);
}
}
Loading