2 writes to MediaType
Microsoft.Extensions.AI.Abstractions (2)
Contents\DataContent.cs (2)
105MediaType = DataUriParser.ThrowIfInvalidMediaType(mediaType); 117MediaType = DataUriParser.ThrowIfInvalidMediaType(mediaType);
28 references to MediaType
Microsoft.Extensions.AI.Abstractions (8)
Contents\DataContent.cs (8)
123/// Determines whether the <see cref="MediaType"/>'s top-level type matches the specified <paramref name="topLevelType"/>. 125/// <param name="topLevelType">The type to compare against <see cref="MediaType"/>.</param> 126/// <returns><see langword="true"/> if the type portion of <see cref="MediaType"/> matches the specified value; otherwise, false.</returns> 131/// the specified <paramref name="topLevelType"/> against the type portion of <see cref="MediaType"/>. 133public bool HasTopLevelMediaType(string topLevelType) => DataUriParser.HasTopLevelMediaType(MediaType, topLevelType); 151_uri = string.Concat("data:", MediaType, ";base64,", Convert.ToBase64String(_data.GetValueOrDefault() 165$"data:{MediaType};base64,{_dataUri.Data}" : 166$"data:{MediaType};,{_dataUri.Data}";
Microsoft.Extensions.AI.Abstractions.Tests (14)
ChatCompletion\ChatMessageTests.cs (2)
290Assert.Equal("mime-type/2", dataContent.MediaType); 298Assert.Equal("mime-type/3", dataContent.MediaType);
Contents\DataContentTests.cs (12)
68Assert.Equal(mediaType, content.MediaType); 71Assert.Equal(mediaType, content.MediaType); 74Assert.Equal(mediaType, content.MediaType); 77Assert.Equal(mediaType, content.MediaType); 80Assert.Equal(mediaType, content.MediaType); 83Assert.Equal(mediaType, content.MediaType); 93Assert.Equal("image/png", content.MediaType); 97Assert.Equal("image/png", content.MediaType); 131Assert.Equal("application/octet-stream", content.MediaType); 137Assert.Equal("application/octet-stream", content.MediaType); 153Assert.Equal("audio/wav", content.MediaType); 199Assert.Equal(mediaType, c.MediaType);
Microsoft.Extensions.AI.AzureAIInference (3)
AzureAIInferenceChatClient.cs (3)
509parts.Add(new ChatMessageImageContentItem(BinaryData.FromBytes(dataContent.Data), dataContent.MediaType)); 518if (dataContent.MediaType.Equals("audio/mpeg", StringComparison.OrdinalIgnoreCase)) 522else if (dataContent.MediaType.Equals("audio/wav", StringComparison.OrdinalIgnoreCase))
Microsoft.Extensions.AI.OpenAI (3)
OpenAIModelMapper.ChatMessage.cs (3)
237parts.Add(ChatMessageContentPart.CreateImagePart(BinaryData.FromBytes(dataContent.Data), dataContent.MediaType)); 242if (dataContent.MediaType.Equals("audio/mpeg", StringComparison.OrdinalIgnoreCase)) 246else if (dataContent.MediaType.Equals("audio/wav", StringComparison.OrdinalIgnoreCase))