Non-JSON formatted data or verbose JSON data on AudioTranscriptions couldn’t decode
I maintainer di solito rispondono entro 3 giorni
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 35/100
Direzione di ricerca
Start with performRequest<ResultType: Codable>() in Sources/OpenAI/OpenAI.swift and the AudioResponseFormat enum in Sources/OpenAI/Public/Models/AudioTranscriptionQuery.swift. Check how the transcription response formats are handled and whether the same behavior applies to AudioTranslations. Done means the listed formats, including plain text and verbose JSON, can be decoded successfully.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Describe the bug
I have tested the behavior of new response_format parameter implemented with #114. However, my frontend code always returned a JSON decoding error.
I traced from the breakpoint and found that it catches the error at this line in the method performRequest<ResultType: Codable>() of OpenAI.swift. Errors seems to occur when anything but a specific JSON structure (e.g. plain text) is entered.
- Serialized data is also returned as UTF-8 plain text
- JSON structure seems to have several patterns (e.g. Verbose JSON)
I tried all formats in the new enum AudioResponseFormat and found that only .json worked fine, text, Verbose JSON, srt and vtt caught any errors.
- ✅
AudioResponseFormat.json - ❌
AudioResponseFormat.text - ❌
AudioResponseFormat.verboseJson - ❌
AudioResponseFormat.srt - ❌
AudioResponseFormat.vtt
I have not tried testing with the AudioTranslations API, but it may contain same problems.
Error example 1
APIErrorResponse(error: OpenAI.APIError(message: "1 validation error for Request\nbody -> response_format\n value is not a valid enumeration member; permitted: 'json', 'text', 'vtt', 'srt', 'verbose_json' (type=type_error.enum; enum_values=[<ResponseFormat.JSON: 'json'>, <ResponseFormat.TEXT: 'text'>, <ResponseFormat.VTT: 'vtt'>, <ResponseFormat.SRT: 'srt'>, <ResponseFormat.VERBOSE_JSON: 'verbose_json'>])", type: "invalid_request_error", param: nil, code: nil))
Error example 2
dataCorrupted(Swift.DecodingError.Context(codingPath: [], debugDescription: "The given data was not valid JSON.", underlyingError: Optional(Error Domain=NSCocoaErrorDomain Code=3840 "Unexpected character 'W' around line 1, column 1." UserInfo={NSDebugDescription=Unexpected character 'W' around line 1, column 1., NSJSONSerializationErrorIndex=0})))
Expected behavior
Correctly decode returned data as JSON or plain text (including vtt, srt).
Desktop (please complete the following information):
- OS: macOS
- Version 14.1.1
- Lingua principale
- Swift
- Stelle
- 2.9k
- Fork
- 519
- Merge medio
- 4g 9h
- PR unite (30g)
- 13
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di MacPaw/OpenAI
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
I maintainer di solito rispondono entro 3 giorni
-
Enable batch promptsAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
MacPaw/OpenAI#73 · 1 commento · 1 reazione ·
I maintainer di solito rispondono entro 3 giorni
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 55/100
I maintainer di solito rispondono entro 3 giorni
-
Add Batch API supportAperta
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
I maintainer di solito rispondono entro 3 giorni
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
I maintainer di solito rispondono entro 3 giorni
Tutte le issue di MacPaw/OpenAI
Issue simili
-
enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
altic-dev/FluidVoice#1117 ·
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 90/100
omacom/try-omarchy#343 ·
I maintainer di solito rispondono entro 1 giorno
-
install.ps1: Windows PowerShell 5.1 aborts after a successful cosign verification (NativeCommandError on 'Verified OK')Forse già presa @sly321-pixel l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
OneBusAway/onebusaway-ios#1518 ·
I maintainer di solito rispondono entro 2 giorni
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 61/100
vorssaint/vorssaint-utils#3030 ·
I maintainer di solito rispondono entro 1 giorno