BxDolAIProviderUnaProxy.php 898 B

123456789101112131415161718192021222324252627282930313233
  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 UnaCore UNA Core
  7. * @{
  8. */
  9. class BxDolAIProviderUnaProxy extends NeuronAI\Providers\OpenAI\OpenAI
  10. {
  11. protected string $baseUri = 'https://unacms.com/m/ai_proxy/v1';
  12. public function __construct(
  13. string $sKey,
  14. string $sSecret,
  15. string $sModel,
  16. ?NeuronAI\HttpClient\HttpClientInterface $httpClient = null,
  17. ) {
  18. if ($sKey === '' || $sSecret === '')
  19. throw new Exception(_t('_sys_agents_una_proxy_unconfigured'));
  20. parent::__construct(
  21. key: '',
  22. model: $sModel,
  23. parameters: [],
  24. strict_response: false,
  25. httpClient: $httpClient ?? new BxDolAIUnaProxyHttpClient($sKey, $sSecret),
  26. );
  27. }
  28. }
  29. /** @} */