fix user issue
This commit is contained in:
parent
f7a3a27422
commit
1a554ea15a
|
|
@ -95,10 +95,7 @@ public partial class ConversationService
|
|||
foreach (var dialog in dialogs.TakeLast(maxDialogCount))
|
||||
{
|
||||
var role = dialog.Role;
|
||||
if (role != AgentRole.User)
|
||||
{
|
||||
role = AgentRole.Assistant;
|
||||
}
|
||||
if (role != AgentRole.User && role != AgentRole.Assistant) continue;
|
||||
|
||||
conversation += $"{role}: {dialog.Payload ?? dialog.Content}\r\n";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -30,7 +30,6 @@ public class ConversationController : ControllerBase
|
|||
{
|
||||
AgentId = agentId,
|
||||
Channel = ConversationChannel.OpenAPI,
|
||||
UserId = _user.Id,
|
||||
TaskId = config.TaskId
|
||||
};
|
||||
conv = await service.NewConversation(conv);
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
using BotSharp.Abstraction.Plugins.Models;
|
||||
using BotSharp.Abstraction.Repositories.Enums;
|
||||
using BotSharp.Abstraction.Users.Enums;
|
||||
using BotSharp.Plugin.MongoStorage.Repository;
|
||||
|
||||
namespace BotSharp.Plugin.MongoStorage;
|
||||
|
|
@ -34,7 +35,10 @@ public class MongoStoragePlugin : IBotSharpPlugin
|
|||
public bool AttachMenu(List<PluginMenuDef> menu)
|
||||
{
|
||||
var section = menu.First(x => x.Label == "Apps");
|
||||
menu.Add(new PluginMenuDef("MongoDB", icon: "bx bx-data", link: "page/mongodb", weight: section.Weight + 10));
|
||||
menu.Add(new PluginMenuDef("MongoDB", icon: "bx bx-data", link: "page/mongodb", weight: section.Weight + 10)
|
||||
{
|
||||
Roles = new List<string> { UserRole.Admin }
|
||||
});
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue