Skip to content

Allow direct image uploads for LemonSlice avatars#1987

Open
rosetta-livekit-bot[bot] wants to merge 1 commit into
mainfrom
fuller-postmen-gentled
Open

Allow direct image uploads for LemonSlice avatars#1987
rosetta-livekit-bot[bot] wants to merge 1 commit into
mainfrom
fuller-postmen-gentled

Conversation

@rosetta-livekit-bot

@rosetta-livekit-bot rosetta-livekit-bot Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Summary

Testing

  • pnpm build:agents
  • pnpm --filter @livekit/agents-plugin-lemonslice build
  • pnpm --filter @livekit/agents-plugin-lemonslice lint
  • pnpm test -- plugins/lemonslice/src/avatar.test.ts
  • pnpm --filter @livekit/agents-plugin-lemonslice api:check

Ported 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.

agent_image = Image.open(Path(__file__).parent / "test-img.jpg")
avatar = lemonslice.AvatarSession(
    agent_image=agent_image,
    # Prompt to guide the avatar's movements
    agent_prompt="Be expressive in your movements and use your hands while talking.",
)

Note: our package now depends on Pillow.

@rosetta-livekit-bot rosetta-livekit-bot Bot requested a review from a team as a code owner July 7, 2026 18:12
@changeset-bot

changeset-bot Bot commented Jul 7, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 3a76705

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 36 packages
Name Type
@livekit/agents-plugin-lemonslice Patch
@livekit/agents Patch
@livekit/agents-plugin-anam Patch
@livekit/agents-plugin-anthropic Patch
@livekit/agents-plugin-assemblyai Patch
@livekit/agents-plugin-baseten Patch
@livekit/agents-plugin-bey Patch
@livekit/agents-plugin-cartesia Patch
@livekit/agents-plugin-cerebras Patch
@livekit/agents-plugin-deepgram Patch
@livekit/agents-plugin-did Patch
@livekit/agents-plugin-elevenlabs Patch
@livekit/agents-plugin-fishaudio Patch
@livekit/agents-plugin-google Patch
@livekit/agents-plugin-hedra Patch
@livekit/agents-plugin-hume Patch
@livekit/agents-plugin-inworld Patch
@livekit/agents-plugin-liveavatar Patch
@livekit/agents-plugin-livekit Patch
@livekit/agents-plugin-minimax Patch
@livekit/agents-plugin-mistral Patch
@livekit/agents-plugin-mistralai Patch
@livekit/agents-plugin-neuphonic Patch
@livekit/agents-plugin-openai Patch
@livekit/agents-plugin-perplexity Patch
@livekit/agents-plugin-phonic Patch
@livekit/agents-plugin-resemble Patch
@livekit/agents-plugin-rime Patch
@livekit/agents-plugin-runway Patch
@livekit/agents-plugin-sarvam Patch
@livekit/agents-plugin-silero Patch
@livekit/agents-plugin-soniox Patch
@livekit/agents-plugin-tavus Patch
@livekit/agents-plugin-trugen Patch
@livekit/agents-plugin-xai Patch
@livekit/agents-plugins-test Patch

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

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 1 potential issue.

Open in Devin Review

Comment on lines +335 to +340
formData.append(
'image',
new File([imageBlobPart(this.agentImage)], 'image.png', {
type: 'image/png',
}),
);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔍 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.

Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

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.

0 participants