Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@ phpunit.*.xml
.idea/
/.phpunit.result.cache
/.phpunit.cache/
config.json
11 changes: 5 additions & 6 deletions src/AbstractProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,10 @@
* @throws \InvalidArgumentException
* @since ___DEPLOY_VERSION___
*/
public function __construct(array $options = [], ?HttpFactory $httpFactory = null)
public function __construct($options = [], ?HttpFactory $httpFactory = null)
{
// Validate provider is suported
if (!\is_array($options) && !($options instanceof \ArrayAccess)) {

Check failure on line 64 in src/AbstractProvider.php

View workflow job for this annotation

GitHub Actions / framework-ci / Run PHPstan

Result of && is always false.

Check failure on line 64 in src/AbstractProvider.php

View workflow job for this annotation

GitHub Actions / framework-ci / Run PHPstan

Instanceof between ArrayAccess and ArrayAccess will always evaluate to true.

Check failure on line 64 in src/AbstractProvider.php

View workflow job for this annotation

GitHub Actions / framework-ci / Run PHPstan

Result of && is always false.

Check failure on line 64 in src/AbstractProvider.php

View workflow job for this annotation

GitHub Actions / framework-ci / Run PHPstan

Instanceof between ArrayAccess and ArrayAccess will always evaluate to true.
throw new \InvalidArgumentException(
'The options param must be an array or implement the ArrayAccess interface.'
);
Expand Down Expand Up @@ -175,7 +175,7 @@
/**
* Make HTTP DELETE request.
*
* @param string $url API endpoint URL
* @param string $url API endpoint URL
* @param mixed $data Data to send with DELETE request
* @param array $headers HTTP headers
* @param integer $timeout Request timeout
Expand All @@ -190,8 +190,7 @@
$response = $this->httpFactory->getHttp([])->delete($url, $headers, $timeout, $data);

$this->validateResponse($response);

} catch (AuthenticationException|RateLimitException|QuotaExceededException $e) {
} catch (AuthenticationException | RateLimitException | QuotaExceededException $e) {
throw $e;
} catch (ProviderException $e) {
throw $e;
Expand Down Expand Up @@ -341,9 +340,9 @@
}

/**
* Get audio MIME type from file path.
* Get audio MIME type from the input.
*
* @param string $filepath The file path
* @param string $input
*
* @return string The MIME type
* @since __DEPLOY_VERSION__
Expand Down
5 changes: 1 addition & 4 deletions src/Exception/QuotaExceededException.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,11 @@ class QuotaExceededException extends AIException
* Constructor.
*
* @param string $provider The AI provider name
* @param string $message The error message
* @param array $context Additional context data
* @param int|null $httpStatusCode The actual HTTP status code from response
* @param string|null $providerErrorCode The provider-specific error code
*
* @since __DEPLOY_VERSION__
*/
public function __construct(string $provider, array $errorData, int $httpStatusCode)
public function __construct(string $provider, array $errorData, $httpStatusCode)
{
$context = ['error_data' => $errorData];
$providerErrorCode = $errorData['code'] ?? $errorData['error']['code'] ?? null;
Expand Down
6 changes: 2 additions & 4 deletions src/Exception/RateLimitException.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,12 @@ class RateLimitException extends AIException
* Constructor.
*
* @param string $provider The AI provider name
* @param string $message The error message
* @param array $context Additional context data
* @param array $errorData Additional error data
* @param int|null $httpStatusCode The actual HTTP status code from response
* @param string|null $providerErrorCode The provider-specific error code
*
* @since __DEPLOY_VERSION__
*/
public function __construct(string $provider, array $errorData, int $httpStatusCode)
public function __construct(string $provider, array $errorData, $httpStatusCode)
{
$context = ['error_data' => $errorData];
$providerErrorCode = $errorData['code'] ?? $errorData['error']['code'] ?? null;
Expand Down
4 changes: 0 additions & 4 deletions src/Interface/AudioInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ interface AudioInterface
* Generate speech audio from text input.
*
* @param string $text The text to convert to speech
* @param string $model The TTS model to use for speech generation
* @param string $voice The voice to use for speech generation
* @param array $options Additional options for speech generation
*
* @return Response
Expand Down Expand Up @@ -59,7 +57,6 @@ public function getSupportedAudioFormats(): array;
* Transcribe audio to text.
*
* @param string $audioFile Path to the audio file to transcribe
* @param string $model The transcription model to use
* @param array $options Additional options for transcription
*
* @return Response
Expand All @@ -71,7 +68,6 @@ public function transcribe(string $audioFile, array $options = []): Response;
* Translate audio to English text.
*
* @param string $audioFile Path to audio file to translate
* @param string $model Model to use for translation
* @param array $options Additional options
*
* @return Response
Expand Down
Loading
Loading