feat: 完成用量统计功能模块

This commit is contained in:
ccnetcore
2025-06-27 22:13:26 +08:00
parent 96e275efa6
commit 01a3c81359
20 changed files with 281 additions and 98 deletions

View File

@@ -4,6 +4,7 @@ using OpenAI.Chat;
using Volo.Abp.Domain.Services;
using Yi.Framework.AiHub.Domain.AiChat;
using Yi.Framework.AiHub.Domain.Entities;
using Yi.Framework.AiHub.Domain.Entities.Model;
using Yi.Framework.AiHub.Domain.Shared.Dtos;
using Yi.Framework.SqlSugarCore.Abstractions;
@@ -57,7 +58,7 @@ public class AiGateWayManager : DomainService
/// <param name="messages"></param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
public async IAsyncEnumerable<string> CompleteChatAsync(string modelId, List<ChatMessage> messages,
public async IAsyncEnumerable<CompleteChatResponse> CompleteChatAsync(string modelId, List<ChatMessage> messages,
[EnumeratorCancellation] CancellationToken cancellationToken)
{
var modelDescribe = await GetModelAsync(modelId);