deepseek-1.x-dev/src/AiDbVectorsInterface.php

src/AiDbVectorsInterface.php
<?php

namespace Drupal\deepseek;

/**
 * Interface for AI Database Vectors plugins.
 */
interface AiDbVectorsInterface {

  /**
   * Returns the most relevant content to the search vector.
   *
   * @param array $vectors
   *   Vector array from embedding calculate.
   * @param string $message
   *   Message string from user.
   * @param int $limit
   *   Number of returns.
   *
   * @return array
   *   Array string of content chuck.
   */
  public function search(array $vectors, string $message, int $limit = 1): array;

  /**
   * Delete all the content chuck before insert.
   *
   * @param string $entityType
   *   Entity type.
   * @param int $entityId
   *   Entity id.
   */
  public function delete(string $entityType, int $entityId);

  /**
   * Insert the content chuck.
   *
   * @param string $entityType
   *   Entity type.
   * @param int $entityId
   *   Entity id.
   * @param string $chunk
   *   Chunk of content.
   * @param array $vectors
   *   Vector of chunk.
   * @param int $delta
   *   Index of chunk.
   */
  public function insert(string $entityType, int $entityId, string $chunk, array $vectors, int $delta = 0);

  /**
   * Create table / collection.
   *
   * @param string $table_name
   *   Table/Collection name.
   * @param int $dimension
   *   Vector dimensionality.
   */
  public function createTable(string $table_name, int $dimension): bool;

}

Главная | Обратная связь

drupal hosting | друпал хостинг | it patrol .inc