Plugin: AI (OpenAI v2)
This plugin enables sending prompt requests to OpenAI, targeting either OpenAI cloud or Azure AI resources. It utilizes the OpenAI API v2 and the ChatCompletion client.
Provider URL: OpenAI
Class: LTGear.Flowme.Plugin.MT.OpenAI2.Translate
Pipeline Format: XLIFF (MT)
Parameters
ApiKey: API key to access OpenAI.
AzureResourceName (Optional): Specific for Azure OpenAI. The name of your Azure OpenAI Resource.
AzureDeploymentName (Optional): Specific for Azure OpenAI. The deployment name you chose when you deployed the Azure OpenAI model.
ModelName (Optional): Specific for OpenAI cloud. Name of the model.
Prompt: The prompt to ask the OpenAI chat. Allowed placeholders are: {sourceLanguage}, {targetLanguage}, {sourceText}, and {targetText}.
WriteTo: Specifies whether to write the OpenAI result to the source or target. Note that the prompt should be defined accordingly. Allowed values: Source or Target.
Usage Examples
Sample 1: Using Azure Cloud model
ApiKey: your-azure-api-key
AzureResourceName: your-azure-resource-name
AzureDeploymentName: your-azure-deployment-name
Prompt: Translate the following text from {sourceLanguage} to {targetLanguage}: {sourceText}
WriteTo: Target
Sample 2: Using OpenAI cloud model
ApiKey: your-OpenAI-api-key
ModelName: your-model-name
Prompt: Translate the following text from {sourceLanguage} to {targetLanguage}: {sourceText}
WriteTo: Target