Skip to content

Add AudioBytes Class and OpenAI Model Support for Audio Input#446

Open
cto-new[bot] wants to merge 3 commits intomainfrom
engine-task-263478d9-8258-40e0-86f3-cfae3f550b5a
Open

Add AudioBytes Class and OpenAI Model Support for Audio Input#446
cto-new[bot] wants to merge 3 commits intomainfrom
engine-task-263478d9-8258-40e0-86f3-cfae3f550b5a

Conversation

@cto-new
Copy link

@cto-new cto-new bot commented May 14, 2025

Summary

This PR introduces the AudioBytes class to represent audio input bytes and enhances OpenAI chat model support to accept audio (WAV) input as part of user messages. It also ensures consistent type annotations and casting throughout the codebase to maintain compatibility with static type checkers and newer Python standards.

Details

  • Adds AudioBytes class in chat_model/message.py for audio (WAV) input and validates MIME type.
  • Incorporates AudioBytes into UserMessageContentBlock for message flexibility.
  • Serializes AudioBytes correctly in OpenAI chat model and allows their use in user content.
  • Updates OpenAI user message conversion and formatting for audio blocks.
  • Exports AudioBytes from the main module for external availability.
  • Updates all typing.cast() usage to use string literal type expressions as required by PEP 695 and enforced by tooling, ensuring correct syntax and compatibility throughout the repo.
  • Fixes Python formatting, and ensures function signatures and test type hints match new standards.

@cto-new
Copy link
Author

cto-new bot commented May 14, 2025

Engine is processing your review feedback and will update the code shortly...

@cto-new
Copy link
Author

cto-new bot commented May 15, 2025

Engine is processing your review feedback and will update the code shortly...

@jackmpcollins jackmpcollins added the dependencies Pull requests that update a dependency file label Oct 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Comments