Merge branch 'SciSharp:master' into master

This commit is contained in:
C. Oceania 2024-06-24 17:01:47 -05:00 committed by GitHub
commit 773b7a9ccf
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 3 additions and 1 deletions

View file

@ -6,4 +6,5 @@ public class ConversationChannel
public const string OpenAPI = "openapi";
public const string Phone = "phone";
public const string Messenger = "messenger";
public const string Email = "email";
}

View file

@ -27,10 +27,11 @@ public class ConversationController : ControllerBase
public async Task<ConversationViewModel> NewConversation([FromRoute] string agentId, [FromBody] MessageConfig config)
{
var service = _services.GetRequiredService<IConversationService>();
var channel = config.States.FirstOrDefault(x => x.Key == "channel");
var conv = new Conversation
{
AgentId = agentId,
Channel = ConversationChannel.OpenAPI,
Channel = channel == default ? ConversationChannel.OpenAPI : channel.Value,
TaskId = config.TaskId
};
conv = await service.NewConversation(conv);