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