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
40 changes: 20 additions & 20 deletions docs/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ Create `index.ts`:
import { CopilotClient } from "@github/copilot-sdk";

const client = new CopilotClient();
const session = await client.createSession({ model: "gpt-4.1" });
const session = await client.createSession({ model: "auto" });

const response = await session.sendAndWait({ prompt: "What is 2 + 2?" });
console.log(response?.data.content);
Expand Down Expand Up @@ -181,7 +181,7 @@ async def main():
client = CopilotClient()
await client.start()

session = await client.create_session(on_permission_request=PermissionHandler.approve_all, model="gpt-4.1")
session = await client.create_session(on_permission_request=PermissionHandler.approve_all, model="auto")
response = await session.send_and_wait("What is 2 + 2?")
print(response.data.content)

Expand Down Expand Up @@ -223,7 +223,7 @@ func main() {
}
defer client.Stop()

session, err := client.CreateSession(ctx, &copilot.SessionConfig{Model: "gpt-4.1"})
session, err := client.CreateSession(ctx, &copilot.SessionConfig{Model: "auto"})
if err != nil {
log.Fatal(err)
}
Expand Down Expand Up @@ -304,7 +304,7 @@ using GitHub.Copilot;
await using var client = new CopilotClient();
await using var session = await client.CreateSessionAsync(new SessionConfig
{
Model = "gpt-4.1",
Model = "auto",
OnPermissionRequest = PermissionHandler.ApproveAll
});

Expand Down Expand Up @@ -337,7 +337,7 @@ public class HelloCopilot {

var session = client.createSession(
new SessionConfig()
.setModel("gpt-4.1")
.setModel("auto")
.setOnPermissionRequest(PermissionHandler.APPROVE_ALL)
).get();

Expand Down Expand Up @@ -383,7 +383,7 @@ import { CopilotClient } from "@github/copilot-sdk";

const client = new CopilotClient();
const session = await client.createSession({
model: "gpt-4.1",
model: "auto",
streaming: true,
});

Expand Down Expand Up @@ -419,7 +419,7 @@ async def main():
client = CopilotClient()
await client.start()

session = await client.create_session(on_permission_request=PermissionHandler.approve_all, model="gpt-4.1", streaming=True)
session = await client.create_session(on_permission_request=PermissionHandler.approve_all, model="auto", streaming=True)

# Listen for response chunks
def handle_event(event):
Expand Down Expand Up @@ -466,7 +466,7 @@ func main() {
defer client.Stop()

session, err := client.CreateSession(ctx, &copilot.SessionConfig{
Model: "gpt-4.1",
Model: "auto",
Streaming: copilot.Bool(true),
})
if err != nil {
Expand Down Expand Up @@ -562,7 +562,7 @@ using GitHub.Copilot;
await using var client = new CopilotClient();
await using var session = await client.CreateSessionAsync(new SessionConfig
{
Model = "gpt-4.1",
Model = "auto",
OnPermissionRequest = PermissionHandler.ApproveAll,
Streaming = true,
});
Expand Down Expand Up @@ -602,7 +602,7 @@ public class HelloCopilot {

var session = client.createSession(
new SessionConfig()
.setModel("gpt-4.1")
.setModel("auto")
.setStreaming(true)
.setOnPermissionRequest(PermissionHandler.APPROVE_ALL)
).get();
Expand Down Expand Up @@ -912,7 +912,7 @@ const getWeather = defineTool("get_weather", {

const client = new CopilotClient();
const session = await client.createSession({
model: "gpt-4.1",
model: "auto",
streaming: true,
tools: [getWeather],
});
Expand Down Expand Up @@ -968,7 +968,7 @@ async def main():
client = CopilotClient()
await client.start()

session = await client.create_session(on_permission_request=PermissionHandler.approve_all, model="gpt-4.1", streaming=True, tools=[get_weather])
session = await client.create_session(on_permission_request=PermissionHandler.approve_all, model="auto", streaming=True, tools=[get_weather])

def handle_event(event):
if event.type == SessionEventType.ASSISTANT_MESSAGE_DELTA:
Expand Down Expand Up @@ -1045,7 +1045,7 @@ func main() {
defer client.Stop()

session, err := client.CreateSession(ctx, &copilot.SessionConfig{
Model: "gpt-4.1",
Model: "auto",
Streaming: copilot.Bool(true),
Tools: []copilot.Tool{getWeather},
})
Expand Down Expand Up @@ -1185,7 +1185,7 @@ var getWeather = CopilotTool.DefineTool(

await using var session = await client.CreateSessionAsync(new SessionConfig
{
Model = "gpt-4.1",
Model = "auto",
OnPermissionRequest = PermissionHandler.ApproveAll,
Streaming = true,
Tools = [getWeather],
Expand Down Expand Up @@ -1259,7 +1259,7 @@ public class HelloCopilot {

var session = client.createSession(
new SessionConfig()
.setModel("gpt-4.1")
.setModel("auto")
.setStreaming(true)
.setTools(List.of(getWeather))
.setOnPermissionRequest(PermissionHandler.APPROVE_ALL)
Expand Down Expand Up @@ -1316,7 +1316,7 @@ const getWeather = defineTool("get_weather", {

const client = new CopilotClient();
const session = await client.createSession({
model: "gpt-4.1",
model: "auto",
streaming: true,
tools: [getWeather],
});
Expand Down Expand Up @@ -1389,7 +1389,7 @@ async def main():
client = CopilotClient()
await client.start()

session = await client.create_session(on_permission_request=PermissionHandler.approve_all, model="gpt-4.1", streaming=True, tools=[get_weather])
session = await client.create_session(on_permission_request=PermissionHandler.approve_all, model="auto", streaming=True, tools=[get_weather])

def handle_event(event):
if event.type == SessionEventType.ASSISTANT_MESSAGE_DELTA:
Expand Down Expand Up @@ -1482,7 +1482,7 @@ func main() {
defer client.Stop()

session, err := client.CreateSession(ctx, &copilot.SessionConfig{
Model: "gpt-4.1",
Model: "auto",
Streaming: copilot.Bool(true),
Tools: []copilot.Tool{getWeather},
})
Expand Down Expand Up @@ -1671,7 +1671,7 @@ var getWeather = CopilotTool.DefineTool(
await using var client = new CopilotClient();
await using var session = await client.CreateSessionAsync(new SessionConfig
{
Model = "gpt-4.1",
Model = "auto",
OnPermissionRequest = PermissionHandler.ApproveAll,
Streaming = true,
Tools = [getWeather]
Expand Down Expand Up @@ -1765,7 +1765,7 @@ public class WeatherAssistant {

var session = client.createSession(
new SessionConfig()
.setModel("gpt-4.1")
.setModel("auto")
.setStreaming(true)
.setOnPermissionRequest(request ->
CompletableFuture.completedFuture(PermissionDecision.allow())
Expand Down
Loading