xref: /plugin/aichat/Model/EmbeddingInterface.php (revision 4373d2bf7fcddc76e5ba367d903e3d0d86697dff)
1<?php
2
3namespace dokuwiki\plugin\aichat\Model;
4
5/**
6 * Defines an embedding model
7 */
8interface EmbeddingInterface extends ModelInterface
9{
10    /**
11     * Maximum size of chunks this model could handle
12     *
13     * Generally the maximum is defined by the same method in the ChatModel because chunks
14     * need to fit into the chat request.
15     *
16     * @return int
17     */
18    public function getMaxEmbeddingTokenLength();
19
20    /**
21     * Get the dimensions of the embedding vectors
22     *
23     * @return int
24     */
25    public function getDimensions();
26
27    /**
28     * Get the embedding vectors for a given text
29     *
30     * @param string $text
31     * @return float[]
32     * @throws \Exception
33     */
34    public function getEmbedding($text);
35}
36