Skip to content

Implement run_bytes method on AI binding for models that return binary data.#920

Open
kflansburg wants to merge 1 commit intocloudflare:mainfrom
kflansburg:kflansburg/ai-image
Open

Implement run_bytes method on AI binding for models that return binary data.#920
kflansburg wants to merge 1 commit intocloudflare:mainfrom
kflansburg:kflansburg/ai-image

Conversation

@kflansburg
Copy link
Contributor

The method returns a ByteStream which implements Stream.

This can be passed directly to the response or collected to Vec<u8>, as shown in the docstring.

Also added an example worker to demonstrate / test this behavior.

Closes #783

…ary data.

The method returns a `ByteStream` which implements `Stream`.

This can be passed directly to the response or collected to `Vec<u8>`, as shown
in the docstring.

Also added an example worker to demonstrate / test this behavior.

Closes cloudflare#783
@guybedford
Copy link
Collaborator

Amazing, thanks for this. I'll make sure to review it for the next release hopefully next week.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] AI binding fails to handle binary responses from image generation models

2 participants