2 writes to Choices
Microsoft.Extensions.AI.Abstractions.Tests (2)
53 references to Choices
Microsoft.Extensions.AI (7)
Microsoft.Extensions.AI.Abstractions (13)
Microsoft.Extensions.AI.Abstractions.Tests (29)
ChatCompletion\ChatCompletionTests.cs (14)
27Assert.Same(message, Assert.Single(completion.Choices));
41Assert.Same(messages, completion.Choices);
50Assert.Empty(completion.Choices);
61Assert.Same(message, completion.Choices[0]);
74Assert.Same(first, completion.Choices[0]);
122Assert.Same(newChoices, completion.Choices);
150Assert.Equal(4, result.Choices.Count);
152for (int i = 0; i < original.Choices.Count; i++)
154Assert.Equal(ChatRole.Assistant, result.Choices[i].Role);
155Assert.Equal($"Choice{i + 1}", result.Choices[i].Text);
179Assert.Equal(completion.Choices[0].Text, completion.ToString());
194completion.Choices[0] + Environment.NewLine + Environment.NewLine +
197completion.Choices[1] + Environment.NewLine + Environment.NewLine +
200completion.Choices[2],
ChatCompletion\StreamingChatCompletionUpdateExtensionsTests.cs (15)
69Assert.Equal(3, completion.Choices.Count);
71ChatMessage message = completion.Choices[0];
79message = completion.Choices[1];
88message = completion.Choices[2];
96Assert.Equal("Hello, world!", completion.Choices[0].Text);
97Assert.Equal("Hey, you!", completion.Choices[1].Text);
98Assert.Null(completion.Choices[2].Text);
102Assert.Equal("Hello", completion.Choices[0].Contents[0].ToString());
103Assert.Equal(", ", completion.Choices[0].Contents[1].ToString());
104Assert.Equal("world!", completion.Choices[0].Contents[2].ToString());
106Assert.Equal("Hey", completion.Choices[1].Contents[0].ToString());
107Assert.Equal(", ", completion.Choices[1].Contents[1].ToString());
108Assert.Equal("you!", completion.Choices[1].Contents[2].ToString());
110Assert.Null(completion.Choices[2].Text);
179Assert.Single(completion.Choices);
Microsoft.Extensions.AI.Integration.Tests (1)
Microsoft.Extensions.AI.OpenAI (1)
Microsoft.Extensions.AI.Tests (2)