Skip to content

Commit

Permalink
update pint
Browse files Browse the repository at this point in the history
  • Loading branch information
gehrisandro committed Aug 20, 2024
1 parent cf58805 commit 7d9ac24
Show file tree
Hide file tree
Showing 158 changed files with 160 additions and 319 deletions.
4 changes: 1 addition & 3 deletions src/Contracts/ResponseStreamContract.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,4 @@
*
* @internal
*/
interface ResponseStreamContract extends IteratorAggregate
{
}
interface ResponseStreamContract extends IteratorAggregate {}
4 changes: 1 addition & 3 deletions src/Exceptions/InvalidArgumentException.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,4 @@

use Exception;

final class InvalidArgumentException extends Exception
{
}
final class InvalidArgumentException extends Exception {}
4 changes: 1 addition & 3 deletions src/Exceptions/UnknownEventException.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,4 @@

use Exception;

final class UnknownEventException extends Exception
{
}
final class UnknownEventException extends Exception {}
2 changes: 1 addition & 1 deletion src/OpenAI.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@ public static function client(string $apiKey, ?string $organization = null, ?str
*/
public static function factory(): Factory
{
return new Factory();
return new Factory;
}
}
3 changes: 1 addition & 2 deletions src/Responses/Assistants/AssistantDeleteResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@ private function __construct(
public readonly string $object,
public readonly bool $deleted,
private readonly MetaInformation $meta,
) {
}
) {}

/**
* Acts as static factory, and returns a new Response instance.
Expand Down
3 changes: 1 addition & 2 deletions src/Responses/Assistants/AssistantListResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,7 @@ private function __construct(
public readonly ?string $lastId,
public readonly bool $hasMore,
private readonly MetaInformation $meta,
) {
}
) {}

/**
* Acts as static factory, and returns a new Response instance.
Expand Down
3 changes: 1 addition & 2 deletions src/Responses/Assistants/AssistantResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,7 @@ private function __construct(
public ?float $topP,
public string|AssistantResponseResponseFormat $responseFormat,
private readonly MetaInformation $meta,
) {
}
) {}

/**
* Acts as static factory, and returns a new Response instance.
Expand Down
3 changes: 1 addition & 2 deletions src/Responses/Assistants/AssistantResponseResponseFormat.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ final class AssistantResponseResponseFormat implements ResponseContract

private function __construct(
public string $type,
) {
}
) {}

/**
* Acts as static factory, and returns a new Response instance.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ final class AssistantResponseResponseFormatText implements ResponseContract

private function __construct(
public string $type,
) {
}
) {}

/**
* Acts as static factory, and returns a new Response instance.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ final class AssistantResponseToolCodeInterpreter implements ResponseContract

private function __construct(
public string $type,
) {
}
) {}

/**
* Acts as static factory, and returns a new Response instance.
Expand Down
3 changes: 1 addition & 2 deletions src/Responses/Assistants/AssistantResponseToolFileSearch.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ final class AssistantResponseToolFileSearch implements ResponseContract

private function __construct(
public string $type,
) {
}
) {}

/**
* Acts as static factory, and returns a new Response instance.
Expand Down
3 changes: 1 addition & 2 deletions src/Responses/Assistants/AssistantResponseToolFunction.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@ final class AssistantResponseToolFunction implements ResponseContract
private function __construct(
public string $type,
public AssistantResponseToolFunctionFunction $function,
) {
}
) {}

/**
* Acts as static factory, and returns a new Response instance.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ private function __construct(
public string $description,
public string $name,
public array $parameters,
) {
}
) {}

/**
* Acts as static factory, and returns a new Response instance.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@ final class AssistantResponseToolResourceCodeInterpreter implements ResponseCont
*/
private function __construct(
public array $fileIds,
) {
}
) {}

/**
* Acts as static factory, and returns a new Response instance.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@ final class AssistantResponseToolResourceFileSearch implements ResponseContract
*/
private function __construct(
public array $vectorStoreIds,
) {
}
) {}

