File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -21,15 +21,14 @@ public void Example10_CodeInterpreter()
2121
2222 CodeInterpreterToolContainer container = new ( CodeInterpreterToolContainerConfiguration . CreateAutomaticContainerConfiguration ( ) ) ;
2323 CodeInterpreterTool codeInterpreterTool = new ( container ) ;
24-
2524 ResponseCreationOptions options = new ( )
2625 {
2726 Tools = { codeInterpreterTool }
2827 } ;
2928
3029 List < ResponseItem > inputItems =
3130 [
32- ResponseItem . CreateUserMessageItem ( "Create a 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." ) ,
3332 ] ;
3433
3534 OpenAIResponse response = client . CreateResponse ( inputItems , options ) ;
@@ -46,6 +45,7 @@ public void Example10_CodeInterpreter()
4645 . OfType < ContainerFileCitationMessageAnnotation > ( )
4746 . FirstOrDefault ( ) ;
4847
48+ // 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 ) ;
5151 using FileStream stream = File . OpenWrite ( $ "{ Guid . NewGuid ( ) } .xlsx") ;
Original file line number Diff line number Diff line change @@ -22,15 +22,14 @@ public async Task Example10_CodeInterpreterAsync()
2222
2323 CodeInterpreterToolContainer container = new ( CodeInterpreterToolContainerConfiguration . CreateAutomaticContainerConfiguration ( ) ) ;
2424 CodeInterpreterTool codeInterpreterTool = new ( container ) ;
25-
2625 ResponseCreationOptions options = new ( )
2726 {
2827 Tools = { codeInterpreterTool }
2928 } ;
3029
3130 List < ResponseItem > inputItems =
3231 [
33- ResponseItem . CreateUserMessageItem ( "Create a 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." ) ,
3433 ] ;
3534
3635 OpenAIResponse response = await client . CreateResponseAsync ( inputItems , options ) ;
@@ -47,6 +46,7 @@ public async Task Example10_CodeInterpreterAsync()
4746 . OfType < ContainerFileCitationMessageAnnotation > ( )
4847 . FirstOrDefault ( ) ;
4948
49+ // 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 ) ;
5252 using FileStream stream = File . OpenWrite ( $ "{ Guid . NewGuid ( ) } .xlsx") ;
You can’t perform that action at this time.
0 commit comments