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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -226,3 +226,4 @@ _ref_preview/

# Claude Code session artifacts in subdirectories (not root .claude/)
Generation/**/.claude/
.keys/
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@

public string Model { get; set; } = "gpt-5.4-mini";

public string? BaseUrl { get; set; }

Check warning on line 34 in Generation/Converters/Argumentum.AssetConverter/DatasetUpdater/DatasetUpdaterConfig.cs

View workflow job for this annotation

GitHub Actions / build (Release)

The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.

Check warning on line 34 in Generation/Converters/Argumentum.AssetConverter/DatasetUpdater/DatasetUpdaterConfig.cs

View workflow job for this annotation

GitHub Actions / build (Debug)

The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.

public int? MaxOutputTokens { get; set; }

public int MaxTokensPerMinute { get; set; } = 70000;

public DivisionMode DivisionMode { get; set; }
Expand Down Expand Up @@ -469,6 +473,8 @@
var dataPrompt = new Prompt()
{
ApiKey = openAIKey,
BaseUrl = BaseUrl,
MaxOutputTokens = MaxOutputTokens,
Model = Model,
SystemPrompt = systemPrompt,
DialogPrompts = DialogPrompts,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -509,11 +509,13 @@ public async Task Apply(AssetConverterConfig config)
AssistantAnswerPath = PromptsRootPath + "PromptVirtuesTranslateEnAssistant.txt"
}
},
// FR → EN translation empty-only — eco tier. Fallback: gpt-4.1-mini
Model = "gpt-5.4-mini",
// FR → EN via OpenAI gpt-5.5 (best quality per benchmark)
Model = "gpt-5.5",
OpenAIKeyPath = @".keys\openai-key.txt",
MaxOutputTokens = 4096,
MaxTokensPerMinute = 70000,
DivisionMode = DivisionMode.SequentialChunks,
ChunkSize = 8,
ChunkSize = 4,
UseFunctionCalling = true,
NbMessageCalls = 1,
SkipChunkNb = 0,
Expand Down Expand Up @@ -794,11 +796,13 @@ public async Task Apply(AssetConverterConfig config)
AssistantAnswerPath = PromptsRootPath + "PromptScenariiTranslateEnAssistant.txt"
}
},
// FR → EN translation empty-only — eco tier. Fallback: gpt-4.1-mini
Model = "gpt-5.4-mini",
// FR → EN via OpenAI gpt-5.5 (best quality per benchmark)
Model = "gpt-5.5",
OpenAIKeyPath = @".keys\openai-key.txt",
MaxOutputTokens = 4096,
MaxTokensPerMinute = 70000,
DivisionMode = DivisionMode.SequentialChunks,
ChunkSize = 8,
ChunkSize = 4,
UseFunctionCalling = true,
NbMessageCalls = 1,
SkipChunkNb = 0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ public class Prompt

public string ApiKey { get; set; } = "";

public string? BaseUrl { get; set; }

public int? MaxOutputTokens { get; set; }

public string SystemPrompt { get; set; } = "";

public List<PromptExample> DialogPrompts { get; set; } = new();
Expand All @@ -32,7 +36,15 @@ public ChatClient ChatClient
{
if (_chatClient == null)
{
_openAIClient = new OpenAI.OpenAIClient(ApiKey);
if (!string.IsNullOrEmpty(BaseUrl))
{
var options = new OpenAI.OpenAIClientOptions { Endpoint = new Uri(BaseUrl) };
_openAIClient = new OpenAI.OpenAIClient(new System.ClientModel.ApiKeyCredential(ApiKey), options);
}
else
{
_openAIClient = new OpenAI.OpenAIClient(ApiKey);
}
_chatClient = _openAIClient.GetChatClient(Model);
}
return _chatClient;
Expand Down Expand Up @@ -77,6 +89,11 @@ public async Task<string> Send(CancellationToken cancellationToken, Action<strin

var options = new ChatCompletionOptions();

if (MaxOutputTokens.HasValue)
{
options.MaxOutputTokenCount = MaxOutputTokens.Value;
}

if (Functions != null && Functions.Count > 0)
{
foreach (var func in Functions)
Expand Down
Loading