using AIStudio.Models;
namespace AIStudio.Provider.OpenAI;
public static class SystemPromptRoleExtensions
{
///
/// Spells a system prompt role the way OpenAI's APIs expect it.
///
///
/// 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.
///
/// The role the model profile states.
/// The role, as OpenAI names it.
public static string ToOpenAIRole(this SystemPromptRole role) => role switch
{
SystemPromptRole.SYSTEM => "system",
SystemPromptRole.DEVELOPER => "developer",
SystemPromptRole.USER => "user",
_ => "developer",
};
}