10000 feat(OpenAI): Add support for streaming for transcriptions by iBotPeaches · Pull Request #603 · openai-php/client · GitHub
[go: up one dir, main page]

Skip to content

feat(OpenAI): Add support for streaming for transcriptions #603

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jun 17, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
fix(OpenAI): Add transcription support streaming
  • Loading branch information
iBotPeaches committed Jun 16, 2025
commit 74225b27a817fddd256714ab7378a1a3a81f401b
4 changes: 2 additions & 2 deletions src/Responses/Audio/Streaming/TranscriptTextDelta.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
/**
* @phpstan-import-type LogprobsType from Logprobs
*
* @phpstan-type TranscriptTextDeltaType array{logprobs: array<int, LogprobsType>, delta: string}
* @phpstan-type TranscriptTextDeltaType array{logprobs?: array<int, LogprobsType>|null, delta: string}
*
* @implements ResponseContract<TranscriptTextDeltaType>
*/
Expand All @@ -29,7 +29,7 @@ final class TranscriptTextDelta implements ResponseContract, ResponseHasMetaInfo
use HasMetaInformation;

/**
* @param array<int, string>|null $logprobs
* @param array<int, Logprobs>|null $logprobs
*/
private function __construct(
public readonly ?array $logprobs,
Expand Down
4 changes: 2 additions & 2 deletions src/Responses/Audio/Streaming/TranscriptTextDone.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
/**
* @phpstan-import-type LogprobsType from Logprobs
*
* @phpstan-type TranscriptTextDoneType array{logprobs?: array<int, LogprobsType>, text: string}
* @phpstan-type TranscriptTextDoneType array{logprobs?: array<int, LogprobsType>|null, text: string}
*
* @implements ResponseContract<TranscriptTextDoneType>
*/
Expand All @@ -29,7 +29,7 @@ final class TranscriptTextDone implements ResponseContract, ResponseHasMetaInfor
use HasMetaInformation;

/**
* @param array<int, string>|null $logprobs
* @param array<int, Logprobs>|null $logprobs
*/
private function __construct(
public readonly ?array $logprobs,
Expand Down
2 changes: 1 addition & 1 deletion src/Responses/Audio/TranscriptionStreamResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ final class TranscriptionStreamResponse implements ResponseContract

private function __construct(
public readonly string $event,
public readonly mixed $response,
public readonly TranscriptTextDelta|TranscriptTextDone $response,
) {}

/**
Expand Down
0