Skip to content

Commit

Permalink
refactor!: freeze the lib folder, move lib to plugin-core
Browse files Browse the repository at this point in the history
  • Loading branch information
snowyu committed Sep 16, 2024
1 parent e2cb4af commit 64616c3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions lib/json.ai.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ system: |-
Accurately Extract THE CONTENT input by the user as a JSON object according to THE OUTPUT JSON CONTENT FIELDS REQUIREMENTS specified by the user:
user: |-
THE OUTPUT JSON CONTENT FIELDS REQUIREMENTS:
json-schema:
{{output}}
---
THE CONTENT:
Expand Down
7 changes: 5 additions & 2 deletions lib/translator.ai.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,16 +58,18 @@ parameters:
$set:
content: "@file({{file}})"
- system: |-
You are the best translator in the world.
You are the best master of translation in the world.
- $if: "this.content"
then:
# For API mode.
- $set:
source: "?=content"
- $if: "!this.lang || this.lang === 'auto'"
then:
$set:
lang: "?=this.$detectLang(content.slice(0, 120))"
- user: |-
Output high-quality translation result before the completion delimiter "{{completion_delimiter}}".
Think carefully. Output very high-quality translation result before the completion delimiter "{{completion_delimiter}}".
{% if terms %}
Translation according to terms:
{{terms}}
Expand All @@ -83,6 +85,7 @@ parameters:
{%- 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"`
# - -> json(output=output, content='source_lang:'+lang +'\nsource_text:' + source + '\ntarget_lang:'+target + '\ntarget_text:' + content)
else:
# For multi-turn conversation in interactive mode.
- ---
Expand Down

0 comments on commit 64616c3

Please sign in to comment.