mirror of
https://gitee.com/ccnetcore/Yi
synced 2026-04-06 17:26:35 +08:00
feat: 新增gemini支持
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
using Yi.Framework.AiHub.Domain.Shared.Dtos.OpenAi;
|
||||
|
||||
namespace Yi.Framework.AiHub.Domain.AiGateWay;
|
||||
|
||||
public static class SupplementalMultiplierHelper
|
||||
{
|
||||
public static void SetSupplementalMultiplier(this ThorUsageResponse? usage,decimal multiplier)
|
||||
{
|
||||
if (usage is not null)
|
||||
{
|
||||
usage.InputTokens =
|
||||
(int)Math.Round((usage.InputTokens ?? 0) * multiplier);
|
||||
usage.OutputTokens =
|
||||
(int)Math.Round((usage.OutputTokens ?? 0) * multiplier);
|
||||
usage.CompletionTokens =
|
||||
(int)Math.Round((usage.CompletionTokens ?? 0) * multiplier);
|
||||
usage.PromptTokens =
|
||||
(int)Math.Round((usage.PromptTokens ?? 0) * multiplier);
|
||||
usage.TotalTokens =
|
||||
(int)Math.Round((usage.TotalTokens ?? 0) * multiplier);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user