Skip to content
Closed
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
3 changes: 2 additions & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
"ghcr.io/devcontainers/features/go:1": {},
"ghcr.io/devcontainers/features/node:1": {},
"ghcr.io/devcontainers-extra/features/uv:1": {},
"ghcr.io/schlich/devcontainer-features/just:0": {}
"ghcr.io/schlich/devcontainer-features/just:0": {},
"ghcr.io/devcontainers/features/dotnet:2": {}
}

// Features to add to the dev container. More info: https://containers.dev/features.
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/issue-triage.lock.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions .github/workflows/sdk-consistency-review.lock.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 13 additions & 4 deletions docs/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -458,11 +458,16 @@ import sys
from copilot import CopilotClient
from copilot.tools import define_tool
from copilot.generated.session_events import SessionEventType
from pydantic import BaseModel, Field

# Define the parameters for the tool using Pydantic
class GetWeatherParams(BaseModel):
city: str = Field(description="The name of the city to get weather for")

# Define a tool that Copilot can call
@define_tool(description="Get the current weather for a city")
async def get_weather(params: dict) -> dict:
city = params["city"]
async def get_weather(params: GetWeatherParams) -> dict:
city = params.city
# In a real app, you'd call a weather API here
conditions = ["sunny", "cloudy", "rainy", "partly cloudy"]
temp = random.randint(50, 80)
Expand Down Expand Up @@ -724,10 +729,14 @@ import sys
from copilot import CopilotClient
from copilot.tools import define_tool
from copilot.generated.session_events import SessionEventType
from pydantic import BaseModel, Field

class GetWeatherParams(BaseModel):
city: str = Field(description="The name of the city to get weather for")

@define_tool(description="Get the current weather for a city")
async def get_weather(params: dict) -> dict:
city = params["city"]
async def get_weather(params: GetWeatherParams) -> dict:
city = params.city
conditions = ["sunny", "cloudy", "rainy", "partly cloudy"]
temp = random.randint(50, 80)
condition = random.choice(conditions)
Expand Down
25 changes: 25 additions & 0 deletions dotnet/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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<UserMessageDataAttachmentsItem>
{
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:
Expand Down
24 changes: 24 additions & 0 deletions go/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
22 changes: 22 additions & 0 deletions nodejs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
28 changes: 26 additions & 2 deletions python/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ Python SDK for programmatic control of GitHub Copilot CLI via JSON-RPC.
## Installation

```bash
pip install -e .
pip install -e --group dev .
# or
uv sync
```

## Quick Start
Expand Down Expand Up @@ -155,6 +157,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:
Expand Down Expand Up @@ -217,5 +241,5 @@ Note: `assistant.message` and `assistant.reasoning` (final events) are always se

## Requirements

- Python 3.8+
- Python 3.9+
- GitHub Copilot CLI installed and accessible
2 changes: 2 additions & 0 deletions python/copilot/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
ResumeSessionConfig,
SessionConfig,
SessionEvent,
SessionMetadata,
Tool,
ToolHandler,
ToolInvocation,
Expand Down Expand Up @@ -59,6 +60,7 @@
"ResumeSessionConfig",
"SessionConfig",
"SessionEvent",
"SessionMetadata",
"Tool",
"ToolHandler",
"ToolInvocation",
Expand Down
Loading
Loading