Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
# make sure to use a service that supports image input from a URI.
chat_completion_service, request_settings = get_chat_completion_service_and_request_settings(Services.AZURE_OPENAI)

IMAGE_URI = "https://upload.wikimedia.org/wikipedia/commons/d/d5/Half-timbered_mansion%2C_Zirkel%2C_East_view.jpg"
IMAGE_URI = "https://raw.githubusercontent.com/microsoft/semantic-kernel/main/python/tests/assets/sample_image.jpg"
IMAGE_PATH = "samples/concepts/resources/sample_image.jpg"

# Create an image content with the image URI.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ async def test_image_content_stream(
):
"""Test function calling streaming."""
IMAGE_URI = (
"https://upload.wikimedia.org/wikipedia/commons/d/d5/Half-timbered_mansion%2C_Zirkel%2C_East_view.jpg"
"https://raw.githubusercontent.com/microsoft/semantic-kernel/main/python/tests/assets/sample_image.jpg"
)
image_content_remote = ImageContent(uri=IMAGE_URI)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@
from tests.integration.completions.completion_test_base import ServiceType
from tests.utils import retry

# Use the repo's own sample image via raw GitHub URL for URI-based tests.
# Previously this pointed to a 17.5 MB Wikimedia image that got blocked by
# Wikimedia's User-Agent policy (Phabricator T400119), causing Azure's
# server-side image fetcher to fail with HTTP 403.
IMAGE_TEST_URL = "https://raw.githubusercontent.com/microsoft/semantic-kernel/main/python/tests/assets/sample_image.jpg"

pytestmark = pytest.mark.parametrize(
"service_id, execution_settings_kwargs, inputs, kwargs",
[
Expand All @@ -37,15 +43,12 @@
role=AuthorRole.USER,
items=[
TextContent(text="What is in this image?"),
ImageContent(
uri="https://upload.wikimedia.org/wikipedia/commons/d/d5/Half-timbered_mansion%2C_Zirkel%2C_East_view.jpg"
),
ImageContent(uri=IMAGE_TEST_URL),
],
),
ChatMessageContent(role=AuthorRole.USER, items=[TextContent(text="Where was it made?")]),
],
{},
marks=pytest.mark.xfail(reason="OpenAI service raise error for downloading image from URL"),
id="openai_image_input_uri",
),
pytest.param(
Expand Down Expand Up @@ -74,9 +77,7 @@
role=AuthorRole.USER,
items=[
TextContent(text="What is in this image?"),
ImageContent(
uri="https://upload.wikimedia.org/wikipedia/commons/d/d5/Half-timbered_mansion%2C_Zirkel%2C_East_view.jpg"
),
ImageContent(uri=IMAGE_TEST_URL),
],
),
ChatMessageContent(role=AuthorRole.USER, items=[TextContent(text="Where was it made?")]),
Expand Down Expand Up @@ -134,9 +135,7 @@
role=AuthorRole.USER,
items=[
TextContent(text="What is in this image?"),
ImageContent(
uri="https://upload.wikimedia.org/wikipedia/commons/d/d5/Half-timbered_mansion%2C_Zirkel%2C_East_view.jpg"
),
ImageContent(uri=IMAGE_TEST_URL),
],
),
ChatMessageContent(role=AuthorRole.USER, items=[TextContent(text="Where was it made?")]),
Expand Down
Loading