INNER CODE UNIT · Python

build_messages

OpenVGLab/OmniLottie · app.py:149

def build_messages(task_type, text_prompt=None, image=None, video_frames=None):
    messages = [{"role": "system", "content": SYSTEM_PROMPT}]

    if task_type == "text":
        text = simplify_to_animation_description(text_prompt)
        messages.append({
            "role": "user",
            "content": [{"type": "text", "text": f"Generate Lottie code: {text}"}]
        })

    elif task_type == "image":
        text = simplify_to_animation_description(text_prompt)
        messages.append({
            "role": "user",
            "content": [
                {"type": "image", "image": image},
                {"type": "text", "text": f"Animate this image: {text}"}
            ]

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…