This commit is contained in:
2026-04-15 00:34:05 +03:30
parent 5b90d694dc
commit 62c54a3d4c
7 changed files with 68 additions and 19 deletions
+25 -4
View File
@@ -47,11 +47,11 @@ namespace xAiService.Controllers
try
{
//
var tokens = Ex();
var userInfo = await GetUserInfo();
var result = await aiService
.GetTextResponseAsync(
prompt: prompt,
tokens: tokens,
userInfo: userInfo,
cancellationToken: cancellationToken
);
@@ -67,12 +67,33 @@ namespace xAiService.Controllers
}
[HttpGet("AskStream")]
public async Task AskAIStream(
public async Task<ActionResult> AskAIStream(
[FromQuery] string prompt,
CancellationToken cancellationToken = default
)
{
//
// Do ...
try
{
//
var userInfo = await GetUserInfo();
var result = aiService
.GetTextReponseStreamAsync(
prompt: prompt,
userInfo: userInfo,
cancellationToken: cancellationToken
);
//
return Ok(result);
}
catch (Exception ex)
{
//
var result = GetExceptionActionResult(ex);
return result;
}
}
#endregion
}