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