webscout 8.2.6__py3-none-any.whl → 8.2.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 (292) hide show
  1. webscout/AIutel.py +97 -87
  2. webscout/version.py +1 -1
  3. {webscout-8.2.6.dist-info → webscout-8.2.7.dist-info}/METADATA +2 -15
  4. webscout-8.2.7.dist-info/RECORD +26 -0
  5. {webscout-8.2.6.dist-info → webscout-8.2.7.dist-info}/WHEEL +1 -1
  6. webscout-8.2.7.dist-info/entry_points.txt +3 -0
  7. webscout-8.2.7.dist-info/top_level.txt +1 -0
  8. webscout/Extra/GitToolkit/__init__.py +0 -10
  9. webscout/Extra/GitToolkit/gitapi/__init__.py +0 -12
  10. webscout/Extra/GitToolkit/gitapi/repository.py +0 -195
  11. webscout/Extra/GitToolkit/gitapi/user.py +0 -96
  12. webscout/Extra/GitToolkit/gitapi/utils.py +0 -62
  13. webscout/Extra/YTToolkit/YTdownloader.py +0 -957
  14. webscout/Extra/YTToolkit/__init__.py +0 -3
  15. webscout/Extra/YTToolkit/transcriber.py +0 -476
  16. webscout/Extra/YTToolkit/ytapi/__init__.py +0 -6
  17. webscout/Extra/YTToolkit/ytapi/channel.py +0 -307
  18. webscout/Extra/YTToolkit/ytapi/errors.py +0 -13
  19. webscout/Extra/YTToolkit/ytapi/extras.py +0 -45
  20. webscout/Extra/YTToolkit/ytapi/https.py +0 -88
  21. webscout/Extra/YTToolkit/ytapi/patterns.py +0 -61
  22. webscout/Extra/YTToolkit/ytapi/playlist.py +0 -59
  23. webscout/Extra/YTToolkit/ytapi/pool.py +0 -8
  24. webscout/Extra/YTToolkit/ytapi/query.py +0 -40
  25. webscout/Extra/YTToolkit/ytapi/stream.py +0 -63
  26. webscout/Extra/YTToolkit/ytapi/utils.py +0 -62
  27. webscout/Extra/YTToolkit/ytapi/video.py +0 -232
  28. webscout/Extra/__init__.py +0 -7
  29. webscout/Extra/autocoder/__init__.py +0 -9
  30. webscout/Extra/autocoder/autocoder.py +0 -910
  31. webscout/Extra/autocoder/autocoder_utiles.py +0 -332
  32. webscout/Extra/gguf.py +0 -684
  33. webscout/Extra/tempmail/__init__.py +0 -28
  34. webscout/Extra/tempmail/async_utils.py +0 -141
  35. webscout/Extra/tempmail/base.py +0 -161
  36. webscout/Extra/tempmail/cli.py +0 -187
  37. webscout/Extra/tempmail/emailnator.py +0 -84
  38. webscout/Extra/tempmail/mail_tm.py +0 -361
  39. webscout/Extra/tempmail/temp_mail_io.py +0 -292
  40. webscout/Extra/weather.py +0 -194
  41. webscout/Extra/weather_ascii.py +0 -76
  42. webscout/Litlogger/__init__.py +0 -67
  43. webscout/Litlogger/core/__init__.py +0 -6
  44. webscout/Litlogger/core/level.py +0 -23
  45. webscout/Litlogger/core/logger.py +0 -165
  46. webscout/Litlogger/handlers/__init__.py +0 -12
  47. webscout/Litlogger/handlers/console.py +0 -33
  48. webscout/Litlogger/handlers/file.py +0 -143
  49. webscout/Litlogger/handlers/network.py +0 -173
  50. webscout/Litlogger/styles/__init__.py +0 -7
  51. webscout/Litlogger/styles/colors.py +0 -249
  52. webscout/Litlogger/styles/formats.py +0 -458
  53. webscout/Litlogger/styles/text.py +0 -87
  54. webscout/Litlogger/utils/__init__.py +0 -6
  55. webscout/Litlogger/utils/detectors.py +0 -153
  56. webscout/Litlogger/utils/formatters.py +0 -200
  57. webscout/Provider/AI21.py +0 -177
  58. webscout/Provider/AISEARCH/DeepFind.py +0 -250
  59. webscout/Provider/AISEARCH/ISou.py +0 -256
  60. webscout/Provider/AISEARCH/Perplexity.py +0 -359
  61. webscout/Provider/AISEARCH/__init__.py +0 -10
  62. webscout/Provider/AISEARCH/felo_search.py +0 -228
  63. webscout/Provider/AISEARCH/genspark_search.py +0 -208
  64. webscout/Provider/AISEARCH/hika_search.py +0 -198
  65. webscout/Provider/AISEARCH/iask_search.py +0 -436
  66. webscout/Provider/AISEARCH/monica_search.py +0 -246
  67. webscout/Provider/AISEARCH/scira_search.py +0 -322
  68. webscout/Provider/AISEARCH/webpilotai_search.py +0 -281
  69. webscout/Provider/Aitopia.py +0 -316
  70. webscout/Provider/AllenAI.py +0 -447
  71. webscout/Provider/Andi.py +0 -228
  72. webscout/Provider/Blackboxai.py +0 -229
  73. webscout/Provider/ChatGPTClone.py +0 -237
  74. webscout/Provider/ChatGPTGratis.py +0 -194
  75. webscout/Provider/ChatSandbox.py +0 -342
  76. webscout/Provider/Cloudflare.py +0 -325
  77. webscout/Provider/Cohere.py +0 -208
  78. webscout/Provider/Deepinfra.py +0 -338
  79. webscout/Provider/ElectronHub.py +0 -773
  80. webscout/Provider/ExaAI.py +0 -261
  81. webscout/Provider/ExaChat.py +0 -358
  82. webscout/Provider/Free2GPT.py +0 -241
  83. webscout/Provider/GPTWeb.py +0 -249
  84. webscout/Provider/Gemini.py +0 -169
  85. webscout/Provider/GithubChat.py +0 -370
  86. webscout/Provider/GizAI.py +0 -285
  87. webscout/Provider/Glider.py +0 -222
  88. webscout/Provider/Groq.py +0 -801
  89. webscout/Provider/HF_space/__init__.py +0 -0
  90. webscout/Provider/HF_space/qwen_qwen2.py +0 -206
  91. webscout/Provider/HeckAI.py +0 -257
  92. webscout/Provider/HuggingFaceChat.py +0 -469
  93. webscout/Provider/Hunyuan.py +0 -283
  94. webscout/Provider/Jadve.py +0 -291
  95. webscout/Provider/Koboldai.py +0 -381
  96. webscout/Provider/LambdaChat.py +0 -411
  97. webscout/Provider/Llama3.py +0 -259
  98. webscout/Provider/MCPCore.py +0 -315
  99. webscout/Provider/Marcus.py +0 -206
  100. webscout/Provider/Nemotron.py +0 -218
  101. webscout/Provider/Netwrck.py +0 -270
  102. webscout/Provider/OLLAMA.py +0 -396
  103. webscout/Provider/OPENAI/__init__.py +0 -28
  104. webscout/Provider/OPENAI/ai4chat.py +0 -286
  105. webscout/Provider/OPENAI/base.py +0 -46
  106. webscout/Provider/OPENAI/c4ai.py +0 -367
  107. webscout/Provider/OPENAI/chatgpt.py +0 -549
  108. webscout/Provider/OPENAI/chatgptclone.py +0 -481
  109. webscout/Provider/OPENAI/deepinfra.py +0 -309
  110. webscout/Provider/OPENAI/e2b.py +0 -1350
  111. webscout/Provider/OPENAI/exaai.py +0 -404
  112. webscout/Provider/OPENAI/exachat.py +0 -437
  113. webscout/Provider/OPENAI/freeaichat.py +0 -352
  114. webscout/Provider/OPENAI/glider.py +0 -316
  115. webscout/Provider/OPENAI/groq.py +0 -354
  116. webscout/Provider/OPENAI/heckai.py +0 -341
  117. webscout/Provider/OPENAI/llmchatco.py +0 -327
  118. webscout/Provider/OPENAI/mcpcore.py +0 -376
  119. webscout/Provider/OPENAI/multichat.py +0 -368
  120. webscout/Provider/OPENAI/netwrck.py +0 -350
  121. webscout/Provider/OPENAI/opkfc.py +0 -488
  122. webscout/Provider/OPENAI/scirachat.py +0 -462
  123. webscout/Provider/OPENAI/sonus.py +0 -294
  124. webscout/Provider/OPENAI/standardinput.py +0 -425
  125. webscout/Provider/OPENAI/textpollinations.py +0 -329
  126. webscout/Provider/OPENAI/toolbaz.py +0 -406
  127. webscout/Provider/OPENAI/typegpt.py +0 -346
  128. webscout/Provider/OPENAI/uncovrAI.py +0 -455
  129. webscout/Provider/OPENAI/utils.py +0 -211
  130. webscout/Provider/OPENAI/venice.py +0 -413
  131. webscout/Provider/OPENAI/wisecat.py +0 -381
  132. webscout/Provider/OPENAI/writecream.py +0 -156
  133. webscout/Provider/OPENAI/x0gpt.py +0 -371
  134. webscout/Provider/OPENAI/yep.py +0 -327
  135. webscout/Provider/OpenGPT.py +0 -209
  136. webscout/Provider/Openai.py +0 -496
  137. webscout/Provider/PI.py +0 -429
  138. webscout/Provider/Perplexitylabs.py +0 -415
  139. webscout/Provider/QwenLM.py +0 -254
  140. webscout/Provider/Reka.py +0 -214
  141. webscout/Provider/StandardInput.py +0 -290
  142. webscout/Provider/TTI/AiForce/__init__.py +0 -22
  143. webscout/Provider/TTI/AiForce/async_aiforce.py +0 -224
  144. webscout/Provider/TTI/AiForce/sync_aiforce.py +0 -245
  145. webscout/Provider/TTI/FreeAIPlayground/__init__.py +0 -9
  146. webscout/Provider/TTI/FreeAIPlayground/async_freeaiplayground.py +0 -181
  147. webscout/Provider/TTI/FreeAIPlayground/sync_freeaiplayground.py +0 -180
  148. webscout/Provider/TTI/ImgSys/__init__.py +0 -23
  149. webscout/Provider/TTI/ImgSys/async_imgsys.py +0 -202
  150. webscout/Provider/TTI/ImgSys/sync_imgsys.py +0 -195
  151. webscout/Provider/TTI/MagicStudio/__init__.py +0 -2
  152. webscout/Provider/TTI/MagicStudio/async_magicstudio.py +0 -111
  153. webscout/Provider/TTI/MagicStudio/sync_magicstudio.py +0 -109
  154. webscout/Provider/TTI/Nexra/__init__.py +0 -22
  155. webscout/Provider/TTI/Nexra/async_nexra.py +0 -286
  156. webscout/Provider/TTI/Nexra/sync_nexra.py +0 -258
  157. webscout/Provider/TTI/PollinationsAI/__init__.py +0 -23
  158. webscout/Provider/TTI/PollinationsAI/async_pollinations.py +0 -311
  159. webscout/Provider/TTI/PollinationsAI/sync_pollinations.py +0 -265
  160. webscout/Provider/TTI/__init__.py +0 -12
  161. webscout/Provider/TTI/aiarta/__init__.py +0 -2
  162. webscout/Provider/TTI/aiarta/async_aiarta.py +0 -482
  163. webscout/Provider/TTI/aiarta/sync_aiarta.py +0 -440
  164. webscout/Provider/TTI/artbit/__init__.py +0 -22
  165. webscout/Provider/TTI/artbit/async_artbit.py +0 -155
  166. webscout/Provider/TTI/artbit/sync_artbit.py +0 -148
  167. webscout/Provider/TTI/fastflux/__init__.py +0 -22
  168. webscout/Provider/TTI/fastflux/async_fastflux.py +0 -261
  169. webscout/Provider/TTI/fastflux/sync_fastflux.py +0 -252
  170. webscout/Provider/TTI/huggingface/__init__.py +0 -22
  171. webscout/Provider/TTI/huggingface/async_huggingface.py +0 -199
  172. webscout/Provider/TTI/huggingface/sync_huggingface.py +0 -195
  173. webscout/Provider/TTI/piclumen/__init__.py +0 -23
  174. webscout/Provider/TTI/piclumen/async_piclumen.py +0 -268
  175. webscout/Provider/TTI/piclumen/sync_piclumen.py +0 -233
  176. webscout/Provider/TTI/pixelmuse/__init__.py +0 -4
  177. webscout/Provider/TTI/pixelmuse/async_pixelmuse.py +0 -249
  178. webscout/Provider/TTI/pixelmuse/sync_pixelmuse.py +0 -182
  179. webscout/Provider/TTI/talkai/__init__.py +0 -4
  180. webscout/Provider/TTI/talkai/async_talkai.py +0 -229
  181. webscout/Provider/TTI/talkai/sync_talkai.py +0 -207
  182. webscout/Provider/TTS/__init__.py +0 -8
  183. webscout/Provider/TTS/base.py +0 -159
  184. webscout/Provider/TTS/deepgram.py +0 -156
  185. webscout/Provider/TTS/elevenlabs.py +0 -111
  186. webscout/Provider/TTS/gesserit.py +0 -128
  187. webscout/Provider/TTS/murfai.py +0 -113
  188. webscout/Provider/TTS/parler.py +0 -111
  189. webscout/Provider/TTS/speechma.py +0 -180
  190. webscout/Provider/TTS/streamElements.py +0 -333
  191. webscout/Provider/TTS/utils.py +0 -280
  192. webscout/Provider/TeachAnything.py +0 -233
  193. webscout/Provider/TextPollinationsAI.py +0 -306
  194. webscout/Provider/TwoAI.py +0 -280
  195. webscout/Provider/TypliAI.py +0 -305
  196. webscout/Provider/Venice.py +0 -258
  197. webscout/Provider/VercelAI.py +0 -253
  198. webscout/Provider/WiseCat.py +0 -233
  199. webscout/Provider/WrDoChat.py +0 -370
  200. webscout/Provider/Writecream.py +0 -237
  201. webscout/Provider/WritingMate.py +0 -269
  202. webscout/Provider/Youchat.py +0 -330
  203. webscout/Provider/__init__.py +0 -178
  204. webscout/Provider/ai4chat.py +0 -203
  205. webscout/Provider/aimathgpt.py +0 -189
  206. webscout/Provider/akashgpt.py +0 -335
  207. webscout/Provider/asksteve.py +0 -212
  208. webscout/Provider/bagoodex.py +0 -145
  209. webscout/Provider/cerebras.py +0 -288
  210. webscout/Provider/chatglm.py +0 -215
  211. webscout/Provider/cleeai.py +0 -213
  212. webscout/Provider/copilot.py +0 -425
  213. webscout/Provider/elmo.py +0 -283
  214. webscout/Provider/freeaichat.py +0 -285
  215. webscout/Provider/geminiapi.py +0 -208
  216. webscout/Provider/geminiprorealtime.py +0 -160
  217. webscout/Provider/granite.py +0 -235
  218. webscout/Provider/hermes.py +0 -266
  219. webscout/Provider/julius.py +0 -223
  220. webscout/Provider/koala.py +0 -268
  221. webscout/Provider/learnfastai.py +0 -325
  222. webscout/Provider/llama3mitril.py +0 -215
  223. webscout/Provider/llmchat.py +0 -255
  224. webscout/Provider/llmchatco.py +0 -306
  225. webscout/Provider/meta.py +0 -798
  226. webscout/Provider/multichat.py +0 -364
  227. webscout/Provider/scira_chat.py +0 -297
  228. webscout/Provider/scnet.py +0 -243
  229. webscout/Provider/searchchat.py +0 -292
  230. webscout/Provider/sonus.py +0 -258
  231. webscout/Provider/talkai.py +0 -194
  232. webscout/Provider/toolbaz.py +0 -353
  233. webscout/Provider/turboseek.py +0 -266
  234. webscout/Provider/typefully.py +0 -330
  235. webscout/Provider/typegpt.py +0 -289
  236. webscout/Provider/uncovr.py +0 -368
  237. webscout/Provider/x0gpt.py +0 -299
  238. webscout/Provider/yep.py +0 -389
  239. webscout/litagent/__init__.py +0 -29
  240. webscout/litagent/agent.py +0 -455
  241. webscout/litagent/constants.py +0 -60
  242. webscout/litprinter/__init__.py +0 -59
  243. webscout/scout/__init__.py +0 -8
  244. webscout/scout/core/__init__.py +0 -7
  245. webscout/scout/core/crawler.py +0 -140
  246. webscout/scout/core/scout.py +0 -568
  247. webscout/scout/core/search_result.py +0 -96
  248. webscout/scout/core/text_analyzer.py +0 -63
  249. webscout/scout/core/text_utils.py +0 -277
  250. webscout/scout/core/web_analyzer.py +0 -52
  251. webscout/scout/core.py +0 -881
  252. webscout/scout/element.py +0 -460
  253. webscout/scout/parsers/__init__.py +0 -69
  254. webscout/scout/parsers/html5lib_parser.py +0 -172
  255. webscout/scout/parsers/html_parser.py +0 -236
  256. webscout/scout/parsers/lxml_parser.py +0 -178
  257. webscout/scout/utils.py +0 -37
  258. webscout/swiftcli/__init__.py +0 -95
  259. webscout/swiftcli/core/__init__.py +0 -7
  260. webscout/swiftcli/core/cli.py +0 -297
  261. webscout/swiftcli/core/context.py +0 -104
  262. webscout/swiftcli/core/group.py +0 -241
  263. webscout/swiftcli/decorators/__init__.py +0 -28
  264. webscout/swiftcli/decorators/command.py +0 -221
  265. webscout/swiftcli/decorators/options.py +0 -220
  266. webscout/swiftcli/decorators/output.py +0 -252
  267. webscout/swiftcli/exceptions.py +0 -21
  268. webscout/swiftcli/plugins/__init__.py +0 -9
  269. webscout/swiftcli/plugins/base.py +0 -135
  270. webscout/swiftcli/plugins/manager.py +0 -262
  271. webscout/swiftcli/utils/__init__.py +0 -59
  272. webscout/swiftcli/utils/formatting.py +0 -252
  273. webscout/swiftcli/utils/parsing.py +0 -267
  274. webscout/zeroart/__init__.py +0 -55
  275. webscout/zeroart/base.py +0 -60
  276. webscout/zeroart/effects.py +0 -99
  277. webscout/zeroart/fonts.py +0 -816
  278. webscout-8.2.6.dist-info/RECORD +0 -307
  279. webscout-8.2.6.dist-info/entry_points.txt +0 -3
  280. webscout-8.2.6.dist-info/top_level.txt +0 -2
  281. webstoken/__init__.py +0 -30
  282. webstoken/classifier.py +0 -189
  283. webstoken/keywords.py +0 -216
  284. webstoken/language.py +0 -128
  285. webstoken/ner.py +0 -164
  286. webstoken/normalizer.py +0 -35
  287. webstoken/processor.py +0 -77
  288. webstoken/sentiment.py +0 -206
  289. webstoken/stemmer.py +0 -73
  290. webstoken/tagger.py +0 -60
  291. webstoken/tokenizer.py +0 -158
  292. {webscout-8.2.6.dist-info → webscout-8.2.7.dist-info}/licenses/LICENSE.md +0 -0
