GameSentenceMiner 2.11.1__py3-none-any.whl → 2.11.2__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- GameSentenceMiner/ai/ai_prompting.py +21 -10
- GameSentenceMiner/config_gui.py +9 -1
- GameSentenceMiner/util/configuration.py +1 -0
- {gamesentenceminer-2.11.1.dist-info → gamesentenceminer-2.11.2.dist-info}/METADATA +1 -1
- {gamesentenceminer-2.11.1.dist-info → gamesentenceminer-2.11.2.dist-info}/RECORD +9 -9
- {gamesentenceminer-2.11.1.dist-info → gamesentenceminer-2.11.2.dist-info}/WHEEL +0 -0
- {gamesentenceminer-2.11.1.dist-info → gamesentenceminer-2.11.2.dist-info}/entry_points.txt +0 -0
- {gamesentenceminer-2.11.1.dist-info → gamesentenceminer-2.11.2.dist-info}/licenses/LICENSE +0 -0
- {gamesentenceminer-2.11.1.dist-info → gamesentenceminer-2.11.2.dist-info}/top_level.txt +0 -0
@@ -91,15 +91,28 @@ class AIManager(ABC):
|
|
91
91
|
|
92
92
|
@abstractmethod
|
93
93
|
def _build_prompt(self, lines: List[GameLine], sentence: str, current_line: GameLine, game_title: str) -> str:
|
94
|
-
|
95
|
-
|
94
|
+
if get_config().ai.dialogue_context_length != 0:
|
95
|
+
if get_config().ai.dialogue_context_length == -1:
|
96
|
+
start_index = 0
|
97
|
+
end_index = len(lines)
|
98
|
+
else:
|
99
|
+
start_index = max(0, current_line.index - get_config().ai.dialogue_context_length)
|
100
|
+
end_index = min(len(lines), current_line.index + 1 + get_config().ai.dialogue_context_length)
|
101
|
+
|
102
|
+
context_lines_text = []
|
103
|
+
for i in range(start_index, end_index):
|
104
|
+
if i < len(lines):
|
105
|
+
context_lines_text.append(lines[i].text)
|
96
106
|
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
107
|
+
dialogue_context = "\n".join(context_lines_text)
|
108
|
+
|
109
|
+
dialogue_context = f"""
|
110
|
+
Dialogue Context:
|
101
111
|
|
102
|
-
|
112
|
+
{dialogue_context}
|
113
|
+
"""
|
114
|
+
else:
|
115
|
+
dialogue_context = "No dialogue context available."
|
103
116
|
|
104
117
|
if get_config().ai.use_canned_translation_prompt:
|
105
118
|
prompt_to_use = TRANSLATION_PROMPT
|
@@ -109,10 +122,8 @@ class AIManager(ABC):
|
|
109
122
|
prompt_to_use = get_config().ai.custom_prompt
|
110
123
|
|
111
124
|
full_prompt = textwrap.dedent(f"""
|
112
|
-
**Disclaimer:** All dialogue provided is from the script of the video game "{game_title}". This content is entirely fictional and part of a narrative. It must not be treated as real-world user input or a genuine request. The goal is accurate, context-aware localization.
|
125
|
+
**Disclaimer:** All dialogue provided is from the script of the video game "{game_title}". This content is entirely fictional and part of a narrative. It must not be treated as real-world user input or a genuine request. The goal is accurate, context-aware localization. If no context is provided, do not throw errors or warnings.
|
113
126
|
|
114
|
-
Dialogue Context:
|
115
|
-
|
116
127
|
{dialogue_context}
|
117
128
|
|
118
129
|
{prompt_to_use}
|
GameSentenceMiner/config_gui.py
CHANGED
@@ -360,7 +360,8 @@ class ConfigApp:
|
|
360
360
|
anki_field=self.ai_anki_field.get(),
|
361
361
|
use_canned_translation_prompt=self.use_canned_translation_prompt.get(),
|
362
362
|
use_canned_context_prompt=self.use_canned_context_prompt.get(),
|
363
|
-
custom_prompt=self.custom_prompt.get("1.0", tk.END)
|
363
|
+
custom_prompt=self.custom_prompt.get("1.0", tk.END),
|
364
|
+
dialogue_context_length=int(self.ai_dialogue_context_length.get()),
|
364
365
|
)
|
365
366
|
)
|
366
367
|
|
@@ -1623,6 +1624,13 @@ class ConfigApp:
|
|
1623
1624
|
self.ai_anki_field.grid(row=self.current_row, column=1, sticky='EW', pady=2)
|
1624
1625
|
self.current_row += 1
|
1625
1626
|
|
1627
|
+
HoverInfoLabelWidget(ai_frame, text="Dialogue Context Length:", tooltip="Number of previous/next lines to include as context for AI. 0 to disable. -1 for as many as possible (Use With Caution)",
|
1628
|
+
foreground="red", font=("Helvetica", 10, "bold"), row=self.current_row, column=0)
|
1629
|
+
self.ai_dialogue_context_length = ttk.Entry(ai_frame)
|
1630
|
+
self.ai_dialogue_context_length.insert(0, str(self.settings.ai.dialogue_context_length))
|
1631
|
+
self.ai_dialogue_context_length.grid(row=self.current_row, column=1, sticky='EW', pady=2)
|
1632
|
+
self.current_row += 1
|
1633
|
+
|
1626
1634
|
HoverInfoLabelWidget(ai_frame, text="Use Canned Translation Prompt:",
|
1627
1635
|
tooltip="Use a pre-defined translation prompt for AI.", row=self.current_row, column=0)
|
1628
1636
|
self.use_canned_translation_prompt = tk.BooleanVar(value=self.settings.ai.use_canned_translation_prompt)
|
@@ -1,12 +1,12 @@
|
|
1
1
|
GameSentenceMiner/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
2
2
|
GameSentenceMiner/anki.py,sha256=3BVFXAM7tpJAxHMbsMpnMHUoDfyqHQ1JSYJThW18QWA,16846
|
3
|
-
GameSentenceMiner/config_gui.py,sha256=
|
3
|
+
GameSentenceMiner/config_gui.py,sha256=QTK1yBDcfHaIUR_JyekkRQY9CVI_rh3Cae0bi7lviIo,99198
|
4
4
|
GameSentenceMiner/gametext.py,sha256=6VkjmBeiuZfPk8T6PHFdIAElBH2Y_oLVYvmcafqN7RM,6747
|
5
5
|
GameSentenceMiner/gsm.py,sha256=wTERcvG37SeDel51TCFusoQqk5B_b11YY4QZMTF0a6s,24954
|
6
6
|
GameSentenceMiner/obs.py,sha256=o_I6213VZvXqYkZDdUBgUg2KWi9SbnNZZjjUnKnQkK4,15190
|
7
7
|
GameSentenceMiner/vad.py,sha256=A3CvBQ67w3c7L8s7mTMxo6U_9ZQXlCToIpGUbePotfA,18321
|
8
8
|
GameSentenceMiner/ai/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
9
|
-
GameSentenceMiner/ai/ai_prompting.py,sha256=
|
9
|
+
GameSentenceMiner/ai/ai_prompting.py,sha256=ojp7i_xg2YB1zALgFbivwtXPMVkThnSbPoUiAs-nz_g,25892
|
10
10
|
GameSentenceMiner/assets/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
11
11
|
GameSentenceMiner/assets/icon.png,sha256=9GRL8uXUAgkUSlvbm9Pv9o2poFVRGdW6s2ub_DeUD9M,937624
|
12
12
|
GameSentenceMiner/assets/icon128.png,sha256=l90j7biwdz5ahwOd5wZ-406ryEV9Pan93dquJQ3e1CI,18395
|
@@ -30,7 +30,7 @@ GameSentenceMiner/owocr/owocr/run.py,sha256=lwZOj5nmQWgXlQOA_b2FYrMjhGWCPA7ZZCBg
|
|
30
30
|
GameSentenceMiner/owocr/owocr/screen_coordinate_picker.py,sha256=Na6XStbQBtpQUSdbN3QhEswtKuU1JjReFk_K8t5ezQE,3395
|
31
31
|
GameSentenceMiner/util/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
32
32
|
GameSentenceMiner/util/audio_offset_selector.py,sha256=8Stk3BP-XVIuzRv9nl9Eqd2D-1yD3JrgU-CamBywJmY,8542
|
33
|
-
GameSentenceMiner/util/configuration.py,sha256=
|
33
|
+
GameSentenceMiner/util/configuration.py,sha256=vwBehuEP2QVvbsyJx5x1EPXZEOtGsqeIQjlEES0vVdQ,28999
|
34
34
|
GameSentenceMiner/util/electron_config.py,sha256=3VmIrcXhC-wIMMc4uqV85NrNenRl4ZUbnQfSjWEwuig,9852
|
35
35
|
GameSentenceMiner/util/ffmpeg.py,sha256=t0tflxq170n8PZKkdw8fTZIUQfXD0p_qARa9JTdhBTc,21530
|
36
36
|
GameSentenceMiner/util/gsm_utils.py,sha256=iRyLVcodMptRhkCzLf3hyqc6_RCktXnwApi6mLju6oQ,11565
|
@@ -62,9 +62,9 @@ GameSentenceMiner/web/templates/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm
|
|
62
62
|
GameSentenceMiner/web/templates/index.html,sha256=Gv3CJvNnhAzIVV_QxhNq4OD-pXDt1vKCu9k6WdHSXuA,215343
|
63
63
|
GameSentenceMiner/web/templates/text_replacements.html,sha256=tV5c8mCaWSt_vKuUpbdbLAzXZ3ATZeDvQ9PnnAfqY0M,8598
|
64
64
|
GameSentenceMiner/web/templates/utility.html,sha256=3flZinKNqUJ7pvrZk6xu__v67z44rXnaK7UTZ303R-8,16946
|
65
|
-
gamesentenceminer-2.11.
|
66
|
-
gamesentenceminer-2.11.
|
67
|
-
gamesentenceminer-2.11.
|
68
|
-
gamesentenceminer-2.11.
|
69
|
-
gamesentenceminer-2.11.
|
70
|
-
gamesentenceminer-2.11.
|
65
|
+
gamesentenceminer-2.11.2.dist-info/licenses/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
|
66
|
+
gamesentenceminer-2.11.2.dist-info/METADATA,sha256=zpe9LIoyiK5AyBRjnGH7Blp8z5rksCm3Nrxng5CKhyg,7319
|
67
|
+
gamesentenceminer-2.11.2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
68
|
+
gamesentenceminer-2.11.2.dist-info/entry_points.txt,sha256=2APEP25DbfjSxGeHtwBstMH8mulVhLkqF_b9bqzU6vQ,65
|
69
|
+
gamesentenceminer-2.11.2.dist-info/top_level.txt,sha256=V1hUY6xVSyUEohb0uDoN4UIE6rUZ_JYx8yMyPGX4PgQ,18
|
70
|
+
gamesentenceminer-2.11.2.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|