last ...
This commit is contained in:
@@ -21,17 +21,6 @@ namespace xAiModels.Constants
|
||||
[StringValue("ProjectRemoved")]
|
||||
ProjectRemoved,
|
||||
|
||||
//
|
||||
// Conversation ...
|
||||
[StringValue("ConversationCreated")]
|
||||
ConversationCreated,
|
||||
|
||||
[StringValue("ConversationUpdated")]
|
||||
ConversationUpdated,
|
||||
|
||||
[StringValue("ConversationRemoved")]
|
||||
ConversationRemoved,
|
||||
|
||||
//
|
||||
// Message ...
|
||||
[StringValue("MessageCreated")]
|
||||
@@ -42,5 +31,27 @@ namespace xAiModels.Constants
|
||||
|
||||
[StringValue("MessageRemoved")]
|
||||
MessageRemoved,
|
||||
|
||||
//
|
||||
// MCPServer ...
|
||||
[StringValue("McpServerCreated")]
|
||||
McpServerCreated,
|
||||
|
||||
[StringValue("McpServerUpdated")]
|
||||
McpServerUpdated,
|
||||
|
||||
[StringValue("McpServerRemoved")]
|
||||
McpServerRemoved,
|
||||
|
||||
//
|
||||
// Conversation ...
|
||||
[StringValue("ConversationCreated")]
|
||||
ConversationCreated,
|
||||
|
||||
[StringValue("ConversationUpdated")]
|
||||
ConversationUpdated,
|
||||
|
||||
[StringValue("ConversationRemoved")]
|
||||
ConversationRemoved,
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
using xExceptions.Attributes;
|
||||
|
||||
namespace xAiModels.Constants
|
||||
{
|
||||
public enum XAiMcpServerUsageScope
|
||||
{
|
||||
[StringValue(XAiModelsConstants.XAiMcpServerUsageScopeAll)]
|
||||
All = 1,
|
||||
|
||||
[StringValue(XAiModelsConstants.XAiMcpServerUsageScopeOwner)]
|
||||
Owner = 2
|
||||
}
|
||||
}
|
||||
@@ -90,5 +90,11 @@ namespace xAiModels.Constants
|
||||
public const string XAiKnowledgeMetadataScopeId = "scopeId";
|
||||
public const string XAiKnowledgeMetadataOwnerId = "ownerId";
|
||||
public const string XAiKnowledgeMetadataIngestedAtUtc = "ingestedAtUtc";
|
||||
|
||||
//
|
||||
// Mcp Server ...
|
||||
public const int XAiMcpServerMinTimeoutSeconds = 30;
|
||||
public const string XAiMcpServerUsageScopeAll = "All";
|
||||
public const string XAiMcpServerUsageScopeOwner = "Owner";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using xCommons.Providers;
|
||||
using xAiModels.Models.Dtos;
|
||||
using xDataService.Interfaces;
|
||||
using xCommons.Configurations;
|
||||
using xDataService.Controllers;
|
||||
using xAiModels.Models.Entities;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Microsoft.EntityFrameworkCore.Query;
|
||||
|
||||
namespace xAiModels.Controllers
|
||||
{
|
||||
public abstract class XAiMcpServerControllerBase : XBaseServiceController<XAiMcpServer, XAiMcpServerDto, Guid>
|
||||
{
|
||||
protected XAiMcpServerControllerBase(
|
||||
ILogger<XAiMcpServerControllerBase> logger,
|
||||
XAppConfiguration appConfiguration,
|
||||
XValidationProvider validationProvider,
|
||||
IXBaseRepositoryService<XAiMcpServer, XAiMcpServerDto, Guid> repositoryService,
|
||||
Func<IQueryable<XAiMcpServer>, IOrderedQueryable<XAiMcpServer>> defaultOrderBuilder = null,
|
||||
Func<IQueryable<XAiMcpServer>, IIncludableQueryable<XAiMcpServer, object>> defaultIncludeBuilder = null
|
||||
) : base(
|
||||
logger,
|
||||
appConfiguration,
|
||||
validationProvider,
|
||||
repositoryService,
|
||||
defaultOrderBuilder,
|
||||
defaultIncludeBuilder
|
||||
)
|
||||
{ }
|
||||
}
|
||||
}
|
||||
+63
-103
@@ -100,6 +100,11 @@ namespace xAiModels.DI
|
||||
pushHelper.AddHub<XAiProjectDtoHub>(XAiModelsConstants.XAiProjectDtoHub);
|
||||
pushHelper.AddHub<XAiProjectEntityHub>(XAiModelsConstants.XAiProjectEntityHub);
|
||||
|
||||
//
|
||||
// XAiMcpServer ...
|
||||
pushHelper.AddHub<XAiMcpServerDtoHub>(XAiModelsConstants.XAiMcpServerDtoHub);
|
||||
pushHelper.AddHub<XAiMcpServerEntityHub>(XAiModelsConstants.XAiMcpServerEntityHub);
|
||||
|
||||
//
|
||||
// XAiConversation ...
|
||||
pushHelper.AddHub<XAiConversationDtoHub>(XAiModelsConstants.XAiConversationDtoHub);
|
||||
@@ -143,109 +148,15 @@ namespace xAiModels.DI
|
||||
}
|
||||
|
||||
//
|
||||
// Create an Scope for Services Acces ...
|
||||
// Handle Seeding Category/SubCategory Resources ...
|
||||
// TODO: Enable Seeding if Required ...
|
||||
// using (var scope = app.ApplicationServices.CreateScope())
|
||||
// {
|
||||
// //
|
||||
// // Retrieve Configuratuions ...
|
||||
// var aiMessageProvider = scope.ServiceProvider.GetService<IXAiMessageServiceProvider>();
|
||||
// var aiProjectProvider = scope.ServiceProvider.GetService<IXAiProjectServiceProvider>();
|
||||
// var aiConversationProvider = scope.ServiceProvider.GetService<IXAiConversationServiceProvider>();
|
||||
// var configuration = scope.ServiceProvider.GetService<XAiDataServiceServiceConfiguration>();
|
||||
// if (!configuration.IsNullOrDefault() &&
|
||||
// !categoryProvider.IsNullOrDefault() &&
|
||||
// !subaiConversationDescriptor.IsNullOrDefault()
|
||||
// )
|
||||
// {
|
||||
// //
|
||||
// // Logging ...
|
||||
// Log("Start Seeding ...");
|
||||
|
||||
// //
|
||||
// // Count Data in Category ...
|
||||
// var hasCategory = (categoryProvider.Count().GetAwaiter().GetResult()) > 0;
|
||||
// var hasSubCategory = (subCategoryProvider.Count().GetAwaiter().GetResult()) > 0;
|
||||
|
||||
// //
|
||||
// // Seed Category Resources ...
|
||||
// var canSeed =
|
||||
// !hasCategory &&
|
||||
// configuration.Categories.HasChild();
|
||||
// if (canSeed)
|
||||
// {
|
||||
// //
|
||||
// // Loop through Provided items ...
|
||||
// foreach (var cat in configuration.Categories)
|
||||
// {
|
||||
// //
|
||||
// try
|
||||
// {
|
||||
// //
|
||||
// Log($"Start Seeding Category: {cat.Titles.Locales.ToArray()[0].Value} ...");
|
||||
|
||||
// //
|
||||
// categoryProvider.Refresh(
|
||||
// resource: cat,
|
||||
// userInfo: null,
|
||||
// connectionId: null,
|
||||
// cancellationToken: default
|
||||
// )
|
||||
// .GetAwaiter()
|
||||
// .GetResult();
|
||||
|
||||
// //
|
||||
// Log($"Seeding Category: {cat.Titles.Locales.ToArray()[0].Value} Finished Successfully ...");
|
||||
// }
|
||||
// catch (Exception ex)
|
||||
// {
|
||||
// Log($"Seeding Category: {cat.Titles.Locales.ToArray()[0].Value} Failed due: {ex.Message} ...");
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
// //
|
||||
// // Seed SubCategory Resources ...
|
||||
// canSeed =
|
||||
// !hasSubCategory &&
|
||||
// configuration.SubCategories.HasChild();
|
||||
// if (canSeed)
|
||||
// {
|
||||
// //
|
||||
// // Loop through Provided items ...
|
||||
// foreach (var subcat in configuration.SubCategories)
|
||||
// {
|
||||
// //
|
||||
// try
|
||||
// {
|
||||
// //
|
||||
// Log($"Start Seeding SubCategory: {subcat.Titles.Locales.ToArray()[0].Value} ...");
|
||||
|
||||
// //
|
||||
// subCategoryProvider.Refresh(
|
||||
// userInfo: null,
|
||||
// resource: subcat,
|
||||
// connectionId: null,
|
||||
// cancellationToken: default
|
||||
// )
|
||||
// .GetAwaiter()
|
||||
// .GetResult();
|
||||
|
||||
// //
|
||||
// Log($"Seeding SubCategory: {subcat.Titles.Locales.ToArray()[0].Value} Finished Successfully ...");
|
||||
// }
|
||||
// catch (Exception ex)
|
||||
// {
|
||||
// Log($"Seeding SubCategory: {subcat.Titles.Locales.ToArray()[0].Value} Failed due: {ex.Message} ...");
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
// //
|
||||
// Log("Finish Seeding ...");
|
||||
// }
|
||||
// }
|
||||
// Using XAiMcpServer Repository Descriptor ...
|
||||
if (!aiMcpServerDescriptor.IsNull())
|
||||
{
|
||||
//
|
||||
app.UseXRepository(
|
||||
descriptor: aiMcpServerDescriptor,
|
||||
isDevelopmentEnvironment: isDevelopmentEnvironment
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
@@ -253,6 +164,7 @@ namespace xAiModels.DI
|
||||
private static XRepositoryDescriptor aiVectorDescriptor = null;
|
||||
private static XRepositoryDescriptor aiMessageDescriptor = null;
|
||||
private static XRepositoryDescriptor aiProjectDescriptor = null;
|
||||
private static XRepositoryDescriptor aiMcpServerDescriptor = null;
|
||||
private static XRepositoryDescriptor aiConversationDescriptor = null;
|
||||
|
||||
/// <summary>
|
||||
@@ -355,6 +267,15 @@ namespace xAiModels.DI
|
||||
methodName: XAiModelsConstants.GetXAiProjectEFRepositoryDescriptor
|
||||
);
|
||||
|
||||
//
|
||||
// XAiMcpServer ...
|
||||
aiMcpServerDescriptor = typeof(XAiModelsHelper)
|
||||
.InvokeGenericMethod<XRepositoryDescriptor>(
|
||||
args: null,
|
||||
runtimeType: contextType,
|
||||
methodName: XAiModelsConstants.GetXAiMcpServerEFRepositoryDescriptor
|
||||
);
|
||||
|
||||
//
|
||||
// XAiConversation ...
|
||||
aiConversationDescriptor = typeof(XAiModelsHelper)
|
||||
@@ -379,6 +300,10 @@ namespace xAiModels.DI
|
||||
// XAiProject ...
|
||||
aiProjectDescriptor = XAiModelsHelper.GetXAiProjectMongoRepositoryDescriptor();
|
||||
|
||||
//
|
||||
// XAiMcpServer ...
|
||||
aiMcpServerDescriptor = XAiModelsHelper.GetXAiMcpServerMongoRepositoryDescriptor();
|
||||
|
||||
//
|
||||
// XAiConversation ...
|
||||
aiConversationDescriptor = XAiModelsHelper.GetXAiConversationMongoRepositoryDescriptor();
|
||||
@@ -398,6 +323,10 @@ namespace xAiModels.DI
|
||||
// XAiProject ...
|
||||
aiProjectDescriptor = XAiModelsHelper.GetXAiProjectInMemoryRepositoryDescriptor();
|
||||
|
||||
//
|
||||
// XAiMcpServer ...
|
||||
aiMcpServerDescriptor = XAiModelsHelper.GetXAiMcpServerInMemoryRepositoryDescriptor();
|
||||
|
||||
//
|
||||
// XAiConversation ...
|
||||
aiConversationDescriptor = XAiModelsHelper.GetXAiConversationInMemoryRepositoryDescriptor();
|
||||
@@ -439,6 +368,17 @@ namespace xAiModels.DI
|
||||
);
|
||||
}
|
||||
|
||||
//
|
||||
// XAiMcpServer ...
|
||||
if (!aiMcpServerDescriptor.IsNull())
|
||||
{
|
||||
//
|
||||
services.AddXRepository(
|
||||
lifeTime: lifeTime,
|
||||
descriptor: aiMcpServerDescriptor
|
||||
);
|
||||
}
|
||||
|
||||
//
|
||||
// XAiConversation ...
|
||||
if (!aiConversationDescriptor.IsNull())
|
||||
@@ -522,6 +462,26 @@ namespace xAiModels.DI
|
||||
);
|
||||
#endregion
|
||||
|
||||
//
|
||||
#region AiMcpServer ...
|
||||
//
|
||||
services.Add(
|
||||
new ServiceDescriptor(typeof(IXAiMcpServerServiceProvider), typeof(XAiMcpServerServiceProvider), lifeTime)
|
||||
);
|
||||
services.Add(
|
||||
new ServiceDescriptor(typeof(IXAiMcpServerRepositoryService), typeof(XAiMcpServerRepositoryService), lifeTime)
|
||||
);
|
||||
services.Add(
|
||||
new ServiceDescriptor(typeof(IXAiMcpServerRepositoryProvider), typeof(XAiMcpServerRepositoryProvider), lifeTime)
|
||||
);
|
||||
|
||||
//
|
||||
// Enrichers ...
|
||||
services.Add(
|
||||
new ServiceDescriptor(typeof(IXAiMcpServerEnricher), typeof(XAiMcpServerEnricher), lifeTime)
|
||||
);
|
||||
#endregion
|
||||
|
||||
//
|
||||
#region AiConversation ...
|
||||
//
|
||||
|
||||
@@ -111,6 +111,36 @@ namespace xAiModels.Extensions
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Validate a McpServer for Add Or Update ...
|
||||
/// </summary>
|
||||
/// <param name="source"></param>
|
||||
/// <returns></returns>
|
||||
public static bool IsValidForAddOrUpdate(this XAiMcpServer source)
|
||||
{
|
||||
//
|
||||
var result =
|
||||
!source.IsNullOrDefault() &&
|
||||
!source.Name.IsNullOrEmpty() &&
|
||||
!source.OwnerId.IsNullOrEmpty() &&
|
||||
!source.Endpoint.IsNullOrEmpty();
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
public static bool IsValidForAddOrUpdate(this XAiMcpServerDto source)
|
||||
{
|
||||
//
|
||||
var result =
|
||||
!source.IsNullOrDefault() &&
|
||||
!source.Name.IsNullOrEmpty() &&
|
||||
!source.OwnerId.IsNullOrEmpty() &&
|
||||
!source.Endpoint.IsNullOrEmpty();
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Validate a Model Descriptor ...
|
||||
/// </summary>
|
||||
|
||||
@@ -1079,5 +1079,272 @@ namespace xAiModels.Helpers
|
||||
}
|
||||
#endregion
|
||||
#endregion
|
||||
|
||||
//
|
||||
#region XAiMcpServer ...
|
||||
//
|
||||
#region EF Repository Descriptor Provider(s) ...
|
||||
public static XEFRepositoryDescriptor<
|
||||
XAiMcpServer,
|
||||
Guid,
|
||||
IXAiMcpServerKeyGenerator,
|
||||
XAiMcpServerKeyGenerator,
|
||||
IXAiMcpServerRepositoryEvents,
|
||||
XAiMcpServerRepositoryEvents,
|
||||
XAiMcpServerGraphType,
|
||||
GuidGraphType,
|
||||
XAiMcpServerGraphQuery,
|
||||
IXAiMcpServerGraphQLTypeHelper,
|
||||
XAiMcpServerGraphQLTypeHelper,
|
||||
XAiMcpServerGraphSchema,
|
||||
IXAiMcpServerRepository,
|
||||
XAiMcpServerEFRepository<TContext>,
|
||||
TContext
|
||||
> GetXAiMcpServerEFRepositoryDescriptor<TContext>()
|
||||
where TContext : XDbContext
|
||||
{
|
||||
//
|
||||
var result = new XEFRepositoryDescriptor<
|
||||
XAiMcpServer,
|
||||
Guid,
|
||||
IXAiMcpServerKeyGenerator,
|
||||
XAiMcpServerKeyGenerator,
|
||||
IXAiMcpServerRepositoryEvents,
|
||||
XAiMcpServerRepositoryEvents,
|
||||
XAiMcpServerGraphType,
|
||||
GuidGraphType,
|
||||
XAiMcpServerGraphQuery,
|
||||
IXAiMcpServerGraphQLTypeHelper,
|
||||
XAiMcpServerGraphQLTypeHelper,
|
||||
XAiMcpServerGraphSchema,
|
||||
IXAiMcpServerRepository,
|
||||
XAiMcpServerEFRepository<TContext>,
|
||||
TContext
|
||||
>();
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
|
||||
public static XEFRepositoryDescriptor<
|
||||
XAiMcpServer,
|
||||
Guid,
|
||||
IXAiMcpServerKeyGenerator,
|
||||
XAiMcpServerKeyGenerator,
|
||||
IXAiMcpServerRepositoryEvents,
|
||||
XAiMcpServerRepositoryEvents,
|
||||
XAiMcpServerGraphType,
|
||||
GuidGraphType,
|
||||
XAiMcpServerGraphQuery,
|
||||
IXAiMcpServerGraphQLTypeHelper,
|
||||
XAiMcpServerGraphQLTypeHelper,
|
||||
XAiMcpServerGraphSchema,
|
||||
IXAiMcpServerRepository,
|
||||
XAiMcpServerEFRepository<TContext>,
|
||||
TContext,
|
||||
IXAiMcpServerSeeder,
|
||||
TSeederImplementation
|
||||
> GetXAiMcpServerEFRepositoryDescriptor<TContext, TSeederImplementation>()
|
||||
where TContext : XDbContext
|
||||
where TSeederImplementation : XBaseDbSeeder<XAiMcpServer, Guid>
|
||||
{
|
||||
//
|
||||
var result = new XEFRepositoryDescriptor<
|
||||
XAiMcpServer,
|
||||
Guid,
|
||||
IXAiMcpServerKeyGenerator,
|
||||
XAiMcpServerKeyGenerator,
|
||||
IXAiMcpServerRepositoryEvents,
|
||||
XAiMcpServerRepositoryEvents,
|
||||
XAiMcpServerGraphType,
|
||||
GuidGraphType,
|
||||
XAiMcpServerGraphQuery,
|
||||
IXAiMcpServerGraphQLTypeHelper,
|
||||
XAiMcpServerGraphQLTypeHelper,
|
||||
XAiMcpServerGraphSchema,
|
||||
IXAiMcpServerRepository,
|
||||
XAiMcpServerEFRepository<TContext>,
|
||||
TContext,
|
||||
IXAiMcpServerSeeder,
|
||||
TSeederImplementation
|
||||
>();
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
#endregion
|
||||
|
||||
//
|
||||
#region Mongo Repository Descriptor Provider(s) ...
|
||||
public static XMongoRepositoryDescriptor<
|
||||
XAiMcpServer,
|
||||
Guid,
|
||||
IXAiMcpServerKeyGenerator,
|
||||
XAiMcpServerKeyGenerator,
|
||||
IXAiMcpServerRepositoryEvents,
|
||||
XAiMcpServerRepositoryEvents,
|
||||
XAiMcpServerGraphType,
|
||||
GuidGraphType,
|
||||
XAiMcpServerGraphQuery,
|
||||
IXAiMcpServerGraphQLTypeHelper,
|
||||
XAiMcpServerGraphQLTypeHelper,
|
||||
XAiMcpServerGraphSchema,
|
||||
IXAiMcpServerRepository,
|
||||
XAiMcpServerMongoRepository
|
||||
> GetXAiMcpServerMongoRepositoryDescriptor()
|
||||
{
|
||||
//
|
||||
var result = new XMongoRepositoryDescriptor<
|
||||
XAiMcpServer,
|
||||
Guid,
|
||||
IXAiMcpServerKeyGenerator,
|
||||
XAiMcpServerKeyGenerator,
|
||||
IXAiMcpServerRepositoryEvents,
|
||||
XAiMcpServerRepositoryEvents,
|
||||
XAiMcpServerGraphType,
|
||||
GuidGraphType,
|
||||
XAiMcpServerGraphQuery,
|
||||
IXAiMcpServerGraphQLTypeHelper,
|
||||
XAiMcpServerGraphQLTypeHelper,
|
||||
XAiMcpServerGraphSchema,
|
||||
IXAiMcpServerRepository,
|
||||
XAiMcpServerMongoRepository
|
||||
>();
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
|
||||
public static XMongoRepositoryDescriptor<
|
||||
XAiMcpServer,
|
||||
Guid,
|
||||
IXAiMcpServerKeyGenerator,
|
||||
XAiMcpServerKeyGenerator,
|
||||
IXAiMcpServerRepositoryEvents,
|
||||
XAiMcpServerRepositoryEvents,
|
||||
XAiMcpServerGraphType,
|
||||
GuidGraphType,
|
||||
XAiMcpServerGraphQuery,
|
||||
IXAiMcpServerGraphQLTypeHelper,
|
||||
XAiMcpServerGraphQLTypeHelper,
|
||||
XAiMcpServerGraphSchema,
|
||||
IXAiMcpServerRepository,
|
||||
XAiMcpServerMongoRepository,
|
||||
IXAiMcpServerSeeder,
|
||||
TSeederImplementation
|
||||
> GetXAiMcpServerMongoRepositoryDescriptor<TSeederImplementation>()
|
||||
where TSeederImplementation : XBaseDbSeeder<XAiMcpServer, Guid>
|
||||
{
|
||||
//
|
||||
var result = new XMongoRepositoryDescriptor<
|
||||
XAiMcpServer,
|
||||
Guid,
|
||||
IXAiMcpServerKeyGenerator,
|
||||
XAiMcpServerKeyGenerator,
|
||||
IXAiMcpServerRepositoryEvents,
|
||||
XAiMcpServerRepositoryEvents,
|
||||
XAiMcpServerGraphType,
|
||||
GuidGraphType,
|
||||
XAiMcpServerGraphQuery,
|
||||
IXAiMcpServerGraphQLTypeHelper,
|
||||
XAiMcpServerGraphQLTypeHelper,
|
||||
XAiMcpServerGraphSchema,
|
||||
IXAiMcpServerRepository,
|
||||
XAiMcpServerMongoRepository,
|
||||
IXAiMcpServerSeeder,
|
||||
TSeederImplementation
|
||||
>();
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
#endregion
|
||||
|
||||
//
|
||||
#region InMemory Repository Descriptor Provider(s) ...
|
||||
public static XInMemoryRepositoryDescriptor<
|
||||
XAiMcpServer,
|
||||
Guid,
|
||||
IXAiMcpServerKeyGenerator,
|
||||
XAiMcpServerKeyGenerator,
|
||||
IXAiMcpServerRepositoryEvents,
|
||||
XAiMcpServerRepositoryEvents,
|
||||
XAiMcpServerGraphType,
|
||||
GuidGraphType,
|
||||
XAiMcpServerGraphQuery,
|
||||
IXAiMcpServerGraphQLTypeHelper,
|
||||
XAiMcpServerGraphQLTypeHelper,
|
||||
XAiMcpServerGraphSchema,
|
||||
IXAiMcpServerRepository,
|
||||
XAiMcpServerInMemoryRepository
|
||||
> GetXAiMcpServerInMemoryRepositoryDescriptor()
|
||||
{
|
||||
//
|
||||
var result = new XInMemoryRepositoryDescriptor<
|
||||
XAiMcpServer,
|
||||
Guid,
|
||||
IXAiMcpServerKeyGenerator,
|
||||
XAiMcpServerKeyGenerator,
|
||||
IXAiMcpServerRepositoryEvents,
|
||||
XAiMcpServerRepositoryEvents,
|
||||
XAiMcpServerGraphType,
|
||||
GuidGraphType,
|
||||
XAiMcpServerGraphQuery,
|
||||
IXAiMcpServerGraphQLTypeHelper,
|
||||
XAiMcpServerGraphQLTypeHelper,
|
||||
XAiMcpServerGraphSchema,
|
||||
IXAiMcpServerRepository,
|
||||
XAiMcpServerInMemoryRepository
|
||||
>();
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
|
||||
public static XInMemoryRepositoryDescriptor<
|
||||
XAiMcpServer,
|
||||
Guid,
|
||||
IXAiMcpServerKeyGenerator,
|
||||
XAiMcpServerKeyGenerator,
|
||||
IXAiMcpServerRepositoryEvents,
|
||||
XAiMcpServerRepositoryEvents,
|
||||
XAiMcpServerGraphType,
|
||||
GuidGraphType,
|
||||
XAiMcpServerGraphQuery,
|
||||
IXAiMcpServerGraphQLTypeHelper,
|
||||
XAiMcpServerGraphQLTypeHelper,
|
||||
XAiMcpServerGraphSchema,
|
||||
IXAiMcpServerRepository,
|
||||
XAiMcpServerInMemoryRepository,
|
||||
IXAiMcpServerSeeder,
|
||||
TSeederImplementation
|
||||
> GetXAiMcpServerInMemoryRepositoryDescriptor<TSeederImplementation>()
|
||||
where TSeederImplementation : XBaseDbSeeder<XAiMcpServer, Guid>
|
||||
{
|
||||
//
|
||||
var result = new XInMemoryRepositoryDescriptor<
|
||||
XAiMcpServer,
|
||||
Guid,
|
||||
IXAiMcpServerKeyGenerator,
|
||||
XAiMcpServerKeyGenerator,
|
||||
IXAiMcpServerRepositoryEvents,
|
||||
XAiMcpServerRepositoryEvents,
|
||||
XAiMcpServerGraphType,
|
||||
GuidGraphType,
|
||||
XAiMcpServerGraphQuery,
|
||||
IXAiMcpServerGraphQLTypeHelper,
|
||||
XAiMcpServerGraphQLTypeHelper,
|
||||
XAiMcpServerGraphSchema,
|
||||
IXAiMcpServerRepository,
|
||||
XAiMcpServerInMemoryRepository,
|
||||
IXAiMcpServerSeeder,
|
||||
TSeederImplementation
|
||||
>();
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
#endregion
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
using System;
|
||||
using xDataService.Interfaces;
|
||||
using xAiModels.Models.Entities;
|
||||
|
||||
namespace xAiModels.Interfaces.Entities
|
||||
{
|
||||
public interface IXAiMcpServerSeeder : IXBaseDbSeeder<XAiMcpServer, Guid>
|
||||
{ }
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
using System;
|
||||
using xModels.Base;
|
||||
using xModels.Dtos;
|
||||
using xAiModels.Constants;
|
||||
|
||||
namespace xAiModels.Models.Dtos
|
||||
{
|
||||
@@ -12,6 +13,11 @@ namespace xAiModels.Models.Dtos
|
||||
public string OwnerId { get; set; }
|
||||
public virtual XPersonDto Owner { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Specified Which Scope can Use MCP Server ...
|
||||
/// </summary>
|
||||
public XAiMcpServerUsageScope Scope { get; set; } = XAiMcpServerUsageScope.Owner;
|
||||
|
||||
/// <summary>
|
||||
/// MCP Server Name ...
|
||||
/// </summary>
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using xModels.Base;
|
||||
using xAiModels.Constants;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace xAiModels.Models.Entities
|
||||
@@ -16,6 +17,11 @@ namespace xAiModels.Models.Entities
|
||||
[StringLength(255)]
|
||||
public string OwnerId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Specified Which Scope can Use MCP Server ...
|
||||
/// </summary>
|
||||
public XAiMcpServerUsageScope Scope { get; set; } = XAiMcpServerUsageScope.Owner;
|
||||
|
||||
/// <summary>
|
||||
/// MCP Server Name ...
|
||||
/// </summary>
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
using System;
|
||||
using xDataService.Providers;
|
||||
using xAiModels.Models.Entities;
|
||||
using xDataService.Configuration;
|
||||
using xAiModels.Interfaces.Entities;
|
||||
|
||||
namespace xAiModels.Providers.Entities
|
||||
{
|
||||
public abstract class XAiMcpServerSeederBase : XBaseDbSeeder<XAiMcpServer, Guid>, IXAiMcpServerSeeder
|
||||
{
|
||||
protected XAiMcpServerSeederBase(
|
||||
string entity,
|
||||
string database,
|
||||
IXAiMcpServerRepository repository,
|
||||
XDataServiceConfiguration dataServiceConfiguration
|
||||
) : base(
|
||||
entity,
|
||||
database,
|
||||
repository,
|
||||
dataServiceConfiguration
|
||||
)
|
||||
{ }
|
||||
}
|
||||
}
|
||||
@@ -100,90 +100,6 @@ namespace xAiModels.Providers.Hubs
|
||||
}
|
||||
#endregion
|
||||
|
||||
//
|
||||
#region XAiConversation ...
|
||||
/// <summary>
|
||||
/// Notify a New Item Created ...
|
||||
/// </summary>
|
||||
/// <param name="item"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public async Task ConversationCreated(
|
||||
XAiProjectDto item,
|
||||
CancellationToken cancellationToken = default
|
||||
)
|
||||
{
|
||||
//
|
||||
var connectionId = Context.ConnectionId;
|
||||
if (!connectionId.IsNullOrEmpty())
|
||||
{
|
||||
//
|
||||
await Clients
|
||||
.AllExcept(connectionId)
|
||||
.SendAsync(
|
||||
XAiDataProviderHubActions.ConversationCreated.GetStringValue(),
|
||||
item.ToJSON(camelCase: true),
|
||||
connectionId,
|
||||
cancellationToken
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Notify an Item Removed ...
|
||||
/// </summary>
|
||||
/// <param name="item"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public async Task ConversationRemoved(
|
||||
XAiProjectDto item,
|
||||
CancellationToken cancellationToken = default
|
||||
)
|
||||
{
|
||||
//
|
||||
var connectionId = Context.ConnectionId;
|
||||
if (!connectionId.IsNullOrEmpty())
|
||||
{
|
||||
//
|
||||
await Clients
|
||||
.AllExcept(connectionId)
|
||||
.SendAsync(
|
||||
XAiDataProviderHubActions.ConversationRemoved.GetStringValue(),
|
||||
item.ToJSON(camelCase: true),
|
||||
connectionId,
|
||||
cancellationToken
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Notify an Item Updated ...
|
||||
/// </summary>
|
||||
/// <param name="item"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public async Task ConversationUpdated(
|
||||
XAiProjectDto item,
|
||||
CancellationToken cancellationToken = default
|
||||
)
|
||||
{
|
||||
//
|
||||
var connectionId = Context.ConnectionId;
|
||||
if (!connectionId.IsNullOrEmpty())
|
||||
{
|
||||
//
|
||||
await Clients
|
||||
.AllExcept(connectionId)
|
||||
.SendAsync(
|
||||
XAiDataProviderHubActions.ConversationUpdated.GetStringValue(),
|
||||
item.ToJSON(camelCase: true),
|
||||
connectionId,
|
||||
cancellationToken
|
||||
);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
//
|
||||
#region XAiMessage ...
|
||||
/// <summary>
|
||||
@@ -267,5 +183,173 @@ namespace xAiModels.Providers.Hubs
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
//
|
||||
#region XAiMcpServer ...
|
||||
/// <summary>
|
||||
/// Notify a New Item Created ...
|
||||
/// </summary>
|
||||
/// <param name="item"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public async Task McpServerCreated(
|
||||
XAiMcpServerDto item,
|
||||
CancellationToken cancellationToken = default
|
||||
)
|
||||
{
|
||||
//
|
||||
var connectionId = Context.ConnectionId;
|
||||
if (!connectionId.IsNullOrEmpty())
|
||||
{
|
||||
//
|
||||
await Clients
|
||||
.AllExcept(connectionId)
|
||||
.SendAsync(
|
||||
XAiDataProviderHubActions.McpServerCreated.GetStringValue(),
|
||||
item.ToJSON(camelCase: true),
|
||||
connectionId,
|
||||
cancellationToken
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Notify an Item Removed ...
|
||||
/// </summary>
|
||||
/// <param name="item"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public async Task McpServerRemoved(
|
||||
XAiMcpServerDto item,
|
||||
CancellationToken cancellationToken = default
|
||||
)
|
||||
{
|
||||
//
|
||||
var connectionId = Context.ConnectionId;
|
||||
if (!connectionId.IsNullOrEmpty())
|
||||
{
|
||||
//
|
||||
await Clients
|
||||
.AllExcept(connectionId)
|
||||
.SendAsync(
|
||||
XAiDataProviderHubActions.McpServerRemoved.GetStringValue(),
|
||||
item.ToJSON(camelCase: true),
|
||||
connectionId,
|
||||
cancellationToken
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Notify an Item Updated ...
|
||||
/// </summary>
|
||||
/// <param name="item"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public async Task McpServerUpdated(
|
||||
XAiMcpServerDto item,
|
||||
CancellationToken cancellationToken = default
|
||||
)
|
||||
{
|
||||
//
|
||||
var connectionId = Context.ConnectionId;
|
||||
if (!connectionId.IsNullOrEmpty())
|
||||
{
|
||||
//
|
||||
await Clients
|
||||
.AllExcept(connectionId)
|
||||
.SendAsync(
|
||||
XAiDataProviderHubActions.McpServerUpdated.GetStringValue(),
|
||||
item.ToJSON(camelCase: true),
|
||||
connectionId,
|
||||
cancellationToken
|
||||
);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
//
|
||||
#region XAiConversation ...
|
||||
/// <summary>
|
||||
/// Notify a New Item Created ...
|
||||
/// </summary>
|
||||
/// <param name="item"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public async Task ConversationCreated(
|
||||
XAiProjectDto item,
|
||||
CancellationToken cancellationToken = default
|
||||
)
|
||||
{
|
||||
//
|
||||
var connectionId = Context.ConnectionId;
|
||||
if (!connectionId.IsNullOrEmpty())
|
||||
{
|
||||
//
|
||||
await Clients
|
||||
.AllExcept(connectionId)
|
||||
.SendAsync(
|
||||
XAiDataProviderHubActions.ConversationCreated.GetStringValue(),
|
||||
item.ToJSON(camelCase: true),
|
||||
connectionId,
|
||||
cancellationToken
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Notify an Item Removed ...
|
||||
/// </summary>
|
||||
/// <param name="item"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public async Task ConversationRemoved(
|
||||
XAiProjectDto item,
|
||||
CancellationToken cancellationToken = default
|
||||
)
|
||||
{
|
||||
//
|
||||
var connectionId = Context.ConnectionId;
|
||||
if (!connectionId.IsNullOrEmpty())
|
||||
{
|
||||
//
|
||||
await Clients
|
||||
.AllExcept(connectionId)
|
||||
.SendAsync(
|
||||
XAiDataProviderHubActions.ConversationRemoved.GetStringValue(),
|
||||
item.ToJSON(camelCase: true),
|
||||
connectionId,
|
||||
cancellationToken
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Notify an Item Updated ...
|
||||
/// </summary>
|
||||
/// <param name="item"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public async Task ConversationUpdated(
|
||||
XAiProjectDto item,
|
||||
CancellationToken cancellationToken = default
|
||||
)
|
||||
{
|
||||
//
|
||||
var connectionId = Context.ConnectionId;
|
||||
if (!connectionId.IsNullOrEmpty())
|
||||
{
|
||||
//
|
||||
await Clients
|
||||
.AllExcept(connectionId)
|
||||
.SendAsync(
|
||||
XAiDataProviderHubActions.ConversationUpdated.GetStringValue(),
|
||||
item.ToJSON(camelCase: true),
|
||||
connectionId,
|
||||
cancellationToken
|
||||
);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
+229
-142
@@ -38,10 +38,13 @@ namespace xAiModels.Providers
|
||||
private readonly IXAiMessageEnricher messageEnricher;
|
||||
private readonly IXAiProjectEnricher projectEnricher;
|
||||
private readonly IXAiVectorRepository vectorRepository;
|
||||
private readonly IXAiMcpServerEnricher mcpServerEnricher;
|
||||
private readonly IXAiMcpServerRepository mcpServerRepository;
|
||||
private readonly IXAiConversationEnricher conversationEnricher;
|
||||
private readonly IXAiVectorRepositoryService vectorRepositoryService;
|
||||
private readonly IXAiMessageRepositoryService messageRepositoryService;
|
||||
private readonly IXAiProjectRepositoryService projectRepositoryService;
|
||||
private readonly IXAiMcpServerRepositoryService mcpServerRepositoryService;
|
||||
private readonly IXAiProjectTitleResourceProvider projectTitleResourceProvider;
|
||||
private readonly IXAiConversationRepositoryService conversationRepositoryService;
|
||||
private readonly IXAiConversationTitleResourceProvider conversationTitleResourceProvider;
|
||||
@@ -56,10 +59,13 @@ namespace xAiModels.Providers
|
||||
IXAiProjectEnricher projectEnricher,
|
||||
IXAiMessageEnricher messageEnricher,
|
||||
IXAiVectorRepository vectorRepository,
|
||||
IXAiMcpServerEnricher mcpServerEnricher,
|
||||
IXAiMcpServerRepository mcpServerRepository,
|
||||
IXAiConversationEnricher conversationEnricher,
|
||||
IXAiVectorRepositoryService vectorRepositoryService,
|
||||
IXAiMessageRepositoryService messageRepositoryService,
|
||||
IXAiProjectRepositoryService projectRepositoryService,
|
||||
IXAiMcpServerRepositoryService mcpServerRepositoryService,
|
||||
IXAiProjectTitleResourceProvider projectTitleResourceProvider,
|
||||
IXAiConversationRepositoryService conversationRepositoryService,
|
||||
IXAiConversationTitleResourceProvider conversationTitleResourceProvider,
|
||||
@@ -73,10 +79,13 @@ namespace xAiModels.Providers
|
||||
this.messageEnricher = messageEnricher;
|
||||
this.appConfiguration = appConfiguration;
|
||||
this.vectorRepository = vectorRepository;
|
||||
this.mcpServerEnricher = mcpServerEnricher;
|
||||
this.mcpServerRepository = mcpServerRepository;
|
||||
this.conversationEnricher = conversationEnricher;
|
||||
this.vectorRepositoryService = vectorRepositoryService;
|
||||
this.messageRepositoryService = messageRepositoryService;
|
||||
this.projectRepositoryService = projectRepositoryService;
|
||||
this.mcpServerRepositoryService = mcpServerRepositoryService;
|
||||
this.projectTitleResourceProvider = projectTitleResourceProvider;
|
||||
this.conversationRepositoryService = conversationRepositoryService;
|
||||
this.conversationTitleResourceProvider = conversationTitleResourceProvider;
|
||||
@@ -1149,6 +1158,111 @@ namespace xAiModels.Providers
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Query Messages ...
|
||||
/// </summary>
|
||||
/// <param name="ownerId"></param>
|
||||
/// <param name="conversationId"></param>
|
||||
/// <param name="query"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<XQueryResult<XAiMessageDto>> QueryMessages(
|
||||
string ownerId,
|
||||
Guid conversationId,
|
||||
XQuery query,
|
||||
CancellationToken cancellationToken = default
|
||||
)
|
||||
{
|
||||
//
|
||||
// Validate ...
|
||||
if (conversationId.IsDefaultGuid())
|
||||
{
|
||||
XException.InvalidArgs.Throw();
|
||||
}
|
||||
|
||||
//
|
||||
// Retrieve Conversation ...
|
||||
var conversation = await conversationRepositoryService.GetAsync(
|
||||
id: conversationId,
|
||||
includeBuilder: null,
|
||||
ignoreSoftDeleteds: true,
|
||||
cancellationToken: cancellationToken
|
||||
);
|
||||
if (conversation.IsNullOrDefault())
|
||||
{
|
||||
XException.NotFound.Throw();
|
||||
}
|
||||
|
||||
//
|
||||
Expression<Func<XAiMessage, bool>> predicate = x =>
|
||||
x.ConversationId == conversationId;
|
||||
if (!ownerId.IsNullOrEmpty())
|
||||
{
|
||||
//
|
||||
predicate = x =>
|
||||
x.OwnerId == ownerId &&
|
||||
x.ConversationId == conversationId;
|
||||
}
|
||||
|
||||
//
|
||||
var result = await messageRepositoryService.QueryAsync(
|
||||
query: query,
|
||||
predicate: predicate,
|
||||
includeBuilder: null,
|
||||
ignoreSoftDeleteds: true,
|
||||
cancellationToken: cancellationToken,
|
||||
orderBuilder: x => x.OrderBy(y => y.CreatedOn)
|
||||
);
|
||||
if (!result.IsNullOrDefault() &&
|
||||
result.Items.HasChild())
|
||||
{
|
||||
//
|
||||
result.Items = [..await EnrichRange(
|
||||
sources: result.Items,
|
||||
cancellationToken: cancellationToken
|
||||
)];
|
||||
}
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Query McpServers ...
|
||||
/// </summary>
|
||||
/// <param name="query"></param>
|
||||
/// <param name="predicate"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<XQueryResult<XAiMcpServerDto>> QueryMcpServers(
|
||||
XQuery query,
|
||||
Expression<Func<XAiMcpServer, bool>> predicate = null,
|
||||
CancellationToken cancellationToken = default
|
||||
)
|
||||
{
|
||||
//
|
||||
var result = await mcpServerRepositoryService.QueryAsync(
|
||||
query: query,
|
||||
predicate: predicate,
|
||||
includeBuilder: null,
|
||||
ignoreSoftDeleteds: true,
|
||||
cancellationToken: cancellationToken,
|
||||
orderBuilder: x => x.OrderBy(y => y.CreatedOn)
|
||||
);
|
||||
if (!result.IsNullOrDefault() &&
|
||||
result.Items.HasChild())
|
||||
{
|
||||
//
|
||||
result.Items = [..await EnrichRange(
|
||||
sources: result.Items,
|
||||
cancellationToken: cancellationToken
|
||||
)];
|
||||
}
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Query Conversations ...
|
||||
/// </summary>
|
||||
@@ -1218,75 +1332,6 @@ namespace xAiModels.Providers
|
||||
//
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Query Messages ...
|
||||
/// </summary>
|
||||
/// <param name="ownerId"></param>
|
||||
/// <param name="conversationId"></param>
|
||||
/// <param name="query"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<XQueryResult<XAiMessageDto>> QueryMessages(
|
||||
string ownerId,
|
||||
Guid conversationId,
|
||||
XQuery query,
|
||||
CancellationToken cancellationToken = default
|
||||
)
|
||||
{
|
||||
//
|
||||
// Validate ...
|
||||
if (conversationId.IsDefaultGuid())
|
||||
{
|
||||
XException.InvalidArgs.Throw();
|
||||
}
|
||||
|
||||
//
|
||||
// Retrieve Conversation ...
|
||||
var conversation = await conversationRepositoryService.GetAsync(
|
||||
id: conversationId,
|
||||
includeBuilder: null,
|
||||
ignoreSoftDeleteds: true,
|
||||
cancellationToken: cancellationToken
|
||||
);
|
||||
if (conversation.IsNullOrDefault())
|
||||
{
|
||||
XException.NotFound.Throw();
|
||||
}
|
||||
|
||||
//
|
||||
Expression<Func<XAiMessage, bool>> predicate = x =>
|
||||
x.ConversationId == conversationId;
|
||||
if (!ownerId.IsNullOrEmpty())
|
||||
{
|
||||
//
|
||||
predicate = x =>
|
||||
x.OwnerId == ownerId &&
|
||||
x.ConversationId == conversationId;
|
||||
}
|
||||
|
||||
//
|
||||
var result = await messageRepositoryService.QueryAsync(
|
||||
query: query,
|
||||
predicate: predicate,
|
||||
includeBuilder: null,
|
||||
ignoreSoftDeleteds: true,
|
||||
cancellationToken: cancellationToken,
|
||||
orderBuilder: x => x.OrderBy(y => y.CreatedOn)
|
||||
);
|
||||
if (!result.IsNullOrDefault() &&
|
||||
result.Items.HasChild())
|
||||
{
|
||||
//
|
||||
result.Items = [..await EnrichRange(
|
||||
sources: result.Items,
|
||||
cancellationToken: cancellationToken
|
||||
)];
|
||||
}
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
#endregion
|
||||
|
||||
//
|
||||
@@ -1674,48 +1719,6 @@ namespace xAiModels.Providers
|
||||
|
||||
//
|
||||
#region Enrichers ...
|
||||
/// <summary>
|
||||
/// Enrich Specified Item ...
|
||||
/// </summary>
|
||||
/// <param name="source"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<XAiVectorDto> Enrich(
|
||||
XAiVector source,
|
||||
CancellationToken cancellationToken = default
|
||||
)
|
||||
{
|
||||
//
|
||||
var result = await vectorEnricher.Enrich(
|
||||
source: source,
|
||||
cancellationToken: cancellationToken
|
||||
);
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Enrich Specified Items ...
|
||||
/// </summary>
|
||||
/// <param name="sources"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<IEnumerable<XAiVectorDto>> EnrichRange(
|
||||
IEnumerable<XAiVector> sources,
|
||||
CancellationToken cancellationToken = default
|
||||
)
|
||||
{
|
||||
//
|
||||
var result = await vectorEnricher.EnrichRange(
|
||||
sources: sources,
|
||||
cancellationToken: cancellationToken
|
||||
);
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Enrich Specified Item ...
|
||||
/// </summary>
|
||||
@@ -1738,19 +1741,40 @@ namespace xAiModels.Providers
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Enrich Specified Items ...
|
||||
/// Enrich Specified Item ...
|
||||
/// </summary>
|
||||
/// <param name="sources"></param>
|
||||
/// <param name="source"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<IEnumerable<XAiVectorDto>> EnrichRange(
|
||||
IEnumerable<XAiVectorDto> sources,
|
||||
public async Task<XAiVectorDto> Enrich(
|
||||
XAiVector source,
|
||||
CancellationToken cancellationToken = default
|
||||
)
|
||||
{
|
||||
//
|
||||
var result = await vectorEnricher.EnrichRange(
|
||||
sources: sources,
|
||||
var result = await vectorEnricher.Enrich(
|
||||
source: source,
|
||||
cancellationToken: cancellationToken
|
||||
);
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Enrich Specified Item ...
|
||||
/// </summary>
|
||||
/// <param name="source"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<XAiMessageDto> Enrich(
|
||||
XAiMessageDto source,
|
||||
CancellationToken cancellationToken = default
|
||||
)
|
||||
{
|
||||
//
|
||||
var result = await messageEnricher.Enrich(
|
||||
source: source,
|
||||
cancellationToken: cancellationToken
|
||||
);
|
||||
|
||||
@@ -1786,26 +1810,20 @@ namespace xAiModels.Providers
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Enrich Specified Items ...
|
||||
/// Enrich Specified Item ...
|
||||
/// </summary>
|
||||
/// <param name="sources"></param>
|
||||
/// <param name="fillConversations"></param>
|
||||
/// <param name="fillConversationMessages"></param>
|
||||
/// <param name="source"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<IEnumerable<XAiProjectDto>> EnrichRange(
|
||||
IEnumerable<XAiProjectDto> sources,
|
||||
bool fillConversations = false,
|
||||
bool fillConversationMessages = false,
|
||||
public async Task<XAiMcpServerDto> Enrich(
|
||||
XAiMcpServerDto source,
|
||||
CancellationToken cancellationToken = default
|
||||
)
|
||||
{
|
||||
//
|
||||
var result = await projectEnricher.EnrichRange(
|
||||
sources: sources,
|
||||
fillConversations: fillConversations,
|
||||
cancellationToken: cancellationToken,
|
||||
fillConversationMessages: fillConversationMessages
|
||||
var result = await mcpServerEnricher.Enrich(
|
||||
source: source,
|
||||
cancellationToken: cancellationToken
|
||||
);
|
||||
|
||||
//
|
||||
@@ -1840,19 +1858,16 @@ namespace xAiModels.Providers
|
||||
/// Enrich Specified Items ...
|
||||
/// </summary>
|
||||
/// <param name="sources"></param>
|
||||
/// <param name="fillMessages"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<IEnumerable<XAiConversationDto>> EnrichRange(
|
||||
IEnumerable<XAiConversationDto> sources,
|
||||
bool fillMessages = false,
|
||||
public async Task<IEnumerable<XAiVectorDto>> EnrichRange(
|
||||
IEnumerable<XAiVector> sources,
|
||||
CancellationToken cancellationToken = default
|
||||
)
|
||||
{
|
||||
//
|
||||
var result = await conversationEnricher.EnrichRange(
|
||||
var result = await vectorEnricher.EnrichRange(
|
||||
sources: sources,
|
||||
fillMessages: fillMessages,
|
||||
cancellationToken: cancellationToken
|
||||
);
|
||||
|
||||
@@ -1861,19 +1876,19 @@ namespace xAiModels.Providers
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Enrich Specified Item ...
|
||||
/// Enrich Specified Items ...
|
||||
/// </summary>
|
||||
/// <param name="source"></param>
|
||||
/// <param name="sources"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<XAiMessageDto> Enrich(
|
||||
XAiMessageDto source,
|
||||
public async Task<IEnumerable<XAiVectorDto>> EnrichRange(
|
||||
IEnumerable<XAiVectorDto> sources,
|
||||
CancellationToken cancellationToken = default
|
||||
)
|
||||
{
|
||||
//
|
||||
var result = await messageEnricher.Enrich(
|
||||
source: source,
|
||||
var result = await vectorEnricher.EnrichRange(
|
||||
sources: sources,
|
||||
cancellationToken: cancellationToken
|
||||
);
|
||||
|
||||
@@ -1881,6 +1896,33 @@ namespace xAiModels.Providers
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Enrich Specified Items ...
|
||||
/// </summary>
|
||||
/// <param name="sources"></param>
|
||||
/// <param name="fillConversations"></param>
|
||||
/// <param name="fillConversationMessages"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<IEnumerable<XAiProjectDto>> EnrichRange(
|
||||
IEnumerable<XAiProjectDto> sources,
|
||||
bool fillConversations = false,
|
||||
bool fillConversationMessages = false,
|
||||
CancellationToken cancellationToken = default
|
||||
)
|
||||
{
|
||||
//
|
||||
var result = await projectEnricher.EnrichRange(
|
||||
sources: sources,
|
||||
fillConversations: fillConversations,
|
||||
cancellationToken: cancellationToken,
|
||||
fillConversationMessages: fillConversationMessages
|
||||
);
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Enrich Specified Items ...
|
||||
/// </summary>
|
||||
@@ -1901,6 +1943,51 @@ namespace xAiModels.Providers
|
||||
//
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Enrich Specified Items ...
|
||||
/// </summary>
|
||||
/// <param name="sources"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<IEnumerable<XAiMcpServerDto>> EnrichRange(
|
||||
IEnumerable<XAiMcpServerDto> sources,
|
||||
CancellationToken cancellationToken = default
|
||||
)
|
||||
{
|
||||
//
|
||||
var result = await mcpServerEnricher.EnrichRange(
|
||||
sources: sources,
|
||||
cancellationToken: cancellationToken
|
||||
);
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Enrich Specified Items ...
|
||||
/// </summary>
|
||||
/// <param name="sources"></param>
|
||||
/// <param name="fillMessages"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<IEnumerable<XAiConversationDto>> EnrichRange(
|
||||
IEnumerable<XAiConversationDto> sources,
|
||||
bool fillMessages = false,
|
||||
CancellationToken cancellationToken = default
|
||||
)
|
||||
{
|
||||
//
|
||||
var result = await conversationEnricher.EnrichRange(
|
||||
sources: sources,
|
||||
fillMessages: fillMessages,
|
||||
cancellationToken: cancellationToken
|
||||
);
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
#endregion
|
||||
|
||||
//
|
||||
|
||||
Reference in New Issue
Block a user