82 references to ChatResponseUpdate
Microsoft.Extensions.AI (1)
ChatCompletion\FunctionInvokingChatClient.cs (1)
650
new
()
Microsoft.Extensions.AI.Abstractions (3)
ChatCompletion\ChatResponse.cs (2)
130
extra = new
ChatResponseUpdate
148
updates[i] = new
ChatResponseUpdate
ChatCompletion\ChatResponseUpdate.cs (1)
70
new
()
Microsoft.Extensions.AI.Abstractions.Tests (47)
ChatCompletion\ChatResponseUpdateExtensionsTests.cs (38)
35
new
() { Contents = [new UsageContent(new() { InputTokenCount = 1, OutputTokenCount = 2 })] },
36
new
() { Contents = [new UsageContent(new() { InputTokenCount = 4, OutputTokenCount = 5 })] },
511
new
() { AdditionalProperties = new() { ["responseKey"] = "responseValue" } },
662
updates.Add(
new
() { Contents = [new DataContent("data:image/png;base64,aGVsbG8=")] });
692
new
() { Contents = [new TextReasoningContent("D")] },
693
new
() { Contents = [new TextReasoningContent("E")] },
694
new
() { Contents = [new TextReasoningContent("F")] },
697
new
() { Contents = [new TextReasoningContent("I")] },
698
new
() { Contents = [new TextReasoningContent("J")] },
700
new
() { Contents = [new TextReasoningContent("L")] },
703
new
() { Contents = [new TextReasoningContent("O")] },
704
new
() { Contents = [new TextReasoningContent("P")] },
727
new
() { Contents = [new TextReasoningContent("A") { ProtectedData = "1" }] },
728
new
() { Contents = [new TextReasoningContent("B") { ProtectedData = "2" }] },
729
new
() { Contents = [new TextReasoningContent("C")] },
730
new
() { Contents = [new TextReasoningContent("D")] },
731
new
() { Contents = [new TextReasoningContent("E") { ProtectedData = "3" }] },
732
new
() { Contents = [new TextReasoningContent("F") { ProtectedData = "4" }] },
733
new
() { Contents = [new TextReasoningContent("G")] },
734
new
() { Contents = [new TextReasoningContent("H")] },
767
new
() { Contents = [new TextContent("D") { Annotations = [new()] }] },
768
new
() { Contents = [new TextContent("E") { Annotations = [new()] }] },
769
new
() { Contents = [new TextContent("F") { Annotations = [new()] }] },
770
new
() { Contents = [new TextContent("G") { Annotations = [] }] },
771
new
() { Contents = [new TextContent("H") { Annotations = [] }] },
772
new
() { Contents = [new TextContent("I") { Annotations = [new()] }] },
773
new
() { Contents = [new TextContent("J") { Annotations = [new()] }] },
775
new
() { Contents = [new TextContent("L") { Annotations = [new()] }] },
778
new
() { Contents = [new TextContent("O") { Annotations = [new()] }] },
779
new
() { Contents = [new TextContent("P") { Annotations = [new()] }] },
806
new
() { Contents = [new UsageContent(new() { TotalTokenCount = 42 })] },
934
new
() { Contents = [new ImageGenerationToolResultContent { ImageId = "img1", Outputs = [image1] }] },
937
new
() { Contents = [new ImageGenerationToolResultContent { ImageId = "img2", Outputs = [image2] }] },
940
new
() { Contents = [new ImageGenerationToolResultContent { ImageId = "img1", Outputs = [image3] }] },
943
new
() { Contents = [new ImageGenerationToolResultContent { ImageId = "img2", Outputs = [image4] }] },
988
new
() { Contents = [new ImageGenerationToolResultContent { ImageId = null, Outputs = [image1] }] },
991
new
() { Contents = [new ImageGenerationToolResultContent { ImageId = "", Outputs = [image2] }] },
994
new
() { Contents = [new ImageGenerationToolResultContent { ImageId = null, Outputs = [image3] }] },
ChatCompletion\ChatResponseUpdateTests.cs (9)
16
ChatResponseUpdate update =
new
();
33
ChatResponseUpdate update =
new
();
87
ChatResponseUpdate update =
new
()
115
ChatResponseUpdate original =
new
()
180
var original = new
ChatResponseUpdate
221
var original = new
ChatResponseUpdate
249
var original = new
ChatResponseUpdate
();
273
var original = new
ChatResponseUpdate
308
var original = new
ChatResponseUpdate
Microsoft.Extensions.AI.OpenAI (4)
OpenAIAssistantsChatClient.cs (2)
167
ChatResponseUpdate ruUpdate =
new
()
304
yield return
new
()
OpenAIChatClient.cs (2)
364
ChatResponseUpdate responseUpdate =
new
()
438
ChatResponseUpdate responseUpdate =
new
()
Microsoft.Extensions.AI.OpenAI.Tests (1)
OpenAIConversionTests.cs (1)
1210
var responseUpdate = new
ChatResponseUpdate
Microsoft.Extensions.AI.Tests (26)
ChatCompletion\ConfigureOptionsChatClientTests.cs (1)
38
var expectedUpdates = Enumerable.Range(0, 3).Select(i => new
ChatResponseUpdate
()).ToArray();
ChatCompletion\DistributedCachingChatClientTest.cs (8)
250
new
()
263
new
()
268
new
()
316
new
() { Role = ChatRole.Assistant, Contents = [new FunctionCallContent("callId1", "separator")] },
369
new
() { Role = ChatRole.Assistant, Contents = [new TextContent("Hello")] },
370
new
() { Role = ChatRole.Assistant, Contents = [new TextContent(" world, ")] },
371
new
()
382
new
()
ChatCompletion\FunctionInvokingChatClientTests.cs (3)
1192
new
() { Contents = [new FunctionCallContent("callId1", "Func1", new Dictionary<string, object?> { ["text"] = "Input 1" })] },
1193
new
() { Contents = [new FunctionCallContent("callId2", "Func1", new Dictionary<string, object?> { ["text"] = "Input 2" })] }
1198
updates = [
new
() { Contents = [new TextContent("OK bye")] }];
ChatCompletion\OpenTelemetryChatClientTests.cs (14)
76
yield return new
ChatResponseUpdate
81
yield return new
ChatResponseUpdate
375
yield return
new
() { Contents = [new TextReasoningContent("This is reasoning")] };
376
yield return
new
() { Contents = [new FunctionCallContent("call-123", "GetWeather", new Dictionary<string, object?> { ["location"] = "Seattle" })] };
377
yield return
new
() { Contents = [new FunctionResultContent("call-123", "72°F and sunny")] };
378
yield return
new
() { Contents = [new DataContent(Convert.FromBase64String("aGVsbG8gd29ybGQ="), "image/png")] };
379
yield return
new
() { Contents = [new UriContent(new Uri("https://example.com/image.jpg"), "image/jpeg")] };
380
yield return
new
() { Contents = [new HostedFileContent("file-abc123")] };
629
yield return
new
() { Contents = [new CodeInterpreterToolCallContent { CallId = "ci-call-1", Inputs = [new TextContent("print('hello')")] }] };
630
yield return
new
() { Contents = [new CodeInterpreterToolResultContent { CallId = "ci-call-1", Outputs = [new TextContent("hello")] }] };
631
yield return
new
() { Contents = [new ImageGenerationToolCallContent { ImageId = "img-123" }] };
632
yield return
new
() { Contents = [new ImageGenerationToolResultContent { ImageId = "img-123", Outputs = [new UriContent(new Uri("https://example.com/image.png"), "image/png")] }] };
633
yield return
new
() { Contents = [new McpServerToolCallContent("mcp-call-1", "myTool", "myServer") { Arguments = new Dictionary<string, object?> { ["param1"] = "value1" } }] };
634
yield return
new
() { Contents = [new McpServerToolResultContent("mcp-call-1") { Output = [new TextContent("Tool result")] }] };