Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: Image support for Gemini Live #1207

Open
aristid opened this issue Feb 11, 2025 · 0 comments
Open

Feature request: Image support for Gemini Live #1207

aristid opened this issue Feb 11, 2025 · 0 comments
Labels
help wanted Looking for someone to take on this issue

Comments

@aristid
Copy link

aristid commented Feb 11, 2025

Gemini Flash now can create nice graphs, other images may follow. Could you please add support for that to gemini.py?

Image

I added the following to _handle_evt_model_turn()

        elif mime_type.startswith("image/"):
            logger.debug(f"Received image from Gemini: {mime_type}")
            image = base64.b64decode(inline_data.data)
            if not image:
                return

            image_message = {
                "role": "assistant",
                "content": [{
                    "type": "image_url",
                    "image_url": {"url": f"data:{mime_type};base64,{inline_data.data}"}
                }],
                "source": "tool"
            }

            await self.push_frame(LLMFullResponseStartFrame())
            await self.push_frame(LLMMessagesAppendFrame(messages=[image_message]))
            await self.push_frame(LLMFullResponseEndFrame())

Maybe it should be added to context as well, not sure. I added an RTVI processor to the pipeline to forward image frames to the client. It more or less works, but I'm sure there is a better way to add this functionality, I don't yet have a good understanding of Pipecat internals.

Could you say whether you plan to add this in the next weeks or is it low priority? Thank you.

@vipyne vipyne added the help wanted Looking for someone to take on this issue label Feb 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Looking for someone to take on this issue
Projects
None yet
Development

No branches or pull requests

2 participants