google / google/adk-web

How to display Image in WEB UI

Open
#189 1 comment 2 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
1k
Forks
267
Avg merge
1d 12h
Merged PRs (30d)
9

Description

How to display Image in WEBUI
I have before model callback that cuts the circuit and responds with LlmResponse. i tried both from_bytes and inline-data. Both display empty message. I am able to save the image locally. I am able to save the image in artifact service and it is then displayed in WEB UI.

return LlmResponse(
content=types.Content(
role="model",
parts=[
types.Part(text=f"✅ Here is the QR code for: '{text_for_qrcode}'"),
types.Part.from_bytes(
mime_type='image/png;base64',
data=base64_string
),
types.Part(inline_data=types.Blob(
data=base64_string,
mime_type="image/png;base64",
display_name="qrcode"
)
)
]
)
)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.