2025-03-24 16:28:14 +00:00
|
|
|
<?php
|
|
|
|
|
|
2025-08-21 12:14:52 +01:00
|
|
|
namespace BookStack\Search\Queries\Services;
|
2025-03-24 16:28:14 +00:00
|
|
|
|
|
|
|
|
interface VectorQueryService
|
|
|
|
|
{
|
|
|
|
|
/**
|
|
|
|
|
* Generate embedding vectors from the given chunk of text.
|
|
|
|
|
* @return float[]
|
|
|
|
|
*/
|
|
|
|
|
public function generateEmbeddings(string $text): array;
|
2025-03-24 19:51:48 +00:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Query the LLM service using the given user input, and
|
|
|
|
|
* relevant context text retrieved locally via a vector search.
|
|
|
|
|
* Returns the response output text from the LLM.
|
|
|
|
|
*
|
|
|
|
|
* @param string[] $context
|
|
|
|
|
*/
|
|
|
|
|
public function query(string $input, array $context): string;
|
2025-03-24 16:28:14 +00:00
|
|
|
}
|