-
-
Notifications
You must be signed in to change notification settings - Fork 0
feat:Add ChatCompletionContentPartAudio and InputAudio schemas to OpenAPI #136
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
Conversation
WalkthroughThis pull request introduces two new schemas to the OpenAPI specification to extend chat completion capabilities. The new Changes
Sequence Diagram(s)sequenceDiagram
participant Client
participant API
participant Validator
Client->>API: Send chat completion request with audio data
API->>Validator: Validate against ChatCompletionUserMessage schema
Validator-->>API: Confirm audio input (ChatCompletionContentPartAudio with InputAudio)
API-->>Client: Respond acknowledging audio input acceptance
Suggested reviewers
Poem
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (2)
src/libs/DeepInfra/openapi.yaml (2)
3457-3470: New Schema: ChatCompletionContentPartAudio
The new schemaChatCompletionContentPartAudiocorrectly defines an object with the required propertiestypeandinput_audio. Thetypefield is constrained to the fixed valueinput_audio, and theinput_audioproperty properly references theInputAudioschema. This implementation meets the PR’s objective of extending chat completion capabilities to handle audio inputs.Consider adding a brief description for the
typefield to further clarify that it is meant to always use the fixed value"input_audio".
4185-4200: New Schema: InputAudio
TheInputAudioschema is implemented appropriately: it requires adataproperty (of type string) and offers an optionalformatproperty constrained to eitherwavormp3(defaulting towav). This schema provides a solid foundation for handling audio input data.Consider enhancing the documentation for the
dataproperty—for example, clarifying whether it should be base64-encoded audio or raw data—to improve clarity for API consumers.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (16)
src/libs/DeepInfra/Generated/AnyOf.3.Json.g.csis excluded by!**/generated/**src/libs/DeepInfra/Generated/AnyOf.3.g.csis excluded by!**/generated/**src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionContentPartAudio.Json.g.csis excluded by!**/generated/**src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionContentPartAudio.g.csis excluded by!**/generated/**src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionContentPartAudioType.g.csis excluded by!**/generated/**src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionUserMessage.g.csis excluded by!**/generated/**src/libs/DeepInfra/Generated/DeepInfra.Models.InputAudio.Json.g.csis excluded by!**/generated/**src/libs/DeepInfra/Generated/DeepInfra.Models.InputAudio.g.csis excluded by!**/generated/**src/libs/DeepInfra/Generated/DeepInfra.Models.InputAudioFormat.g.csis excluded by!**/generated/**src/libs/DeepInfra/Generated/JsonConverters.AnyOf3.g.csis excluded by!**/generated/**src/libs/DeepInfra/Generated/JsonConverters.ChatCompletionContentPartAudioType.g.csis excluded by!**/generated/**src/libs/DeepInfra/Generated/JsonConverters.ChatCompletionContentPartAudioTypeNullable.g.csis excluded by!**/generated/**src/libs/DeepInfra/Generated/JsonConverters.InputAudioFormat.g.csis excluded by!**/generated/**src/libs/DeepInfra/Generated/JsonConverters.InputAudioFormatNullable.g.csis excluded by!**/generated/**src/libs/DeepInfra/Generated/JsonSerializerContext.g.csis excluded by!**/generated/**src/libs/DeepInfra/Generated/JsonSerializerContextTypes.g.csis excluded by!**/generated/**
📒 Files selected for processing (1)
src/libs/DeepInfra/openapi.yaml(3 hunks)
🔇 Additional comments (1)
src/libs/DeepInfra/openapi.yaml (1)
3583-3585: Integration Update: Inclusion in ChatCompletionUserMessage
The reference toChatCompletionContentPartAudiois now included in theanyOfarray of thecontentproperty within theChatCompletionUserMessageschema. This integration allows API consumers to specify audio-based message content alongside text and image content.
Summary by CodeRabbit