This commit is contained in:
2026-11-03 18:56:52 +03:30
parent 62aa8d51e6
commit 9668f26ffe
13 changed files with 876 additions and 340 deletions
+168 -84
View File
@@ -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
}
}