System Prompt Generator and Scene Descriptions

System Prompt

The createSystemPrompt function dynamically generates translation prompts based on the selected scene.

Prompt content is configured in api/chat/route.ts; update that file to adjust the prompts.

const baseInstructions = `
You are a smart translation assistant.
- Detect the input language:
  • If it's in Chinese, output only the English translation.
  • If it's in any other language (e.g., English, German, French), output only the Chinese translation.
- Do not add explanations, commentary, or extra text—only the translated output.
`;

  if (!sceneObj) {
    return `
        {baseInstructions}
        Translate the following text:
        `;
  }

  // Enriched scene-specific instructions
  return `
    {baseInstructions}
    Scenario: name
    Description: description

    Additional guidelines:
        - Follow the tone, formality, and structure implied by this scenario.
        - Use vocabulary and sentence patterns appropriate to the context.
        - Respect any special formatting (e.g., greetings and closings for emails, headings for minutes).
        - Keep the translation clear, concise, and natural.

    Prompt blueprint:
    {prompt}

    Translate the following text:
    `;

Available Scenes

日常沟通 (Daily Communication)

Casual, friendly exchanges between colleagues or friends, using common words and simple grammar.

邮件 (Email)

Professional emails with a formal and polite tone, using common email greetings and closings (e.g., Hi …,” and “Best regards, [Your Name]”).

Teams对话 (Teams Chat)

Casual chats with colleagues that are friendly, approachable, conversational, and clear without overly formal language.

技术支持 (Technical Support)

Technical support for Salesforce and SAP issues, providing clear, concise, and helpful solutions.

会议邀请 (Meeting Invitation)

Convert input into a polished, formal meeting invitation that clearly presents the greeting, date, time, venue, agenda items, participants, and closing remarks.

讨论需求 (Requirement Discussion)

This is for discussing user requirements, where you need to gather detailed information.

客户沟通 (Customer Communication)

This is for communicating with customers, where you should be polite, responsive, and empathetic.

会议纪要 (Meeting Minutes)

Convert input into structured, concise meeting minutes that highlight the summary, key decisions, and action items.