BotSharp/src/Infrastructure/BotSharp.Abstraction/MLTasks/Settings/LlmModelSetting.cs

68 lines
1.5 KiB
C#
Raw Normal View History

2023-12-13 18:12:25 +00:00
namespace BotSharp.Abstraction.MLTasks.Settings;
public class LlmModelSetting
{
2024-01-22 02:39:13 +00:00
/// <summary>
/// Model Id, like "gpt-3.5" and "gpt-4".
/// </summary>
public string? Id { get; set; }
/// <summary>
/// Deployment model name
/// </summary>
2023-12-13 18:12:25 +00:00
public string Name { get; set; }
2024-01-22 02:39:13 +00:00
/// <summary>
/// Model version
/// </summary>
public string Version { get; set; } = "1106-Preview";
2024-01-22 02:39:13 +00:00
/// <summary>
/// Api version
/// </summary>
public string? ApiVersion { get; set; }
/// <summary>
2024-01-22 02:39:13 +00:00
/// Deployment same functional model in a group.
/// It can be used to deploy same model in different regions.
/// </summary>
public string? Group { get; set; }
2023-12-13 18:12:25 +00:00
public string ApiKey { get; set; }
public string Endpoint { get; set; }
public LlmModelType Type { get; set; } = LlmModelType.Chat;
2024-05-13 21:53:41 +00:00
/// <summary>
/// If true, allow sending images/vidoes to this model
/// </summary>
public bool MultiModal { get; set; }
2024-06-24 19:32:52 +00:00
/// <summary>
/// If true, allow generating images
/// </summary>
public bool ImageGeneration { get; set; }
2023-12-13 18:12:25 +00:00
/// <summary>
/// Prompt cost per 1K token
/// </summary>
public float PromptCost { get; set; }
/// <summary>
/// Completion cost per 1K token
/// </summary>
public float CompletionCost { get; set; }
public override string ToString()
{
return $"[{Type}] {Name} {Endpoint}";
}
}
public enum LlmModelType
{
Text = 1,
2024-06-24 18:03:05 +00:00
Chat = 2,
2024-07-01 02:14:02 +00:00
Image = 3,
Embedding = 4
2023-12-13 18:12:25 +00:00
}