Skip to content

Commit dc95429

Browse files
committed
docs: fix non-compiling attachment examples in the .NET README
The three attachment examples in dotnet/README.md referenced a type family that no longer exists in the SDK: UserMessageDataAttachmentsItem, UserMessageDataAttachmentsItemFile, UserMessageDataAttachmentsItemBlob and the enum UserMessageDataAttachmentsItemType. Copying any of them produced CS0246/CS0103, and because this README is packed as the package README it is also what renders on the GitHub.Copilot.SDK NuGet page. Update the examples to the shipped public API - List<Attachment> holding AttachmentFile and AttachmentBlob - matching the C# blocks in docs/features/image-input.md that documentation validation compiles. The explicit discriminator assignment in the file attachment example is dropped because the concrete subclass supplies it.
1 parent b88e8c8 commit dc95429

1 file changed

Lines changed: 6 additions & 7 deletions

File tree

dotnet/README.md

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -296,9 +296,9 @@ The SDK supports image attachments via the `Attachments` parameter. You can atta
296296
await session.SendAsync(new MessageOptions
297297
{
298298
Prompt = "What's in this image?",
299-
Attachments = new List<UserMessageDataAttachmentsItem>
299+
Attachments = new List<Attachment>
300300
{
301-
new UserMessageDataAttachmentsItemFile
301+
new AttachmentFile
302302
{
303303
Path = "/path/to/image.jpg",
304304
DisplayName = "image.jpg",
@@ -310,9 +310,9 @@ await session.SendAsync(new MessageOptions
310310
await session.SendAsync(new MessageOptions
311311
{
312312
Prompt = "What's in this image?",
313-
Attachments = new List<UserMessageDataAttachmentsItem>
313+
Attachments = new List<Attachment>
314314
{
315-
new UserMessageDataAttachmentsItemBlob
315+
new AttachmentBlob
316316
{
317317
Data = base64ImageData,
318318
MimeType = "image/png",
@@ -721,11 +721,10 @@ await session2.SendAsync(new MessageOptions { Prompt = "Hello from session 2" })
721721
await session.SendAsync(new MessageOptions
722722
{
723723
Prompt = "Analyze this file",
724-
Attachments = new List<UserMessageDataAttachmentsItem>
724+
Attachments = new List<Attachment>
725725
{
726-
new UserMessageDataAttachmentsItem
726+
new AttachmentFile
727727
{
728-
Type = UserMessageDataAttachmentsItemType.File,
729728
Path = "/path/to/file.cs",
730729
DisplayName = "My File"
731730
}

0 commit comments

Comments
 (0)