From b58f1dd73615356290654e6600c61365cd068894 Mon Sep 17 00:00:00 2001 From: Hadi Khazaee Asl Date: Sun, 8 Nov 2026 17:59:31 +0330 Subject: [PATCH] last ... --- Constants/XAiApiConstants.cs | 2 +- Providers/XAIServiceBase.cs | 3 +-- Startup.cs | 18 +++++++++++++++--- appsettings.Development.json | 9 ++++++++- appsettings.json | 37 ++++++++++++++++++++++++++++++++++-- xAiApi.csproj | 15 +++------------ 6 files changed, 63 insertions(+), 21 deletions(-) diff --git a/Constants/XAiApiConstants.cs b/Constants/XAiApiConstants.cs index 50302f9..ba0ebf7 100644 --- a/Constants/XAiApiConstants.cs +++ b/Constants/XAiApiConstants.cs @@ -16,7 +16,7 @@ namespace xAiApi.Constants public const string XAiApiContentExtractionPromptName = "ContentExtraction"; // - public const string XAiDefaultModelName = "Gemma"; + public const string XAiDefaultModelName = "Arion"; public const string XAiEmbeddingModelName = "Embed"; public const string XAiDefaultVisionModelName = "Qwen"; public const string XAiDefaultThinkingModelName = "Qwen"; diff --git a/Providers/XAIServiceBase.cs b/Providers/XAIServiceBase.cs index 9a404d5..95b9d49 100644 --- a/Providers/XAIServiceBase.cs +++ b/Providers/XAIServiceBase.cs @@ -27,7 +27,6 @@ using System.Collections.Generic; using Microsoft.Extensions.Logging; using xAiApi.Interfaces.Extractors; using System.Runtime.CompilerServices; -using System.IO; namespace xAiApi.Providers { @@ -130,7 +129,7 @@ namespace xAiApi.Providers ); // - Options.Tools = [.. availableTools.Cast()]; + Options.Tools = [.. availableTools]; } // diff --git a/Startup.cs b/Startup.cs index 532a43c..8744878 100644 --- a/Startup.cs +++ b/Startup.cs @@ -1,8 +1,10 @@ +using xLoggingService.DI; using System; using System.IO; using xAiApi.DI; using System.Linq; using xAiModels.DI; +using xAiService.DI; using xTagService.DI; using System.Net.Http; using xAiApi.Database; @@ -29,7 +31,6 @@ using Newtonsoft.Json.Serialization; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using IdentityModel.AspNetCore.OAuth2Introspection; -using xAiService.DI; namespace xAiApi { @@ -61,6 +62,7 @@ namespace xAiApi public void ConfigureServices(IServiceCollection services) { + services.AddXLoggingService(Configuration); // // Register Validation Provider and all XCommons Module Services ... services.AddXCommons(Configuration); @@ -192,7 +194,7 @@ namespace xAiApi // // Register File Content Extractor Services ... services.AddXAiFileContentExtractors(); - + // // Register Text Chunker Service ... services.AddXAiTextChunker(); @@ -214,7 +216,10 @@ namespace xAiApi services.AddXAiServices(); } - public void Configure(IApplicationBuilder app, IWebHostEnvironment env) + public void Configure( + IApplicationBuilder app, + IWebHostEnvironment env + ) { // // Configure the HTTP request pipeline. @@ -231,6 +236,10 @@ namespace xAiApi app.UseHsts(); } + // + // Setting Environment in App Confiuration ... + app.AddEnvironmentToXAppConfiguration(env.EnvironmentName); + // // Force Https Redirection ... app.UseHttpsRedirection(); @@ -315,3 +324,6 @@ namespace xAiApi } } } + + + diff --git a/appsettings.Development.json b/appsettings.Development.json index c4b7352..62c8248 100644 --- a/appsettings.Development.json +++ b/appsettings.Development.json @@ -37,9 +37,16 @@ }, "AiApiConfiguration": { "Models": [ + { + "Name": "Arion", + "Provider": "OpenAI", + "LLM": "claude-fable-5-1", + "Url": "https://arionhub.pro/v1", + "ApiKey": "sk-AKJGD8J9gOCrQgc5oWPGtRGUo25PnnQGnMoipzdliYHa3otZ" + }, { "ApiKey": "", - "Name": "Gemma", + "Name": "Gemma_BKP", "LLM": "gemma3:1b", "Provider": "OpenAI", "Url": "http://178.131.88.93:1112/v1" diff --git a/appsettings.json b/appsettings.json index 800aad6..af3c6fe 100644 --- a/appsettings.json +++ b/appsettings.json @@ -22,7 +22,6 @@ "DefaultValues": { "version": "1.0" } - }, "HttpServiceConfiguration": { "DisableSSLCheck": true, @@ -56,7 +55,41 @@ "LogLevel": { "Default": "Information", "Microsoft.AspNetCore": "Warning" + }, + "XLogger": { + "Enabled": true, + "ApplicationName": "xAiApi", + "EnvironmentName": "Production", + "MinimumLevel": "Information", + "Queue": { + "Enabled": true, + "Capacity": 10000, + "ShutdownTimeoutSeconds": 10 + }, + "File": { + "Enabled": true, + "Directory": "./Logs", + "FileName": "xAiApi-.log", + "Format": "Json", + "MinimumLevel": "Information", + "RetainedFileCountLimit": 30 + }, + "Database": { + "Enabled": false, + "Provider": "Microsoft.Data.Sqlite", + "ConnectionString": "Filename=./Db/XLogs.db", + "TableName": "XLogs", + "AutoCreateTable": true, + "MinimumLevel": "Warning" + }, + "Event": { + "Enabled": false, + "Topic": "application-logs", + "Action": "ApplicationLogCreated", + "Sender": "xAiApi", + "MinimumLevel": "Error" + } } }, "AllowedHosts": "*" -} \ No newline at end of file +} diff --git a/xAiApi.csproj b/xAiApi.csproj index abc9e33..27964e6 100644 --- a/xAiApi.csproj +++ b/xAiApi.csproj @@ -1,5 +1,4 @@ - 1.0.0 @@ -8,28 +7,22 @@ SaherElm IT Center xSaherElm.xAiApi netcoreapp3.1 - a WebAPI Project which contains all Business Logic of xSaherElm Project's AI. - icon.png - false false - - - @@ -42,7 +35,6 @@ - @@ -66,14 +58,12 @@ - $(NoWarn);1591 true true - @@ -81,10 +71,11 @@ all - - + + + \ No newline at end of file