webscout 7.5__py3-none-any.whl → 7.7__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.

Potentially problematic release.


This version of webscout might be problematic. Click here for more details.

Files changed (132) hide show
  1. webscout/AIauto.py +5 -53
  2. webscout/AIutel.py +8 -318
  3. webscout/DWEBS.py +460 -489
  4. webscout/Extra/YTToolkit/YTdownloader.py +14 -53
  5. webscout/Extra/YTToolkit/transcriber.py +12 -13
  6. webscout/Extra/YTToolkit/ytapi/video.py +0 -1
  7. webscout/Extra/__init__.py +0 -1
  8. webscout/Extra/autocoder/__init__.py +9 -9
  9. webscout/Extra/autocoder/autocoder_utiles.py +193 -199
  10. webscout/Extra/autocoder/rawdog.py +789 -677
  11. webscout/Extra/gguf.py +682 -428
  12. webscout/Extra/weather.py +178 -156
  13. webscout/Extra/weather_ascii.py +70 -17
  14. webscout/Litlogger/core/logger.py +1 -2
  15. webscout/Litlogger/handlers/file.py +1 -1
  16. webscout/Litlogger/styles/formats.py +0 -2
  17. webscout/Litlogger/utils/detectors.py +0 -1
  18. webscout/Provider/AISEARCH/DeepFind.py +0 -1
  19. webscout/Provider/AISEARCH/ISou.py +1 -22
  20. webscout/Provider/AISEARCH/felo_search.py +0 -1
  21. webscout/Provider/AllenAI.py +28 -30
  22. webscout/Provider/C4ai.py +29 -11
  23. webscout/Provider/ChatGPTClone.py +226 -0
  24. webscout/Provider/ChatGPTGratis.py +24 -56
  25. webscout/Provider/DeepSeek.py +25 -17
  26. webscout/Provider/Deepinfra.py +115 -48
  27. webscout/Provider/Gemini.py +1 -1
  28. webscout/Provider/Glider.py +33 -12
  29. webscout/Provider/HF_space/qwen_qwen2.py +2 -2
  30. webscout/Provider/HeckAI.py +23 -7
  31. webscout/Provider/Hunyuan.py +272 -0
  32. webscout/Provider/Jadve.py +20 -5
  33. webscout/Provider/LambdaChat.py +391 -0
  34. webscout/Provider/Netwrck.py +42 -19
  35. webscout/Provider/OLLAMA.py +256 -32
  36. webscout/Provider/PI.py +4 -2
  37. webscout/Provider/Perplexitylabs.py +26 -6
  38. webscout/Provider/PizzaGPT.py +10 -51
  39. webscout/Provider/TTI/AiForce/async_aiforce.py +4 -37
  40. webscout/Provider/TTI/AiForce/sync_aiforce.py +41 -38
  41. webscout/Provider/TTI/FreeAIPlayground/__init__.py +9 -9
  42. webscout/Provider/TTI/FreeAIPlayground/async_freeaiplayground.py +179 -206
  43. webscout/Provider/TTI/FreeAIPlayground/sync_freeaiplayground.py +180 -192
  44. webscout/Provider/TTI/MagicStudio/__init__.py +2 -0
  45. webscout/Provider/TTI/MagicStudio/async_magicstudio.py +111 -0
  46. webscout/Provider/TTI/MagicStudio/sync_magicstudio.py +109 -0
  47. webscout/Provider/TTI/PollinationsAI/async_pollinations.py +5 -24
  48. webscout/Provider/TTI/PollinationsAI/sync_pollinations.py +2 -22
  49. webscout/Provider/TTI/__init__.py +2 -3
  50. webscout/Provider/TTI/aiarta/async_aiarta.py +14 -14
  51. webscout/Provider/TTI/aiarta/sync_aiarta.py +52 -21
  52. webscout/Provider/TTI/artbit/async_artbit.py +3 -32
  53. webscout/Provider/TTI/artbit/sync_artbit.py +3 -31
  54. webscout/Provider/TTI/fastflux/__init__.py +22 -0
  55. webscout/Provider/TTI/fastflux/async_fastflux.py +261 -0
  56. webscout/Provider/TTI/fastflux/sync_fastflux.py +252 -0
  57. webscout/Provider/TTI/piclumen/__init__.py +22 -22
  58. webscout/Provider/TTI/piclumen/sync_piclumen.py +232 -232
  59. webscout/Provider/TTS/__init__.py +2 -2
  60. webscout/Provider/TTS/deepgram.py +12 -39
  61. webscout/Provider/TTS/elevenlabs.py +14 -40
  62. webscout/Provider/TTS/gesserit.py +11 -35
  63. webscout/Provider/TTS/murfai.py +13 -39
  64. webscout/Provider/TTS/parler.py +17 -40
  65. webscout/Provider/TTS/speechma.py +180 -0
  66. webscout/Provider/TTS/streamElements.py +17 -44
  67. webscout/Provider/TextPollinationsAI.py +39 -59
  68. webscout/Provider/Venice.py +25 -8
  69. webscout/Provider/WebSim.py +227 -0
  70. webscout/Provider/WiseCat.py +27 -5
  71. webscout/Provider/Youchat.py +64 -37
  72. webscout/Provider/__init__.py +12 -7
  73. webscout/Provider/akashgpt.py +20 -5
  74. webscout/Provider/flowith.py +33 -7
  75. webscout/Provider/freeaichat.py +32 -45
  76. webscout/Provider/koala.py +20 -5
  77. webscout/Provider/labyrinth.py +239 -0
  78. webscout/Provider/learnfastai.py +28 -15
  79. webscout/Provider/llamatutor.py +1 -1
  80. webscout/Provider/llmchat.py +30 -8
  81. webscout/Provider/multichat.py +65 -9
  82. webscout/Provider/sonus.py +208 -0
  83. webscout/Provider/talkai.py +1 -0
  84. webscout/Provider/turboseek.py +3 -0
  85. webscout/Provider/tutorai.py +2 -0
  86. webscout/Provider/typegpt.py +155 -65
  87. webscout/Provider/uncovr.py +297 -0
  88. webscout/Provider/x0gpt.py +3 -1
  89. webscout/Provider/yep.py +102 -20
  90. webscout/__init__.py +3 -0
  91. webscout/cli.py +53 -40
  92. webscout/conversation.py +1 -10
  93. webscout/litagent/__init__.py +2 -2
  94. webscout/litagent/agent.py +356 -20
  95. webscout/litagent/constants.py +34 -5
  96. webscout/litprinter/__init__.py +0 -3
  97. webscout/models.py +181 -0
  98. webscout/optimizers.py +1 -1
  99. webscout/prompt_manager.py +2 -8
  100. webscout/scout/core/scout.py +1 -4
  101. webscout/scout/core/search_result.py +1 -1
  102. webscout/scout/core/text_utils.py +1 -1
  103. webscout/scout/core.py +2 -5
  104. webscout/scout/element.py +1 -1
  105. webscout/scout/parsers/html_parser.py +1 -1
  106. webscout/scout/utils.py +0 -1
  107. webscout/swiftcli/__init__.py +1 -3
  108. webscout/tempid.py +1 -1
  109. webscout/update_checker.py +1 -3
  110. webscout/version.py +1 -1
  111. webscout/webscout_search_async.py +1 -2
  112. webscout/yep_search.py +297 -297
  113. {webscout-7.5.dist-info → webscout-7.7.dist-info}/LICENSE.md +4 -4
  114. {webscout-7.5.dist-info → webscout-7.7.dist-info}/METADATA +127 -405
  115. {webscout-7.5.dist-info → webscout-7.7.dist-info}/RECORD +118 -117
  116. webscout/Extra/autollama.py +0 -231
  117. webscout/Provider/Amigo.py +0 -274
  118. webscout/Provider/Bing.py +0 -243
  119. webscout/Provider/DiscordRocks.py +0 -253
  120. webscout/Provider/TTI/blackbox/__init__.py +0 -4
  121. webscout/Provider/TTI/blackbox/async_blackbox.py +0 -212
  122. webscout/Provider/TTI/blackbox/sync_blackbox.py +0 -199
  123. webscout/Provider/TTI/deepinfra/__init__.py +0 -4
  124. webscout/Provider/TTI/deepinfra/async_deepinfra.py +0 -227
  125. webscout/Provider/TTI/deepinfra/sync_deepinfra.py +0 -199
  126. webscout/Provider/TTI/imgninza/__init__.py +0 -4
  127. webscout/Provider/TTI/imgninza/async_ninza.py +0 -214
  128. webscout/Provider/TTI/imgninza/sync_ninza.py +0 -209
  129. webscout/Provider/TTS/voicepod.py +0 -117
  130. {webscout-7.5.dist-info → webscout-7.7.dist-info}/WHEEL +0 -0
  131. {webscout-7.5.dist-info → webscout-7.7.dist-info}/entry_points.txt +0 -0
  132. {webscout-7.5.dist-info → webscout-7.7.dist-info}/top_level.txt +0 -0
