BxAiProxyDb.php 899 B

12345678910111213141516171819202122232425262728293031323334353637
  1. <?php defined('BX_DOL') or die('hack attempt');
  2. /**
  3. * Copyright (c) UNA, Inc - https://una.io
  4. * MIT License - https://opensource.org/licenses/MIT
  5. *
  6. * @defgroup AIProxy AI Proxy
  7. * @ingroup UnaModules
  8. *
  9. * @{
  10. */
  11. class BxAiProxyDb extends BxDolModuleDb
  12. {
  13. public function __construct(&$oConfig)
  14. {
  15. parent::__construct($oConfig);
  16. }
  17. /**
  18. * Active knowledge stores the master can search. A una-proxy store would call this site again.
  19. *
  20. * @return array<int, string>
  21. */
  22. public function getActiveKnowledgeStores(): array
  23. {
  24. $aStores = $this->getPairs(
  25. "SELECT `id`, `title` FROM `sys_agents_vector_store` WHERE `active` = 1 AND `type` <> :type ORDER BY `title` ASC",
  26. 'id',
  27. 'title',
  28. ['type' => 'una-proxy']
  29. );
  30. return is_array($aStores) ? $aStores : [];
  31. }
  32. }
  33. /** @} */