提交代码
This commit is contained in:
parent
458ee3e04a
commit
34880b0122
|
|
@ -66,6 +66,7 @@ public class ChatBLL : MiaoYuBase
|
|||
ModelConfigId = charact.ModelConfigId,
|
||||
TenantId = charact.TenantId,
|
||||
UserId = _UserId,
|
||||
TotalToken = 0,
|
||||
};
|
||||
Dao.daoDbMiaoYu.context.T_User_Chat.Add(userChatSession);
|
||||
Dao.daoDbMiaoYu.context.SaveChanges();
|
||||
|
|
@ -327,9 +328,13 @@ public class ChatBLL : MiaoYuBase
|
|||
t_Character.Token = charact.Token;
|
||||
}
|
||||
}
|
||||
t_Chat1.Tokens = claudeChatResponse.InputTokens - charact.Token;
|
||||
t_Chat1.Tokens = claudeChatResponse.InputTokens ;
|
||||
t_Chat1.Input_tokens = claudeChatResponse.InputTokens;
|
||||
//设置消耗的总token
|
||||
if (userChatSession.TotalToken == null)
|
||||
{
|
||||
userChatSession.TotalToken = 0;
|
||||
}
|
||||
userChatSession.TotalToken += claudeChatResponse.InputTokens + claudeChatResponse.OutputTokens;
|
||||
Dao.daoDbMiaoYu.context.Add(t_Chat1);
|
||||
Dao.daoDbMiaoYu.context.Add(t_Chat);
|
||||
|
|
|
|||
|
|
@ -127,7 +127,7 @@ namespace HuanMeng.MiaoYu.Code.Users
|
|||
var memoryCard = Dao.daoDbMiaoYu.context.T_User_MemoryCard.Where(it => it.UserId == _UserId && it.CharacterId == 0).Count();
|
||||
//var memoryCard = user.GetUserCurrencyMoney(UserCurrencyType.记忆卡, Dao);
|
||||
//获取聊天次数
|
||||
var hasTalked = Dao.daoDbMiaoYu.context.T_User_Chat.Where(it => it.UserId == _UserId && !it.IsDelete && it.TotalToken > 0).Count();
|
||||
var hasTalked = Dao.daoDbMiaoYu.context.T_User_Chat.Where(it => it.UserId == _UserId && !it.IsDelete ).Count();
|
||||
List<CreateCharacterInfo> characters = new List<CreateCharacterInfo>();
|
||||
return new BaseResponse<ResponseUserInfo>(ResonseCode.Success, "请求成功", new ResponseUserInfo
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user