|
|
@@ -13988,7 +13988,7 @@ FROM
|
|
|
/// <param name="dto"></param>
|
|
|
/// <returns></returns>
|
|
|
[HttpPost]
|
|
|
- public async Task<IActionResult> BusinessInvitationInstructionsFileContentStream(BusinessInvitationInstructionsFileDto dto)
|
|
|
+ public async Task<IActionResult> BusinessInvitationInstructionsFileContentStream([FromBody] BusinessInvitationInstructionsFileDto dto, CancellationToken cancellationToken = default)
|
|
|
{
|
|
|
if (dto.Diid < 1)
|
|
|
{
|
|
|
@@ -14094,15 +14094,20 @@ FROM
|
|
|
|
|
|
try
|
|
|
{
|
|
|
+ cancellationToken.ThrowIfCancellationRequested();
|
|
|
await foreach (var chunk in _deepSeekService.ChatStreamAsync(chat, "deepseek-reasoner", 0.7f, 60000))
|
|
|
{
|
|
|
await Response.WriteAsync(NdjsonLine(chunk) + "\n");
|
|
|
await Response.Body.FlushAsync();
|
|
|
}
|
|
|
+
|
|
|
+ await Response.WriteAsync(JsonConvert.SerializeObject(new { phase = "success", text = "结束" }) + "\n");
|
|
|
+ await Response.Body.FlushAsync(cancellationToken);
|
|
|
}
|
|
|
catch (Exception ex)
|
|
|
{
|
|
|
await Response.WriteAsync(JsonConvert.SerializeObject(new { phase = "error", text = ex.Message }) + "\n");
|
|
|
+ await Response.Body.FlushAsync(cancellationToken);
|
|
|
}
|
|
|
|
|
|
return new EmptyResult();
|