[Workers AI] Undefined result for models that return binary output
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 52/100
- Tipo de issue
- Error
- Claridad
- Bastante claro
- Estado de actividad
- Tranquilo
- Stack tecnológico
- typescript
Línea de trabajo
Start at the client.ai.run entry point shown in the reproduction and trace how responses are handled for the binary-output model versus the base64-string model. Run the provided snippet against leonardo/phoenix-1.0 and confirm that the binary result is returned instead of undefined; add coverage for this behavior if the surrounding code has tests.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Confirm this is a Typescript library issue and not an underlying Cloudflare API issue
- This is an issue with the Typescript library
Describe the bug
Hello!
I can't tell if I'm holding the SDK wrong, but when I use the Typescript SDK to run a model like leonardo/phoenix-1.0 that, according to the docs, returns the following payload...
{
"type": "string",
"contentType": "image/jpeg",
"format": "binary",
"description": "The generated image in JPEG format"
}
...I get an undefined output. If I run a model that returns a base64 string (like schnell), I get back a JSON object that correctly reflects the type that's in the documentation.
What could I be doing wrong?
To Reproduce
Run this snippet:
import Cloudflare from 'cloudflare';
const client = new Cloudflare({
apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted
});
const output = await client.ai.run("@cf/leonardo/phoenix-1.0", {
prompt: "A cat eating soup dumplings",
account_id: process.env['CLOUDFLARE_ACCOUNT_ID']!,
})
console.log('Output type:', typeof output);
console.log('Output:', output);
Observe this output:
Output type: undefined
Output: undefined
Code snippets
OS
macOS
Runtime version
Typescript 5.7.3
Library version
v5.2.0
- Lenguaje dominante
- TypeScript
- Estrellas
- 835
- Forks
- 201
- Merge medio
- 41 min
- PR fusionados (30 d)
- 1
Preparar el entorno
Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de cloudflare/cloudflare-typescript
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
cloudflare/cloudflare-typescript#2821 ·
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 76/100
cloudflare/cloudflare-typescript#2811 ·
-
workers.scripts.deployments.list() paginates the wrong field in v7.2.0Posiblemente ocupada @airshakur88 la tomó hace 15 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
cloudflare/cloudflare-typescript#2805 · 1 comentario · 1 reacción ·
-
Release CalendarAbierto
Dificultad 1/5 Menos de una hora Aptitud para principiantes 68/100
cloudflare/cloudflare-typescript#2755 · 7 comentarios · 1 reacción ·
-
<!-- ccr-overview-v2 -->Abierto
Dificultad 1/5 1-3 horas Aptitud para principiantes 15/100
cloudflare/cloudflare-typescript#2812 ·
Todos los issues de cloudflare/cloudflare-typescript
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
TriliumNext/Trilium#12837 · 1 reacción ·
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 85/100
LibreChat-AI/LibreChat#18944 ·
Los mantenedores suelen responder en 1 día
-
bug root-cause:found
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
openchamber/openchamber#7620 · 1 comentario ·
Los mantenedores suelen responder en 2 días
-
enhancement good first issue help wanted
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
Anatomik5/codetovideo#8 ·
-
[Bug] Windows Ghidra provider rejects a PATH-only JDK: bare `java.exe` probe fails with Win32 87Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 1 día