Vision

Example

Open your bot’s eyes

main.py

from ugly_bot import *

@export("user_visible")
def example(live_user):
    text = text_gen(
        model=TextGenModel.OPENAI_GPT_4O,
        instruction='You are funny and always making jokes.',
        messages=[
            TextGenMessage(
                role = TextGenRole.USER,
                content = [
                    live_user.image,
                    "Describe this image"
                ]
            ),
        ],
    )
    message_send(markdown=text)

start()

Note

Vision requires an image, so we trigger on event user_visible which happens when a user becomes visible. Also, sending the image to the LLM requires a more complex message format.

Glossary