Skip to content

Conversation

@olivier-drieux
Copy link
Contributor

@olivier-drieux olivier-drieux commented Oct 22, 2025

What:

  • Bug Fix

Description:

TranscriptionResponse now parses both verbose JSON and diarized JSON responses.
Segment fields differ between the two response types.
This commit updates TranscriptionResponseSegment to handle both responses.
Note: Fields that differ between responses are now nullable, also, the id property can now be a integer or a string.

@iBotPeaches
Copy link
Collaborator

ah interesting. I have to read up on this - I missed it. Enabled CI to run for now

@iBotPeaches
Copy link
Collaborator

Thanks - looks good. I want to run it through some real testing when I have some time. I'll adapt one of my samples here and run it through on both ways to be sure - https://github.com/iBotPeaches/openai-php-laravel-test/tree/master/app/Console/Commands

@iBotPeaches
Copy link
Collaborator

Its odd the docs and your samples have non-null values, but my raw tests return a lot more nulls than I expect. Below is a real call sample

{
	"text": "The quick brown fox jumps over the lazy dog.",
	"segments": [
		{
			"type": "transcript.text.segment",
			"text": " The quick brown fox jumps over the lazy dog.",
			"speaker": "A",
			"start": 0,
			"end": 2.1499999999999995,
			"id": "seg_0"
		}
	],
	"usage": {
		"type": "tokens",
		"total_tokens": 172,
		"input_tokens": 51,
		"input_token_details": {
			"text_tokens": 11,
			"audio_tokens": 40
		},
		"output_tokens": 121
	}
}

Copy link
Collaborator

@iBotPeaches iBotPeaches left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested it out here - iBotPeaches/openai-php-laravel-test@acc7a03

Confirmed failure prior to patch and success afterwards. I don't fully understand why I have nulls on a ton of fields, but direct calls via CURL replicate as well.

@iBotPeaches iBotPeaches merged commit 6fd45a8 into openai-php:main Oct 23, 2025
12 checks passed
@iBotPeaches
Copy link
Collaborator

thanks!

@iBotPeaches iBotPeaches added this to the v0.18.0 milestone Oct 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants