mirror of
https://github.com/hanzoai/go-openai-realtime.git
synced 2026-09-30 21:54:42 +00:00
Merge pull request #11 from cgooding-va/fix-g711-audio-format-constants
Fix G711 AudioFormat constants
This commit is contained in:
@@ -72,7 +72,7 @@ func TestSessionUpdateEvent(t *testing.T) {
|
||||
"instructions": "test-instructions",
|
||||
"voice": "alloy",
|
||||
"input_audio_format": "pcm16",
|
||||
"output_audio_format": "g711-ulaw",
|
||||
"output_audio_format": "g711_ulaw",
|
||||
"input_audio_transcription": {
|
||||
"model": "whisper-1"
|
||||
},
|
||||
@@ -126,7 +126,7 @@ func TestSessionUpdateEvent(t *testing.T) {
|
||||
"instructions": "test-instructions",
|
||||
"voice": "alloy",
|
||||
"input_audio_format": "pcm16",
|
||||
"output_audio_format": "g711-ulaw",
|
||||
"output_audio_format": "g711_ulaw",
|
||||
"input_audio_transcription": {
|
||||
"model": "whisper-1"
|
||||
},
|
||||
@@ -196,7 +196,7 @@ func TestSessionUpdateEventSimple(t *testing.T) {
|
||||
"instructions": "test-instructions",
|
||||
"voice": "alloy",
|
||||
"input_audio_format": "pcm16",
|
||||
"output_audio_format": "g711-ulaw",
|
||||
"output_audio_format": "g711_ulaw",
|
||||
"turn_detection": null,
|
||||
"temperature": 0.5,
|
||||
"max_response_output_tokens": 100
|
||||
@@ -380,7 +380,7 @@ func TestResponseCreateEvent(t *testing.T) {
|
||||
],
|
||||
"instructions": "test-instructions",
|
||||
"voice": "alloy",
|
||||
"output_audio_format": "g711-ulaw",
|
||||
"output_audio_format": "g711_ulaw",
|
||||
"tool_choice": "auto",
|
||||
"max_output_tokens": 100
|
||||
},
|
||||
@@ -392,7 +392,7 @@ func TestResponseCreateEvent(t *testing.T) {
|
||||
message.Response.MaxOutputTokens = openairt.Inf
|
||||
data, err = json.Marshal(message)
|
||||
require.NoError(t, err)
|
||||
expected = `{"event_id":"test-id","response":{"modalities":["text","audio"],"instructions":"test-instructions","voice":"alloy","output_audio_format":"g711-ulaw","tool_choice":"auto","max_output_tokens":"inf"},"type":"response.create"}`
|
||||
expected = `{"event_id":"test-id","response":{"modalities":["text","audio"],"instructions":"test-instructions","voice":"alloy","output_audio_format":"g711_ulaw","tool_choice":"auto","max_output_tokens":"inf"},"type":"response.create"}`
|
||||
require.JSONEq(t, expected, string(data))
|
||||
}
|
||||
|
||||
|
||||
@@ -21,8 +21,8 @@ type AudioFormat string
|
||||
|
||||
const (
|
||||
AudioFormatPcm16 AudioFormat = "pcm16"
|
||||
AudioFormatG711Ulaw AudioFormat = "g711-ulaw"
|
||||
AudioFormatG711Alaw AudioFormat = "g711-alaw"
|
||||
AudioFormatG711Ulaw AudioFormat = "g711_ulaw"
|
||||
AudioFormatG711Alaw AudioFormat = "g711_alaw"
|
||||
)
|
||||
|
||||
type Modality string
|
||||
|
||||
Reference in New Issue
Block a user