fix bug
This commit is contained in:
@@ -157,7 +157,7 @@ export interface ChatSession {
|
||||
export const CONVERSATION_SYSTEM_PROMPT_TEMPLATE = `You are a professional real-time conversation translator.
|
||||
Current Context:
|
||||
- Role A (Me): {ME_NAME}, Gender: {ME_GENDER}, Language: {ME_LANG}.
|
||||
- Role B (Partner): {PART_NAME}, Gender: {PART_GENDER}, Language: {PART_LANG}.
|
||||
- Role B (Other): {PART_NAME}, Gender: {PART_GENDER}, Language: {PART_LANG}.
|
||||
|
||||
[Conversation History]
|
||||
{HISTORY_BLOCK}
|
||||
@@ -169,7 +169,7 @@ Translate the incoming text from {FROM_LANG} to {TO_LANG}.
|
||||
1. Contextual Awareness: Use the [Conversation History] to resolve pronouns (it, that, etc.) and maintain consistency.
|
||||
2. Tone & Register:
|
||||
- If translating for 'Me', strictly use the tone: {MY_TONE}.
|
||||
- If translating for 'Partner', auto-detect and preserve their original tone/emotion.
|
||||
- If translating for 'Other', auto-detect and preserve their original tone/emotion.
|
||||
3. Natural Flow: Keep the translation concise and natural for a chat environment. Avoid "translationese".
|
||||
4. Strictly avoid over-translation: Do not add extra information not present in the source text.
|
||||
5. Output ONLY the translated text, no explanations.`;
|
||||
@@ -178,8 +178,7 @@ export const CONVERSATION_EVALUATION_PROMPT_TEMPLATE = `# Role: Expert Conversat
|
||||
|
||||
# Context Info
|
||||
- Role A (Me): {ME_NAME} ({ME_GENDER}, Native {ME_LANG})
|
||||
- Role B (Partner): {PART_NAME} ({PART_GENDER}, Native {PART_LANG})
|
||||
- Target Tone: {TARGET_TONE}
|
||||
- Role B (Other): {PART_NAME} ({PART_GENDER}, Native {PART_LANG})
|
||||
|
||||
# Recent Conversation Flow (Original Messages Only):
|
||||
{HISTORY_BLOCK}
|
||||
@@ -192,9 +191,20 @@ export const CONVERSATION_EVALUATION_PROMPT_TEMPLATE = `# Role: Expert Conversat
|
||||
|
||||
# Audit Priorities
|
||||
1. **Contextual Accuracy**: Does the translation correctly reflect the meaning based on the [Recent Conversation Flow]?
|
||||
2. **Relational Tone**: Does it match the [Target Tone]?
|
||||
2. **Relational Tone**:
|
||||
- If the Speaker is 'Me', does it match the target tone({TARGET_TONE})?
|
||||
- If the Speaker is 'Other', does it preserve their original tone/emotion?
|
||||
3. **Naturalness**: Is it concise and fit for an IM (Instant Messaging) environment?
|
||||
|
||||
# Instructions
|
||||
1. **Evaluation**: Compare the [Source Text] and [Translation] based on the [Audit Priorities].
|
||||
2. **Scoring Strategy**:
|
||||
- **90-100**: Accurate, grammatically sound, and flows naturally.
|
||||
- **75-89**: Accurate meaning, but suffers from "stiff" phrasing or minor flow issues that need adjustment.
|
||||
- **Below 75**: Contains semantic errors, severe grammar issues, or tone mismatches.
|
||||
3. **Analysis**: Provide a concise explanation in Simplified Chinese. Focus on *why* the error matters (e.g., "meaning is reversed" or "too awkward to read").
|
||||
4. **Suggestions**: Provide a list of specific, actionable suggestions. For each, assign an "importance" from 0 to 100 (0 = unnecessary/optional, 100 = critical error).
|
||||
|
||||
# Output Format
|
||||
Respond ONLY in JSON. "analysis" and "text" MUST be in Simplified Chinese:
|
||||
{
|
||||
@@ -208,25 +218,27 @@ Respond ONLY in JSON. "analysis" and "text" MUST be in Simplified Chinese:
|
||||
export const CONVERSATION_REFINEMENT_PROMPT_TEMPLATE = `# Role: Professional Conversation Editor
|
||||
|
||||
# Context:
|
||||
- Role A: {ME_NAME} ({ME_GENDER}, Native {ME_LANG})
|
||||
- Role B: {PART_NAME} ({PART_GENDER}, Native {PART_LANG})
|
||||
- Target Tone: {TARGET_TONE}
|
||||
- Role A (Me): {ME_NAME} ({ME_GENDER}, Native {ME_LANG})
|
||||
- Role B (Other): {PART_NAME} ({PART_GENDER}, Native {PART_LANG})
|
||||
|
||||
# Recent Conversation Flow (Original Messages Only):
|
||||
{HISTORY_BLOCK}
|
||||
|
||||
# Task: Refine the following translation
|
||||
# Current Turn to Refine:
|
||||
- Speaker: {SENDER_NAME}
|
||||
- Direction: {FROM_LANG} -> {TO_LANG}
|
||||
- Source Text ({FROM_LANG}): {ORIGINAL_TEXT}
|
||||
- Current Draft ({TO_LANG}): {CURRENT_TRANSLATION}
|
||||
- Current Translation ({TO_LANG}): {CURRENT_TRANSLATION}
|
||||
|
||||
# Suggestions to Apply:
|
||||
{SUGGESTIONS}
|
||||
|
||||
# Instructions:
|
||||
1. Produce a new version of the translation that addresses the [Suggestions] while ensuring it fits naturally into the [Recent Conversation Flow].
|
||||
2. Strictly maintain the {TARGET_TONE}.
|
||||
3. Output ONLY the refined {TO_LANG} text. No preamble, no commentary.`;
|
||||
1. Carefully review the [Suggestions] and apply the requested improvements to the [Current Translation] while ensuring it fits naturally into the [Recent Conversation Flow].
|
||||
2. Ensure that the refined translation remains semantically identical to the [Source Text].
|
||||
3. If the Speaker is 'Me', strictly maintain the target tone({TARGET_TONE}); if the Speaker is 'Other', auto-detect and preserve their original tone/emotion.
|
||||
4. If a piece of feedback contradicts the [Source Text], prioritize accuracy and provide a balanced refinement.
|
||||
5. Produce ONLY the refined {TO_LANG} translation, without any additional explanations, notes, or commentary.`;
|
||||
|
||||
export const useSettingsStore = defineStore('settings', () => {
|
||||
const isDark = useLocalStorage('is-dark', false);
|
||||
|
||||
Reference in New Issue
Block a user