From 4245ba726f660c607c205d436b24e1b8a08a3f68 Mon Sep 17 00:00:00 2001 From: Hadi Khazaee Asl Date: Sun, 26 Jul 2026 21:19:46 +0330 Subject: [PATCH] last ... --- Controllers/XAiServiceControllerBase.cs | 100 ------------------------ nuget.config | 1 - 2 files changed, 101 deletions(-) delete mode 100644 Controllers/XAiServiceControllerBase.cs diff --git a/Controllers/XAiServiceControllerBase.cs b/Controllers/XAiServiceControllerBase.cs deleted file mode 100644 index feea1ec..0000000 --- a/Controllers/XAiServiceControllerBase.cs +++ /dev/null @@ -1,100 +0,0 @@ -using System; -using System.Threading; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Mvc; -using Microsoft.Extensions.Logging; -using xAiService.Interfaces; -using xCommons.Configurations; -using xCommons.Providers; -using xIdentityService.Controllers; -using xIdentityService.Interfaces; - -namespace xAiService.Controllers -{ - /// - /// a Controller base Class which implement based Actions to Provides AI Service Access ... - /// - public abstract class XAiServiceControllerBase : XIBaseProviderController, IXAiServiceControllerBase - { - private readonly IXAiService aiService; - - protected XAiServiceControllerBase( - ILogger logger, - IXAiService aiService, - XAppConfiguration appConfiguration, - IXIdentityProvider identityProvider, - XValidationProvider validationProvider - ) : base( - logger, - appConfiguration, - identityProvider, - validationProvider - ) - { - this.aiService = aiService; - } - - // - #region Text Actions ... - [HttpGet("Ask")] - public virtual async Task> Ask( - [FromQuery] string prompt, - CancellationToken cancellationToken = default - ) - { - // - // Do ... - try - { - // - var userInfo = await GetUserInfo(); - var result = await aiService - .GetTextResponseAsync( - prompt: prompt, - userInfo: userInfo, - cancellationToken: cancellationToken - ); - - // - return Ok(result); - } - catch (Exception ex) - { - // - var result = GetExceptionActionResult(ex); - return result; - } - } - - [HttpGet("AskStream")] - public virtual async Task AskStream( - [FromQuery] string prompt, - CancellationToken cancellationToken = default - ) - { - // - // Do ... - try - { - // - var userInfo = await GetUserInfo(); - var result = await aiService - .GetTextReponseStreamAsync( - prompt: prompt, - userInfo: userInfo, - cancellationToken: cancellationToken - ); - - // - return Ok(result); - } - catch (Exception ex) - { - // - var result = GetExceptionActionResult(ex); - return result; - } - } - #endregion - } -} \ No newline at end of file diff --git a/nuget.config b/nuget.config index c6fd40c..394df7c 100644 --- a/nuget.config +++ b/nuget.config @@ -1,7 +1,6 @@ -