BxBaseStudioAgentsVectorStoreData.php 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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 UnaView UNA Studio Representation classes
  7. * @ingroup UnaStudio
  8. * @{
  9. */
  10. class BxBaseStudioAgentsVectorStoreData extends BxDolStudioAgentsVectorStoreData
  11. {
  12. public function __construct ($aOptions, $oTemplate = false)
  13. {
  14. parent::__construct ($aOptions, $oTemplate);
  15. $this->addMarkers($this->_aBrowseParams);
  16. }
  17. protected function _delete ($mixedId)
  18. {
  19. // TODO: delete files from vector store
  20. $mixedResult = parent::_delete($mixedId);
  21. return $mixedResult;
  22. }
  23. protected function _getCellSize ($mixedValue, $sKey, $aField, $aRow)
  24. {
  25. $mixedValue = bx_format_bytes($mixedValue);
  26. return parent::_getCellDefault ($mixedValue, $sKey, $aField, $aRow);
  27. }
  28. protected function _getCellStatus ($mixedValue, $sKey, $aField, $aRow)
  29. {
  30. $mixedValue = $mixedValue == 'processing' ? '<span title="Processing">🕚</span>' : '<span title="Completed">✅</span>';
  31. return parent::_getCellDefault ($mixedValue, $sKey, $aField, $aRow);
  32. }
  33. static public function processPendingData()
  34. {
  35. // TODO: process pending data, e.g. add to vector store, update status, etc.
  36. }
  37. }
  38. /** @} */