Allow direct image uploads for LemonSlice avatars#1987
Allow direct image uploads for LemonSlice avatars#1987rosetta-livekit-bot[bot] wants to merge 1 commit into
Conversation
🦋 Changeset detectedLatest commit: 3a76705 The changes in this PR will be included in the next version bump. This PR includes changesets to release 36 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
| formData.append( | ||
| 'image', | ||
| new File([imageBlobPart(this.agentImage)], 'image.png', { | ||
| type: 'image/png', | ||
| }), | ||
| ); |
There was a problem hiding this comment.
🔍 Uploaded image MIME type is hardcoded to image/png regardless of actual format
The File constructor at plugins/lemonslice/src/avatar.ts:337-339 always uses type: 'image/png' and filename 'image.png', even if the user provides JPEG, WebP, or other image bytes. If the LemonSlice API validates the MIME type or uses it for format detection, non-PNG images could be rejected or misprocessed. Consider either accepting a MIME type option alongside agentImage, or using a generic type like application/octet-stream and letting the server detect the format.
Was this helpful? React with 👍 or 👎 to provide feedback.
Summary
agentImagesupport for direct multipart avatar image uploadsagentIdandagentImageUrlflowsTesting
pnpm build:agentspnpm --filter @livekit/agents-plugin-lemonslice buildpnpm --filter @livekit/agents-plugin-lemonslice lintpnpm test -- plugins/lemonslice/src/avatar.test.tspnpm --filter @livekit/agents-plugin-lemonslice api:checkPorted from livekit/agents#6343
Original PR description
Instead of providing a url to an image or an ID to a LemonSlice avatar, users can now pass us an image directly.
Note: our package now depends on Pillow.