Skip to content

Commit 8cb0bd5

Browse files
committed
Merge branch 'sicp_i18n' into i18n_gh_actions
2 parents f87d8af + 4ca88aa commit 8cb0bd5

File tree

2 files changed

+29
-6
lines changed

2 files changed

+29
-6
lines changed

i18n/.env.example

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,28 @@
11
API_KEY=
2-
AI_MODEL=gpt-4o
3-
# maximum number of characters to be sent for translation per batch
4-
MAX_LEN=2000
5-
#Optional
2+
3+
# Model to be used for translation
4+
# ensure that selected assistant supports file search API
5+
# models that are tried and shown to work includes: o3-mini, 4o and 4o mini
6+
AI_MODEL=gpt-4.1-nano
7+
8+
# maximum number of characters to be sent for translation per batch, default: 3000
9+
# smaller number of characters could lead to greater translation quality
10+
# but worse continuity
11+
MAX_LEN=5000
12+
13+
#Optional, only specify if calling alternative LLM provider
14+
# Note: We require the Assistant API which only OpenAI provides as of 13 April 2025
615
AI_BASEURL=
16+
717
# maximum number of concurent translations that are allowed
8-
MAX_TRANSLATION_NO=10
18+
# if unspecified default to 5
19+
MAX_TRANSLATION_NO=10
20+
21+
# Number of previous messages to be referred to in a thread for LLM Translation, if unspecified, default to 3
22+
# Higher context size might lead to greater continuity in translation but higher cost and lower speed.
23+
CONTEXT=3
24+
25+
# Number of token per query which when exceeded will log an error
26+
# Formula to derive an adequate value: MAX_LEN * CONTEXT * k, where k is a constant
27+
# Recommended k = 1.5
28+
TOKEN_WARNING=7000

i18n/controllers/recurTranslate.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,10 @@ const ignoredTags = [
2626
"SCHEME",
2727
"LONG_PAGE",
2828
"LABEL",
29-
"HISTORY"
29+
"HISTORY",
30+
"REF",
31+
"FIGURE",
32+
3033
];
3134

3235
const MAXLEN = Number(process.env.MAX_LEN) || 3000;

0 commit comments

Comments
 (0)