Illustrate items
illustrate_itemsAdd images to the activity: for every text you send, it searches the Educaplay image bank and a stock photo library for what you describe, chooses the best match and puts it on that text, without touching the text or its audio. It is the way to add images, and you must call it ONLY when the user asked for images in their own words: never illustrate an activity on your own initiative, not even one you have just written. The user decides WHICH texts get an image and you send exactly those, every one of them: all the questions, every choice, only the correct choices, only the incorrect ones, the odd or the even items, the first five, one named text... whatever they said. Never reduce their selection, never pick a subset of your own and never ask which ones to start with: send the whole selection in this call, up to 40 entries, and call again in the same turn with the rest when there are more. Which texts can hold an image depends on the type: "media_targets.image" in the activity state lists them (for example question and choice, or word, hint, definition, card). A text that already has an image keeps it unless existing is "replace"; one with a video or a youtube link is always left untouched. The result lists in "applied" every text that got its image, with the element and the item it went to and, when known, what the image shows, and in "pending" the texts that are still waiting for theirs.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| items | Yes | One entry per text that must get an image: every text of the selection the user asked for, none left out. | |
| answers | Yes | For the choices of a question: "correct" or "incorrect" when the user named only those, otherwise "all". | |
| elements | Yes | The kinds of text the user named, from media_targets.image ("the questions" is question, never question and choice; "the answers" is choice): only those. A text of another kind is left without image. | |
| existing | Yes | What happens to a text that already has an image. "keep": it is left untouched; the value for every request to ADD images. "replace": its image is replaced by a different one and the old one is discarded, and texts without an image are left as they are; ONLY when the user asked to change or replace the image of those very texts ("change the image of Paris", "another picture for question 2", "I do not like that one"). | |
| activity_id | Yes | Id of the activity. |