GameSentenceMiner 2.8.12__py3-none-any.whl → 2.8.13__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 +15 -7
- GameSentenceMiner/configuration.py +4 -1
- GameSentenceMiner/web/texthooking_page.py +1 -0
- {gamesentenceminer-2.8.12.dist-info → gamesentenceminer-2.8.13.dist-info}/METADATA +1 -1
- {gamesentenceminer-2.8.12.dist-info → gamesentenceminer-2.8.13.dist-info}/RECORD +9 -9
- {gamesentenceminer-2.8.12.dist-info → gamesentenceminer-2.8.13.dist-info}/WHEEL +1 -1
- {gamesentenceminer-2.8.12.dist-info → gamesentenceminer-2.8.13.dist-info}/entry_points.txt +0 -0
- {gamesentenceminer-2.8.12.dist-info → gamesentenceminer-2.8.13.dist-info}/licenses/LICENSE +0 -0
- {gamesentenceminer-2.8.12.dist-info → gamesentenceminer-2.8.13.dist-info}/top_level.txt +0 -0
@@ -175,13 +175,21 @@ current_ai_config: Ai | None = None
|
|
175
175
|
|
176
176
|
def get_ai_prompt_result(lines: List[GameLine], sentence: str, current_line: GameLine, game_title: str = ""):
|
177
177
|
global ai_manager, current_ai_config
|
178
|
-
|
179
|
-
if get_config().ai
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
178
|
+
try:
|
179
|
+
if not ai_manager or get_config().ai != current_ai_config:
|
180
|
+
if get_config().ai.provider == AIType.GEMINI.value:
|
181
|
+
ai_manager = GeminiAI(model=get_config().ai.gemini_model, api_key=get_config().ai.gemini_api_key, logger=logger)
|
182
|
+
elif get_config().ai.provider == AIType.GROQ.value:
|
183
|
+
ai_manager = GroqAI(model=get_config().ai.groq_model, api_key=get_config().ai.groq_api_key, logger=logger)
|
184
|
+
current_ai_config = get_config().ai
|
185
|
+
if not ai_manager:
|
186
|
+
logger.error("AI is enabled but the AI Manager did not initialize. Check your AI Config IN GSM.")
|
187
|
+
return ""
|
188
|
+
return ai_manager.process(lines, sentence, current_line, game_title)
|
189
|
+
except Exception as e:
|
190
|
+
logger.info("Error caught while trying to get AI prompt result. Check logs for more details.")
|
191
|
+
logger.debug(e)
|
192
|
+
return ""
|
185
193
|
|
186
194
|
if __name__ == '__main__':
|
187
195
|
lines = [
|
@@ -200,7 +200,10 @@ class Ai:
|
|
200
200
|
def __post_init__(self):
|
201
201
|
if not self.gemini_api_key:
|
202
202
|
self.gemini_api_key = self.api_key
|
203
|
-
|
203
|
+
if self.provider == 'gemini':
|
204
|
+
self.provider = AI_GEMINI
|
205
|
+
if self.provider == 'groq':
|
206
|
+
self.provider = AI_GROQ
|
204
207
|
|
205
208
|
@dataclass_json
|
206
209
|
@dataclass
|
@@ -1,7 +1,7 @@
|
|
1
1
|
GameSentenceMiner/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
2
2
|
GameSentenceMiner/anki.py,sha256=pSkf-il17vKZIBt1ZHHDMfvfO9M-GdF1zox-c--KkAY,14208
|
3
3
|
GameSentenceMiner/config_gui.py,sha256=6TkDLW-0SPWMeNAwzb5WT7aVJ8mxPqmhAQcS1BHzTik,70979
|
4
|
-
GameSentenceMiner/configuration.py,sha256=
|
4
|
+
GameSentenceMiner/configuration.py,sha256=rxl0YocwAF8cCBakOl7k2CPpOfL3FZxnsGMlKZOezmc,21876
|
5
5
|
GameSentenceMiner/electron_config.py,sha256=dGcPYCISPehXubYSzsDuI2Gl092MYK0u3bTnkL9Jh1Y,9787
|
6
6
|
GameSentenceMiner/ffmpeg.py,sha256=mcEcJnYl06oJGbLaymFUfqClFiHf6Hhf2SXo3UV9tvM,13378
|
7
7
|
GameSentenceMiner/gametext.py,sha256=ClSpOeohBWG17MRVIbhXfNDnkUdxU9mTspGv9975uEc,5422
|
@@ -13,7 +13,7 @@ GameSentenceMiner/package.py,sha256=YlS6QRMuVlm6mdXx0rlXv9_3erTGS21jaP3PNNWfAH0,
|
|
13
13
|
GameSentenceMiner/text_log.py,sha256=tBuZ8ElUgPtiQV8U6U90kmRxposwIkL3fjOYejdzikc,5153
|
14
14
|
GameSentenceMiner/util.py,sha256=bb75EQdk4Nf0i9t3XMznjd6NxTWfkOVeE5bZFstbCbU,8910
|
15
15
|
GameSentenceMiner/ai/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
16
|
-
GameSentenceMiner/ai/ai_prompting.py,sha256=
|
16
|
+
GameSentenceMiner/ai/ai_prompting.py,sha256=uTtXIDRpcQqPT4EC-R_pwRP9pBmZ64I6vMDOexhJRp8,9505
|
17
17
|
GameSentenceMiner/communication/__init__.py,sha256=_jGn9PJxtOAOPtJ2rI-Qu9hEHVZVpIvWlxKvqk91_zI,638
|
18
18
|
GameSentenceMiner/communication/send.py,sha256=oOJdCS6-LNX90amkRn5FL2xqx6THGm56zHR2ntVIFTE,229
|
19
19
|
GameSentenceMiner/communication/websocket.py,sha256=pTcUe_ZZRp9REdSU4qalhPmbT_1DKa7w18j6RfFLELA,3074
|
@@ -38,7 +38,7 @@ GameSentenceMiner/vad/silero_trim.py,sha256=ULf3zwS-JMsY82cKF7gZxREHw8L6lgpWF2U1
|
|
38
38
|
GameSentenceMiner/vad/vosk_helper.py,sha256=125X8C9NxFPlWWpoNsbOnEqKx8RCjXN109zNx_QXhyg,6070
|
39
39
|
GameSentenceMiner/vad/whisper_helper.py,sha256=JJ-iltCh813XdjyEw0Wn5DaErf6PDqfH0Efu1Md8cIY,3543
|
40
40
|
GameSentenceMiner/web/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
41
|
-
GameSentenceMiner/web/texthooking_page.py,sha256=
|
41
|
+
GameSentenceMiner/web/texthooking_page.py,sha256=Xf-m_bNSPUNO5x1u4sYdEtHx6ERF8IXrkF9wDx9pto8,12791
|
42
42
|
GameSentenceMiner/web/static/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
43
43
|
GameSentenceMiner/web/static/apple-touch-icon.png,sha256=OcMI8af_68DA_tweOsQ5LytTyMwm7-hPW07IfrOVgEs,46132
|
44
44
|
GameSentenceMiner/web/static/favicon-96x96.png,sha256=lOePzjiKl1JY2J1kT_PMdyEnrlJmi5GWbmXJunM12B4,16502
|
@@ -51,9 +51,9 @@ GameSentenceMiner/web/static/web-app-manifest-512x512.png,sha256=wyqgCWCrLEUxSRX
|
|
51
51
|
GameSentenceMiner/web/templates/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
52
52
|
GameSentenceMiner/web/templates/text_replacements.html,sha256=tV5c8mCaWSt_vKuUpbdbLAzXZ3ATZeDvQ9PnnAfqY0M,8598
|
53
53
|
GameSentenceMiner/web/templates/utility.html,sha256=8yJvmHqkHoMN06qWDckhGoguWyP7LUVZ2oms0tBRdEw,14297
|
54
|
-
gamesentenceminer-2.8.
|
55
|
-
gamesentenceminer-2.8.
|
56
|
-
gamesentenceminer-2.8.
|
57
|
-
gamesentenceminer-2.8.
|
58
|
-
gamesentenceminer-2.8.
|
59
|
-
gamesentenceminer-2.8.
|
54
|
+
gamesentenceminer-2.8.13.dist-info/licenses/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
|
55
|
+
gamesentenceminer-2.8.13.dist-info/METADATA,sha256=EGC_NS8I5l3YuHp0Sd9TaUyVfp_9u3NkZboAZqsAxvM,5933
|
56
|
+
gamesentenceminer-2.8.13.dist-info/WHEEL,sha256=ooBFpIzZCPdw3uqIQsOo4qqbA4ZRPxHnOH7peeONza0,91
|
57
|
+
gamesentenceminer-2.8.13.dist-info/entry_points.txt,sha256=2APEP25DbfjSxGeHtwBstMH8mulVhLkqF_b9bqzU6vQ,65
|
58
|
+
gamesentenceminer-2.8.13.dist-info/top_level.txt,sha256=V1hUY6xVSyUEohb0uDoN4UIE6rUZ_JYx8yMyPGX4PgQ,18
|
59
|
+
gamesentenceminer-2.8.13.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|