Moved all extension methods into extension blocks (#1155)

This commit is contained in:
Thorsten Sommer authored and GitHub committed 2026-11-04 10:46:18 +01:00
1 parent acc7d09fa2
commit c0a75f39ac
138 files changed
+5884 -4954

No files matched your search

@@ -4,22 +4,25 @@ namespace AIStudio.Provider.OpenAI;
public static class SystemPromptRoleExtensions
{
/// <summary>
/// Spells a system prompt role the way OpenAI's APIs expect it.
/// </summary>
/// <remarks>
/// A role no rule states becomes "developer". OpenAI's current documentation names no other, a
/// model the rules do not know is almost always one released after they were written, and the
/// older generations which still want "system" say so in their families.
/// </remarks>
/// <param name="role">The role the model profile states.</param>
/// <returns>The role, as OpenAI names it.</returns>
public static string ToOpenAIRole(this SystemPromptRole role) => role switch
extension(SystemPromptRole role)
{
SystemPromptRole.SYSTEM => "system",
SystemPromptRole.DEVELOPER => "developer",
SystemPromptRole.USER => "user",
/// <summary>
/// Spells a system prompt role the way OpenAI's APIs expect it.
/// </summary>
/// <remarks>
/// A role no rule states becomes "developer". OpenAI's current documentation names no other, a
/// model the rules do not know is almost always one released after they were written, and the
/// older generations which still want "system" say so in their families.
/// </remarks>
/// <returns>The role, as OpenAI names it.</returns>
public string ToOpenAIRole() => role switch
{
SystemPromptRole.SYSTEM => "system",
SystemPromptRole.DEVELOPER => "developer",
SystemPromptRole.USER => "user",
_ => "developer",
};
_ => "developer",
};
}
}