webscout/AIauto.py CHANGED
@@ -1,20 +1,11 @@
1
1
  from webscout.AIbase import Provider
2
- from webscout.g4f import GPT4FREE, TestProviders
3
2
  from webscout.exceptions import AllProvidersFailure
4
- from webscout.Litlogger import Litlogger, LogFormat, ColorScheme
5
3
  from typing import Union, Any, Dict, Generator
6
4
  import importlib
7
5
  import pkgutil
8
6
  import random
9
7
  import inspect
10
8
 
11
- # Initialize LitLogger with cyberpunk theme
12
- logger = Litlogger(
13
- name="AIauto",
14
- format=LogFormat.DETAILED,
15
- color_scheme=ColorScheme.CYBERPUNK
16
- )
17
-
18
9
  def load_providers():
19
10
  provider_map = {}
20
11
  api_key_providers = set()
@@ -30,13 +21,8 @@ def load_providers():
30
21
  # Check if the provider needs an API key
31
22
  if 'api_key' in inspect.signature(attr.__init__).parameters:
32
23
  api_key_providers.add(attr_name.upper())
33
- logger.debug(f"Provider {attr_name} requires API key")
34
- logger.success(f"Loaded provider module: {module_name}")
35
- except Exception as e:
36
- logger.error(f"Failed to load provider {module_name}: {str(e)}")
37
-
38
- logger.info(f"Total providers loaded: {len(provider_map)}")
39
- logger.info(f"API key providers: {len(api_key_providers)}")
24
+ except Exception:
25
+ pass
40
26
  return provider_map, api_key_providers
