Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,7 @@ private ResponseCreationOptions ToOpenAIResponseCreationOptions(ChatOptions? opt
}
else
{
json = """{"type":"code_interpreter","container":"auto"}""";
json = """{"type":"code_interpreter","container":{"type":"auto"}}""";
}

result.Tools.Add(ModelReaderWriter.Read<ResponseTool>(BinaryData.FromString(json)));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,22 @@ public class OpenAIResponseClientIntegrationTests : ChatClientIntegrationTests
// Test structure doesn't make sense with Responses.
public override Task Caching_AfterFunctionInvocation_FunctionOutputUnchangedAsync() => Task.CompletedTask;

[ConditionalFact]
public async Task UseCodeInterpreter_ProducesCodeExecutionResults()
{
SkipIfNotEnabled();

var response = await ChatClient.GetResponseAsync("Use the code interpreter to calculate the square root of 42. Return only the nearest integer value and no other text.", new()
{
Tools = [new HostedCodeInterpreterTool()],
});
Assert.NotNull(response);

ChatMessage message = Assert.Single(response.Messages);

Assert.Equal("6", message.Text);
}

[ConditionalFact]
public async Task UseWebSearch_AnnotationsReflectResults()
{
Expand Down
Loading