Skip to content

Commit 3440135

Browse files
sunbryeCopilot
andcommitted
Change model from gpt-4.1 to auto in getting-started examples
gpt-4.1 is deprecated. Update all code examples to use 'auto' for automatic model selection. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent ef2bb93 commit 3440135

1 file changed

Lines changed: 20 additions & 20 deletions

File tree

docs/getting-started.md

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ Create `index.ts`:
150150
import { CopilotClient } from "@github/copilot-sdk";
151151

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

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

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

@@ -223,7 +223,7 @@ func main() {
223223
}
224224
defer client.Stop()
225225

226-
session, err := client.CreateSession(ctx, &copilot.SessionConfig{Model: "gpt-4.1"})
226+
session, err := client.CreateSession(ctx, &copilot.SessionConfig{Model: "auto"})
227227
if err != nil {
228228
log.Fatal(err)
229229
}
@@ -304,7 +304,7 @@ using GitHub.Copilot;
304304
await using var client = new CopilotClient();
305305
await using var session = await client.CreateSessionAsync(new SessionConfig
306306
{
307-
Model = "gpt-4.1",
307+
Model = "auto",
308308
OnPermissionRequest = PermissionHandler.ApproveAll
309309
});
310310

@@ -337,7 +337,7 @@ public class HelloCopilot {
337337

338338
var session = client.createSession(
339339
new SessionConfig()
340-
.setModel("gpt-4.1")
340+
.setModel("auto")
341341
.setOnPermissionRequest(PermissionHandler.APPROVE_ALL)
342342
).get();
343343

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

384384
const client = new CopilotClient();
385385
const session = await client.createSession({
386-
model: "gpt-4.1",
386+
model: "auto",
387387
streaming: true,
388388
});
389389

@@ -419,7 +419,7 @@ async def main():
419419
client = CopilotClient()
420420
await client.start()
421421

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

424424
# Listen for response chunks
425425
def handle_event(event):
@@ -466,7 +466,7 @@ func main() {
466466
defer client.Stop()
467467

468468
session, err := client.CreateSession(ctx, &copilot.SessionConfig{
469-
Model: "gpt-4.1",
469+
Model: "auto",
470470
Streaming: copilot.Bool(true),
471471
})
472472
if err != nil {
@@ -562,7 +562,7 @@ using GitHub.Copilot;
562562
await using var client = new CopilotClient();
563563
await using var session = await client.CreateSessionAsync(new SessionConfig
564564
{
565-
Model = "gpt-4.1",
565+
Model = "auto",
566566
OnPermissionRequest = PermissionHandler.ApproveAll,
567567
Streaming = true,
568568
});
@@ -602,7 +602,7 @@ public class HelloCopilot {
602602

603603
var session = client.createSession(
604604
new SessionConfig()
605-
.setModel("gpt-4.1")
605+
.setModel("auto")
606606
.setStreaming(true)
607607
.setOnPermissionRequest(PermissionHandler.APPROVE_ALL)
608608
).get();
@@ -912,7 +912,7 @@ const getWeather = defineTool("get_weather", {
912912

913913
const client = new CopilotClient();
914914
const session = await client.createSession({
915-
model: "gpt-4.1",
915+
model: "auto",
916916
streaming: true,
917917
tools: [getWeather],
918918
});
@@ -968,7 +968,7 @@ async def main():
968968
client = CopilotClient()
969969
await client.start()
970970

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

973973
def handle_event(event):
974974
if event.type == SessionEventType.ASSISTANT_MESSAGE_DELTA:
@@ -1045,7 +1045,7 @@ func main() {
10451045
defer client.Stop()
10461046

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

11861186
await using var session = await client.CreateSessionAsync(new SessionConfig
11871187
{
1188-
Model = "gpt-4.1",
1188+
Model = "auto",
11891189
OnPermissionRequest = PermissionHandler.ApproveAll,
11901190
Streaming = true,
11911191
Tools = [getWeather],
@@ -1259,7 +1259,7 @@ public class HelloCopilot {
12591259

12601260
var session = client.createSession(
12611261
new SessionConfig()
1262-
.setModel("gpt-4.1")
1262+
.setModel("auto")
12631263
.setStreaming(true)
12641264
.setTools(List.of(getWeather))
12651265
.setOnPermissionRequest(PermissionHandler.APPROVE_ALL)
@@ -1316,7 +1316,7 @@ const getWeather = defineTool("get_weather", {
13161316

13171317
const client = new CopilotClient();
13181318
const session = await client.createSession({
1319-
model: "gpt-4.1",
1319+
model: "auto",
13201320
streaming: true,
13211321
tools: [getWeather],
13221322
});
@@ -1389,7 +1389,7 @@ async def main():
13891389
client = CopilotClient()
13901390
await client.start()
13911391

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

13941394
def handle_event(event):
13951395
if event.type == SessionEventType.ASSISTANT_MESSAGE_DELTA:
@@ -1482,7 +1482,7 @@ func main() {
14821482
defer client.Stop()
14831483

14841484
session, err := client.CreateSession(ctx, &copilot.SessionConfig{
1485-
Model: "gpt-4.1",
1485+
Model: "auto",
14861486
Streaming: copilot.Bool(true),
14871487
Tools: []copilot.Tool{getWeather},
14881488
})
@@ -1671,7 +1671,7 @@ var getWeather = CopilotTool.DefineTool(
16711671
await using var client = new CopilotClient();
16721672
await using var session = await client.CreateSessionAsync(new SessionConfig
16731673
{
1674-
Model = "gpt-4.1",
1674+
Model = "auto",
16751675
OnPermissionRequest = PermissionHandler.ApproveAll,
16761676
Streaming = true,
16771677
Tools = [getWeather]
@@ -1765,7 +1765,7 @@ public class WeatherAssistant {
17651765

17661766
var session = client.createSession(
17671767
new SessionConfig()
1768-
.setModel("gpt-4.1")
1768+
.setModel("auto")
17691769
.setStreaming(true)
17701770
.setOnPermissionRequest(request ->
17711771
CompletableFuture.completedFuture(PermissionDecision.allow())

0 commit comments

Comments
 (0)