feat: 支持非流式传输功能
This commit is contained in:
@@ -126,7 +126,7 @@ public class AiChatService : ApplicationService
|
||||
}
|
||||
|
||||
//ai网关代理httpcontext
|
||||
await _aiGateWayManager.CompleteChatForHttpContextAsync(_httpContextAccessor.HttpContext, input.Model, history,
|
||||
await _aiGateWayManager.CompleteChatStreamForStatisticsAsync(_httpContextAccessor.HttpContext, input.Model, history,
|
||||
CurrentUser.Id, input.SessionId, cancellationToken);
|
||||
}
|
||||
}
|
||||
@@ -55,9 +55,18 @@ public class OpenApiService : ApplicationService
|
||||
}
|
||||
}
|
||||
|
||||
//ai网关代理httpcontext
|
||||
await _aiGateWayManager.CompleteChatForHttpContextAsync(_httpContextAccessor.HttpContext, input.Model, history,
|
||||
userId, null, cancellationToken);
|
||||
if (input.Stream)
|
||||
{
|
||||
//ai网关代理httpcontext
|
||||
await _aiGateWayManager.CompleteChatStreamForStatisticsAsync(_httpContextAccessor.HttpContext, input.Model,
|
||||
history,
|
||||
userId, null, cancellationToken);
|
||||
}
|
||||
else
|
||||
{
|
||||
await _aiGateWayManager.CompleteChatForStatisticsAsync(_httpContextAccessor.HttpContext,input.Model, history, userId, null,
|
||||
cancellationToken);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -76,7 +85,7 @@ public class OpenApiService : ApplicationService
|
||||
Owned_by = "organization-owner",
|
||||
Permission = new List<string>()
|
||||
}).ToListAsync();
|
||||
|
||||
|
||||
return new ModelGetOutput()
|
||||
{
|
||||
Data = data
|
||||
|
||||
Reference in New Issue
Block a user