From 2d78383a902b383585f4c4102cc0494e6303cd32 Mon Sep 17 00:00:00 2001 From: mathijs-bb Date: Wed, 26 Nov 2025 11:34:13 +0100 Subject: [PATCH] updated efault reasoning effort --- Apps.OpenAI/Actions/TranslationActions.cs | 2 +- Apps.OpenAI/Apps.OpenAI.csproj | 2 +- .../ReasoningEffortDataSourceHandler.cs | 1 + .../Requests/Chat/ReasoningEffortRequest.cs | 2 +- README.md | 13 +++------- Tests.OpenAI/TranslationActionsTests.cs | 26 ++++++++++++++++++- 6 files changed, 33 insertions(+), 13 deletions(-) diff --git a/Apps.OpenAI/Actions/TranslationActions.cs b/Apps.OpenAI/Actions/TranslationActions.cs index 7b66efb..65aa33f 100644 --- a/Apps.OpenAI/Actions/TranslationActions.cs +++ b/Apps.OpenAI/Actions/TranslationActions.cs @@ -301,7 +301,7 @@ public async Task LocalizeText([ActionParameter] TextChat [ActionParameter] GlossaryRequest glossary) { var systemPrompt = "You are a text localizer. Localize the provided text for the specified locale while " + - "preserving the original text structure. Respond with localized text."; + "preserving the original text structure. Respond with localized text and only localized text, nothing else."; var userPrompt = @$" Original text: {input.Text} diff --git a/Apps.OpenAI/Apps.OpenAI.csproj b/Apps.OpenAI/Apps.OpenAI.csproj index 9b0a4c9..bcb361b 100644 --- a/Apps.OpenAI/Apps.OpenAI.csproj +++ b/Apps.OpenAI/Apps.OpenAI.csproj @@ -4,7 +4,7 @@ net8.0 OpenAI Creating safe artificial general intelligence that benefits all of humanity - 2.8.9 + 2.8.10 Apps.OpenAI diff --git a/Apps.OpenAI/DataSourceHandlers/ModelDataSourceHandlers/ReasoningEffortDataSourceHandler.cs b/Apps.OpenAI/DataSourceHandlers/ModelDataSourceHandlers/ReasoningEffortDataSourceHandler.cs index 61279ae..b1fc62e 100644 --- a/Apps.OpenAI/DataSourceHandlers/ModelDataSourceHandlers/ReasoningEffortDataSourceHandler.cs +++ b/Apps.OpenAI/DataSourceHandlers/ModelDataSourceHandlers/ReasoningEffortDataSourceHandler.cs @@ -10,6 +10,7 @@ public IEnumerable GetData() { return [ + new("none", "None"), new("low", "Low"), new("medium", "Medium"), new("high", "High") diff --git a/Apps.OpenAI/Models/Requests/Chat/ReasoningEffortRequest.cs b/Apps.OpenAI/Models/Requests/Chat/ReasoningEffortRequest.cs index 6a523cf..9bd6f8f 100644 --- a/Apps.OpenAI/Models/Requests/Chat/ReasoningEffortRequest.cs +++ b/Apps.OpenAI/Models/Requests/Chat/ReasoningEffortRequest.cs @@ -8,5 +8,5 @@ public class ReasoningEffortRequest { [Display("Reasoning effort")] [StaticDataSource(typeof(ReasoningEffortDataSourceHandler))] - public string? ReasoningEffort { get; set; } + public string? ReasoningEffort { get; set; } = "medium"; } \ No newline at end of file diff --git a/README.md b/README.md index eab8816..a49d21a 100644 --- a/README.md +++ b/README.md @@ -235,6 +235,10 @@ Check downloadable workflow prototypes featuring this app that you can import to - The maximum number of translation units in the XLIFF file is `50 000` because a single batch may include up to 50,000 requests +### Reasoning effort + +- GPT 5.1 introduced the configurable input of "Reasoning effort". All models prior to 5.1 ignore this input and use "medium" reasoning effort. In Blackbird, if you don't provide any input to reasoning effort then by default it passes "medium" to OpenAI. + ### How to know if the batch process is completed? You have 3 options here: @@ -256,15 +260,6 @@ We recommend using the `On background job finished` event trigger as it is more ![1694620196801](image/README/1694620196801.png) This simple example how OpenAI can be used to communicate with the Blackbird Slack app. Whenever the app is mentioned, the message will be send to Chat to generate an answer. We then use Amazon Polly to turn the textual response into a spoken-word resopnse and return it in the same channel. -## Missing features - -In the future we can add actions for: - -- Moderation -- Fine-tuning - -Let us know if you're interested! - ## Actions limitations - For every action maximum allowed timeout are 600 seconds (10 minutes). If the action takes longer than 600 seconds, it will be terminated. Based on our experience, even complex actions should take less than 10 minutes. But if you have a use case that requires more time, let us know. diff --git a/Tests.OpenAI/TranslationActionsTests.cs b/Tests.OpenAI/TranslationActionsTests.cs index 1acce73..1cbe217 100644 --- a/Tests.OpenAI/TranslationActionsTests.cs +++ b/Tests.OpenAI/TranslationActionsTests.cs @@ -107,7 +107,7 @@ public async Task TranslateInBackground_OpenAiEmbedded_WithXliffFile_Success(Inv public async Task TranslateText_WithSerbianLocale_ReturnsLocalizedText(InvocationContext context) { var actions = new TranslationActions(context, FileManagementClient); - var modelIdentifier = new TextChatModelIdentifier { ModelId = "gpt-4.1" }; + var modelIdentifier = new TextChatModelIdentifier { ModelId = "gpt-5.1" }; var localizeRequest = new LocalizeTextRequest { Text = "Develop and implement an HR strategy that drives organizational productivity and supports company's business goals. Design and oversee processes that promote team efficiency and operational effectiveness while reducing complexity and redundancies.", @@ -126,4 +126,28 @@ public async Task TranslateText_WithSerbianLocale_ReturnsLocalizedText(Invocatio // Additional validation to ensure response is not empty and contains Serbian characters Assert.IsGreaterThan(0, result.TranslatedText.Length); } + + [TestMethod, ContextDataSource] + public async Task Translate_Text_Stork_Test(InvocationContext context) + { + var actions = new TranslationActions(context, FileManagementClient); + var modelIdentifier = new TextChatModelIdentifier { ModelId = "gpt-5.1" }; + var localizeRequest = new LocalizeTextRequest + { + Text = "Brat mir einer einen Storch.", + TargetLanguage = "en-US" + }; + + var glossaryRequest = new GlossaryRequest(); + + var result = await actions.LocalizeText(modelIdentifier, localizeRequest, glossaryRequest); + + Assert.IsNotNull(result); + Assert.IsNotNull(result.TranslatedText); + Console.WriteLine("Original: " + localizeRequest.Text); + Console.WriteLine("Localized: " + result.TranslatedText); + + // Additional validation to ensure response is not empty and contains Serbian characters + Assert.IsGreaterThan(0, result.TranslatedText.Length); + } }