]> BookStack Code Mirror - bookstack/blob - app/Search/Vectors/Services/VectorQueryService.php
Vectors: Got basic LLM querying working using vector search context
[bookstack] / app / Search / Vectors / Services / VectorQueryService.php
1 <?php
2
3 namespace BookStack\Search\Vectors\Services;
4
5 interface VectorQueryService
6 {
7     /**
8      * Generate embedding vectors from the given chunk of text.
9      * @return float[]
10      */
11     public function generateEmbeddings(string $text): array;
12
13     /**
14      * Query the LLM service using the given user input, and
15      * relevant context text retrieved locally via a vector search.
16      * Returns the response output text from the LLM.
17      *
18      * @param string[] $context
19      */
20     public function query(string $input, array $context): string;
21 }