Merge branch 'SciSharp:master' into master
This commit is contained in:
commit
773b7a9ccf
|
|
@ -6,4 +6,5 @@ public class ConversationChannel
|
||||||
public const string OpenAPI = "openapi";
|
public const string OpenAPI = "openapi";
|
||||||
public const string Phone = "phone";
|
public const string Phone = "phone";
|
||||||
public const string Messenger = "messenger";
|
public const string Messenger = "messenger";
|
||||||
|
public const string Email = "email";
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -27,10 +27,11 @@ public class ConversationController : ControllerBase
|
||||||
public async Task<ConversationViewModel> NewConversation([FromRoute] string agentId, [FromBody] MessageConfig config)
|
public async Task<ConversationViewModel> NewConversation([FromRoute] string agentId, [FromBody] MessageConfig config)
|
||||||
{
|
{
|
||||||
var service = _services.GetRequiredService<IConversationService>();
|
var service = _services.GetRequiredService<IConversationService>();
|
||||||
|
var channel = config.States.FirstOrDefault(x => x.Key == "channel");
|
||||||
var conv = new Conversation
|
var conv = new Conversation
|
||||||
{
|
{
|
||||||
AgentId = agentId,
|
AgentId = agentId,
|
||||||
Channel = ConversationChannel.OpenAPI,
|
Channel = channel == default ? ConversationChannel.OpenAPI : channel.Value,
|
||||||
TaskId = config.TaskId
|
TaskId = config.TaskId
|
||||||
};
|
};
|
||||||
conv = await service.NewConversation(conv);
|
conv = await service.NewConversation(conv);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue