6 types derived from AIContent
Microsoft.Extensions.AI.Abstractions (5)
Contents\DataContent.cs (1)
28public class DataContent : AIContent
Contents\FunctionCallContent.cs (1)
17public sealed class FunctionCallContent : AIContent
Contents\FunctionResultContent.cs (1)
16public sealed class FunctionResultContent : AIContent
Contents\TextContent.cs (1)
9public sealed class TextContent : AIContent
Contents\UsageContent.cs (1)
14public class UsageContent : AIContent
Microsoft.Extensions.AI.Abstractions.Tests (1)
Contents\AIContentTests.cs (1)
39private sealed class DerivedAIContent : AIContent;
35 references to AIContent
Microsoft.Extensions.AI (6)
ChatCompletion\ChatCompletion{T}.cs (1)
109var content = choice?.Contents.Count == 1 ? choice.Contents[0] : null;
ChatCompletion\FunctionInvokingChatClient.cs (3)
178HashSet<AIContent>? contentsToRemove = null; 357HashSet<AIContent>? contentToRemove, 519var contents = new AIContent[results.Length];
ChatCompletion\OpenTelemetryChatClient.cs (1)
226List<AIContent> items = [];
Utilities\AIJsonUtilities.Defaults.cs (1)
84[JsonSerializable(typeof(AIContent))]
Microsoft.Extensions.AI.Abstractions (7)
ChatCompletion\ChatMessage.cs (3)
15private IList<AIContent>? _contents; 37IList<AIContent> contents) 79public IList<AIContent> Contents
ChatCompletion\StreamingChatCompletionUpdate.cs (2)
23private IList<AIContent>? _contents; 64public IList<AIContent> Contents
Contents\AIContent.cs (2)
20/// Initializes a new instance of the <see cref="AIContent"/> class. 28/// If an <see cref="AIContent"/> is created to represent some underlying object from another object
Microsoft.Extensions.AI.Abstractions.Tests (6)
ChatCompletion\ChatMessageTests.cs (5)
59Assert.Throws<ArgumentNullException>("contents", () => new ChatMessage(ChatRole.User, (IList<AIContent>)null!)); 68List<AIContent> content = []; 192Assert.IsType<List<AIContent>>(new ChatMessage().Contents); 201List<AIContent> contents = []; 261IList<AIContent> items =
ChatCompletion\StreamingChatCompletionUpdateTests.cs (1)
48IList<AIContent> newList = [new TextContent("text")];
Microsoft.Extensions.AI.AzureAIInference (3)
AzureAIInferenceChatClient.cs (3)
429foreach (AIContent item in input.Contents) 453yield return new ChatRequestUserMessage(input.Contents.Select(static (AIContent item) => item switch 466foreach (var content in input.Contents)
Microsoft.Extensions.AI.Ollama (2)
OllamaChatClient.cs (2)
204List<AIContent> contents = []; 322foreach (var item in content.Contents)
Microsoft.Extensions.AI.OpenAI (9)
OpenAIChatClient.cs (9)
114if (ToAIContent(contentPart, response.Model) is AIContent aiContent) 242if (ToAIContent(contentPart, modelId) is AIContent aiContent) 532/// <summary>Creates an <see cref="AIContent"/> from a <see cref="ChatMessageContentPart"/>.</summary> 535/// <returns>The constructed <see cref="AIContent"/>, or null if the content part could not be converted.</returns> 536private static AIContent? ToAIContent(ChatMessageContentPart contentPart, string? modelId) 538AIContent? aiContent = null; 589foreach (AIContent item in input.Contents) 613yield return new UserChatMessage(input.Contents.Select(static (AIContent item) => item switch 627foreach (var content in input.Contents)
Microsoft.Extensions.AI.Tests (2)
ChatCompletion\FunctionInvokingChatClientTests.cs (2)
186IEnumerable<AIContent> content = finalChat.SelectMany(m => m.Contents); 235IEnumerable<AIContent> content = finalChat.SelectMany(m => m.Contents);