BotSharp/src/Plugins/BotSharp.Plugin.ChatbotUI/ViewModels/OpenAiMessageInput.cs

21 lines
636 B
C#
Raw Normal View History

2023-05-27 01:58:31 +00:00
using System.Collections.Generic;
using System.Linq;
using System.Text.Json.Serialization;
2023-06-07 00:59:32 +00:00
namespace BotSharp.Plugin.ChatbotUI.ViewModels;
2023-05-27 01:58:31 +00:00
public class OpenAiMessageInput
{
public string Model { get; set; } = string.Empty;
public List<OpenAiMessageBody> Messages { get; set; } = new List<OpenAiMessageBody>();
[JsonPropertyName("max_tokens")]
public int MaxTokens { get; set; } = 4000;
public bool Stream { get; set; } = true;
public float Temperature { get; set; } = 0.9f;
public override string ToString()
{
return string.Join("\n", Messages.Select(x => x.Role + ": " + x.Content));
}
}