Skip to content

Commit

Permalink
fix(lib): could translate the short phrase
Browse files Browse the repository at this point in the history
  • Loading branch information
snowyu committed Aug 22, 2024
1 parent f1c41a3 commit 8f0ab82
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/translator.ai.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,14 @@ parameters:
# For API mode.
- user: |-
Output high-quality translation result before the completion delimiter "{{completion_delimiter}}".
{%- if content.length > 50 -%}
Translate the following content {% if lang %}from {{lang}} {% endif %}to {{target}}.
---
{{content|trim}}
{%- else -%}
Translate the `"{{content|trim}}"` itself {% if lang %}from {{lang}} {% endif %}to {{target}}.
{{content}}
{%- endif -%}
- --- # First dialogue start and this will hide the above messages from output
- assistant: "[[trans]]" # Return the last instruction's result always. So no need to `$ret: "?=this.prompt.trans"`
else:
Expand Down

0 comments on commit 8f0ab82

Please sign in to comment.