Skip to content
Open
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 @@ -17,9 +17,14 @@
name: "VisionAgent",
instructions: "You are a helpful agent that can analyze images");


Copy link

Copilot AI Dec 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's an extra blank line here that should be removed to maintain consistency with the coding style in other samples.

Suggested change

Copilot uses AI. Check for mistakes.
using HttpClient httpClient = new();
httpClient.DefaultRequestHeaders.UserAgent.ParseAdd("Mozilla/5.0 (Windows NT 10.0; Win64; x64)");
Copy link

Copilot AI Dec 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The User-Agent header is added to work around the 403 Forbidden error, but there's no comment explaining why this is necessary. According to the coding guidelines, sample code should be well-documented with comments explaining the purpose of each step. Consider adding a comment above line 22 explaining that some image hosting services (like Wikipedia) require a User-Agent header to prevent automated scraping.

Copilot generated this review using guidance from repository custom instructions.
byte[] imageBytes = await httpClient.GetByteArrayAsync("https://upload.wikimedia.org/wikipedia/commons/thumb/d/dd/Gfp-wisconsin-madison-the-nature-boardwalk.jpg/2560px-Gfp-wisconsin-madison-the-nature-boardwalk.jpg");

ChatMessage message = new(ChatRole.User, [
new TextContent("What do you see in this image?"),
new UriContent("https://upload.wikimedia.org/wikipedia/commons/thumb/d/dd/Gfp-wisconsin-madison-the-nature-boardwalk.jpg/2560px-Gfp-wisconsin-madison-the-nature-boardwalk.jpg", "image/jpeg")
new DataContent(imageBytes, "image/jpeg")
]);

var thread = agent.GetNewThread();
Expand Down
Loading