#!/usr/bin/env python3
"""
Generated test file for Vision LLM Test
Framework: langchain
Execution mode: async
Streaming: no"""

import os
import sentry_sdk
import asyncio

from langchain_anthropic import ChatAnthropic
from langchain_core.messages import HumanMessage, SystemMessage, AIMessage


sentry_sdk.init(
    dsn=os.environ.get("SENTRY_DSN"),
    traces_sample_rate=1.0,
    send_default_pii=True,
    stream_gen_ai_spans=True,
)

chat = ChatAnthropic(model="claude-haiku-4-5")

async def main():
    # Turn 1
    messages = [
        SystemMessage(content="You are a helpful assistant that can analyze images. Be concise."),
        HumanMessage(content=[
            {"type": "text", "text": "What color is this image? Reply with just the color name."},
            {"type": "image_url", "image_url": {"url": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAFUlEQVR42mP8z8BQz0AEYBxVSF+FABJADveWkH6oAAAAAElFTkSuQmCC"}},
        ]),
    ]
    response = await chat.ainvoke(messages)
    print(f"Turn 1 Response: {response.content}")

if __name__ == "__main__":
    with sentry_sdk.start_transaction(op="test", name="Vision LLM Test"):
        asyncio.run(main())
    sentry_sdk.flush(timeout=5)
