Skip to content

Commit 52df809

Browse files
committed
fb
1 parent c759c61 commit 52df809

38 files changed

+492
-354
lines changed

examples/Responses/Example01_SimpleResponse.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ public partial class ResponseExamples
1313
[Test]
1414
public void Example01_SimpleResponse()
1515
{
16-
ResponseClient client = new(model: "gpt-5", apiKey: Environment.GetEnvironmentVariable("OPENAI_API_KEY"));
16+
ResponsesClient client = new(model: "gpt-5", apiKey: Environment.GetEnvironmentVariable("OPENAI_API_KEY"));
1717

1818
ResponseResult response = client.CreateResponse(new ([ResponseItem.CreateUserMessageItem("Say 'this is a test.'")]));
1919

20-
Console.WriteLine($"[ASSISTANT]: {response.OutputText}");
20+
Console.WriteLine($"[ASSISTANT]: {response.GetOutputText()}");
2121
}
2222
}
2323

examples/Responses/Example01_SimpleResponseAsync.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@ public partial class ResponseExamples
1414
[Test]
1515
public async Task Example01_SimpleResponseAsync()
1616
{
17-
ResponseClient client = new(model: "gpt-5", apiKey: Environment.GetEnvironmentVariable("OPENAI_API_KEY"));
17+
ResponsesClient client = new(model: "gpt-5", apiKey: Environment.GetEnvironmentVariable("OPENAI_API_KEY"));
1818

1919
ResponseResult response = await client.CreateResponseAsync(new ([ResponseItem.CreateUserMessageItem("Say 'this is a test.'")]));
2020

21-
Console.WriteLine($"[ASSISTANT]: {response.OutputText}");
21+
Console.WriteLine($"[ASSISTANT]: {response.GetOutputText()}");
2222
}
2323
}
2424

