using BotSharp.Abstraction.Loggers.Models; using BotSharp.Abstraction.Plugins.Models; using BotSharp.Abstraction.Tasks.Models; using BotSharp.Abstraction.Translation.Models; using BotSharp.Abstraction.Users.Models; using BotSharp.Abstraction.VectorStorage.Models; using Microsoft.EntityFrameworkCore.Infrastructure; namespace BotSharp.Core.Repository; public class BotSharpDbContext : Database, IBotSharpRepository { public IQueryable Users => throw new NotImplementedException(); public IQueryable Agents => throw new NotImplementedException(); public IQueryable UserAgents => throw new NotImplementedException(); public IQueryable Conversations => throw new NotImplementedException(); public int Transaction(Action action) { DatabaseFacade database = base.GetMaster(typeof(TTableInterface)).Database; int num = 0; if (database.CurrentTransaction == null) { using (Microsoft.EntityFrameworkCore.Storage.IDbContextTransaction dbContextTransaction = database.BeginTransaction()) { try { action(); num = base.SaveChanges(); dbContextTransaction.Commit(); return num; } catch (Exception ex) { dbContextTransaction.Rollback(); if (ex.Message.Contains("See the inner exception for details")) { throw ex.InnerException; } throw ex; } } } try { action(); return base.SaveChanges(); } catch (Exception ex2) { if (database.CurrentTransaction != null) { database.CurrentTransaction.Rollback(); } if (ex2.Message.Contains("See the inner exception for details")) { throw ex2.InnerException; } throw ex2; } } #region Plugin public PluginConfig GetPluginConfig() => throw new NotImplementedException(); public void SavePluginConfig(PluginConfig config) => throw new NotImplementedException(); #endregion #region Agent public Agent GetAgent(string agentId) => throw new NotImplementedException(); public List GetAgents(AgentFilter filter) => throw new NotImplementedException(); public List GetAgentsByUser(string userId) => throw new NotImplementedException(); public void UpdateAgent(Agent agent, AgentField field) => throw new NotImplementedException(); public string GetAgentTemplate(string agentId, string templateName) => throw new NotImplementedException(); public bool PatchAgentTemplate(string agentId, AgentTemplate template) => throw new NotImplementedException(); public List GetAgentResponses(string agentId, string prefix, string intent) => throw new NotImplementedException(); public void BulkInsertAgents(List agents) => throw new NotImplementedException(); public void BulkInsertUserAgents(List userAgents) => throw new NotImplementedException(); public bool DeleteAgents() => throw new NotImplementedException(); public bool DeleteAgent(string agentId) => throw new NotImplementedException(); #endregion #region Agent Task public PagedItems GetAgentTasks(AgentTaskFilter filter) => throw new NotImplementedException(); public AgentTask? GetAgentTask(string agentId, string taskId) => throw new NotImplementedException(); public void InsertAgentTask(AgentTask task) => throw new NotImplementedException(); public void BulkInsertAgentTasks(List tasks) => throw new NotImplementedException(); public void UpdateAgentTask(AgentTask task, AgentTaskField field) => throw new NotImplementedException(); public bool DeleteAgentTask(string agentId, List taskIds) => throw new NotImplementedException(); public bool DeleteAgentTasks() => throw new NotImplementedException(); #endregion #region Conversation public void CreateNewConversation(Conversation conversation) => throw new NotImplementedException(); public bool DeleteConversations(IEnumerable conversationIds) => throw new NotImplementedException(); public Conversation GetConversation(string conversationId) => throw new NotImplementedException(); public PagedItems GetConversations(ConversationFilter filter) => throw new NotImplementedException(); public List GetLastConversations() => throw new NotImplementedException(); public List GetIdleConversations(int batchSize, int messageLimit, int bufferHours, IEnumerable excludeAgentIds) => throw new NotImplementedException(); public List GetConversationDialogs(string conversationId) => throw new NotImplementedException(); public ConversationState GetConversationStates(string conversationId) => throw new NotImplementedException(); public void AppendConversationDialogs(string conversationId, List dialogs) => new NotImplementedException(); public void UpdateConversationTitle(string conversationId, string title) => new NotImplementedException(); public void UpdateConversationBreakpoint(string conversationId, ConversationBreakpoint breakpoint) => new NotImplementedException(); public ConversationBreakpoint? GetConversationBreakpoint(string conversationId) => throw new NotImplementedException(); public void UpdateConversationStates(string conversationId, List states) => new NotImplementedException(); public void UpdateConversationStatus(string conversationId, string status) => new NotImplementedException(); public IEnumerable TruncateConversation(string conversationId, string messageId, bool cleanLog = false) => throw new NotImplementedException(); #endregion #region Execution Log public void AddExecutionLogs(string conversationId, List logs) { throw new NotImplementedException(); } public List GetExecutionLogs(string conversationId) { throw new NotImplementedException(); } #endregion #region LLM Completion Log public void SaveLlmCompletionLog(LlmCompletionLog log) { throw new NotImplementedException(); } #endregion #region Conversation Content Log public void SaveConversationContentLog(ContentLogOutputModel log) { throw new NotImplementedException(); } public List GetConversationContentLogs(string conversationId) { throw new NotImplementedException(); } #endregion #region Conversation State Log public void SaveConversationStateLog(ConversationStateLogModel log) { throw new NotImplementedException(); } public List GetConversationStateLogs(string conversationId) { throw new NotImplementedException(); } #endregion #region Stats public void IncrementConversationCount() { throw new NotImplementedException(); } #endregion #region Translation public IEnumerable GetTranslationMemories(IEnumerable queries) => throw new NotImplementedException(); public bool SaveTranslationMemories(IEnumerable inputs) => throw new NotImplementedException(); #endregion #region Knowledge public bool AddKnowledgeCollectionConfigs(List configs, bool reset = false) => throw new NotImplementedException(); public bool DeleteKnowledgeCollectionConfig(string collectionName) => throw new NotImplementedException(); public IEnumerable GetKnowledgeCollectionConfigs(VectorCollectionConfigFilter filter) => throw new NotImplementedException(); public bool SaveKnolwedgeBaseFileMeta(KnowledgeDocMetaData metaData) => throw new NotImplementedException(); public PagedItems GetKnowledgeBaseFileMeta(string collectionName, string vectorStoreProvider, KnowledgeFileFilter filter) => throw new NotImplementedException(); #endregion }