test_case_id: "create_image_happy_path_001"
description: "Verifies the basic happy path of creating an image with a specified filename."
tags: ["all", "agent", "tools", "image_tools"]
skip_intermediate_events: true

gateway_input:
  target_agent_name: "TestAgent"
  user_identity: "happy_path_tester@example.com"
  a2a_parts: [{type: "text", text: "Create an image of a blue bird."}]
  external_context:
    a2a_session_id: "fixed_session_for_create_image_happy_path_001"
llm_interactions:
  # 1. First LLM call returns the tool call
  - static_response:
      choices:
        - message:
            role: "assistant"
            tool_calls:
              - id: "tool_call_create_image_happy_1"
                type: "function"
                function:
                  name: "create_image_from_description"
                  arguments: '{"image_description": "A blue bird.", "output_filename": "blue_bird.png"}'
          finish_reason: "tool_calls"
  # 2. Second LLM call after the tool succeeds
  - static_response:
      choices:
        - message:
            role: "assistant"
            content: "I have created the image `blue_bird.png` for you."
primed_image_generation_responses:
  - response: '{"created": 1677652288, "data": [{"b64_json": "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII="}]}'
    status_code: 200
expected_gateway_output:
  - type: "final_response"
    kind: task
    id: '*'
    contextId: "fixed_session_for_create_image_happy_path_001"
    status:
      state: completed
      message:
        kind: message
        messageId: '*'
        role: agent
        parts:
          - type: "text"
            text_contains:
              - "I have created the image `blue_bird.png`"
    assert_artifact_state:
      - session_id: "fixed_session_for_create_image_happy_path_001"
        user_id: "happy_path_tester@example.com"
        filename: "blue_bird.png"
        version: 0
        expected_content_base64: "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII="
        expected_metadata_contains:
          description: "Image generated from prompt: A blue bird."
          source_prompt: "A blue bird."
          generation_tool: "direct_api"
