# tests/integration/scenarios_declarative/test_data/image_tools/describe_image/test_describe_image_happy_path.yaml
test_case_id: "describe_image_happy_path"
description: "Tests the standard, successful execution of the describe_image tool with a default prompt."
tags: ["all", "agent", "tools", "image_tools"]
skip_intermediate_events: true

setup_artifacts:
  - filename: "test_image.png"
    mime_type: "image/png"
    content_base64: "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mP8/wcAAwAB/epv2AAAAABJRU5ErkJggg==" # 1x1 red pixel PNG

gateway_input:
  user_prompt: "Describe the image test_image.png"
  user_identity: "test_user@example.com"
  target_agent_name: "TestAgent"
  tool_names: ["describe_image"]

llm_interactions:
  # First LLM call: Agent decides to use the describe_image tool
  - static_response:
      choices:
        - message:
            role: "assistant"
            tool_calls:
              - id: "call_describe_image_123"
                type: "function"
                function:
                  name: "describe_image"
                  arguments: '{"image_filename": "test_image.png"}'
    expected_request:
      tools_present: ["describe_image"]

  # Second LLM call (to the vision API): This should now succeed
  - static_response:
      choices:
        - message:
            role: "assistant"
            content: "This is a detailed description of the image provided by the vision model."
      usage:
        prompt_tokens: 100
        completion_tokens: 25
        total_tokens: 125

  # Third LLM call: Agent processes the successful tool output
  - static_response:
      choices:
        - message:
            role: "assistant"
            content: "The image `test_image.png` is described as: This is a detailed description of the image provided by the vision model."
    expected_request:
      expected_tool_responses_in_llm_messages:
        - tool_call_id_matches_prior_request_index: 0
          response_json_matches:
            status: "success"
            message: "Image described successfully"
            description: "This is a detailed description of the image provided by the vision model."
            image_filename: "test_image.png"
            image_version: 0

expected_gateway_output:
  - type: "final_response"
    kind: task
    id: '*'
    contextId: session_describe_image_happy_path
    status:
      state: "completed"
      message:
        kind: message
        messageId: '*'
        role: agent
        parts:
          - type: "text"
            text_contains:
              - "This is a detailed description"
