BotSharp/src/Infrastructure/BotSharp.Abstraction/Conversations/IConversationService.cs

33 lines
1.3 KiB
C#
Raw Normal View History

2023-06-03 02:07:30 +00:00
namespace BotSharp.Abstraction.Conversations;
public interface IConversationService
{
2023-09-06 03:19:36 +00:00
IConversationStateService States { get; }
2023-06-27 18:31:13 +00:00
Task<Conversation> NewConversation(Conversation conversation);
2023-09-06 03:19:36 +00:00
void SetConversationId(string conversationId, string channel);
2023-07-19 22:30:23 +00:00
Task<Conversation> GetConversation(string id);
2023-06-27 18:31:13 +00:00
Task<List<Conversation>> GetConversations();
Task DeleteConversation(string id);
2023-08-14 22:14:05 +00:00
/// <summary>
/// Send message to LLM
/// </summary>
/// <param name="agentId"></param>
/// <param name="conversationId"></param>
/// <param name="lastDalog"></param>
/// <param name="onMessageReceived"></param>
/// <param name="onFunctionExecuting">This delegate is useful when you want to report progress on UI</param>
/// <param name="onFunctionExecuted">This delegate is useful when you want to report progress on UI</param>
2023-08-14 22:14:05 +00:00
/// <returns></returns>
Task<bool> SendMessage(string agentId,
RoleDialogModel lastDalog,
Func<RoleDialogModel, Task> onMessageReceived,
Func<RoleDialogModel, Task> onFunctionExecuting,
Func<RoleDialogModel, Task> onFunctionExecuted);
2023-08-14 22:14:05 +00:00
2023-09-06 03:19:36 +00:00
List<RoleDialogModel> GetDialogHistory(int lastCount = 20);
2023-06-27 18:31:13 +00:00
Task CleanHistory(string agentId);
2023-09-04 02:45:31 +00:00
Task CallFunctions(RoleDialogModel msg);
2023-06-03 02:07:30 +00:00
}