- Apply Using XUserInfoClaims to RefreshAsync on McpServers ...
- Adding DateTime Prompt Handling in XAiServiceBase ... - Adding Support for Function Tools Attachment into ChatOptions when Asking Ai ... - Adding XDateTimeDescriptor class for Configuring DateTime attaching in Prompt Context, attached it on XAiApiConfiguration and also Configure it in appSettings File ...
This commit is contained in:
@@ -207,13 +207,23 @@ namespace xAiApi.Providers
|
||||
return $"✗ Error: {ex.Message} ...";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Force Refresh Mcp Servers ...
|
||||
/// </summary>
|
||||
/// <param name="userInfo"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public async Task RefreshAsync()
|
||||
public async Task RefreshAsync(
|
||||
XUserClaimsInfoDto userInfo = null,
|
||||
CancellationToken cancellationToken = default
|
||||
)
|
||||
{
|
||||
//
|
||||
if (!userInfo.IsAdmin()) {
|
||||
XException.NotAllowed.Throw();
|
||||
}
|
||||
|
||||
//
|
||||
logger.LogInformation("MCP: Reinitialize Mcp Servers ...");
|
||||
foreach (var client in clients.Values)
|
||||
@@ -230,7 +240,10 @@ namespace xAiApi.Providers
|
||||
|
||||
//
|
||||
isInitialized = false;
|
||||
await GetAvailableToolsAsync(cancellationToken: CancellationToken.None);
|
||||
await GetAvailableToolsAsync(
|
||||
userInfo: userInfo,
|
||||
cancellationToken: cancellationToken
|
||||
);
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
Reference in New Issue
Block a user