Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions Apps.OpenAI/Actions/EditActions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,10 @@ async Task<IEnumerable<TranslationEntity>> BatchTranslate(IEnumerable<(Unit Unit
segment.State = SegmentState.Reviewed;
}

unit.Provenance.Review.Tool = UniversalClient.GetModel(modelIdentifier.ModelId);
unit.Provenance.Review.ToolReference = $"https://openai.com/{UniversalClient.GetModel(modelIdentifier.ModelId)}";
var model = UniversalClient.GetModel(modelIdentifier.ModelId);
unit.Provenance.Review.Tool = model;
double tokens = result.Usage.TotalTokens / processedBatches.Count();
unit.AddUsage(model, Math.Round(tokens, 0), UsageUnit.Tokens);
}

result.TotalSegmentsUpdated = updatedCount;
Expand Down Expand Up @@ -431,8 +433,10 @@ async Task<IEnumerable<TranslationEntity>> BatchTranslate(IEnumerable<(Unit Unit
segment.State = SegmentState.Reviewed;
}

unit.Provenance.Review.Tool = UniversalClient.GetModel(modelIdentifier.ModelId);
unit.Provenance.Review.ToolReference = $"https://openai.com/{UniversalClient.GetModel(modelIdentifier.ModelId)}";
var model = UniversalClient.GetModel(modelIdentifier.ModelId);
unit.Provenance.Review.Tool = model;
double tokens = result.Usage.TotalTokens / processedBatches.Count();
unit.AddUsage(model, Math.Round(tokens, 0), UsageUnit.Tokens);
}

result.TotalSegmentsUpdated = updatedCount;
Expand Down
6 changes: 4 additions & 2 deletions Apps.OpenAI/Actions/TranslationActions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,10 @@ async Task<IEnumerable<TranslationEntity>> BatchTranslate(IEnumerable<(Unit Unit
}
}

unit.Provenance.Translation.Tool = UniversalClient.GetModel(modelIdentifier.ModelId);
unit.Provenance.Translation.ToolReference = $"https://openai.com/{UniversalClient.GetModel(modelIdentifier.ModelId)}";
var model = UniversalClient.GetModel(modelIdentifier.ModelId);
unit.Provenance.Translation.Tool = model;
double tokens = result.Usage.TotalTokens / processedBatches.Count();
unit.AddUsage(model, Math.Round(tokens, 0), UsageUnit.Tokens);
}

result.TargetsUpdatedCount = updatedCount;
Expand Down
4 changes: 2 additions & 2 deletions Apps.OpenAI/Apps.OpenAI.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<TargetFramework>net8.0</TargetFramework>
<Product>OpenAI</Product>
<Description>Creating safe artificial general intelligence that benefits all of humanity</Description>
<Version>2.8.11</Version>
<Version>2.8.12</Version>
<AssemblyName>Apps.OpenAI</AssemblyName>
</PropertyGroup>

Expand All @@ -13,7 +13,7 @@
<PackageReference Include="Blackbird.Applications.SDK.Extensions.FileManagement" Version="1.1.0" />
<PackageReference Include="Blackbird.Applications.Sdk.Glossaries.Utils" Version="1.0.1" />
<PackageReference Include="Blackbird.Applications.Sdk.Utils" Version="1.0.26" />
<PackageReference Include="Blackbird.Filters" Version="1.1.35" />
<PackageReference Include="Blackbird.Filters" Version="1.1.43" />
<PackageReference Include="Blackbird.Xliff.Utils" Version="1.1.14" />
<PackageReference Include="Microsoft.AspNetCore.Http.Features" Version="5.0.17" />
<PackageReference Include="Microsoft.Extensions.Configuration" Version="9.0.10" />
Expand Down