Skip to content

[Feature] Support audio modality via Chat resource #627

@MaestroError

Description

@MaestroError

Background

I was trying to implement audio modality with Chat completions API:

Image

Into the LarAgent and it returns empty message:

[choices] => Array
        (
            [0] => OpenAI\Responses\Chat\CreateResponseChoice Object
                (
                    [index] => 0
                    [message] => OpenAI\Responses\Chat\CreateResponseMessage Object
                        (
                            [role] => assistant
                            [content] =>
                            [toolCalls] => Array
                                (
                                )

                            [functionCall] =>
                        )

                    [finishReason] => stop
                )

        )

I tried to debug it and found out that API actually returns the audio content but CreateResponseChoice doesn't stores it, I printed the response:

$response = $this->transporter->requestObject($payload);

[choices] => Array
                (
                    [0] => Array
                        (
                            [index] => 0
                            [message] => Array
                                (
                                    [role] => assistant
                                    [content] =>
                                    [refusal] =>
                                    [audio] => Array
                                        (
                                            [id] => audio_686ad073bba08191bd03d9c9541b0f58
                                            [data] => SUQzBAAAAAAAI1RTU0UAAAAPAAADTGF2ZjYwLjE2LjEwMAAAAAAAAAAAAAAA//OEwAAAAAAAAAAAAFhpbmcAAAAPAAAApQAAjcAABgoLDhEUGBscHyQlKS0uMjU3Ojw.... (Long Base64 string)
                                            [expires_at] => 1751834243
                                            [transcript] => Your name is John. Do you have any other questions for me, John?
                                        )

                                    [annotations] => Array
                                        (
                                        )

                                )

                            [finish_reason] => stop
                        )

                )

I would like to add support for Audio modality output via Chat resource. Learn more here: https://platform.openai.com/docs/api-reference/chat/create

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions