Skip to content

Commit 9bfe41f

Browse files
Merge pull request #186 from jamesrochabrun/feature/realtime-fixes-and-audio-improvements
Adding language parameter
2 parents 0ae931f + ed8ecf1 commit 9bfe41f

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

Sources/OpenAI/Public/Parameters/Realtime/OpenAIRealtimeSessionConfiguration.swift

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,8 +155,14 @@ extension OpenAIRealtimeSessionConfiguration {
155155
public struct InputAudioTranscription: Encodable, Sendable {
156156
/// The model to use for transcription (e.g., "whisper-1").
157157
public let model: String
158-
public init(model: String) {
158+
159+
/// The language of the input audio in ISO-639-1 format (e.g., "en", "es", "ja").
160+
/// Supplying the input language improves transcription accuracy and latency.
161+
public let language: String?
162+
163+
public init(model: String, language: String? = nil) {
159164
self.model = model
165+
self.language = language
160166
}
161167
}
162168
}

0 commit comments

Comments
 (0)