29 writes to MediaType
Microsoft.Extensions.AI.Abstractions (1)
Generated\Basic.CompilerLog.Util\Basic.CompilerLog.Util.Impl.BasicGeneratedFilesAnalyzerReference\JsonContext.HostedFileContent.g.cs (1)
83Setter = static (obj, value) => ((global::Microsoft.Extensions.AI.HostedFileContent)obj).MediaType = value!,
Microsoft.Extensions.AI.Abstractions.Tests (8)
Contents\HostedFileContentTests.cs (7)
78c.MediaType = "image/png"; 81c.MediaType = "application/pdf"; 84c.MediaType = null; 98Assert.Throws<ArgumentException>("value", () => c.MediaType = invalidMediaType); 109HostedFileContent c = new("id123") { MediaType = mediaType }; 191MediaType = "text/plain", 226HostedFileContent c = new("id123") { MediaType = mediaType };
Generated\361d1da7f942c932\TestJsonSerializerContext.HostedFileContent.g.cs (1)
81Setter = static (obj, value) => ((global::Microsoft.Extensions.AI.HostedFileContent)obj).MediaType = value!,
Microsoft.Extensions.AI.Evaluation.Reporting (1)
Generated\Basic.CompilerLog.Util\Basic.CompilerLog.Util.Impl.BasicGeneratedFilesAnalyzerReference\JsonContext.HostedFileContent.g.cs (1)
83Setter = static (obj, value) => ((global::Microsoft.Extensions.AI.HostedFileContent)obj).MediaType = value!,
Microsoft.Extensions.AI.Evaluation.Reporting.Azure (1)
Generated\Basic.CompilerLog.Util\Basic.CompilerLog.Util.Impl.BasicGeneratedFilesAnalyzerReference\JsonContext.HostedFileContent.g.cs (1)
83Setter = static (obj, value) => ((global::Microsoft.Extensions.AI.HostedFileContent)obj).MediaType = value!,
Microsoft.Extensions.AI.OpenAI (5)
OpenAIAssistantsChatClient.cs (1)
232(hcitrc.Outputs ??= []).Add(new HostedFileContent(output.ImageFileId) { MediaType = "image/*" });
OpenAIHostedFileClient.cs (2)
334MediaType = MediaTypeMap.GetMediaType(openAIFile.Filename), 350MediaType = MediaTypeMap.GetMediaType(name),
OpenAIResponsesChatClient.cs (2)
1698content = new HostedFileContent(part.InputImageFileId) { MediaType = "image/*" }; 1954var hfc = new HostedFileContent(fileId) { MediaType = mimeType, RawRepresentation = output };
Microsoft.Extensions.AI.OpenAI.Tests (4)
OpenAIResponseClientTests.cs (4)
5056new FunctionResultContent("call_file", new HostedFileContent("file-abc123") { MediaType = "image/png", Name = "result.png" }) 5402new FunctionResultContent("call_hosted_file", new HostedFileContent("file-xyz789") { MediaType = "text/plain", Name = "document.txt" }) 5576new HostedFileContent("file-img-456") { MediaType = "image/png" }, 5577new HostedFileContent("file-img-789") { MediaType = "image/jpeg", AdditionalProperties = new AdditionalPropertiesDictionary { ["detail"] = "high" }},
Microsoft.Extensions.AI.Stabilization.Tests (8)
Generated\361d1da7f942c932\AIContentSerializationRegressionContext.HostedFileContent.g.cs (1)
81Setter = static (obj, value) => ((global::Microsoft.Extensions.AI.HostedFileContent)obj).MediaType = value!,
parent\Microsoft.Extensions.AI.Abstractions.Tests\Contents\HostedFileContentTests.cs (7)
78c.MediaType = "image/png"; 81c.MediaType = "application/pdf"; 84c.MediaType = null; 98Assert.Throws<ArgumentException>("value", () => c.MediaType = invalidMediaType); 109HostedFileContent c = new("id123") { MediaType = mediaType }; 191MediaType = "text/plain", 226HostedFileContent c = new("id123") { MediaType = mediaType };
Microsoft.Extensions.AI.Tests (1)
Generated\361d1da7f942c932\TestJsonSerializerContext.HostedFileContent.g.cs (1)
81Setter = static (obj, value) => ((global::Microsoft.Extensions.AI.HostedFileContent)obj).MediaType = value!,
44 references to MediaType
Microsoft.Extensions.AI (4)
Common\OtelMessageSerializer.cs (2)
116MimeType = fc.MediaType, 117Modality = DeriveModalityFromMediaType(fc.MediaType),
Realtime\OpenTelemetryRealtimeClientSession.cs (2)
581MimeType = fc.MediaType, 582Modality = OtelMessageSerializer.DeriveModalityFromMediaType(fc.MediaType),
Microsoft.Extensions.AI.Abstractions (9)
Contents\HostedFileContent.cs (8)
98/// Determines whether the <see cref="MediaType"/>'s top-level type matches the specified <paramref name="topLevelType"/>. 100/// <param name="topLevelType">The type to compare against <see cref="MediaType"/>.</param> 101/// <returns><see langword="true"/> if the type portion of <see cref="MediaType"/> matches the specified value; otherwise, false.</returns> 107/// the specified <paramref name="topLevelType"/> against the type portion of <see cref="MediaType"/>. 110/// If <see cref="MediaType"/> is <see langword="null"/>, this method returns <see langword="false"/>. 113public bool HasTopLevelMediaType(string topLevelType) => MediaType is not null && DataUriParser.HasTopLevelMediaType(MediaType, topLevelType); 123if (MediaType is string mediaType)
Generated\Basic.CompilerLog.Util\Basic.CompilerLog.Util.Impl.BasicGeneratedFilesAnalyzerReference\JsonContext.HostedFileContent.g.cs (1)
82Getter = static obj => ((global::Microsoft.Extensions.AI.HostedFileContent)obj).MediaType,
Microsoft.Extensions.AI.Abstractions.Tests (8)
Contents\HostedFileContentTests.cs (7)
76Assert.Null(c.MediaType); 79Assert.Equal("image/png", c.MediaType); 82Assert.Equal("application/pdf", c.MediaType); 85Assert.Null(c.MediaType); 110Assert.Equal(mediaType, c.MediaType); 234Assert.Null(c.MediaType); 262Assert.Equal("application/pdf", hostedFile.MediaType);
Generated\361d1da7f942c932\TestJsonSerializerContext.HostedFileContent.g.cs (1)
80Getter = static obj => ((global::Microsoft.Extensions.AI.HostedFileContent)obj).MediaType,
Microsoft.Extensions.AI.Evaluation.Reporting (1)
Generated\Basic.CompilerLog.Util\Basic.CompilerLog.Util.Impl.BasicGeneratedFilesAnalyzerReference\JsonContext.HostedFileContent.g.cs (1)
82Getter = static obj => ((global::Microsoft.Extensions.AI.HostedFileContent)obj).MediaType,
Microsoft.Extensions.AI.Evaluation.Reporting.Azure (1)
Generated\Basic.CompilerLog.Util\Basic.CompilerLog.Util.Impl.BasicGeneratedFilesAnalyzerReference\JsonContext.HostedFileContent.g.cs (1)
82Getter = static obj => ((global::Microsoft.Extensions.AI.HostedFileContent)obj).MediaType,
Microsoft.Extensions.AI.OpenAI.Tests (12)
OpenAIHostedFileClientIntegrationTests.cs (4)
46Assert.Equal("application/x-ndjson", uploadedFile.MediaType); 103Assert.Contains(files, f => f.FileId == uploadedFileId && f.MediaType == "text/plain" && f.Name == fileName); 134Assert.Equal("text/plain", fileInfo.MediaType); 184Assert.Equal("text/plain", uploadedFile.MediaType);
OpenAIHostedFileClientTests.cs (8)
120Assert.Equal("application/x-ndjson", result.MediaType); 209Assert.Equal("application/x-ndjson", result.MediaType); 268Assert.Equal("application/x-ndjson", files[0].MediaType); 275Assert.Equal("application/x-ndjson", files[1].MediaType); 666Assert.Equal("text/csv", result.MediaType); 748Assert.Equal("application/pdf", result.MediaType); 791Assert.Equal("text/plain", files[0].MediaType); 795Assert.Equal("text/csv", files[1].MediaType);
Microsoft.Extensions.AI.Stabilization.Tests (8)
Generated\361d1da7f942c932\AIContentSerializationRegressionContext.HostedFileContent.g.cs (1)
80Getter = static obj => ((global::Microsoft.Extensions.AI.HostedFileContent)obj).MediaType,
parent\Microsoft.Extensions.AI.Abstractions.Tests\Contents\HostedFileContentTests.cs (7)
76Assert.Null(c.MediaType); 79Assert.Equal("image/png", c.MediaType); 82Assert.Equal("application/pdf", c.MediaType); 85Assert.Null(c.MediaType); 110Assert.Equal(mediaType, c.MediaType); 234Assert.Null(c.MediaType); 262Assert.Equal("application/pdf", hostedFile.MediaType);
Microsoft.Extensions.AI.Tests (1)
Generated\361d1da7f942c932\TestJsonSerializerContext.HostedFileContent.g.cs (1)
80Getter = static obj => ((global::Microsoft.Extensions.AI.HostedFileContent)obj).MediaType,