Skip to content

Commit 12414b8

Browse files
committed
Use container file citation filename in sample
1 parent 7f01dc9 commit 12414b8

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

examples/Responses/Example10_CodeInterpreter.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public void Example10_CodeInterpreter()
2828

2929
List<ResponseItem> inputItems =
3030
[
31-
ResponseItem.CreateUserMessageItem("Create an Excel spreadsheet that contains the mathematical times tables from 1-12."),
31+
ResponseItem.CreateUserMessageItem("Create an Excel spreadsheet that contains the mathematical times tables from 1-12 and make it available for download."),
3232
];
3333

3434
OpenAIResponse response = client.CreateResponse(inputItems, options);
@@ -48,7 +48,7 @@ public void Example10_CodeInterpreter()
4848
// Download the file from the container and save it.
4949
ContainerClient containerClient = new(apiKey: Environment.GetEnvironmentVariable("OPENAI_API_KEY"));
5050
BinaryData fileBytes = containerClient.DownloadContainerFile(containerFileCitation.ContainerId, containerFileCitation.FileId);
51-
using FileStream stream = File.OpenWrite($"{Guid.NewGuid()}.xlsx");
51+
using FileStream stream = File.OpenWrite(containerFileCitation.Filename);
5252
fileBytes.ToStream().CopyTo(stream);
5353
}
5454
}

examples/Responses/Example10_CodeInterpreterAsync.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public async Task Example10_CodeInterpreterAsync()
2929

3030
List<ResponseItem> inputItems =
3131
[
32-
ResponseItem.CreateUserMessageItem("Create an Excel spreadsheet that contains the mathematical times tables from 1-12."),
32+
ResponseItem.CreateUserMessageItem("Create an Excel spreadsheet that contains the mathematical times tables from 1-12 and make it available for download."),
3333
];
3434

3535
OpenAIResponse response = await client.CreateResponseAsync(inputItems, options);
@@ -49,7 +49,7 @@ public async Task Example10_CodeInterpreterAsync()
4949
// Download the file from the container and save it.
5050
ContainerClient containerClient = new(apiKey: Environment.GetEnvironmentVariable("OPENAI_API_KEY"));
5151
BinaryData fileBytes = await containerClient.DownloadContainerFileAsync(containerFileCitation.ContainerId, containerFileCitation.FileId);
52-
using FileStream stream = File.OpenWrite($"{Guid.NewGuid()}.xlsx");
52+
using FileStream stream = File.OpenWrite(containerFileCitation.Filename);
5353
fileBytes.ToStream().CopyTo(stream);
5454
}
5555
}

0 commit comments

Comments
 (0)