Skip to content

Commit 018c1d3

Browse files
committed
Add support for audio inputs
1 parent 3851874 commit 018c1d3

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/Models/Input.swift

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,12 @@ import MetaCodable
5050
case medium
5151
}
5252

53+
/// The format of the audio data sent to the model.
54+
public enum AudioFormat: String, CaseIterable, Equatable, Hashable, Codable, Sendable {
55+
case mp3
56+
case wav
57+
}
58+
5359
/// A text input to the model.
5460
@CodedAs("input_text") case text(_ text: String)
5561

@@ -74,6 +80,11 @@ import MetaCodable
7480
fileUrl: URL? = nil,
7581
filename: String? = nil
7682
)
83+
84+
/// An audio input to the model.
85+
/// - Parameter data: Base64-encoded audio data.
86+
/// - Parameter format: The format of the audio data.
87+
@CodedAs("input_audio") case audio(data: String, format: AudioFormat)
7788
}
7889

7990
/// A text input to the model, equivalent to a text input.

0 commit comments

Comments
 (0)