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
|
|
|
|
|
{
|
2023-07-19 22:30:23 +00:00
|
|
|
public string AgentId { get; set; }
|
|
|
|
|
public string ConversationId { get; set; }
|
2023-05-27 01:58:31 +00:00
|
|
|
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));
|
|
|
|
|
}
|
|
|
|
|
}
|