@@ -1,773 +0,0 @@
1
- from curl_cffi import CurlError
2
- from curl_cffi.requests import Session
3
- import json
4
- import os
5
- from typing import Any, Dict, Optional, Generator, Union, List
6
-
7
- import requests
8
-
9
- from webscout.AIutel import Optimizers
10
- from webscout.AIutel import Conversation, sanitize_stream # Import sanitize_stream
11
- from webscout.AIutel import AwesomePrompts, sanitize_stream
12
- from webscout.AIbase import Provider, AsyncProvider
13
- from webscout import exceptions
14
- from webscout.litagent import LitAgent
15
-
16
- class ElectronHub(Provider):
17
- """
18
- A class to interact with the ElectronHub API with LitAgent user-agent.
19
- """
20
-
21
- # Default models list (will be updated dynamically)
22
- AVAILABLE_MODELS = [
23
- # OpenAI GPT models
24
- "gpt-3.5-turbo",
25
- "gpt-3.5-turbo-16k",
26
- "gpt-3.5-turbo-1106",
27
- "gpt-3.5-turbo-0125",
28
- "gpt-4",
29
- "gpt-4-turbo",
30
- "gpt-4-turbo-preview",
31
- "gpt-4-0125-preview",
32
- "gpt-4-1106-preview",
33
- "gpt-4o",
34
- "gpt-4o-2024-05-13",
35
- "gpt-4o-2024-08-06",
36
- "gpt-4o-2024-11-20",
37
- "gpt-4o-search-preview",
38
- "gpt-4o-search-preview-2025-03-11",
39
- "gpt-4o-mini",
40
- "gpt-4o-mini-2024-07-18",
41
- "gpt-4o-mini-search-preview",
42
- "gpt-4o-mini-search-preview-2025-03-11",
43
- "chatgpt-4o-latest",
44
- "gpt-4.5-preview",
45
- "gpt-4.5-preview-2025-02-27",
46
- "o1-mini",
47
- "o1-preview",
48
- "o1",
49
- "o1-low",
50
- "o1-high",
51
- "o3-mini",
52
- "o3-mini-low",
53
- "o3-mini-high",
54
- "o3-mini-online",
55
-
56
- # Anthropic Claude models
57
- "claude-2",
58
- "claude-2.1",
59
- "claude-3-haiku-20240307",
60
- "claude-3-5-haiku-20241022",
61
- "claude-3-opus-20240229",
62
- "claude-3-sonnet-20240229",
63
- "claude-3-5-sonnet-20240620",
64
- "claude-3-5-sonnet-20241022",
65
- "claude-3-7-sonnet-20250219",
66
- "claude-3-7-sonnet-20250219-thinking",
67
- "claude-3-opus-20240229:safe",
68
- "claude-3-sonnet-20240229:safe",
69
- "claude-3-5-sonnet-20240620:safe",
70
- "claude-3-5-sonnet-20241022:safe",
71
- "claude-3-7-sonnet-20250219:safe",
72
- "claude-3-7-sonnet-20250219-thinking:safe",
73
-
74
- # Google Gemini models
75
- "gemini-1.0-pro",
76
- "gemini-1.0-pro-vision",
77
- "gemini-1.5-pro",
78
- "gemini-1.5-pro-latest",
79
- "gemini-1.5-flash-8b",
80
- "gemini-1.5-flash",
81
- "gemini-1.5-flash-latest",
82
- "gemini-1.5-flash-exp",
83
- "gemini-1.5-flash-online",
84
- "gemini-exp-1206",
85
- "learnlm-1.5-pro-experimental",
86
- "gemini-2.0-flash-001",
87
- "gemini-2.0-flash-exp",
88
- "gemini-2.0-flash-thinking-exp",
89
- "gemini-2.0-flash-thinking-exp-1219",
90
- "gemini-2.0-flash-thinking-exp-01-21",
91
- "gemini-2.0-flash-lite-preview-02-05",
92
- "gemini-2.0-flash-lite-001",
93
- "gemini-2.0-pro-exp-02-05",
94
- "gemini-2.5-pro-exp-03-25",
95
-
96
- # Google PaLM models
97
- "palm-2-chat-bison",
98
- "palm-2-codechat-bison",
99
- "palm-2-chat-bison-32k",
100
- "palm-2-codechat-bison-32k",
101
-
102
- # Meta Llama models
103
- "llama-2-13b-chat-awq",
104
- "llama-2-7b-chat-fp16",
105
- "llama-2-7b-chat-int8",
106
- "llama-2-70b-chat",
107
- "llama-3-8b-instruct",
108
- "llama-3-8b-instruct-awq",
109
- "llama-3-70b",
110
- "llama-3.1-8b-instruct",
111
- "llama-3.1-8b-instruct-awq",
112
- "llama-3.1-8b-instruct-fp8",
113
- "llama-3.1-70b",
114
- "llama-3.1-405b",
115
- "llama-3.2-11b-vision-instruct",
116
- "llama-3.2-1b-instruct",
117
- "llama-3.2-3b-instruct",
118
- "llama-3.2-90b",
119
- "llama-3.3-70b-instruct-fp8-fast",
120
- "llama-guard-3-8b",
121
- "llamaguard-7b-awq",
122
- "meta-llama-3-8b-instruct",
123
- "llama-3.1-nemotron-70b-instruct",
124
- "llama-3.1-tulu-3-70b",
125
- "llama-3.1-tulu-3-405b",
126
- "llama-3.1-sonar-small-128k-online",
127
- "llama-3.1-sonar-large-128k-online",
128
- "llama-3.1-sonar-huge-128k-online",
129
- "llama-3.1-sonar-small-128k-chat",
130
- "llama-3.1-sonar-large-128k-chat",
131
- "llama-3.1-swallow-70b-instruct-v0.3",
132
- "llama-3.1-8b-lexi-uncensored-v2",
133
- "llama-3.1-lumimaid-8b",
134
- "llama-3.1-lumimaid-70b",
135
- "llama3-openbiollm-70b",
136
-
137
- # Mistral models
138
- "mistral-7b-instruct-v0.1",
139
- "mistral-7b-instruct-v0.1-awq",
140
- "mistral-7b-instruct-v0.2",
141
- "mistral-tiny-latest",
142
- "mistral-tiny",
143
- "mistral-tiny-2312",
144
- "mistral-tiny-2407",
145
- "mistral-small-3.1-24b-instruct",
146
- "mistral-small-24b-instruct-2501",
147
- "mistral-small-latest",
148
- "mistral-small",
149
- "mistral-small-2312",
150
- "mistral-small-2402",
151
- "mistral-small-2409",
152
- "mistral-medium-latest",
153
- "mistral-medium",
154
- "mistral-medium-2312",
155
- "mistral-large-latest",
156
- "mistral-large-2411",
157
- "mistral-large-2407",
158
- "mistral-large-2402",
159
- "open-mistral-nemo",
160
- "open-mistral-nemo-2407",
161
- "open-mixtral-8x22b-2404",
162
- "open-mixtral-8x7b",
163
-
164
- # Codestral models
165
- "codestral-mamba",
166
- "codestral-latest",
167
- "codestral-2405",
168
- "codestral-2412",
169
- "codestral-2501",
170
-
171
- # Ministral models
172
- "ministral-3b",
173
- "ministral-3b-2410",
174
- "ministral-8b",
175
- "ministral-8b-2410",
176
-
177
- # Mistral Saba models
178
- "mistral-saba-latest",
179
- "mistral-saba-2502",
180
-
181
- # Mixtral models
182
- "mixtral-8x7b",
183
- "mixtral-8x22b",
184
-
185
- # DeepSeek models
186
- "deepseek-coder",
187
- "deepseek-coder-6.7b-base-awq",
188
- "deepseek-coder-6.7b-instruct-awq",
189
- "deepseek-llm-67b-chat",
190
- "deepseek-math-7b-instruct",
191
- "deepseek-r1",
192
- "deepseek-r1-distill-llama-70b",
193
- "deepseek-r1-distill-llama-8b",
194
- "deepseek-r1-distill-qwen-1.5b",
195
- "deepseek-r1-distill-qwen-14b",
196
- "deepseek-r1-distill-qwen-32b",
197
- "deepseek-r1-distill-qwen-7b",
198
- "deepseek-r1-nitro",
199
- "deepseek-r1-zero",
200
- "deepseek-v2.5",
201
- "deepseek-v3",
202
- "deepseek-v3-0324",
203
- "deepseek-vl2",
204
-
205
- # Qwen models
206
- "qwen-1.5-0.5b-chat",
207
- "qwen-1.5-1.8b-chat",
208
- "qwen-1.5-14b-chat-awq",
209
- "qwen-1.5-7b-chat-awq",
210
- "qwen-2-7b-instruct",
211
- "qwen-2-72b-instruct",
212
- "qwen-2-vl-7b-instruct",
213
- "qwen-2-vl-72b-instruct",
214
- "qwen-2.5-7b-instruct",
215
- "qwen-2.5-32b-instruct",
216
- "qwen-2.5-72b-instruct",
217
- "qwen-2.5-coder-32b-instruct",
218
- "qwq-32b-preview",
219
- "qwq-32b",
220
- "qwen-vl-plus",
221
- "qwen2.5-vl-3b-instruct",
222
- "qwen2.5-vl-7b-instruct",
223
- "qwen2.5-vl-72b-instruct",
224
- "qwen-turbo",
225
- "qwen-plus",
226
- "qwen-max",
227
-
228
- # F1 models
229
- "f1-mini-preview",
230
- "f1-preview",
231
-
232
- # Command models
233
- "command",
234
- "command-light",
235
- "command-nightly",
236
- "command-light-nightly",
237
- "command-r",
238
- "command-r-03-2024",
239
- "command-r-08-2024",
240
- "command-r-plus",
241
- "command-r-plus-04-2024",
242
- "command-r-plus-08-2024",
243
- "command-r7b-12-2024",
244
- "command-a-03-2025",
245
-
246
- # Dolphin models
247
- "dolphin-mixtral-8x7b",
248
- "dolphin-mixtral-8x22b",
249
- "dolphin3.0-mistral-24b",
250
- "dolphin3.0-r1-mistral-24b",
251
-
252
- # Cohere models
253
- "c4ai-aya-expanse-8b",
254
- "c4ai-aya-expanse-32b",
255
-
256
- # Reka models
257
- "reka-flash",
258
- "reka-core",
259
- "reka-flash-3",
260
-
261
- # OpenChat models
262
- "openchat-3.5-0106",
263
- "openchat-3.5-7b",
264
- "openchat-3.6-8b",
265
-
266
- # Yi models
267
- "yi-34b-chat-200k",
268
- "yi-large",
269
- "yi-large-rag",
270
- "yi-large-turbo",
271
- "yi-medium",
272
- "yi-vl-plus",
273
-
274
- # Phi models
275
- "phi-2",
276
- "phi-3-mini-128k-instruct",
277
- "phi-3-medium-128k-instruct",
278
- "phi-3.5-mini-128k-instruct",
279
- "phi-4",
280
- "phi-4-multimodal-instruct",
281
-
282
- # Claude models by AION-LABS
283
- "aion-1.0",
284
- "aion-1.0-mini",
285
- "aion-rp-llama-3.1-8b",
286
-
287
- # Other AI models
288
- "nemotron-4-340b",
289
- "pixtral-large-2411",
290
- "pixtral-12b",
291
- "dbrx-instruct",
292
- "grok-2",
293
- "grok-2-mini",
294
- "grok-beta",
295
- "grok-vision-beta",
296
- "grok-2-1212",
297
- "grok-2-vision-1212",
298
- "grok-3-early",
299
- "grok-3-preview-02-24",
300
- "r1-1776",
301
- "sonar-deep-research",
302
- "sonar-reasoning-pro",
303
- "sonar-reasoning",
304
- "sonar-pro",
305
- "sonar",
306
- "wizardlm-2-7b",
307
- "wizardlm-2-8x22b",
308
- "minimax-01",
309
- "jamba-1.5-large",
310
- "jamba-1.5-mini",
311
- "jamba-1.6-large",
312
- "jamba-1.6-mini",
313
- "jamba-instruct",
314
-
315
- # Chinese language models
316
- "doubao-lite-4k",
317
- "doubao-lite-32k",
318
- "doubao-pro-4k",
319
- "doubao-pro-32k",
320
- "ui-tars-72b-dpo",
321
- "ernie-lite-8k",
322
- "ernie-tiny-8k",
323
- "ernie-speed-8k",
324
- "ernie-speed-128k",
325
- "hunyuan-lite",
326
- "hunyuan-standard-2025-02-10",
327
- "hunyuan-large-2025-02-10",
328
- "glm-3-130b",
329
- "glm-4-flash",
330
- "glm-4-long",
331
- "glm-4-airx",
332
- "glm-4-air",
333
- "glm-4-plus",
334
- "glm-4-alltools",
335
- "spark-desk-v1.5",
336
-
337
- # Other language models
338
- "discolm-german-7b-v1-awq",
339
- "falcon-7b-instruct",
340
- "neural-chat-7b-v3-1-awq",
341
- "openhermes-2.5-mistral-7b",
342
- "openhermes-2.5-mistral-7b-awq",
343
- "sqlcoder-7b-2",
344
- "starling-lm-7b-beta",
345
- "tinyllama-1.1b-chat-v1.0",
346
- "una-cybertron-7b-v2-bf16",
347
- "zephyr-7b-beta",
348
- "zephyr-7b-beta-awq",
349
-
350
- # Inference-optimized models
351
- "mistral-nemo-inferor-12b",
352
- "rocinante-12b-v1",
353
- "rocinante-12b-v1.1",
354
- "unslopnemo-12b",
355
-
356
- # Additional specialty models
357
- "granite-3.1-2b-instruct",
358
- "granite-3.1-8b-instruct",
359
- "solar-0-70b-16bit",
360
- "olympiccoder-7b",
361
- "olympiccoder-32b",
362
- "anubis-pro-105b-v1",
363
- "fallen-llama-3.3-r1-70b-v1",
364
- "skyfall-36b-v2",
365
- "wayfarer-large-70b-llama-3.3",
366
- "qwq-32b-snowdrop-v0",
367
- "qwq-32b-abliterated",
368
- "sky-t1-32b-preview",
369
- "tiny-r1-32b-preview",
370
- "lfm-3b",
371
- "lfm-7b",
372
- "lfm-40b",
373
- "eva-llama-3.33-70b-v0.0",
374
- "eva-llama-3.33-70b-v0.1",
375
- "eva-qwen2.5-72b",
376
- "eva-qwen2.5-32b-v0.2",
377
- "sorcererlm-8x22b",
378
- "mythalion-13b",
379
- "toppy-m-7b",
380
- "l3-lunaris-8b",
381
- "l3.1-70b-hanami-x1",
382
- "lumimaid-magnum-v4-12b",
383
- "magnum-v4-72b",
384
- "magnum-v4-12b",
385
- "magnum-v3-34b",
386
- "magnum-v2.5-12b-kto",
387
- "magnum-v2-72b",
388
- "magnum-v2-32b",
389
- "magnum-v2-12b",
390
- "magnum-72b",
391
- "mini-magnum-12b-v1.1",
392
- "remm-slerp-l2-13b",
393
- "patricide-12b-unslop-mell",
394
- "midnight-rose-70b",
395
- "airoboros-l2-13b-gpt4-m2.0",
396
- "airoboros-l2-70b",
397
- "xwin-lm-70b",
398
- "noromaid-20b",
399
- "violet-twilight-v0.2",
400
- "saiga-nemo-12b",
401
- "l3-8b-stheno-v3.2",
402
- "l3.3-electra-r1-70b",
403
- "l3.3-cu-mai-r1-70b",
404
- "l3.3-mokume-gane-r1-70b-v1.1",
405
- "l3.3-70b-euryale-v2.3",
406
- "l3.3-ms-evayale-70b",
407
- "70b-l3.3-cirrus-x1",
408
- "l31-70b-euryale-v2.2",
409
- "l3-70b-euryale-v2.1",
410
- "fimbulvetr-11b-v2",
411
- "goliath-120b",
412
- "hermes-2-pro-mistral-7b",
413
- "mytho-max-l2-13b",
414
- "deephermes-3-llama-3-8b-preview",
415
- "nous-hermes-llama2-13b",
416
- "hermes-3-llama-3.1-405b",
417
- "nous-hermes-2-mixtral-8x7b-dpo",
418
- "nova-lite-v1",
419
- "nova-micro-v1",
420
- "nova-pro-v1",
421
- "inflection-3-pi",
422
- "inflection-3-productivity",
423
-
424
- # Image generation models
425
- "weaver",
426
- "sdxl",
427
- "sdxl-turbo",
428
- "sdxl-lightning",
429
- "stable-diffusion-3",
430
- "stable-diffusion-3-2b",
431
- "stable-diffusion-3.5-large",
432
- "stable-diffusion-3.5-turbo",
433
- "playground-v3",
434
- "playground-v2.5",
435
- "animaginexl-3.1",
436
- "realvisxl-4.0",
437
- "imagen",
438
- "imagen-3-fast",
439
- "imagen-3",
440
- "luma-photon",
441
- "luma-photon-flash",
442
- "recraft-20b",
443
- "recraft-v3",
444
- "grok-2-aurora",
445
- "flux-schnell",
446
- "flux-dev",
447
- "flux-pro",
448
- "flux-1.1-pro",
449
- "flux-1.1-pro-ultra",
450
- "flux-1.1-pro-ultra-raw",
451
- "flux-realism",
452
- "flux-half-illustration",
453
- "ideogram-v2-turbo",
454
- "ideogram-v2",
455
- "amazon-titan",
456
- "amazon-titan-v2",
457
- "nova-canvas",
458
- "omni-gen",
459
- "aura-flow",
460
- "cogview-3-flash",
461
- "sana",
462
- "kandinsky-3",
463
- "dall-e-3",
464
- "midjourney-v6.1",
465
- "midjourney-v6",
466
- "midjourney-v5.2",
467
- "midjourney-v5.1",
468
- "midjourney-v5",
469
- "midjourney-v7",
470
- "niji-v6",
471
- "niji-v5",
472
-
473
- # Video generation models
474
- "t2v-turbo",
475
- "cogvideox-5b",
476
- "ltx-video",
477
- "mochi-1",
478
- "dream-machine",
479
- "hailuo-ai",
480
- "haiper-video-2.5",
481
- "haiper-video-2",
482
- "hunyuan-video",
483
- "kling-video/v1/standard/text-to-video",
484
- "kling-video/v1/pro/text-to-video",
485
- "kling-video/v1.6/standard/text-to-video",
486
- "kling-video/v1.5/pro/text-to-video",
487
- "kokoro-82m",
488
-
489
- # Audio models
490
- "elevenlabs",
491
- "myshell-tts",
492
- "deepinfra-tts",
493
- "whisper-large-v3",
494
- "distil-large-v3",
495
-
496
- # Embedding and moderation models
497
- "text-embedding-3-large",
498
- "text-embedding-3-small",
499
- "omni-moderation-latest",
500
- "omni-moderation-2024-09-26",
501
- "text-moderation-latest",
502
- "text-moderation-stable",
503
- "text-moderation-007"
504
- ]
505
-
506
- @classmethod
507
- def get_models(cls, api_key: str = None):
508
- """Fetch available models from ElectronHub API.
509
-
510
- Args:
511
- api_key (str, optional): ElectronHub API key. If not provided, returns default models.
512
-
513
- Returns:
514
- list: List of available model IDs
515
- """
516
- if not api_key:
517
- return cls.AVAILABLE_MODELS
518
-
519
- try:
520
- headers = {
521
- 'Content-Type': 'application/json',
522
- 'Accept': '*/*',
523
- 'User-Agent': LitAgent().random(),
524
- 'Authorization': f'Bearer {api_key}'
525
- }
526
-
527
- response = requests.get(
528
- "https://api.electronhub.top/v1/models",
529
- headers=headers,
530
- timeout=10
531
- )
532
-
533
- if response.status_code != 200:
534
- return cls.AVAILABLE_MODELS
535
-
536
- data = response.json()
537
- if "data" in data and isinstance(data["data"], list):
538
- return [model["id"] for model in data["data"]]
539
- return cls.AVAILABLE_MODELS
540
-
541
- except Exception:
542
- # Fallback to default models list if fetching fails
543
- return cls.AVAILABLE_MODELS
544
-
545
- @classmethod
546
- def update_available_models(cls, api_key=None):
547
- """Update the available models list from ElectronHub API"""
548
- try:
549
- models = cls.get_models(api_key)
550
- if models and len(models) > 0:
551
- cls.AVAILABLE_MODELS = models
552
- except Exception:
553
- # Fallback to default models list if fetching fails
554
- pass
555
-
556
- @staticmethod
557
- def _electronhub_extractor(chunk: Union[str, Dict[str, Any]]) -> Optional[str]:
558
- """Extracts content from ElectronHub stream JSON objects."""
559
- if isinstance(chunk, dict):
560
- return chunk.get("choices", [{}])[0].get("delta", {}).get("content")
561
- return None
562
-
563
- def __init__(
564
- self,
565
- is_conversation: bool = True,
566
- max_tokens: int = 16000,
567
- timeout: int = 30,
568
- intro: str = None,
569
- filepath: str = None,
570
- update_file: bool = True,
571
- proxies: dict = {},
572
- history_offset: int = 10250,
573
- act: str = None,
574
- model: str = "claude-3-7-sonnet-20250219",
575
- system_prompt: str = "You're helpful assistant that can help me with my questions.",
576
- api_key: str = None
577
- ):
578
- """Initializes the ElectronHub API client."""
579
- # Update available models from API
580
- self.update_available_models(api_key)
581
-
582
- # Validate model after updating available models
583
- if model not in self.AVAILABLE_MODELS:
584
- raise ValueError(f"Invalid model: {model}. Choose from: {self.AVAILABLE_MODELS}")
585
-
586
- self.url = "https://api.electronhub.top/v1/chat/completions"
587
- # Use LitAgent for user-agent
588
- self.headers = {
589
- 'User-Agent': LitAgent().random(),
590
- 'Content-Type': 'application/json',
591
- 'Accept': '*/*',
592
- 'Accept-Language': 'en-US,en;q=0.9',
593
- 'DNT': '1',
594
- 'Origin': 'https://playground.electronhub.top',
595
- 'Referer': 'https://playground.electronhub.top/',
596
- 'Sec-Fetch-Dest': 'empty',
597
- 'Sec-Fetch-Mode': 'cors',
598
- 'Sec-Fetch-Site': 'same-site',
599
- 'Priority': 'u=1, i'
600
- }
601
-
602
- # Add API key if provided
603
- if api_key:
604
- self.headers['Authorization'] = f'Bearer {api_key}'
605
- self.system_prompt = system_prompt
606
- self.session = Session() # Use curl_cffi Session
607
- self.session.headers.update(self.headers)
608
- self.session.proxies = proxies # Assign proxies directly
609
-
610
- self.is_conversation = is_conversation
611
- self.max_tokens = max_tokens
612
- self.timeout = timeout
613
- self.last_response = {}
614
- self.model = model
615
-
616
- self.__available_optimizers = (
617
- method
618
- for method in dir(Optimizers)
619
- if callable(getattr(Optimizers, method)) and not method.startswith("__")
620
- )
621
- Conversation.intro = (
622
- AwesomePrompts().get_act(
623
- act, raise_not_found=True, default=None, case_insensitive=True
624
- )
625
- if act
626
- else intro or Conversation.intro
627
- )
628
-
629
- self.conversation = Conversation(
630
- is_conversation, self.max_tokens, filepath, update_file
631
- )
632
- self.conversation.history_offset = history_offset
633
-
634
- def ask(
635
- self,
636
- prompt: str,
637
- stream: bool = True,
638
- raw: bool = False,
639
- optimizer: str = None,
640
- conversationally: bool = False,
641
- temperature: float = 0.5,
642
- top_p: float = 1.0,
643
- top_k: int = 5,
644
- ) -> Union[Dict[str, Any], Generator]:
645
- conversation_prompt = self.conversation.gen_complete_prompt(prompt)
646
- if optimizer:
647
- if optimizer in self.__available_optimizers:
648
- conversation_prompt = getattr(Optimizers, optimizer)(
649
- conversation_prompt if conversationally else prompt
650
- )
651
- else:
652
- raise Exception(f"Optimizer is not one of {self.__available_optimizers}")
653
-
654
- # Construct messages for the conversation
655
- messages = [
656
- {"role": "system", "content": self.system_prompt},
657
- {"role": "user", "content": [{"type": "text", "text": conversation_prompt}]}
658
- ]
659
-
660
- # Payload construction based on ElectronHub API requirements
661
- payload = {
662
- "model": self.model,
663
- "messages": messages,
664
- "stream": stream,
665
- "stream_options": {"include_usage": True},
666
- "max_tokens": self.max_tokens,
667
- "temperature": temperature,
668
- "top_p": top_p,
669
- "top_k": top_k,
670
- "web_search": False,
671
- "customId": None
672
- }
673
-
674
- def for_stream():
675
- try:
676
- response = self.session.post(
677
- self.url, headers=self.headers, data=json.dumps(payload), stream=True, timeout=self.timeout,
678
- impersonate="chrome120" # Add impersonate
679
- )
680
- response.raise_for_status()
681
-
682
- streaming_text = ""
683
- # Use sanitize_stream
684
- processed_stream = sanitize_stream(
685
- data=response.iter_content(chunk_size=None), # Pass byte iterator
686
- intro_value="data:",
687
- to_json=True, # Stream sends JSON
688
- skip_markers=["[DONE]"],
689
- content_extractor=self._electronhub_extractor, # Use the specific extractor
690
- yield_raw_on_error=False # Skip non-JSON lines or lines where extractor fails
691
- )
692
-
693
- for content_chunk in processed_stream:
694
- # content_chunk is the string extracted by _electronhub_extractor
695
- if content_chunk and isinstance(content_chunk, str):
696
- streaming_text += content_chunk
697
- resp = dict(text=content_chunk)
698
- yield resp if not raw else content_chunk
699
-
700
- except CurlError as e:
701
- raise exceptions.FailedToGenerateResponseError(f"Request failed (CurlError): {str(e)}") from e
702
- except Exception as e:
703
- raise exceptions.FailedToGenerateResponseError(f"Request failed: {str(e)}")
704
- finally:
705
- # Update history after stream finishes or fails
706
- if streaming_text:
707
- self.conversation.update_chat_history(prompt, streaming_text)
708
-
709
- def for_non_stream():
710
- collected_response = ""
711
- try:
712
- for chunk in for_stream():
713
- if isinstance(chunk, dict) and "text" in chunk:
714
- content = chunk["text"]
715
- if content is not None:
716
- collected_response += content
717
- except Exception as e:
718
- raise exceptions.FailedToGenerateResponseError(f"Error during non-stream processing: {str(e)}")
719
-
720
- # Update history and last_response after aggregation
721
- self.last_response = {"text": collected_response}
722
- self.conversation.update_chat_history(prompt, collected_response)
723
- return self.last_response
724
-
725
- return for_stream() if stream else for_non_stream()
726
-
727
- def chat(
728
- self,
729
- prompt: str,
730
- stream: bool = True,
731
- optimizer: str = None,
732
- conversationally: bool = False,
733
- temperature: float = 0.5,
734
- top_p: float = 1.0,
735
- top_k: int = 5,
736
- ) -> str:
737
- def for_stream():
738
- for response in self.ask(
739
- prompt,
740
- True,
741
- optimizer=optimizer,
742
- conversationally=conversationally,
743
- temperature=temperature,
744
- top_p=top_p,
745
- top_k=top_k
746
- ):
747
- yield self.get_message(response)
748
- def for_non_stream():
749
- return self.get_message(
750
- self.ask(
751
- prompt,
752
- False,
753
- optimizer=optimizer,
754
- conversationally=conversationally,
755
- temperature=temperature,
756
- top_p=top_p,
757
- top_k=top_k
758
- )
759
- )
760
- return for_stream() if stream else for_non_stream()
761
-
762
- def get_message(self, response: dict) -> str:
763
- assert isinstance(response, dict), "Response should be of dict data-type only"
764
- return response["text"]
765
-
766
- if __name__ == "__main__":
767
- from rich import print
768
- # You need to provide your own API key
769
- api_key = "" # U can get free API key from https://playground.electronhub.top/console
770
- ai = ElectronHub(timeout=5000, api_key=api_key)
771
- response = ai.chat("hi there, how are you today?", stream=True)
772
- for chunk in response:
773
- print(chunk, end="", flush=True)