Compare commits
5
Commits
1b09b4f6a0
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e1cc28edc6 | ||
|
|
be08a4d287 | ||
|
|
98f6af7ce5 | ||
|
|
0bc45bd8b9 | ||
|
|
63b922f09b |
@@ -1,6 +1,7 @@
|
|||||||
#
|
#
|
||||||
bin/*
|
bin/*
|
||||||
obj/*
|
obj/*
|
||||||
|
Logs
|
||||||
|
|
||||||
#
|
#
|
||||||
Db/*
|
Db/*
|
||||||
|
|||||||
+5
-1
@@ -1,4 +1,5 @@
|
|||||||
using System.Text;
|
using System.Text;
|
||||||
|
using xLoggingService.DI;
|
||||||
using Microsoft.AspNetCore.Hosting;
|
using Microsoft.AspNetCore.Hosting;
|
||||||
using Microsoft.Extensions.Hosting;
|
using Microsoft.Extensions.Hosting;
|
||||||
|
|
||||||
@@ -19,10 +20,13 @@ namespace xAiMcpServer
|
|||||||
{
|
{
|
||||||
//
|
//
|
||||||
var result = Host.CreateDefaultBuilder(args)
|
var result = Host.CreateDefaultBuilder(args)
|
||||||
|
.ConfigureLogging(logging =>
|
||||||
|
logging.AddXTelemetryLogger())
|
||||||
.ConfigureWebHostDefaults(webBuilder =>
|
.ConfigureWebHostDefaults(webBuilder =>
|
||||||
{
|
{
|
||||||
webBuilder.UseStartup<Startup>();
|
webBuilder.UseStartup<Startup>();
|
||||||
});
|
})
|
||||||
|
.AddXTelemetry();
|
||||||
|
|
||||||
//
|
//
|
||||||
return result;
|
return result;
|
||||||
|
|||||||
@@ -21,7 +21,7 @@
|
|||||||
"commandName": "Project",
|
"commandName": "Project",
|
||||||
"launchBrowser": true,
|
"launchBrowser": true,
|
||||||
"launchUrl": "weatherforecast",
|
"launchUrl": "weatherforecast",
|
||||||
"applicationUrl": "https://localhost:7001;http://localhost:7000",
|
"applicationUrl": "https://localhost:7001;http://localhost:7000;https://0.0.0.0:7001;",
|
||||||
"environmentVariables": {
|
"environmentVariables": {
|
||||||
"ASPNETCORE_ENVIRONMENT": "Development"
|
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||||
}
|
}
|
||||||
|
|||||||
+16
@@ -4,6 +4,7 @@ using System.Net.Http;
|
|||||||
using xAiMcpServer.DI;
|
using xAiMcpServer.DI;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
|
using xLoggingService.DI;
|
||||||
using xIdentityService.DI;
|
using xIdentityService.DI;
|
||||||
using xCommons.Extensions;
|
using xCommons.Extensions;
|
||||||
using xAiService.Extensions;
|
using xAiService.Extensions;
|
||||||
@@ -42,6 +43,10 @@ namespace xAiMcpServer
|
|||||||
services.AddXAppConfiguration(Configuration);
|
services.AddXAppConfiguration(Configuration);
|
||||||
var appConfiguration = services.GetRegisteredService<XAppConfiguration>();
|
var appConfiguration = services.GetRegisteredService<XAppConfiguration>();
|
||||||
|
|
||||||
|
//
|
||||||
|
// Register Logging Service ...
|
||||||
|
services.AddXLoggingService(Configuration);
|
||||||
|
|
||||||
//
|
//
|
||||||
// Register Allowed Origins ...
|
// Register Allowed Origins ...
|
||||||
services.AddXCors(appConfiguration.AllowedOrigins);
|
services.AddXCors(appConfiguration.AllowedOrigins);
|
||||||
@@ -112,6 +117,10 @@ namespace xAiMcpServer
|
|||||||
app.UseHsts();
|
app.UseHsts();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// Setting Environment in App Confiuration ...
|
||||||
|
app.AddEnvironmentToXAppConfiguration(env.EnvironmentName);
|
||||||
|
|
||||||
//
|
//
|
||||||
// Force Https Redirection ...
|
// Force Https Redirection ...
|
||||||
app.UseHttpsRedirection();
|
app.UseHttpsRedirection();
|
||||||
@@ -131,6 +140,13 @@ namespace xAiMcpServer
|
|||||||
// Using Routing ...
|
// Using Routing ...
|
||||||
app.UseRouting();
|
app.UseRouting();
|
||||||
|
|
||||||
|
//
|
||||||
|
// Using Request Logging ...
|
||||||
|
if (!isDevelopmentEnvironment)
|
||||||
|
{
|
||||||
|
app.UseXRequestLogger();
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Use xIdentityService (Authentication) ...
|
// Use xIdentityService (Authentication) ...
|
||||||
app.UseXIdentityService();
|
app.UseXIdentityService();
|
||||||
|
|||||||
+1
-1
@@ -28,7 +28,7 @@ namespace xAiMcpServer.Tools
|
|||||||
[XAiMcpTool(
|
[XAiMcpTool(
|
||||||
RequiresAuthentication = true,
|
RequiresAuthentication = true,
|
||||||
RequiredPolicy = XPolicies.EnabledUser,
|
RequiredPolicy = XPolicies.EnabledUser,
|
||||||
Description = "Get information about the currently logged-in user.")]
|
Description = "when user asks anything about itself, use this to retrieve user information.")]
|
||||||
public async Task<string> WhoAmI()
|
public async Task<string> WhoAmI()
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
|
|||||||
@@ -4,6 +4,7 @@
|
|||||||
"DefaultLanguage": "fa-IR",
|
"DefaultLanguage": "fa-IR",
|
||||||
"XPoweredValue": "SaherElmITCenter",
|
"XPoweredValue": "SaherElmITCenter",
|
||||||
"WelcomeMessage": "Welcome to xSaherElm Project's AI Mcp Server",
|
"WelcomeMessage": "Welcome to xSaherElm Project's AI Mcp Server",
|
||||||
|
"DefaultCacheTtlMinutes": 10,
|
||||||
"SwaggerConfiguration": {
|
"SwaggerConfiguration": {
|
||||||
"Version": "v1.0",
|
"Version": "v1.0",
|
||||||
"Title": "xSaherElm AI Mcp Server",
|
"Title": "xSaherElm AI Mcp Server",
|
||||||
@@ -46,6 +47,38 @@
|
|||||||
"HtmlEndpoint": "https://html.duckduckgo.com/html/",
|
"HtmlEndpoint": "https://html.duckduckgo.com/html/",
|
||||||
"LiteEndpoint": "https://lite.duckduckgo.com/lite/"
|
"LiteEndpoint": "https://lite.duckduckgo.com/lite/"
|
||||||
},
|
},
|
||||||
|
"LoggingServiceConfiguration": {
|
||||||
|
"Enabled": true,
|
||||||
|
"MinimumLevel": "Information",
|
||||||
|
"Queue": {
|
||||||
|
"Enabled": true,
|
||||||
|
"Capacity": 10000,
|
||||||
|
"ShutdownTimeoutSeconds": 10
|
||||||
|
},
|
||||||
|
"File": {
|
||||||
|
"Enabled": true,
|
||||||
|
"Format": "Json",
|
||||||
|
"Directory": "./Logs",
|
||||||
|
"RetainedFileCountLimit": 30,
|
||||||
|
"MinimumLevel": "Information",
|
||||||
|
"FileName": "xAiMcpServer-.log"
|
||||||
|
},
|
||||||
|
"Database": {
|
||||||
|
"Enabled": false,
|
||||||
|
"TableName": "XLogs",
|
||||||
|
"AutoCreateTable": true,
|
||||||
|
"MinimumLevel": "Warning",
|
||||||
|
"Provider": "Microsoft.Data.Sqlite",
|
||||||
|
"ConnectionString": "Filename=./Db/XLogs.db"
|
||||||
|
},
|
||||||
|
"Event": {
|
||||||
|
"Enabled": false,
|
||||||
|
"MinimumLevel": "Error",
|
||||||
|
"Sender": "xAiMcpServer",
|
||||||
|
"Topic": "application-logs",
|
||||||
|
"Action": "ApplicationLogCreated"
|
||||||
|
}
|
||||||
|
},
|
||||||
"Logging": {
|
"Logging": {
|
||||||
"LogLevel": {
|
"LogLevel": {
|
||||||
"Microsoft": "Warning",
|
"Microsoft": "Warning",
|
||||||
|
|||||||
@@ -35,6 +35,7 @@
|
|||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ProjectReference Include="../Modules/xCommons/xCommons.csproj" />
|
<ProjectReference Include="../Modules/xCommons/xCommons.csproj" />
|
||||||
<ProjectReference Include="../Modules/xAiService/xAiService.csproj" />
|
<ProjectReference Include="../Modules/xAiService/xAiService.csproj" />
|
||||||
|
<ProjectReference Include="../Modules/xLoggingService/xLoggingService.csproj" />
|
||||||
<ProjectReference Include="../Modules/xIdentityHelper/xIdentityHelper.csproj" />
|
<ProjectReference Include="../Modules/xIdentityHelper/xIdentityHelper.csproj" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user