41
27
 
42
28
  provider_map, api_key_providers = load_providers()
@@ -106,7 +92,6 @@ class AUTO(Provider):
106
92
  for provider_name, provider_class in available_providers:
107
93
  try:
108
94
  self.provider_name = f"webscout-{provider_name}"
109
- logger.info(f"Trying provider: {self.provider_name}")
110
95
 
111
96
  self.provider = provider_class(
112
97
  is_conversation=self.is_conversation,
@@ -120,44 +105,11 @@ class AUTO(Provider):
120
105
  act=self.act,
121
106
  )
122
107
  response = self.provider.ask(**ask_kwargs)
123
- logger.success(f"Successfully used provider: {self.provider_name}")
124
- return response
125
- except Exception as e:
126
- logger.warning(f"Provider {self.provider_name} failed: {str(e)}")
127
- continue
128
-
129
- # Try GPT4FREE providers
130
- gpt4free_providers = TestProviders(timeout=self.timeout).get_results(run=run_new_test)
131
- random.shuffle(gpt4free_providers)
132
-
133
- for provider_info in gpt4free_providers:
134
- if provider_info["name"].upper() in self.exclude:
135
- continue
136
- try:
137
- self.provider_name = f"g4f-{provider_info['name']}"
138
- logger.info(f"Trying provider: {self.provider_name}")
139
-
140
- self.provider = GPT4FREE(
141
- provider=provider_info["name"],
142
- is_conversation=self.is_conversation,
143
- max_tokens=self.max_tokens,
144
- intro=self.intro,
145
- filepath=self.filepath,
146
- update_file=self.update_file,
147
- proxies=self.proxies,
148
- history_offset=self.history_offset,
149
- act=self.act,
150
- )
151
-
152
- response = self.provider.ask(**ask_kwargs)
153
- logger.success(f"Successfully used provider: {self.provider_name}")
154
108
  return response
155
- except Exception as e:
156
- logger.warning(f"Provider {self.provider_name} failed: {str(e)}")
109
+ except Exception:
157
110
  continue
158
111
 
159
112
  # If we get here, all providers failed
160
- logger.error("All providers failed to process the request")
161
113
  raise AllProvidersFailure("All providers failed to process the request")
162
114
 
