last ...
This commit is contained in:
@@ -0,0 +1,55 @@
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using xAiService.Controllers;
|
||||
using xAiService.Interfaces;
|
||||
using xCommons.Attributes;
|
||||
using xCommons.Configurations;
|
||||
using xCommons.Providers;
|
||||
using xIdentityService.Interfaces;
|
||||
|
||||
namespace xApi.Controllers.V1
|
||||
{
|
||||
[ApiController]
|
||||
[ApiVersion("1.0")]
|
||||
[RequireXPowered(true)]
|
||||
[Route("api/v{version:apiVersion}/[controller]")]
|
||||
public class AiController : XAiServiceControllerBase, IXAiServiceControllerBase
|
||||
{
|
||||
//
|
||||
#region Constructor ...
|
||||
public AiController(
|
||||
ILogger<AiController> logger,
|
||||
IXAiService aiService,
|
||||
XAppConfiguration appConfiguration,
|
||||
IXIdentityProvider identityProvider,
|
||||
XValidationProvider validationProvider
|
||||
) : base(
|
||||
logger,
|
||||
aiService,
|
||||
appConfiguration,
|
||||
identityProvider,
|
||||
validationProvider
|
||||
)
|
||||
{ }
|
||||
#endregion
|
||||
|
||||
//
|
||||
#region Text Actions ...
|
||||
[AllowAnonymous]
|
||||
[HttpGet("Ask")]
|
||||
public override async Task<ActionResult<string>> Ask(
|
||||
[FromQuery] string prompt,
|
||||
CancellationToken cancellationToken = default
|
||||
)
|
||||
{
|
||||
return await base.Ask(
|
||||
prompt: prompt,
|
||||
cancellationToken: cancellationToken
|
||||
);
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -122,6 +122,11 @@
|
||||
"SummaryEndsWdith": " ...",
|
||||
"ContentSummaryMaxLength": 255
|
||||
},
|
||||
"AIServiceConfiguration": {
|
||||
"Url": "https://localhost:6001/api/v1/ai",
|
||||
"XPoweredValue": "SaherElmITCenter",
|
||||
"DefaultClientTimeout": -1
|
||||
},
|
||||
"Logging": {
|
||||
"LogLevel": {
|
||||
"Default": "Information",
|
||||
|
||||
+1
-1
@@ -1,8 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<configuration>
|
||||
<packageSources>
|
||||
<add key="megan" value="https://hub.megan.ir/nuget/index.json" />
|
||||
<add key="nuget" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
|
||||
<add key="baget" value="https://nuget.saherelmhub.ir/v3/index.json" protocolVersion="3" />
|
||||
<add key="RunFlare" value="https://mirror-nuget.runflare.com/v3/index.json" protocolVersion="3" />
|
||||
</packageSources>
|
||||
</configuration>
|
||||
Reference in New Issue
Block a user