-
Notifications
You must be signed in to change notification settings - Fork 95
Open
Labels
kind: bugCategorizes issue or PR as related to a bug.Categorizes issue or PR as related to a bug.
Description
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
Metadata
Metadata
Assignees
Labels
kind: bugCategorizes issue or PR as related to a bug.Categorizes issue or PR as related to a bug.