Rename ContentType to SubContentType for clarity & moved into the provider space

This commit is contained in:
Thorsten Sommer 2025-12-28 21:06:46 +01:00
parent 422791e8b9
commit 6a2d60740f
Signed by: tsommer
GPG Key ID: 371BBA77A02C0108
6 changed files with 22 additions and 17 deletions

View File

@ -8,5 +8,5 @@ public interface ISubContent
/// <summary> /// <summary>
/// The type of the sub-content. /// The type of the sub-content.
/// </summary> /// </summary>
public ContentType Type { get; init; } public SubContentType Type { get; init; }
} }

View File

@ -3,9 +3,9 @@ namespace AIStudio.Provider.OpenAI;
/// <summary> /// <summary>
/// Image sub-content for multimodal messages. /// Image sub-content for multimodal messages.
/// </summary> /// </summary>
public record SubContentImageUrl(ContentType Type, string ImageUrl) : ISubContent public record SubContentImageUrl(SubContentType Type, string ImageUrl) : ISubContent
{ {
public SubContentImageUrl() : this(ContentType.IMAGE_URL, string.Empty) public SubContentImageUrl() : this(SubContentType.IMAGE_URL, string.Empty)
{ {
} }
} }

View File

@ -6,9 +6,9 @@ namespace AIStudio.Provider.OpenAI;
/// <remarks> /// <remarks>
/// Right now, this is used only by OpenAI in its responses API. /// Right now, this is used only by OpenAI in its responses API.
/// </remarks> /// </remarks>
public record SubContentInputImage(ContentType Type, string ImageUrl) : ISubContent public record SubContentInputImage(SubContentType Type, string ImageUrl) : ISubContent
{ {
public SubContentInputImage() : this(ContentType.INPUT_IMAGE, string.Empty) public SubContentInputImage() : this(SubContentType.INPUT_IMAGE, string.Empty)
{ {
} }
} }

View File

@ -6,9 +6,9 @@ namespace AIStudio.Provider.OpenAI;
/// <remarks> /// <remarks>
/// Right now, this is used only by OpenAI in its responses API. /// Right now, this is used only by OpenAI in its responses API.
/// </remarks> /// </remarks>
public record SubContentInputText(ContentType Type, string Text) : ISubContent public record SubContentInputText(SubContentType Type, string Text) : ISubContent
{ {
public SubContentInputText() : this(ContentType.INPUT_TEXT, string.Empty) public SubContentInputText() : this(SubContentType.INPUT_TEXT, string.Empty)
{ {
} }
} }

View File

@ -3,9 +3,9 @@ namespace AIStudio.Provider.OpenAI;
/// <summary> /// <summary>
/// Text sub-content for multimodal messages. /// Text sub-content for multimodal messages.
/// </summary> /// </summary>
public record SubContentText(ContentType Type, string Text) : ISubContent public record SubContentText(SubContentType Type, string Text) : ISubContent
{ {
public SubContentText() : this(ContentType.TEXT, string.Empty) public SubContentText() : this(SubContentType.TEXT, string.Empty)
{ {
} }
} }

View File

@ -1,9 +1,9 @@
namespace AIStudio.Provider.OpenAI; namespace AIStudio.Provider;
/// <summary> /// <summary>
/// Content types for OpenAI API interactions when using multimodal messages. /// Sub content types for OpenAI-compatible API interactions when using multimodal messages.
/// </summary> /// </summary>
public enum ContentType public enum SubContentType
{ {
/// <summary> /// <summary>
/// Default type for user prompts in multimodal messages. This type is supported across all providers. /// Default type for user prompts in multimodal messages. This type is supported across all providers.
@ -22,13 +22,18 @@ public enum ContentType
/// </summary> /// </summary>
INPUT_IMAGE, INPUT_IMAGE,
/// <summary>
/// Right now only supported by OpenAI (responses & chat completion API), Google (chat completions API), and Mistral (chat completions API).
/// </summary>
INPUT_AUDIO,
/// <summary> /// <summary>
/// Default type for images in multimodal messages. This type is supported across all providers. /// Default type for images in multimodal messages. This type is supported across all providers.
/// </summary> /// </summary>
IMAGE_URL, IMAGE_URL,
/// <summary>
/// The image type is used exclusively by Anthropic's messages API.
/// </summary>
IMAGE,
/// <summary>
/// Right now only supported by OpenAI (responses & chat completion API), Google (chat completions API), and Mistral (chat completions API).
/// </summary>
INPUT_AUDIO,
} }