examples/Responses/Example02_SimpleResponseStreaming.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ public partial class ResponseExamples
1414
[Test]
1515
public void Example02_SimpleResponseStreaming()
1616
{
17-
ResponseClient client = new(model: "gpt-5", apiKey: Environment.GetEnvironmentVariable("OPENAI_API_KEY"));
17+
ResponsesClient client = new(model: "gpt-5", apiKey: Environment.GetEnvironmentVariable("OPENAI_API_KEY"));
1818

1919
CollectionResult<StreamingResponseUpdate> responseUpdates = client.CreateResponseStreaming(new ([ResponseItem.CreateUserMessageItem("Say 'this is a test.'")]));
2020

examples/Responses/Example02_SimpleResponseStreamingAsync.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ public partial class ResponseExamples
1616
[Test]
1717
public async Task Example02_SimpleResponseStreamingAsync()
1818
{
19-
ResponseClient client = new(model: "gpt-5", apiKey: Environment.GetEnvironmentVariable("OPENAI_API_KEY"));
19+
ResponsesClient client = new(model: "gpt-5", apiKey: Environment.GetEnvironmentVariable("OPENAI_API_KEY"));
2020

2121
AsyncCollectionResult<StreamingResponseUpdate> responseUpdates = client.CreateResponseStreamingAsync(new ([ResponseItem.CreateUserMessageItem("Say 'this is a test.'")]));
2222

examples/Responses/Example03_FunctionCalling.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ private static string GetCurrentWeather(string location, string unit = "celsius"
6262
[Test]
6363
public void Example03_FunctionCalling()
6464
{
65-
ResponseClient client = new("gpt-5", Environment.GetEnvironmentVariable("OPENAI_API_KEY"));
65+
ResponsesClient client = new("gpt-5", Environment.GetEnvironmentVariable("OPENAI_API_KEY"));
6666

6767
List<ResponseItem> inputItems =
6868
[
@@ -83,9 +83,9 @@ public void Example03_FunctionCalling()
8383
requiresAction = false;
8484
ResponseResult response = client.CreateResponse(options);
8585

86-
inputItems.AddRange(response.Output);
86+
inputItems.AddRange(response.OutputItems);
8787

88-
foreach (ResponseItem outputItem in response.Output)
88+
foreach (ResponseItem outputItem in response.OutputItems)
8989
{
9090
if (outputItem is FunctionCallResponseItem functionCall)
9191
{
@@ -132,7 +132,7 @@ public void Example03_FunctionCalling()
132132
}
133133
}
134134

135-
PrintMessageItems(response.Output.OfType<MessageResponseItem>());
135+
PrintMessageItems(response.OutputItems.OfType<MessageResponseItem>());
136136

137137
} while (requiresAction);
138138
}

examples/Responses/Example03_FunctionCallingAsync.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public partial class ResponseExamples
1919
[Test]
2020
public async Task Example03_FunctionCallingAsync()
2121
{
22-
ResponseClient client = new("gpt-5", Environment.GetEnvironmentVariable("OPENAI_API_KEY"));
22+
ResponsesClient client = new("gpt-5", Environment.GetEnvironmentVariable("OPENAI_API_KEY"));
2323

2424
List<ResponseItem> inputItems =
2525
[
@@ -40,9 +40,9 @@ public async Task Example03_FunctionCallingAsync()
4040
requiresAction = false;
4141
ResponseResult response = await client.CreateResponseAsync(options);
4242

43-
inputItems.AddRange(response.Output);
43+
inputItems.AddRange(response.OutputItems);
4444

45-
foreach (ResponseItem outputItem in response.Output)
45+
foreach (ResponseItem outputItem in response.OutputItems)
4646
{
4747
if (outputItem is FunctionCallResponseItem functionCall)
4848
{
@@ -89,7 +89,7 @@ public async Task Example03_FunctionCallingAsync()
8989
}
9090
}
9191

92-
PrintMessageItems(response.Output.OfType<MessageResponseItem>());
92+
PrintMessageItems(response.OutputItems.OfType<MessageResponseItem>());
9393

9494
} while (requiresAction);
9595
}

examples/Responses/Example04_FunctionCallingStreaming.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public partial class ResponseExamples
1919
[Test]
2020
public void Example04_FunctionCallingStreaming()
2121
{
22-
ResponseClient client = new("gpt-5", Environment.GetEnvironmentVariable("OPENAI_API_KEY"));
22+
ResponsesClient client = new("gpt-5", Environment.GetEnvironmentVariable("OPENAI_API_KEY"));
2323

2424
List<ResponseItem> inputItems =
2525
[

examples/Responses/Example04_FunctionCallingStreamingAsync.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public partial class ResponseExamples
2020
[Test]
2121
public async Task Example04_FunctionCallingStreamingAsync()
2222
{
23-
ResponseClient client = new("gpt-5", Environment.GetEnvironmentVariable("OPENAI_API_KEY"));
23+
ResponsesClient client = new("gpt-5", Environment.GetEnvironmentVariable("OPENAI_API_KEY"));
2424

2525
List<ResponseItem> inputItems =
2626
[

examples/Responses/Example05_RemoteMcp.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,11 @@ public void Example05_RemoteMcp()
2626
}
2727
};
2828

29-
ResponseClient client = new(model: "gpt-5", apiKey: Environment.GetEnvironmentVariable("OPENAI_API_KEY"));
29+
ResponsesClient client = new(model: "gpt-5", apiKey: Environment.GetEnvironmentVariable("OPENAI_API_KEY"));
3030

3131
ResponseResult response = client.CreateResponse(options);
3232

33-
Console.WriteLine($"[ASSISTANT]: {response.OutputText}");
33+
Console.WriteLine($"[ASSISTANT]: {response.GetOutputText()}");
3434
}
3535
}
3636

examples/Responses/Example05_RemoteMcpAsync.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,11 @@ public async Task Example05_RemoteMcpAsync()
2727
}
2828
};
2929

30-
ResponseClient client = new(model: "gpt-5", apiKey: Environment.GetEnvironmentVariable("OPENAI_API_KEY"));
30+
ResponsesClient client = new(model: "gpt-5", apiKey: Environment.GetEnvironmentVariable("OPENAI_API_KEY"));
3131

3232
ResponseResult response = await client.CreateResponseAsync(options);
3333

34-
Console.WriteLine($"[ASSISTANT]: {response.OutputText}");
34+
Console.WriteLine($"[ASSISTANT]: {response.GetOutputText()}");
3535
}
3636
}
3737

0 commit comments

Comments
 (0)