/**
* Acts as static factory, and returns a new Response instance.
Expand Down
3 changes: 1 addition & 2 deletions src/Responses/Assistants/AssistantResponseToolResources.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@ final class AssistantResponseToolResources implements ResponseContract
private function __construct(
public ?AssistantResponseToolResourceCodeInterpreter $codeInterpreter,
public ?AssistantResponseToolResourceFileSearch $fileSearch,
) {
}
) {}

/**
* Acts as static factory, and returns a new Response instance.
Expand Down
2 changes: 1 addition & 1 deletion src/Responses/Audio/SpeechStreamResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public function meta(): MetaInformation

public static function fake(?string $content = null, ?MetaInformation $meta = null): static
{
$psr17Factory = new Psr17Factory();
$psr17Factory = new Psr17Factory;
$response = $psr17Factory->createResponse()
->withBody($psr17Factory->createStream($content ?? (string) file_get_contents(__DIR__.'/../../Testing/Responses/Fixtures/Audio/speech-streamed.mp3')));

Expand Down
3 changes: 1 addition & 2 deletions src/Responses/Audio/TranscriptionResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,7 @@ private function __construct(
public readonly array $words,
public readonly string $text,
private readonly MetaInformation $meta,
) {
}
) {}

/**
* Acts as static factory, and returns a new Response instance.
Expand Down
3 changes: 1 addition & 2 deletions src/Responses/Audio/TranscriptionResponseSegment.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@ private function __construct(
public readonly float $compressionRatio,
public readonly float $noSpeechProb,
public readonly ?bool $transient,
) {
}
) {}

/**
* Acts as static factory, and returns a new Response instance.
Expand Down
3 changes: 1 addition & 2 deletions src/Responses/Audio/TranscriptionResponseWord.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ private function __construct(
public readonly string $word,
public readonly float $start,
public readonly float $end,
) {
}
) {}

/**
* Acts as static factory, and returns a new Response instance.
Expand Down
3 changes: 1 addition & 2 deletions src/Responses/Audio/TranslationResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,7 @@ private function __construct(
public readonly array $segments,
public readonly string $text,
private readonly MetaInformation $meta,
) {
}
) {}

/**
* Acts as static factory, and returns a new Response instance.
Expand Down
3 changes: 1 addition & 2 deletions src/Responses/Audio/TranslationResponseSegment.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@ private function __construct(
public readonly float $compressionRatio,
public readonly float $noSpeechProb,
public readonly ?bool $transient,
) {
}
) {}

/**
* Acts as static factory, and returns a new Response instance.
Expand Down
3 changes: 1 addition & 2 deletions src/Responses/Batches/BatchListResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,7 @@ private function __construct(
public readonly ?string $lastId,
public readonly bool $hasMore,
private readonly MetaInformation $meta,
) {
}
) {}

/**
* Acts as static factory, and returns a new Response instance.
Expand Down
3 changes: 1 addition & 2 deletions src/Responses/Batches/BatchResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,7 @@ private function __construct(
public ?BatchResponseRequestCounts $requestCounts,
public ?array $metadata,
private readonly MetaInformation $meta,
) {
}
) {}

/**
* Acts as static factory, and returns a new Response instance.
Expand Down
3 changes: 1 addition & 2 deletions src/Responses/Batches/BatchResponseErrors.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@ final class BatchResponseErrors implements ResponseContract
private function __construct(
public string $object,
public array $data,
) {
}
) {}

/**
* Acts as static factory, and returns a new Response instance.
Expand Down
3 changes: 1 addition & 2 deletions src/Responses/Batches/BatchResponseErrorsData.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ private function __construct(
public string $message,
public ?string $param,
public ?int $line,
) {
}
) {}

/**
* Acts as static factory, and returns a new Response instance.
Expand Down
3 changes: 1 addition & 2 deletions src/Responses/Batches/BatchResponseRequestCounts.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ private function __construct(
public int $total,
public int $completed,
public int $failed,
) {
}
) {}

/**
* Acts as static factory, and returns a new Response instance.
Expand Down
3 changes: 1 addition & 2 deletions src/Responses/Chat/CreateResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,7 @@ private function __construct(
public readonly array $choices,
public readonly CreateResponseUsage $usage,
private readonly MetaInformation $meta,
) {
}
) {}

/**
* Acts as static factory, and returns a new Response instance.
Expand Down
3 changes: 1 addition & 2 deletions src/Responses/Chat/CreateResponseChoice.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ private function __construct(
public readonly int $index,
public readonly CreateResponseMessage $message,
public readonly ?string $finishReason,
) {
}
) {}

/**
* @param array{index: int, message: array{role: string, content: ?string, function_call: ?array{name: string, arguments: string}, tool_calls: ?array<int, array{id: string, type: string, function: array{name: string, arguments: string}}>}, finish_reason: string|null} $attributes
Expand Down
3 changes: 1 addition & 2 deletions src/Responses/Chat/CreateResponseFunctionCall.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ final class CreateResponseFunctionCall
private function __construct(
public readonly string $name,
public readonly string $arguments,
) {
}
) {}

/**
* @param array{name: string, arguments: string} $attributes
Expand Down
3 changes: 1 addition & 2 deletions src/Responses/Chat/CreateResponseMessage.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ private function __construct(
public readonly ?string $content,
public readonly array $toolCalls,
public readonly ?CreateResponseFunctionCall $functionCall,
) {
}
) {}

/**
* @param array{role: string, content: ?string, function_call: ?array{name: string, arguments: string}, tool_calls: ?array<int, array{id: string, type: string, function: array{name: string, arguments: string}}>} $attributes
Expand Down
3 changes: 1 addition & 2 deletions src/Responses/Chat/CreateResponseToolCall.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ private function __construct(
public readonly string $id,
public readonly string $type,
public readonly CreateResponseToolCallFunction $function,
) {
}
) {}

/**
* @param array{id: string, type: string, function: array{name: string, arguments: string}} $attributes
Expand Down
3 changes: 1 addition & 2 deletions src/Responses/Chat/CreateResponseToolCallFunction.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ final class CreateResponseToolCallFunction
private function __construct(
public readonly string $name,
public readonly string $arguments,
) {
}
) {}

/**
* @param array{name: string, arguments: string} $attributes
Expand Down
3 changes: 1 addition & 2 deletions src/Responses/Chat/CreateResponseUsage.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ private function __construct(
public readonly int $promptTokens,
public readonly ?int $completionTokens,
public readonly int $totalTokens,
) {
}
) {}

/**
* @param array{prompt_tokens: int, completion_tokens: int|null, total_tokens: int} $attributes
Expand Down
3 changes: 1 addition & 2 deletions src/Responses/Chat/CreateStreamedResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,7 @@ private function __construct(
public readonly string $model,
public readonly array $choices,
public readonly ?CreateResponseUsage $usage,
) {
}
) {}

/**
* Acts as static factory, and returns a new Response instance.
Expand Down
3 changes: 1 addition & 2 deletions src/Responses/Chat/CreateStreamedResponseChoice.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ private function __construct(
public readonly int $index,
public readonly CreateStreamedResponseDelta $delta,
public readonly ?string $finishReason,
) {
}
) {}

/**
* @param array{index: int, delta?: array{role?: string, content?: string}, finish_reason: string|null} $attributes
Expand Down
3 changes: 1 addition & 2 deletions src/Responses/Chat/CreateStreamedResponseDelta.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ private function __construct(
public readonly ?string $content,
public readonly array $toolCalls,
public readonly ?CreateStreamedResponseFunctionCall $functionCall,
) {
}
) {}

/**
* @param array{role?: string, content?: string, function_call?: array{name?: ?string, arguments?: ?string}, tool_calls?: array<int, array{id?: string, type?: string, function: array{name?: string, arguments: string}}>} $attributes
Expand Down
3 changes: 1 addition & 2 deletions src/Responses/Chat/CreateStreamedResponseFunctionCall.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ final class CreateStreamedResponseFunctionCall
private function __construct(
public readonly ?string $name,
public readonly ?string $arguments,
) {
}
) {}

/**
* @param array{name?: ?string, arguments?: ?string} $attributes
Expand Down
3 changes: 1 addition & 2 deletions src/Responses/Chat/CreateStreamedResponseToolCall.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ private function __construct(
public readonly ?string $id,
public readonly ?string $type,
public readonly CreateStreamedResponseToolCallFunction $function,
) {
}
) {}

/**
* @param array{id?: string, type?: string, function: array{name?: string, arguments: string}} $attributes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ final class CreateStreamedResponseToolCallFunction
private function __construct(
public readonly ?string $name,
public readonly string $arguments,
) {
}
) {}

/**
* @param array{name?: string, arguments: string} $attributes
Expand Down
Loading

0 comments on commit 7d9ac24

Please sign in to comment.