BotSharp/src/Plugins/UiAdapters/BotSharp.UiAdapter.ChatbotUI/ViewModels/OpenAiMessageInput.cs

21 lines
620 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;
namespace ChatbotUI.ViewModels;
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));
}
}