xref: /plugin/aichat/Model/EmbeddingInterface.php (revision 34a1c47875552330ce367360d99f2c3f9f69af94)
1294a9eafSAndreas Gohr<?php
2294a9eafSAndreas Gohr
3294a9eafSAndreas Gohrnamespace dokuwiki\plugin\aichat\Model;
4294a9eafSAndreas Gohr
5294a9eafSAndreas Gohr/**
6294a9eafSAndreas Gohr * Defines an embedding model
7294a9eafSAndreas Gohr */
84373d2bfSAndreas Gohrinterface EmbeddingInterface extends ModelInterface
9294a9eafSAndreas Gohr{
10294a9eafSAndreas Gohr    /**
11294a9eafSAndreas Gohr     * Get the dimensions of the embedding vectors
12294a9eafSAndreas Gohr     */
13*34a1c478SAndreas Gohr    public function getDimensions(): int;
14294a9eafSAndreas Gohr
15294a9eafSAndreas Gohr    /**
16294a9eafSAndreas Gohr     * Get the embedding vectors for a given text
17294a9eafSAndreas Gohr     *
18294a9eafSAndreas Gohr     * @param string $text
19294a9eafSAndreas Gohr     * @return float[]
20294a9eafSAndreas Gohr     * @throws \Exception
21294a9eafSAndreas Gohr     */
22*34a1c478SAndreas Gohr    public function getEmbedding($text): array;
23294a9eafSAndreas Gohr}
24