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