last ...
This commit is contained in:
@@ -138,7 +138,7 @@ namespace xAiApi.Controllers
|
||||
public ActionResult<string> HiAgent()
|
||||
{
|
||||
//
|
||||
var result = $"Hi Admin: {User.Identity.Name} ...";
|
||||
var result = $"Hi Agent: {User.Identity.Name} ...";
|
||||
|
||||
//
|
||||
return Ok(result);
|
||||
@@ -153,7 +153,7 @@ namespace xAiApi.Controllers
|
||||
public ActionResult<string> HiEnabledAgent()
|
||||
{
|
||||
//
|
||||
var result = $"Hi Admin: {User.Identity.Name} is Enabled ...";
|
||||
var result = $"Hi Agent: {User.Identity.Name} is Enabled ...";
|
||||
|
||||
//
|
||||
return Ok(result);
|
||||
|
||||
@@ -10,6 +10,7 @@ using xAiApi.Base;
|
||||
using xCommons.Configurations;
|
||||
using xCommons.Extensions;
|
||||
using xCommons.Providers;
|
||||
using xIdentityHelper;
|
||||
using xIdentityService.Interfaces;
|
||||
|
||||
namespace xAiApi.Controllers.V1
|
||||
@@ -36,8 +37,8 @@ namespace xAiApi.Controllers.V1
|
||||
|
||||
//
|
||||
#region Actions ...
|
||||
[AllowAnonymous]
|
||||
[HttpGet("AskAI")]
|
||||
[Authorize(Policy = XPolicies.EnabledUser)]
|
||||
public async Task<ActionResult<string>> AskAI(
|
||||
[FromQuery] string prompt,
|
||||
CancellationToken cancellationToken = default
|
||||
@@ -65,8 +66,8 @@ namespace xAiApi.Controllers.V1
|
||||
}
|
||||
}
|
||||
|
||||
[AllowAnonymous]
|
||||
[HttpGet("AskAIStream")]
|
||||
[Authorize(Policy = XPolicies.EnabledUser)]
|
||||
public async Task AskAIStream(
|
||||
[FromQuery] string prompt,
|
||||
CancellationToken cancellationToken = default
|
||||
|
||||
@@ -35,7 +35,7 @@ namespace xAiApi.Controllers.V1
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpGet("Version")]
|
||||
[Authorize(Policy = XPolicies.Admin)]
|
||||
[Authorize(Policy = XPolicies.EnabledAdmin)]
|
||||
public async Task<ActionResult<string>> GetVersion()
|
||||
{
|
||||
//
|
||||
@@ -61,7 +61,7 @@ namespace xAiApi.Controllers.V1
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpGet("Models")]
|
||||
[Authorize(Policy = XPolicies.Admin)]
|
||||
[Authorize(Policy = XPolicies.EnabledAdmin)]
|
||||
public async Task<ActionResult<IEnumerable<string>>> GetModels()
|
||||
{
|
||||
//
|
||||
|
||||
Reference in New Issue
Block a user