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

40 lines
1.8 KiB
C#
Raw Normal View History

2024-02-15 20:43:36 +00:00
using BotSharp.Abstraction.Loggers.Models;
2023-12-04 23:42:46 +00:00
using BotSharp.Abstraction.Repositories.Filters;
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-10-30 16:48:18 +00:00
string ConversationId { get; }
2023-06-27 18:31:13 +00:00
Task<Conversation> NewConversation(Conversation conversation);
2023-09-14 01:41:51 +00:00
void SetConversationId(string conversationId, List<string> states);
2023-07-19 22:30:23 +00:00
Task<Conversation> GetConversation(string id);
2023-12-04 23:42:46 +00:00
Task<PagedItems<Conversation>> GetConversations(ConversationFilter filter);
Task<Conversation> UpdateConversationTitle(string id, string title);
2023-11-10 16:01:03 +00:00
Task<List<Conversation>> GetLastConversations();
Task<List<string>> GetIdleConversations(int batchSize, int messageLimit);
Task<bool> DeleteConversations(IEnumerable<string> ids);
2024-01-29 01:33:40 +00:00
Task<bool> TruncateConversation(string conversationId, string messageId);
2024-03-01 02:50:39 +00:00
Task<List<ContentLogOutputModel>> GetConversationContentLogs(string conversationId);
2024-02-15 20:43:36 +00:00
Task<List<ConversationStateLogModel>> GetConversationStateLogs(string conversationId);
2023-08-14 22:14:05 +00:00
/// <summary>
/// Send message to LLM
/// </summary>
/// <param name="agentId"></param>
/// <param name="lastDalog"></param>
2024-02-28 20:40:59 +00:00
/// <param name="onResponseReceived">Received the response from AI Agent</param>
2023-08-14 22:14:05 +00:00
/// <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>
2023-11-27 03:04:48 +00:00
Task<bool> SendMessage(string agentId,
2023-08-14 22:14:05 +00:00
RoleDialogModel lastDalog,
2024-02-28 20:40:59 +00:00
Func<RoleDialogModel, Task> onResponseReceived,
Func<RoleDialogModel, Task> onFunctionExecuting,
Func<RoleDialogModel, Task> onFunctionExecuted);
2023-08-14 22:14:05 +00:00
List<RoleDialogModel> GetDialogHistory(int lastCount = 50);
2023-06-27 18:31:13 +00:00
Task CleanHistory(string agentId);
2023-06-03 02:07:30 +00:00
}