Skip to content

Make demo show images based on assets #44

@polina-c

Description

@polina-c

#33 adds an Image widget which can theoretically accept a URL or an asset. I've only really tested it with URL so far though. All images in the other elements now use this Image widget mechanism rather than having their own URL/asset parameter.

#32 uploads images to use as assets.

The work here is to configure the images here as assets to the app, and then update the system prompt to explain to use the assets rather than URLs. The place where we currently tell it to use URLs is here:

There is a long list of URLs to use here: https://github.com/flutter/genui/blob/main/examples/travel_app/lib/src/images.dart

Ideally, we will still give the LLM access to some set of images and descriptions associated with them, to help it pick assets well based on the context. There is a JSON file checked in here which contains a mapping of description to asset image name: https://github.com/flutter/genui/blob/7a54fa4474a84d4994c1b2e1f8dc987699cdede0/examples/travel_app/assets/travel_images/images.json

We could copy that into the Dart code as a constant the same as I did with the URLs, or else load it as an asset and still template it into the system prompt.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions