Set default channel value for webchat.

This commit is contained in:
Haiping Chen 2023-11-05 19:54:54 -06:00
parent 5d49b1b0e2
commit 1d703591a5
3 changed files with 3 additions and 4 deletions

View file

@ -1,9 +1,7 @@
using BotSharp.Abstraction.Models;
namespace BotSharp.Abstraction.Conversations.Models;
public class IncomingMessageModel : MessageConfig
{
public string Text { get; set; } = string.Empty;
public virtual string Channel { get; set; }
public virtual string Channel { get; set; } = string.Empty;
}

View file

@ -78,7 +78,7 @@ public class ChatbotUiController : ControllerBase, IApiAdapter
conv.SetConversationId(input.ConversationId, input.States);
conv.States.SetState("provider", input.Provider)
.SetState("model", input.Model)
.SetState("channel", "webchat")
.SetState("channel", input.Channel)
.SetState("temperature", input.Temperature)
.SetState("sampling_factor", input.SamplingFactor);

View file

@ -9,6 +9,7 @@ public class OpenAiMessageInput : IncomingMessageModel
{
public string AgentId { get; set; } = string.Empty;
public string ConversationId { get; set; } = string.Empty;
public override string Channel { get; set; } = "webchat";
public List<OpenAiMessageBody> Messages { get; set; } = new List<OpenAiMessageBody>();