Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

cf ai run prints {} for models that return binary output (text-to-speech audio)

Aperta
#437 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
65/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
node.js, typescript
Ambito
ai, cli

Direzione di ricerca

Start by tracing the cf ai run command to where it reads and formats the API response, then check how the CLI handles content types and stdout. Reproduce with the text-to-speech command in the issue and compare its response handling with the REST API's audio/mpeg body. Done when non-JSON response bytes can be retrieved as described and JSON responses still work.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

What happens

cf ai run with a text-to-speech model prints {} and exits 0. The audio the model returned is dropped, so there's no way to get it from the CLI.

$ cf ai run @cf/deepgram/aura-2-en --text "Hello there." --encoding mp3 > out.mp3; echo "exit $?"
exit 0
$ xxd out.mp3
00000000: 7b7d 0a                                  {}.

The same request sent straight to the REST API (POST /accounts/{account_id}/ai/run/@cf/deepgram/aura-2-en with {"text": "...", "speaker": "athena", "encoding": "mp3"}) returns 200 with content-type: audio/mpeg and the MP3 bytes. So it looks like the CLI JSON-parses or serializes every response, and a binary body turns into {}.

Expected

When the response isn't JSON (audio/*, image/*, application/octet-stream), write the raw bytes to stdout (or to a file given with --output FILE), and refuse with a clear message when stdout is a terminal. Failing that, at least exit non-zero rather than print {} with success.

This affects @cf/deepgram/aura-1, @cf/deepgram/aura-2-en, @cf/deepgram/aura-2-es and likely the image-generation models too.

Environment

cf 1.0.0-beta.20, Node v26.12.1, Linux aarch64, signed in with cf auth login (OAuth).

Lingua principale
TypeScript
Stelle
960
Fork
62
Merge medio
17h 15m
PR unite (30g)
194

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di cloudflare/cf

Tutte le issue di cloudflare/cf

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.