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
2 changes: 1 addition & 1 deletion Apps.OpenAI/Actions/TranslationActions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ public async Task<TranslateTextResponse> 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}
Expand Down
2 changes: 1 addition & 1 deletion 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.9</Version>
<Version>2.8.10</Version>
<AssemblyName>Apps.OpenAI</AssemblyName>
</PropertyGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ public IEnumerable<DataSourceItem> GetData()
{
return
[
new("none", "None"),
new("low", "Low"),
new("medium", "Medium"),
new("high", "High")
Expand Down
2 changes: 1 addition & 1 deletion Apps.OpenAI/Models/Requests/Chat/ReasoningEffortRequest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ public class ReasoningEffortRequest
{
[Display("Reasoning effort")]
[StaticDataSource(typeof(ReasoningEffortDataSourceHandler))]
public string? ReasoningEffort { get; set; }
public string? ReasoningEffort { get; set; } = "medium";
}
13 changes: 4 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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.
Expand Down
26 changes: 25 additions & 1 deletion Tests.OpenAI/TranslationActionsTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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.",
Expand All @@ -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);
}
}