163
115
  def chat(
@@ -167,7 +119,7 @@ class AUTO(Provider):
167
119
  optimizer: str = None,
168
120
  conversationally: bool = False,
169
121
  run_new_test: bool = False,
170
- ) -> Union[str, Generator[str, None, None]]:
122
+ ) -> Union[str, Generator[str, None, None]]:
171
123
  response = self.ask(
172
124
  prompt,
173
125
  stream,
@@ -184,8 +136,8 @@ class AUTO(Provider):
184
136
  def get_message(self, response: dict) -> str:
185
137
  assert self.provider is not None, "Chat with AI first"
186
138
  return self.provider.get_message(response)
139
+
187
140
  if __name__ == "__main__":
188
141
  auto = AUTO()
189
-
190
142
  response = auto.chat("Hello, how are you?")
191
143
  print(response)
webscout/AIutel.py CHANGED
@@ -1,25 +1,8 @@
1
- import os
2
1
  import json
3
2
  import platform
4
3
  import subprocess
5
- import logging
6
- import threading
7
- import time
8
- import datetime
9
- import re
10
- import sys
11
- from rich.markdown import Markdown
12
- from rich.console import Console
13
- from typing import List, Tuple, Union
14
- from typing import NoReturn
15
- import requests
16
- from pathlib import Path
17
- from playsound import playsound
18
- from time import sleep as wait
19
- import pathlib
20
- import urllib.parse
21
4
 
22
- default_path = os.path.join(os.path.expanduser("~"), ".cache", "AIWEBS", "webscout")
5
+
23
6
 
24
7
  def sanitize_stream(
25
8
  chunk: str, intro_value: str = "data:", to_json: bool = True
@@ -39,6 +22,7 @@ def sanitize_stream(
39
22
  chunk = chunk[len(intro_value) :]
40
23
 
41
24
  return json.loads(chunk) if to_json else chunk
25
+
42
26
  def run_system_command(
43
27
  command: str,
44
28
  exit_on_error: bool = True,
@@ -50,9 +34,9 @@ def run_system_command(
50
34
  command (str): shell command
51
35
  exit_on_error (bool, optional): Exit on error. Defaults to True.
52
36
  stdout_error (bool, optional): Print out the error. Defaults to True
53
- help (str, optional): Help info incase of exception. Defaults to None.
37
+ help (str, optional): Help info in case of exception. Defaults to None.
54
38
  Returns:
55
- tuple : (is_successfull, object[Exception|Subprocess.run])
39
+ tuple : (is_successful, object[Exception|Subprocess.run])
56
40
  """
57
41
  try:
58
42
  # Run the command and capture the output
@@ -71,15 +55,6 @@ def run_system_command(
71
55
  else:
72
56
  return (False, e)
73
57
 
74
-
75
- from .conversation import Conversation
76
-
77
- from .optimizers import Optimizers
78
-
79
- from .Extra.autocoder import AutoCoder
80
-
81
- from .prompt_manager import AwesomePrompts
82
-
83
58
  class Updates:
84
59
  """Webscout latest release info"""
85
60
 
@@ -147,295 +122,10 @@ class Updates:
147
122
 
148
123
  return sorted
149
124
 
125
+ from .conversation import Conversation
150
126
 
151
- class Audio:
152
- # Request headers
153
- headers: dict[str, str] = {
154
- "User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36"
155
- }
156
- cache_dir = pathlib.Path("./audio_cache")
157
- all_voices: list[str] = [
158
- "Filiz",
159
- "Astrid",
160
- "Tatyana",
161
- "Maxim",
162
- "Carmen",
163
- "Ines",
164
- "Cristiano",
165
- "Vitoria",
166
- "Ricardo",
167
- "Maja",
168
- "Jan",
169
- "Jacek",
170
- "Ewa",
171
- "Ruben",
172
- "Lotte",
173
- "Liv",
174
- "Seoyeon",
175
- "Takumi",
176
- "Mizuki",
177
- "Giorgio",
178
- "Carla",
179
- "Bianca",
180
- "Karl",
181
- "Dora",
182
- "Mathieu",
183
- "Celine",
184
- "Chantal",
185
- "Penelope",
186
- "Miguel",
187
- "Mia",
188
- "Enrique",
189
- "Conchita",
190
- "Geraint",
191
- "Salli",
192
- "Matthew",
193
- "Kimberly",
194
- "Kendra",
195
- "Justin",
196
- "Joey",
197
- "Joanna",
198
- "Ivy",
199
- "Raveena",
200
- "Aditi",
201
- "Emma",
202
- "Brian",
203
- "Amy",
204
- "Russell",
205
- "Nicole",
206
- "Vicki",
207
- "Marlene",
208
- "Hans",
209
- "Naja",
210
- "Mads",
211
- "Gwyneth",
212
- "Zhiyu",
213
- "es-ES-Standard-A",
214
- "it-IT-Standard-A",
215
- "it-IT-Wavenet-A",
216
- "ja-JP-Standard-A",
217
- "ja-JP-Wavenet-A",
218
- "ko-KR-Standard-A",
219
- "ko-KR-Wavenet-A",
220
- "pt-BR-Standard-A",
221
- "tr-TR-Standard-A",
222
- "sv-SE-Standard-A",
223
- "nl-NL-Standard-A",
224
- "nl-NL-Wavenet-A",
225
- "en-US-Wavenet-A",
226
- "en-US-Wavenet-B",
227
- "en-US-Wavenet-C",
228
- "en-US-Wavenet-D",
229
- "en-US-Wavenet-E",
230
- "en-US-Wavenet-F",
231
- "en-GB-Standard-A",
232
- "en-GB-Standard-B",
233
- "en-GB-Standard-C",
234
- "en-GB-Standard-D",
235
- "en-GB-Wavenet-A",
236
- "en-GB-Wavenet-B",
237
- "en-GB-Wavenet-C",
238
- "en-GB-Wavenet-D",
239
- "en-US-Standard-B",
240
- "en-US-Standard-C",
241
- "en-US-Standard-D",
242
- "en-US-Standard-E",
243
- "de-DE-Standard-A",
244
- "de-DE-Standard-B",
245
- "de-DE-Wavenet-A",
246
- "de-DE-Wavenet-B",
247
- "de-DE-Wavenet-C",
248
- "de-DE-Wavenet-D",
249
- "en-AU-Standard-A",
250
- "en-AU-Standard-B",
251
- "en-AU-Wavenet-A",
252
- "en-AU-Wavenet-B",
253
- "en-AU-Wavenet-C",
254
- "en-AU-Wavenet-D",
255
- "en-AU-Standard-C",
256
- "en-AU-Standard-D",
257
- "fr-CA-Standard-A",
258
- "fr-CA-Standard-B",
259
- "fr-CA-Standard-C",
260
- "fr-CA-Standard-D",
261
- "fr-FR-Standard-C",
262
- "fr-FR-Standard-D",
263
- "fr-FR-Wavenet-A",
264
- "fr-FR-Wavenet-B",
265
- "fr-FR-Wavenet-C",
266
- "fr-FR-Wavenet-D",
267
- "da-DK-Wavenet-A",
268
- "pl-PL-Wavenet-A",
269
- "pl-PL-Wavenet-B",
270
- "pl-PL-Wavenet-C",
271
- "pl-PL-Wavenet-D",
272
- "pt-PT-Wavenet-A",
273
- "pt-PT-Wavenet-B",
274
- "pt-PT-Wavenet-C",
275
- "pt-PT-Wavenet-D",
276
- "ru-RU-Wavenet-A",
277
- "ru-RU-Wavenet-B",
278
- "ru-RU-Wavenet-C",
279
- "ru-RU-Wavenet-D",
280
- "sk-SK-Wavenet-A",
281
- "tr-TR-Wavenet-A",
282
- "tr-TR-Wavenet-B",
283
- "tr-TR-Wavenet-C",
284
- "tr-TR-Wavenet-D",
285
- "tr-TR-Wavenet-E",
286
- "uk-UA-Wavenet-A",
287
- "ar-XA-Wavenet-A",
288
- "ar-XA-Wavenet-B",
289
- "ar-XA-Wavenet-C",
290
- "cs-CZ-Wavenet-A",
291
- "nl-NL-Wavenet-B",
292
- "nl-NL-Wavenet-C",
293
- "nl-NL-Wavenet-D",
294
- "nl-NL-Wavenet-E",
295
- "en-IN-Wavenet-A",
296
- "en-IN-Wavenet-B",
297
- "en-IN-Wavenet-C",
298
- "fil-PH-Wavenet-A",
299
- "fi-FI-Wavenet-A",
300
- "el-GR-Wavenet-A",
301
- "hi-IN-Wavenet-A",
302
- "hi-IN-Wavenet-B",
303
- "hi-IN-Wavenet-C",
304
- "hu-HU-Wavenet-A",
305
- "id-ID-Wavenet-A",
306
- "id-ID-Wavenet-B",
307
- "id-ID-Wavenet-C",
308
- "it-IT-Wavenet-B",
309
- "it-IT-Wavenet-C",
310
- "it-IT-Wavenet-D",
311
- "ja-JP-Wavenet-B",
312
- "ja-JP-Wavenet-C",
313
- "ja-JP-Wavenet-D",
314
- "cmn-CN-Wavenet-A",
315
- "cmn-CN-Wavenet-B",
316
- "cmn-CN-Wavenet-C",
317
- "cmn-CN-Wavenet-D",
318
- "nb-no-Wavenet-E",
319
- "nb-no-Wavenet-A",
320
- "nb-no-Wavenet-B",
321
- "nb-no-Wavenet-C",
322
- "nb-no-Wavenet-D",
323
- "vi-VN-Wavenet-A",
324
- "vi-VN-Wavenet-B",
325
- "vi-VN-Wavenet-C",
326
- "vi-VN-Wavenet-D",
327
- "sr-rs-Standard-A",
328
- "lv-lv-Standard-A",
329
- "is-is-Standard-A",
330
- "bg-bg-Standard-A",
331
- "af-ZA-Standard-A",
332
- "Tracy",
333
- "Danny",
334
- "Huihui",
335
- "Yaoyao",
336
- "Kangkang",
337
- "HanHan",
338
- "Zhiwei",
339
- "Asaf",
340
- "An",
341
- "Stefanos",
342
- "Filip",
343
- "Ivan",
344
- "Heidi",
345
- "Herena",
346
- "Kalpana",
347
- "Hemant",
348
- "Matej",
349
- "Andika",
350
- "Rizwan",
351
- "Lado",
352
- "Valluvar",
353
- "Linda",
354
- "Heather",
355
- "Sean",
356
- "Michael",
357
- "Karsten",
358
- "Guillaume",
359
- "Pattara",
360
- "Jakub",
361
- "Szabolcs",
362
- "Hoda",
363
- "Naayf",
364
- ]
365
-
366
- @classmethod
367
- def text_to_audio(
368
- cls,
369
- message: str,
370
- voice: str = "Brian",
371
- save_to: Union[Path, str] = None,
372
- auto: bool = True,
373
- ) -> Union[str, bytes]:
374
- """
375
- Text to speech using StreamElements API
376
-
377
- Parameters:
378
- message (str): The text to convert to speech
379
- voice (str, optional): The voice to use for speech synthesis. Defaults to "Brian".
380
- save_to (bool, optional): Path to save the audio file. Defaults to None.
381
- auto (bool, optional): Generate filename based on `message` and save to `cls.cache_dir`. Defaults to False.
382
-
383
- Returns:
384
- result (Union[str, bytes]): Path to saved contents or audio content.
385
- """
386
- assert (
387
- voice in cls.all_voices
388
- ), f"Voice '{voice}' not one of [{', '.join(cls.all_voices)}]"
389
- # Base URL for provider API
390
- url: str = (
391
- f"https://api.streamelements.com/kappa/v2/speech?voice={voice}&text={{{urllib.parse.quote(message)}}}"
392
- )
393
- resp = requests.get(url=url, headers=cls.headers, stream=True)
394
- if not resp.ok:
395
- raise Exception(
396
- f"Failed to perform the operation - ({resp.status_code}, {resp.reason}) - {resp.text}"
397
- )
398
-
399
- def sanitize_filename(path):
400
- trash = [
401
- "\\",
402
- "/",
403
- ":",
404
- "*",
405
- "?",
406
- '"',
407
- "<",
408
- "|",
409
- ">",
410
- ]
411
- for val in trash:
412
- path = path.replace(val, "")
413
- return path.strip()
414
-
415
- if auto:
416
- filename: str = message + "..." if len(message) <= 40 else message[:40]
417
- save_to = cls.cache_dir / sanitize_filename(filename)
418
- save_to = save_to.as_posix()
419
-
420
- # Ensure cache_dir exists
421
- cls.cache_dir.mkdir(parents=True, exist_ok=True)
422
-
423
- if save_to:
424
- if not save_to.endswith("mp3"):
425
- save_to += ".mp3"
127
+ from .optimizers import Optimizers
426
128
 
427
- with open(save_to, "wb") as fh:
428
- for chunk in resp.iter_content(chunk_size=512):
429
- fh.write(chunk)
430
- else:
431
- return resp.content
432
- return save_to
129
+ from .Extra.autocoder import AutoCoder
433
130
 
434
- @staticmethod
435
- def play(path_to_audio_file: Union[Path, str]) -> NoReturn:
436
- """Play audio (.mp3) using playsound.
437
- """
438
- if not Path(path_to_audio_file).is_file():
439
- raise FileNotFoundError(f"File does not exist - '{path_to_audio_file}'")
440
- playsound(path_to_audio_file)
441
- #
131
+ from .prompt_manager import AwesomePrompts