namespace BotSharp.Abstraction.MLTasks.Settings; public class LlmModelSetting { /// /// Model Id, like "gpt-4", "gpt-4o", "o1". /// public string Id { get; set; } = null!; /// /// Deployment model name /// public string Name { get; set; } = null!; /// /// Model version /// public string Version { get; set; } = "1106-Preview"; /// /// Api version /// public string? ApiVersion { get; set; } /// /// Deployment same functional model in a group. /// It can be used to deploy same model in different regions. /// public string? Group { get; set; } public string ApiKey { get; set; } = null!; public string? Endpoint { get; set; } public LlmModelType Type { get; set; } = LlmModelType.Chat; /// /// If true, allow sending images/vidoes to this model /// public bool MultiModal { get; set; } /// /// If true, allow generating images /// public bool ImageGeneration { get; set; } /// /// Embedding dimension /// public int Dimension { get; set; } /// /// Settings for reasoning model /// public ReasoningSetting? Reasoning { get; set; } /// /// Settings for web search /// public WebSearchSetting? WebSearch { get; set; } /// /// Settings for images /// public ImageSetting? Image { get; set; } /// /// Settings for llm cost /// public LlmCostSetting Cost { get; set; } = new(); public override string ToString() { return $"[{Type}] {Name} {Endpoint}"; } } public class ReasoningSetting { public float Temperature { get; set; } = 1.0f; public string? EffortLevel { get; set; } } public class WebSearchSetting { public string? SearchContextSize { get; set; } } public class ImageSetting { public ImageGenerationSetting? Generation { get; set; } public ImageEditSetting? Edit { get; set; } public ImageVariationSetting? Variation { get; set; } } public class ImageGenerationSetting { public ModelSettingBase? Style { get; set; } public ModelSettingBase? Size { get; set; } public ModelSettingBase? Quality { get; set; } public ModelSettingBase? ResponseFormat { get; set; } } public class ImageEditSetting { public ModelSettingBase? Size { get; set; } public ModelSettingBase? ResponseFormat { get; set; } } public class ImageVariationSetting { public ModelSettingBase? Size { get; set; } public ModelSettingBase? ResponseFormat { get; set; } } public class ModelSettingBase { public string? Default { get; set; } public IEnumerable? Options { get; set; } } /// /// Cost per 1K tokens /// public class LlmCostSetting { // Input public float TextInputCost { get; set; } = 0f; public float CachedTextInputCost { get; set; } = 0f; public float AudioInputCost { get; set; } = 0f; public float CachedAudioInputCost { get; set; } = 0f; // Output public float TextOutputCost { get; set; } = 0f; public float AudioOutputCost { get; set; } = 0f; } public enum LlmModelType { Text = 1, Chat = 2, Image = 3, Embedding = 4, Audio = 5, Realtime = 6, }