diff --git a/dotnet/README.md b/dotnet/README.md index a3d4076b..5ac20b21 100644 --- a/dotnet/README.md +++ b/dotnet/README.md @@ -200,6 +200,31 @@ session.On(evt => }); ``` +## Image Support + +The SDK supports image attachments via the `Attachments` parameter. You can attach images by providing their file path: + +```csharp +await session.SendAsync(new MessageOptions +{ + Prompt = "What's in this image?", + Attachments = new List + { + new UserMessageDataAttachmentsItem + { + Type = UserMessageDataAttachmentsItemType.File, + Path = "/path/to/image.jpg" + } + } +}); +``` + +Supported image formats include JPG, PNG, GIF, and other common image types. The agent's `view` tool can also read images directly from the filesystem, so you can also ask questions like: + +```csharp +await session.SendAsync(new MessageOptions { Prompt = "What does the most recent jpg in this directory portray?" }); +``` + ## Streaming Enable streaming to receive assistant response chunks as they're generated: diff --git a/go/README.md b/go/README.md index 1a1c0f87..b57fc3c9 100644 --- a/go/README.md +++ b/go/README.md @@ -112,6 +112,30 @@ func main() { - `Bool(v bool) *bool` - Helper to create bool pointers for `AutoStart`/`AutoRestart` options +## Image Support + +The SDK supports image attachments via the `Attachments` field in `MessageOptions`. You can attach images by providing their file path: + +```go +_, err = session.Send(copilot.MessageOptions{ + Prompt: "What's in this image?", + Attachments: []copilot.Attachment{ + { + Type: "file", + Path: "/path/to/image.jpg", + }, + }, +}) +``` + +Supported image formats include JPG, PNG, GIF, and other common image types. The agent's `view` tool can also read images directly from the filesystem, so you can also ask questions like: + +```go +_, err = session.Send(copilot.MessageOptions{ + Prompt: "What does the most recent jpg in this directory portray?", +}) +``` + ### Tools Expose your own functionality to Copilot by attaching tools to a session. diff --git a/nodejs/README.md b/nodejs/README.md index dea3b3ea..97d51304 100644 --- a/nodejs/README.md +++ b/nodejs/README.md @@ -183,6 +183,28 @@ Sessions emit various events during processing: See `SessionEvent` type in the source for full details. +## Image Support + +The SDK supports image attachments via the `attachments` parameter. You can attach images by providing their file path: + +```typescript +await session.send({ + prompt: "What's in this image?", + attachments: [ + { + type: "file", + path: "/path/to/image.jpg", + }, + ], +}); +``` + +Supported image formats include JPG, PNG, GIF, and other common image types. The agent's `view` tool can also read images directly from the filesystem, so you can also ask questions like: + +```typescript +await session.send({ prompt: "What does the most recent jpg in this directory portray?" }); +``` + ## Streaming Enable streaming to receive assistant response chunks as they're generated: diff --git a/python/README.md b/python/README.md index 3fc1300d..a12ff423 100644 --- a/python/README.md +++ b/python/README.md @@ -155,6 +155,28 @@ session = await client.create_session({ The SDK automatically handles `tool.call`, executes your handler (sync or async), and responds with the final result when the tool completes. +## Image Support + +The SDK supports image attachments via the `attachments` parameter. You can attach images by providing their file path: + +```python +await session.send({ + "prompt": "What's in this image?", + "attachments": [ + { + "type": "file", + "path": "/path/to/image.jpg", + } + ] +}) +``` + +Supported image formats include JPG, PNG, GIF, and other common image types. The agent's `view` tool can also read images directly from the filesystem, so you can also ask questions like: + +```python +await session.send({"prompt": "What does the most recent jpg in this directory portray?"}) +``` + ## Streaming Enable streaming to receive assistant response chunks as they're generated: