Video_maker HomeTutorial Build an AI-powered translation app using Coze with zero code

Build an AI-powered translation app using Coze with zero code

As artificial intelligence technologies advance, large language models (LLMs) have demonstrated outstanding performance in terms of translation quality, efficiency, context under
As artificial intelligence technologies advance, large language models (LLMs) have demonstrated outstanding performance in terms of translation quality, efficiency, context understanding, and multilingual support. Therefore, LLMs are increasingly used for text translation to enhance efficiency and reduce costs.
You will learn how to create an AI-powered translation app using Coze in this tutorial.

Step 1: Design the features of your app

First, you need to design your app.
The core features of this AI-powered translation app is to allow users to translate text for a target language specified by users. Translation can be done by using a workflow with an LLM node.
Once the app design and planning are complete, you can begin building the app.

Step 2: Create the AI-powered app project

You need to create an app project first.
You can use workflows to build complex business logic and utilize resources, such as databases, knowledge bases, and plugins to interact with local or online data in AI-powered app projects.
To create an AI-powered app project, follow these steps below:
  1. Log in to Coze.
  2. Select the target workspace at the top of the page, then click Development in the left menu bar.
  3. Click + Create in the upper right corner, then click Low-Code in the Create app area.
  4. Enter the app name and click the AI icon next to the Icon setting to automatically generate an icon using AI capability. Then click Confirm.
Once the app is created, you are redirected to the app's integrated development environment (IDE).
Build an AI-powered translation app

Step 3: Build business logic

After creating the app project, you can start building the business logic for the app. Coze provides a variety of workflow nodes for complex business scenarios, including LLMs, Code, Intent recognition, Knowledge base writing and Knowledge. In addition, you can also integrate with your local and online data by using variables, plugins, and knowledge bases.
In this tutorial, the AI-powered translation app uses a large language model to perform multilingual translation, therefore you only need to create a workflow that includes an LLM node.
To create a workflow that implements translation, follow these steps below:
  1. In the Resources column, find Workflow and click + > New Workflow .
Build an AI-powered translation app
  1. Enter a workflow name and description, then click Confirm.
Workflow names can include letters, numbers, and underscores, and must begin with a letter.
  1. In the workflow canvas, click the Add node button below the Start node connector or canvas, then select the LLM node and connect the two nodes.
Build an AI-powered translation app
  1. Click the Start node to configure the settings. The Start node is configured with the information required to start the workflow.
In this scenario, users need to provide the text to be translated and the target language. Therefore, you must create two parameters as input.
      1. In the input setting, click the + icon to add the first variable (content) for the text to be translated.
      2. Click the click + icon again. Enter the second variable (lang) for the target language.
Build an AI-powered translation app
  1. Click the LLM node to configure the setting.
      1. In the Model setting, expand the list of models and select the required LLM to perform the translation task. Select the GPT-4o model in this tutorial with the default configuration.
To custom the model configuration, click the configuration icon.
Build an AI-powered translation app
      1. Configure input parameters that can be used in the prompts for the model.
In this tutorial, add the text to be translated and target language specified by users to the prompt. This way, the model can translate the text into the target language chosen by the users. You need to set two parameters for the input setting.
          1. Click the + icon in the input setting, and click the corresponding configuration icon to select the variable configured in the Start node.
Build an AI-powered translation app
          1. Repeat the previous operation to add the variable for the target language, ensuring that the input setting contains only the two parameters as shown in the figure below.
Build an AI-powered translation app
      1. In the System prompt setting, enter the following system prompt.
System prompts are a set of instructions that define the behavior and scope of a model. These prompts guide how to ask questions, provide information, and request specific features. In addition, system prompts help set the restrictions of the conversation, such as letting users know what questions or requests are not acceptable.
# Role
You are a professional translator, capable of accurately translating the content provided by the user into the target language without making arbitrary expansions.
## Skills
### Skill 1: Text Translation
1. When the user provides a piece of text, promptly translate it into the target language.
2. Ensure the accuracy and fluency of the translation.
## Restrictions:
1. Only perform translation work and do not answer questions unrelated to translation.
2. Strictly follow the target language requested by the user and do not change it without permission.

In the User prompt setting, enter the user prompt.

In general, user prompts refer to instructions that tell the model what task or intent the user intends to perform. For example, Help me translate this text". The clearer the instruction, the closer the model's output will align with your actual requirements.

First enter the following text.

Translate user input to target language.

Different users provide different text for translation and choose different target languages. Use input variables to represent the text for translation and target language. This way, these variables can be replaced with the actual user requirements when the app is running.

Enter { after the "content" in the prompt and select the variable that refers to the text to be translated.

If no variables are available, check if you have configured the input variables for the model node as instructed in the tutorial.
Build an AI-powered translation app

Repeat the previous method to add a variable for the target language.

Build an AI-powered translation app

In the Output setting, configure the Output format as Text , using the output variable with the default configuration.

Build an AI-powered translation app
  1. Configure the End node.
    1. Click the End node and select Return text .
    2. Select the output of the LLM node as the output parameter.
Build an AI-powered translation app
    1. Enter {{output}} in the Response text box, and use the translated text provided by the LLM in the final response.
Build an AI-powered translation app
At this point, you have completed the entire workflow setup.
  1. To ensure that the business logic is implemented as expected, click Test run to execute the workflow.
Build an AI-powered translation app
  1. On the Test run page, enter the text you want to translate and the target language, and then click Test run .
  2. Check the results if the output meets your expectations.
If not, you can check the output of each node one by one.
Build an AI-powered translation app

Step 4: Publish the app

After testing, you can publish the app as API to interact with other apps.
Before publishing your app as APIs, you must create an access token to authorize API calls.

Related content

This article is reprinted from the Internet. If there is any infringement, please contact us for deletion.

Address of this article: https://www.videomaker.sg/Tutorial/build-an-aipowered-translation-app-using-coze-with-zero-code.html

Related articles

Thank you for your support
H2