webscout 8.2.9__py3-none-any.whl → 2026.1.19__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.
Files changed (413) hide show
  1. webscout/AIauto.py +524 -251
  2. webscout/AIbase.py +247 -319
  3. webscout/AIutel.py +68 -703
  4. webscout/Bard.py +1072 -1026
  5. webscout/Extra/GitToolkit/__init__.py +10 -10
  6. webscout/Extra/GitToolkit/gitapi/__init__.py +20 -12
  7. webscout/Extra/GitToolkit/gitapi/gist.py +142 -0
  8. webscout/Extra/GitToolkit/gitapi/organization.py +91 -0
  9. webscout/Extra/GitToolkit/gitapi/repository.py +308 -195
  10. webscout/Extra/GitToolkit/gitapi/search.py +162 -0
  11. webscout/Extra/GitToolkit/gitapi/trending.py +236 -0
  12. webscout/Extra/GitToolkit/gitapi/user.py +128 -96
  13. webscout/Extra/GitToolkit/gitapi/utils.py +82 -62
  14. webscout/Extra/YTToolkit/README.md +443 -375
  15. webscout/Extra/YTToolkit/YTdownloader.py +953 -957
  16. webscout/Extra/YTToolkit/__init__.py +3 -3
  17. webscout/Extra/YTToolkit/transcriber.py +595 -476
  18. webscout/Extra/YTToolkit/ytapi/README.md +230 -44
  19. webscout/Extra/YTToolkit/ytapi/__init__.py +22 -6
  20. webscout/Extra/YTToolkit/ytapi/captions.py +190 -0
  21. webscout/Extra/YTToolkit/ytapi/channel.py +302 -307
  22. webscout/Extra/YTToolkit/ytapi/errors.py +13 -13
  23. webscout/Extra/YTToolkit/ytapi/extras.py +178 -118
  24. webscout/Extra/YTToolkit/ytapi/hashtag.py +120 -0
  25. webscout/Extra/YTToolkit/ytapi/https.py +89 -88
  26. webscout/Extra/YTToolkit/ytapi/patterns.py +61 -61
  27. webscout/Extra/YTToolkit/ytapi/playlist.py +59 -59
  28. webscout/Extra/YTToolkit/ytapi/pool.py +8 -8
  29. webscout/Extra/YTToolkit/ytapi/query.py +143 -40
  30. webscout/Extra/YTToolkit/ytapi/shorts.py +122 -0
  31. webscout/Extra/YTToolkit/ytapi/stream.py +68 -63
  32. webscout/Extra/YTToolkit/ytapi/suggestions.py +97 -0
  33. webscout/Extra/YTToolkit/ytapi/utils.py +66 -62
  34. webscout/Extra/YTToolkit/ytapi/video.py +403 -232
  35. webscout/Extra/__init__.py +2 -3
  36. webscout/Extra/gguf.py +1298 -684
  37. webscout/Extra/tempmail/README.md +487 -487
  38. webscout/Extra/tempmail/__init__.py +28 -28
  39. webscout/Extra/tempmail/async_utils.py +143 -141
  40. webscout/Extra/tempmail/base.py +172 -161
  41. webscout/Extra/tempmail/cli.py +191 -187
  42. webscout/Extra/tempmail/emailnator.py +88 -84
  43. webscout/Extra/tempmail/mail_tm.py +378 -361
  44. webscout/Extra/tempmail/temp_mail_io.py +304 -292
  45. webscout/Extra/weather.py +196 -194
  46. webscout/Extra/weather_ascii.py +17 -15
  47. webscout/Provider/AISEARCH/PERPLEXED_search.py +175 -0
  48. webscout/Provider/AISEARCH/Perplexity.py +292 -333
  49. webscout/Provider/AISEARCH/README.md +106 -279
  50. webscout/Provider/AISEARCH/__init__.py +16 -9
  51. webscout/Provider/AISEARCH/brave_search.py +298 -0
  52. webscout/Provider/AISEARCH/iask_search.py +357 -410
  53. webscout/Provider/AISEARCH/monica_search.py +200 -220
  54. webscout/Provider/AISEARCH/webpilotai_search.py +242 -255
  55. webscout/Provider/Algion.py +413 -0
  56. webscout/Provider/Andi.py +74 -69
  57. webscout/Provider/Apriel.py +313 -0
  58. webscout/Provider/Ayle.py +323 -0
  59. webscout/Provider/ChatSandbox.py +329 -342
  60. webscout/Provider/ClaudeOnline.py +365 -0
  61. webscout/Provider/Cohere.py +232 -208
  62. webscout/Provider/DeepAI.py +367 -0
  63. webscout/Provider/Deepinfra.py +467 -340
  64. webscout/Provider/EssentialAI.py +217 -0
  65. webscout/Provider/ExaAI.py +274 -261
  66. webscout/Provider/Gemini.py +175 -169
  67. webscout/Provider/GithubChat.py +385 -369
  68. webscout/Provider/Gradient.py +286 -0
  69. webscout/Provider/Groq.py +556 -801
  70. webscout/Provider/HadadXYZ.py +323 -0
  71. webscout/Provider/HeckAI.py +392 -375
  72. webscout/Provider/HuggingFace.py +387 -0
  73. webscout/Provider/IBM.py +340 -0
  74. webscout/Provider/Jadve.py +317 -291
  75. webscout/Provider/K2Think.py +306 -0
  76. webscout/Provider/Koboldai.py +221 -384
  77. webscout/Provider/Netwrck.py +273 -270
  78. webscout/Provider/Nvidia.py +310 -0
  79. webscout/Provider/OPENAI/DeepAI.py +489 -0
  80. webscout/Provider/OPENAI/K2Think.py +423 -0
  81. webscout/Provider/OPENAI/PI.py +463 -0
  82. webscout/Provider/OPENAI/README.md +890 -952
  83. webscout/Provider/OPENAI/TogetherAI.py +405 -0
  84. webscout/Provider/OPENAI/TwoAI.py +255 -357
  85. webscout/Provider/OPENAI/__init__.py +148 -40
  86. webscout/Provider/OPENAI/ai4chat.py +348 -293
  87. webscout/Provider/OPENAI/akashgpt.py +436 -0
  88. webscout/Provider/OPENAI/algion.py +303 -0
  89. webscout/Provider/OPENAI/{exachat.py → ayle.py} +365 -444
  90. webscout/Provider/OPENAI/base.py +253 -249
  91. webscout/Provider/OPENAI/cerebras.py +296 -0
  92. webscout/Provider/OPENAI/chatgpt.py +870 -556
  93. webscout/Provider/OPENAI/chatsandbox.py +233 -173
  94. webscout/Provider/OPENAI/deepinfra.py +403 -322
  95. webscout/Provider/OPENAI/e2b.py +2370 -1414
  96. webscout/Provider/OPENAI/elmo.py +278 -0
  97. webscout/Provider/OPENAI/exaai.py +452 -417
  98. webscout/Provider/OPENAI/freeassist.py +446 -0
  99. webscout/Provider/OPENAI/gradient.py +448 -0
  100. webscout/Provider/OPENAI/groq.py +380 -364
  101. webscout/Provider/OPENAI/hadadxyz.py +292 -0
  102. webscout/Provider/OPENAI/heckai.py +333 -308
  103. webscout/Provider/OPENAI/huggingface.py +321 -0
  104. webscout/Provider/OPENAI/ibm.py +425 -0
  105. webscout/Provider/OPENAI/llmchat.py +253 -0
  106. webscout/Provider/OPENAI/llmchatco.py +378 -335
  107. webscout/Provider/OPENAI/meta.py +541 -0
  108. webscout/Provider/OPENAI/netwrck.py +374 -357
  109. webscout/Provider/OPENAI/nvidia.py +317 -0
  110. webscout/Provider/OPENAI/oivscode.py +348 -287
  111. webscout/Provider/OPENAI/openrouter.py +328 -0
  112. webscout/Provider/OPENAI/pydantic_imports.py +1 -172
  113. webscout/Provider/OPENAI/sambanova.py +397 -0
  114. webscout/Provider/OPENAI/sonus.py +305 -304
  115. webscout/Provider/OPENAI/textpollinations.py +370 -339
  116. webscout/Provider/OPENAI/toolbaz.py +375 -413
  117. webscout/Provider/OPENAI/typefully.py +419 -355
  118. webscout/Provider/OPENAI/typliai.py +279 -0
  119. webscout/Provider/OPENAI/utils.py +314 -318
  120. webscout/Provider/OPENAI/wisecat.py +359 -387
  121. webscout/Provider/OPENAI/writecream.py +185 -163
  122. webscout/Provider/OPENAI/x0gpt.py +462 -365
  123. webscout/Provider/OPENAI/zenmux.py +380 -0
  124. webscout/Provider/OpenRouter.py +386 -0
  125. webscout/Provider/Openai.py +337 -496
  126. webscout/Provider/PI.py +443 -429
  127. webscout/Provider/QwenLM.py +346 -254
  128. webscout/Provider/STT/__init__.py +28 -0
  129. webscout/Provider/STT/base.py +303 -0
  130. webscout/Provider/STT/elevenlabs.py +264 -0
  131. webscout/Provider/Sambanova.py +317 -0
  132. webscout/Provider/TTI/README.md +69 -82
  133. webscout/Provider/TTI/__init__.py +37 -7
  134. webscout/Provider/TTI/base.py +147 -64
  135. webscout/Provider/TTI/claudeonline.py +393 -0
  136. webscout/Provider/TTI/magicstudio.py +292 -201
  137. webscout/Provider/TTI/miragic.py +180 -0
  138. webscout/Provider/TTI/pollinations.py +331 -221
  139. webscout/Provider/TTI/together.py +334 -0
  140. webscout/Provider/TTI/utils.py +14 -11
  141. webscout/Provider/TTS/README.md +186 -192
  142. webscout/Provider/TTS/__init__.py +43 -10
  143. webscout/Provider/TTS/base.py +523 -159
  144. webscout/Provider/TTS/deepgram.py +286 -156
  145. webscout/Provider/TTS/elevenlabs.py +189 -111
  146. webscout/Provider/TTS/freetts.py +218 -0
  147. webscout/Provider/TTS/murfai.py +288 -113
  148. webscout/Provider/TTS/openai_fm.py +364 -129
  149. webscout/Provider/TTS/parler.py +203 -111
  150. webscout/Provider/TTS/qwen.py +334 -0
  151. webscout/Provider/TTS/sherpa.py +286 -0
  152. webscout/Provider/TTS/speechma.py +693 -580
  153. webscout/Provider/TTS/streamElements.py +275 -333
  154. webscout/Provider/TTS/utils.py +280 -280
  155. webscout/Provider/TextPollinationsAI.py +331 -308
  156. webscout/Provider/TogetherAI.py +450 -0
  157. webscout/Provider/TwoAI.py +309 -475
  158. webscout/Provider/TypliAI.py +311 -305
  159. webscout/Provider/UNFINISHED/ChatHub.py +219 -209
  160. webscout/Provider/{OPENAI/glider.py → UNFINISHED/ChutesAI.py} +331 -326
  161. webscout/Provider/{GizAI.py → UNFINISHED/GizAI.py} +300 -295
  162. webscout/Provider/{Marcus.py → UNFINISHED/Marcus.py} +218 -198
  163. webscout/Provider/UNFINISHED/Qodo.py +481 -0
  164. webscout/Provider/{MCPCore.py → UNFINISHED/XenAI.py} +330 -315
  165. webscout/Provider/UNFINISHED/Youchat.py +347 -330
  166. webscout/Provider/UNFINISHED/aihumanizer.py +41 -0
  167. webscout/Provider/UNFINISHED/grammerchecker.py +37 -0
  168. webscout/Provider/UNFINISHED/liner.py +342 -0
  169. webscout/Provider/UNFINISHED/liner_api_request.py +246 -263
  170. webscout/Provider/{samurai.py → UNFINISHED/samurai.py} +231 -224
  171. webscout/Provider/WiseCat.py +256 -233
  172. webscout/Provider/WrDoChat.py +390 -370
  173. webscout/Provider/__init__.py +115 -174
  174. webscout/Provider/ai4chat.py +181 -174
  175. webscout/Provider/akashgpt.py +330 -335
  176. webscout/Provider/cerebras.py +397 -290
  177. webscout/Provider/cleeai.py +236 -213
  178. webscout/Provider/elmo.py +291 -283
  179. webscout/Provider/geminiapi.py +343 -208
  180. webscout/Provider/julius.py +245 -223
  181. webscout/Provider/learnfastai.py +333 -325
  182. webscout/Provider/llama3mitril.py +230 -215
  183. webscout/Provider/llmchat.py +308 -258
  184. webscout/Provider/llmchatco.py +321 -306
  185. webscout/Provider/meta.py +996 -801
  186. webscout/Provider/oivscode.py +332 -309
  187. webscout/Provider/searchchat.py +316 -292
  188. webscout/Provider/sonus.py +264 -258
  189. webscout/Provider/toolbaz.py +359 -353
  190. webscout/Provider/turboseek.py +332 -266
  191. webscout/Provider/typefully.py +262 -202
  192. webscout/Provider/x0gpt.py +332 -299
  193. webscout/__init__.py +31 -39
  194. webscout/__main__.py +5 -5
  195. webscout/cli.py +585 -524
  196. webscout/client.py +1497 -70
  197. webscout/conversation.py +140 -436
  198. webscout/exceptions.py +383 -362
  199. webscout/litagent/__init__.py +29 -29
  200. webscout/litagent/agent.py +492 -455
  201. webscout/litagent/constants.py +60 -60
  202. webscout/models.py +505 -181
  203. webscout/optimizers.py +74 -420
  204. webscout/prompt_manager.py +376 -288
  205. webscout/sanitize.py +1514 -0
  206. webscout/scout/README.md +452 -404
  207. webscout/scout/__init__.py +8 -8
  208. webscout/scout/core/__init__.py +7 -7
  209. webscout/scout/core/crawler.py +330 -210
  210. webscout/scout/core/scout.py +800 -607
  211. webscout/scout/core/search_result.py +51 -96
  212. webscout/scout/core/text_analyzer.py +64 -63
  213. webscout/scout/core/text_utils.py +412 -277
  214. webscout/scout/core/web_analyzer.py +54 -52
  215. webscout/scout/element.py +872 -478
  216. webscout/scout/parsers/__init__.py +70 -69
  217. webscout/scout/parsers/html5lib_parser.py +182 -172
  218. webscout/scout/parsers/html_parser.py +238 -236
  219. webscout/scout/parsers/lxml_parser.py +203 -178
  220. webscout/scout/utils.py +38 -37
  221. webscout/search/__init__.py +47 -0
  222. webscout/search/base.py +201 -0
  223. webscout/search/bing_main.py +45 -0
  224. webscout/search/brave_main.py +92 -0
  225. webscout/search/duckduckgo_main.py +57 -0
  226. webscout/search/engines/__init__.py +127 -0
  227. webscout/search/engines/bing/__init__.py +15 -0
  228. webscout/search/engines/bing/base.py +35 -0
  229. webscout/search/engines/bing/images.py +114 -0
  230. webscout/search/engines/bing/news.py +96 -0
  231. webscout/search/engines/bing/suggestions.py +36 -0
  232. webscout/search/engines/bing/text.py +109 -0
  233. webscout/search/engines/brave/__init__.py +19 -0
  234. webscout/search/engines/brave/base.py +47 -0
  235. webscout/search/engines/brave/images.py +213 -0
  236. webscout/search/engines/brave/news.py +353 -0
  237. webscout/search/engines/brave/suggestions.py +318 -0
  238. webscout/search/engines/brave/text.py +167 -0
  239. webscout/search/engines/brave/videos.py +364 -0
  240. webscout/search/engines/duckduckgo/__init__.py +25 -0
  241. webscout/search/engines/duckduckgo/answers.py +80 -0
  242. webscout/search/engines/duckduckgo/base.py +189 -0
  243. webscout/search/engines/duckduckgo/images.py +100 -0
  244. webscout/search/engines/duckduckgo/maps.py +183 -0
  245. webscout/search/engines/duckduckgo/news.py +70 -0
  246. webscout/search/engines/duckduckgo/suggestions.py +22 -0
  247. webscout/search/engines/duckduckgo/text.py +221 -0
  248. webscout/search/engines/duckduckgo/translate.py +48 -0
  249. webscout/search/engines/duckduckgo/videos.py +80 -0
  250. webscout/search/engines/duckduckgo/weather.py +84 -0
  251. webscout/search/engines/mojeek.py +61 -0
  252. webscout/search/engines/wikipedia.py +77 -0
  253. webscout/search/engines/yahoo/__init__.py +41 -0
  254. webscout/search/engines/yahoo/answers.py +19 -0
  255. webscout/search/engines/yahoo/base.py +34 -0
  256. webscout/search/engines/yahoo/images.py +323 -0
  257. webscout/search/engines/yahoo/maps.py +19 -0
  258. webscout/search/engines/yahoo/news.py +258 -0
  259. webscout/search/engines/yahoo/suggestions.py +140 -0
  260. webscout/search/engines/yahoo/text.py +273 -0
  261. webscout/search/engines/yahoo/translate.py +19 -0
  262. webscout/search/engines/yahoo/videos.py +302 -0
  263. webscout/search/engines/yahoo/weather.py +220 -0
  264. webscout/search/engines/yandex.py +67 -0
  265. webscout/search/engines/yep/__init__.py +13 -0
  266. webscout/search/engines/yep/base.py +34 -0
  267. webscout/search/engines/yep/images.py +101 -0
  268. webscout/search/engines/yep/suggestions.py +38 -0
  269. webscout/search/engines/yep/text.py +99 -0
  270. webscout/search/http_client.py +172 -0
  271. webscout/search/results.py +141 -0
  272. webscout/search/yahoo_main.py +57 -0
  273. webscout/search/yep_main.py +48 -0
  274. webscout/server/__init__.py +48 -0
  275. webscout/server/config.py +78 -0
  276. webscout/server/exceptions.py +69 -0
  277. webscout/server/providers.py +286 -0
  278. webscout/server/request_models.py +131 -0
  279. webscout/server/request_processing.py +404 -0
  280. webscout/server/routes.py +642 -0
  281. webscout/server/server.py +351 -0
  282. webscout/server/ui_templates.py +1171 -0
  283. webscout/swiftcli/__init__.py +79 -95
  284. webscout/swiftcli/core/__init__.py +7 -7
  285. webscout/swiftcli/core/cli.py +574 -297
  286. webscout/swiftcli/core/context.py +98 -104
  287. webscout/swiftcli/core/group.py +268 -241
  288. webscout/swiftcli/decorators/__init__.py +28 -28
  289. webscout/swiftcli/decorators/command.py +243 -221
  290. webscout/swiftcli/decorators/options.py +247 -220
  291. webscout/swiftcli/decorators/output.py +392 -252
  292. webscout/swiftcli/exceptions.py +21 -21
  293. webscout/swiftcli/plugins/__init__.py +9 -9
  294. webscout/swiftcli/plugins/base.py +134 -135
  295. webscout/swiftcli/plugins/manager.py +269 -269
  296. webscout/swiftcli/utils/__init__.py +58 -59
  297. webscout/swiftcli/utils/formatting.py +251 -252
  298. webscout/swiftcli/utils/parsing.py +368 -267
  299. webscout/update_checker.py +280 -136
  300. webscout/utils.py +28 -14
  301. webscout/version.py +2 -1
  302. webscout/version.py.bak +3 -0
  303. webscout/zeroart/__init__.py +218 -135
  304. webscout/zeroart/base.py +70 -66
  305. webscout/zeroart/effects.py +155 -101
  306. webscout/zeroart/fonts.py +1799 -1239
  307. webscout-2026.1.19.dist-info/METADATA +638 -0
  308. webscout-2026.1.19.dist-info/RECORD +312 -0
  309. {webscout-8.2.9.dist-info → webscout-2026.1.19.dist-info}/WHEEL +1 -1
  310. {webscout-8.2.9.dist-info → webscout-2026.1.19.dist-info}/entry_points.txt +1 -1
  311. webscout/DWEBS.py +0 -520
  312. webscout/Extra/Act.md +0 -309
  313. webscout/Extra/GitToolkit/gitapi/README.md +0 -110
  314. webscout/Extra/autocoder/__init__.py +0 -9
  315. webscout/Extra/autocoder/autocoder.py +0 -1105
  316. webscout/Extra/autocoder/autocoder_utiles.py +0 -332
  317. webscout/Extra/gguf.md +0 -430
  318. webscout/Extra/weather.md +0 -281
  319. webscout/Litlogger/README.md +0 -10
  320. webscout/Litlogger/__init__.py +0 -15
  321. webscout/Litlogger/formats.py +0 -4
  322. webscout/Litlogger/handlers.py +0 -103
  323. webscout/Litlogger/levels.py +0 -13
  324. webscout/Litlogger/logger.py +0 -92
  325. webscout/Provider/AI21.py +0 -177
  326. webscout/Provider/AISEARCH/DeepFind.py +0 -254
  327. webscout/Provider/AISEARCH/felo_search.py +0 -202
  328. webscout/Provider/AISEARCH/genspark_search.py +0 -324
  329. webscout/Provider/AISEARCH/hika_search.py +0 -186
  330. webscout/Provider/AISEARCH/scira_search.py +0 -298
  331. webscout/Provider/Aitopia.py +0 -316
  332. webscout/Provider/AllenAI.py +0 -440
  333. webscout/Provider/Blackboxai.py +0 -791
  334. webscout/Provider/ChatGPTClone.py +0 -237
  335. webscout/Provider/ChatGPTGratis.py +0 -194
  336. webscout/Provider/Cloudflare.py +0 -324
  337. webscout/Provider/ExaChat.py +0 -358
  338. webscout/Provider/Flowith.py +0 -217
  339. webscout/Provider/FreeGemini.py +0 -250
  340. webscout/Provider/Glider.py +0 -225
  341. webscout/Provider/HF_space/__init__.py +0 -0
  342. webscout/Provider/HF_space/qwen_qwen2.py +0 -206
  343. webscout/Provider/HuggingFaceChat.py +0 -469
  344. webscout/Provider/Hunyuan.py +0 -283
  345. webscout/Provider/LambdaChat.py +0 -411
  346. webscout/Provider/Llama3.py +0 -259
  347. webscout/Provider/Nemotron.py +0 -218
  348. webscout/Provider/OLLAMA.py +0 -396
  349. webscout/Provider/OPENAI/BLACKBOXAI.py +0 -766
  350. webscout/Provider/OPENAI/Cloudflare.py +0 -378
  351. webscout/Provider/OPENAI/FreeGemini.py +0 -283
  352. webscout/Provider/OPENAI/NEMOTRON.py +0 -232
  353. webscout/Provider/OPENAI/Qwen3.py +0 -283
  354. webscout/Provider/OPENAI/api.py +0 -969
  355. webscout/Provider/OPENAI/c4ai.py +0 -373
  356. webscout/Provider/OPENAI/chatgptclone.py +0 -494
  357. webscout/Provider/OPENAI/copilot.py +0 -242
  358. webscout/Provider/OPENAI/flowith.py +0 -162
  359. webscout/Provider/OPENAI/freeaichat.py +0 -359
  360. webscout/Provider/OPENAI/mcpcore.py +0 -389
  361. webscout/Provider/OPENAI/multichat.py +0 -376
  362. webscout/Provider/OPENAI/opkfc.py +0 -496
  363. webscout/Provider/OPENAI/scirachat.py +0 -477
  364. webscout/Provider/OPENAI/standardinput.py +0 -433
  365. webscout/Provider/OPENAI/typegpt.py +0 -364
  366. webscout/Provider/OPENAI/uncovrAI.py +0 -463
  367. webscout/Provider/OPENAI/venice.py +0 -431
  368. webscout/Provider/OPENAI/yep.py +0 -382
  369. webscout/Provider/OpenGPT.py +0 -209
  370. webscout/Provider/Perplexitylabs.py +0 -415
  371. webscout/Provider/Reka.py +0 -214
  372. webscout/Provider/StandardInput.py +0 -290
  373. webscout/Provider/TTI/aiarta.py +0 -365
  374. webscout/Provider/TTI/artbit.py +0 -0
  375. webscout/Provider/TTI/fastflux.py +0 -200
  376. webscout/Provider/TTI/piclumen.py +0 -203
  377. webscout/Provider/TTI/pixelmuse.py +0 -225
  378. webscout/Provider/TTS/gesserit.py +0 -128
  379. webscout/Provider/TTS/sthir.py +0 -94
  380. webscout/Provider/TeachAnything.py +0 -229
  381. webscout/Provider/UNFINISHED/puterjs.py +0 -635
  382. webscout/Provider/UNFINISHED/test_lmarena.py +0 -119
  383. webscout/Provider/Venice.py +0 -258
  384. webscout/Provider/VercelAI.py +0 -253
  385. webscout/Provider/Writecream.py +0 -246
  386. webscout/Provider/WritingMate.py +0 -269
  387. webscout/Provider/asksteve.py +0 -220
  388. webscout/Provider/chatglm.py +0 -215
  389. webscout/Provider/copilot.py +0 -425
  390. webscout/Provider/freeaichat.py +0 -285
  391. webscout/Provider/granite.py +0 -235
  392. webscout/Provider/hermes.py +0 -266
  393. webscout/Provider/koala.py +0 -170
  394. webscout/Provider/lmarena.py +0 -198
  395. webscout/Provider/multichat.py +0 -364
  396. webscout/Provider/scira_chat.py +0 -299
  397. webscout/Provider/scnet.py +0 -243
  398. webscout/Provider/talkai.py +0 -194
  399. webscout/Provider/typegpt.py +0 -289
  400. webscout/Provider/uncovr.py +0 -368
  401. webscout/Provider/yep.py +0 -389
  402. webscout/litagent/Readme.md +0 -276
  403. webscout/litprinter/__init__.py +0 -59
  404. webscout/swiftcli/Readme.md +0 -323
  405. webscout/tempid.py +0 -128
  406. webscout/webscout_search.py +0 -1184
  407. webscout/webscout_search_async.py +0 -654
  408. webscout/yep_search.py +0 -347
  409. webscout/zeroart/README.md +0 -89
  410. webscout-8.2.9.dist-info/METADATA +0 -1033
  411. webscout-8.2.9.dist-info/RECORD +0 -289
  412. {webscout-8.2.9.dist-info → webscout-2026.1.19.dist-info}/licenses/LICENSE.md +0 -0
  413. {webscout-8.2.9.dist-info → webscout-2026.1.19.dist-info}/top_level.txt +0 -0
@@ -1,444 +1,365 @@
1
- import time
2
- import uuid
3
- import requests
4
- import json
5
- from typing import List, Dict, Optional, Union, Generator, Any
6
-
7
- from webscout.litagent import LitAgent
8
- from .base import BaseChat, BaseCompletions, OpenAICompatibleProvider
9
- from .utils import (
10
- ChatCompletion,
11
- ChatCompletionChunk,
12
- Choice,
13
- ChatCompletionMessage,
14
- ChoiceDelta,
15
- CompletionUsage,
16
- format_prompt,
17
- count_tokens
18
- )
19
-
20
- # ANSI escape codes for formatting
21
- BOLD = "\033[1m"
22
- RED = "\033[91m"
23
- RESET = "\033[0m"
24
-
25
- # Model configurations
26
- MODEL_CONFIGS = {
27
- "exaanswer": {
28
- "endpoint": "https://ayle.chat/api/exaanswer",
29
- "models": ["exaanswer"],
30
- },
31
- "gemini": {
32
- "endpoint": "https://ayle.chat/api/gemini",
33
- "models": [
34
- "gemini-2.0-flash",
35
- "gemini-2.0-flash-exp-image-generation",
36
- "gemini-2.0-flash-thinking-exp-01-21",
37
- "gemini-2.5-pro-exp-03-25",
38
- "gemini-2.0-pro-exp-02-05",
39
- "gemini-2.5-flash-preview-04-17",
40
-
41
-
42
- ],
43
- },
44
- "openrouter": {
45
- "endpoint": "https://ayle.chat/api/openrouter",
46
- "models": [
47
- "mistralai/mistral-small-3.1-24b-instruct:free",
48
- "deepseek/deepseek-r1:free",
49
- "deepseek/deepseek-chat-v3-0324:free",
50
- "google/gemma-3-27b-it:free",
51
- "meta-llama/llama-4-maverick:free",
52
- ],
53
- },
54
- "groq": {
55
- "endpoint": "https://ayle.chat/api/groq",
56
- "models": [
57
- "deepseek-r1-distill-llama-70b",
58
- "deepseek-r1-distill-qwen-32b",
59
- "gemma2-9b-it",
60
- "llama-3.1-8b-instant",
61
- "llama-3.2-1b-preview",
62
- "llama-3.2-3b-preview",
63
- "llama-3.2-90b-vision-preview",
64
- "llama-3.3-70b-specdec",
65
- "llama-3.3-70b-versatile",
66
- "llama3-70b-8192",
67
- "llama3-8b-8192",
68
- "qwen-2.5-32b",
69
- "qwen-2.5-coder-32b",
70
- "qwen-qwq-32b",
71
- "meta-llama/llama-4-scout-17b-16e-instruct"
72
- ],
73
- },
74
- "cerebras": {
75
- "endpoint": "https://ayle.chat/api/cerebras",
76
- "models": [
77
- "llama3.1-8b",
78
- "llama-3.3-70b"
79
- ],
80
- },
81
- "xai": {
82
- "endpoint": "https://ayle.chat/api/xai",
83
- "models": [
84
- "grok-3-mini-beta"
85
- ],
86
- },
87
- }
88
-
89
-
90
- class Completions(BaseCompletions):
91
- def __init__(self, client: 'ExaChat'):
92
- self._client = client
93
-
94
- def create(
95
- self,
96
- *,
97
- model: str,
98
- messages: List[Dict[str, str]],
99
- max_tokens: Optional[int] = None, # Not used directly but kept for compatibility
100
- stream: bool = False,
101
- temperature: Optional[float] = None,
102
- top_p: Optional[float] = None,
103
- **kwargs: Any
104
- ) -> Union[ChatCompletion, Generator[ChatCompletionChunk, None, None]]:
105
- """
106
- Creates a model response for the given chat conversation.
107
- Mimics openai.chat.completions.create
108
- """
109
- # Format the messages using the format_prompt utility
110
- # This creates a conversation in the format: "User: message\nAssistant: response\nUser: message\nAssistant:"
111
- question = format_prompt(messages, add_special_tokens=True, do_continue=True)
112
-
113
- # Determine the provider based on the model
114
- provider = self._client._get_provider_from_model(model)
115
-
116
- # Build the appropriate payload based on the provider
117
- if provider == "exaanswer":
118
- payload = {
119
- "query": question,
120
- "messages": []
121
- }
122
- elif provider in ["gemini", "cerebras"]:
123
- payload = {
124
- "query": question,
125
- "model": model,
126
- "messages": []
127
- }
128
- else: # openrouter or groq
129
- payload = {
130
- "query": question + "\n", # Add newline for openrouter and groq models
131
- "model": model,
132
- "messages": []
133
- }
134
-
135
- request_id = f"chatcmpl-{uuid.uuid4()}"
136
- created_time = int(time.time())
137
-
138
- if stream:
139
- return self._create_stream(request_id, created_time, model, provider, payload)
140
- else:
141
- return self._create_non_stream(request_id, created_time, model, provider, payload)
142
-
143
- def _create_stream(
144
- self, request_id: str, created_time: int, model: str, provider: str, payload: Dict[str, Any]
145
- ) -> Generator[ChatCompletionChunk, None, None]:
146
- try:
147
- endpoint = self._client._get_endpoint(provider)
148
- response = self._client.session.post(
149
- endpoint,
150
- headers=self._client.headers,
151
- json=payload,
152
- stream=True,
153
- timeout=self._client.timeout
154
- )
155
- response.raise_for_status()
156
-
157
- # Track token usage across chunks
158
- completion_tokens = 0
159
- streaming_text = ""
160
-
161
- for line in response.iter_lines():
162
- if not line:
163
- continue
164
-
165
- try:
166
- data = json.loads(line.decode('utf-8'))
167
- if 'choices' in data and len(data['choices']) > 0:
168
- content = data['choices'][0].get('delta', {}).get('content', '')
169
- if content:
170
- streaming_text += content
171
- completion_tokens += count_tokens(content)
172
-
173
- # Create a delta object for this chunk
174
- delta = ChoiceDelta(content=content)
175
- choice = Choice(index=0, delta=delta, finish_reason=None)
176
-
177
- chunk = ChatCompletionChunk(
178
- id=request_id,
179
- choices=[choice],
180
- created=created_time,
181
- model=model,
182
- )
183
-
184
- yield chunk
185
- except json.JSONDecodeError:
186
- continue
187
-
188
- # Final chunk with finish_reason
189
- delta = ChoiceDelta(content=None)
190
- choice = Choice(index=0, delta=delta, finish_reason="stop")
191
-
192
- chunk = ChatCompletionChunk(
193
- id=request_id,
194
- choices=[choice],
195
- created=created_time,
196
- model=model,
197
- )
198
-
199
- yield chunk
200
-
201
- except requests.exceptions.RequestException as e:
202
- print(f"{RED}Error during ExaChat stream request: {e}{RESET}")
203
- raise IOError(f"ExaChat request failed: {e}") from e
204
-
205
- def _create_non_stream(
206
- self, request_id: str, created_time: int, model: str, provider: str, payload: Dict[str, Any]
207
- ) -> ChatCompletion:
208
- try:
209
- endpoint = self._client._get_endpoint(provider)
210
- response = self._client.session.post(
211
- endpoint,
212
- headers=self._client.headers,
213
- json=payload,
214
- timeout=self._client.timeout
215
- )
216
- response.raise_for_status()
217
-
218
- full_response = ""
219
- for line in response.iter_lines():
220
- if line:
221
- try:
222
- data = json.loads(line.decode('utf-8'))
223
- if 'choices' in data and len(data['choices']) > 0:
224
- content = data['choices'][0].get('delta', {}).get('content', '')
225
- if content:
226
- full_response += content
227
- except json.JSONDecodeError:
228
- continue
229
-
230
- # Create usage statistics (estimated)
231
- prompt_tokens = count_tokens(payload.get("query", ""))
232
- completion_tokens = count_tokens(full_response)
233
- total_tokens = prompt_tokens + completion_tokens
234
-
235
- usage = CompletionUsage(
236
- prompt_tokens=prompt_tokens,
237
- completion_tokens=completion_tokens,
238
- total_tokens=total_tokens
239
- )
240
-
241
- # Create the message object
242
- message = ChatCompletionMessage(
243
- role="assistant",
244
- content=full_response
245
- )
246
-
247
- # Create the choice object
248
- choice = Choice(
249
- index=0,
250
- message=message,
251
- finish_reason="stop"
252
- )
253
-
254
- # Create the completion object
255
- completion = ChatCompletion(
256
- id=request_id,
257
- choices=[choice],
258
- created=created_time,
259
- model=model,
260
- usage=usage,
261
- )
262
-
263
- return completion
264
-
265
- except Exception as e:
266
- print(f"{RED}Error during ExaChat non-stream request: {e}{RESET}")
267
- raise IOError(f"ExaChat request failed: {e}") from e
268
-
269
- class Chat(BaseChat):
270
- def __init__(self, client: 'ExaChat'):
271
- self.completions = Completions(client)
272
-
273
- class ExaChat(OpenAICompatibleProvider):
274
- """
275
- OpenAI-compatible client for ExaChat API.
276
-
277
- Usage:
278
- client = ExaChat()
279
- response = client.chat.completions.create(
280
- model="exaanswer",
281
- messages=[{"role": "user", "content": "Hello!"}]
282
- )
283
- print(response.choices[0].message.content)
284
- """
285
-
286
- AVAILABLE_MODELS = [
287
- # ExaAnswer Models
288
- "exaanswer",
289
-
290
- # XAI Models
291
- "grok-3-mini-beta",
292
-
293
- # Gemini Models
294
- "gemini-2.0-flash",
295
- "gemini-2.0-flash-exp-image-generation",
296
- "gemini-2.0-flash-thinking-exp-01-21",
297
- "gemini-2.5-pro-exp-03-25",
298
- "gemini-2.0-pro-exp-02-05",
299
- "gemini-2.5-flash-preview-04-17",
300
-
301
- # OpenRouter Models
302
- "mistralai/mistral-small-3.1-24b-instruct:free",
303
- "deepseek/deepseek-r1:free",
304
- "deepseek/deepseek-chat-v3-0324:free",
305
- "google/gemma-3-27b-it:free",
306
- "meta-llama/llama-4-maverick:free",
307
-
308
- # Groq Models
309
- "deepseek-r1-distill-llama-70b",
310
- "deepseek-r1-distill-qwen-32b",
311
- "gemma2-9b-it",
312
- "llama-3.1-8b-instant",
313
- "llama-3.2-1b-preview",
314
- "llama-3.2-3b-preview",
315
- "llama-3.2-90b-vision-preview",
316
- "llama-3.3-70b-specdec",
317
- "llama-3.3-70b-versatile",
318
- "llama3-70b-8192",
319
- "llama3-8b-8192",
320
- "qwen-2.5-32b",
321
- "qwen-2.5-coder-32b",
322
- "qwen-qwq-32b",
323
- "meta-llama/llama-4-scout-17b-16e-instruct",
324
-
325
-
326
- # Cerebras Models
327
- "llama3.1-8b",
328
- "llama-3.3-70b",
329
-
330
- ]
331
-
332
- def __init__(
333
- self,
334
- timeout: int = 30,
335
- temperature: float = 0.5,
336
- top_p: float = 1.0
337
- ):
338
- """
339
- Initialize the ExaChat client.
340
-
341
- Args:
342
- timeout: Request timeout in seconds.
343
- temperature: Temperature for response generation.
344
- top_p: Top-p sampling parameter.
345
- """
346
- self.timeout = timeout
347
- self.temperature = temperature
348
- self.top_p = top_p
349
-
350
- # Initialize LitAgent for user agent generation
351
- agent = LitAgent()
352
-
353
- self.headers = {
354
- "accept": "*/*",
355
- "accept-language": "en-US,en;q=0.9",
356
- "content-type": "application/json",
357
- "origin": "https://ayle.chat/",
358
- "referer": "https://ayle.chat//",
359
- "user-agent": agent.random(),
360
- }
361
-
362
- self.session = requests.Session()
363
- self.session.headers.update(self.headers)
364
- self.session.cookies.update({"session": uuid.uuid4().hex})
365
-
366
- # Initialize the chat interface
367
- self.chat = Chat(self)
368
-
369
- @property
370
- def models(self):
371
- class _ModelList:
372
- def list(inner_self):
373
- return type(self).AVAILABLE_MODELS
374
- return _ModelList()
375
- def _get_endpoint(self, provider: str) -> str:
376
- """Get the API endpoint for the specified provider."""
377
- return MODEL_CONFIGS[provider]["endpoint"]
378
-
379
- def _get_provider_from_model(self, model: str) -> str:
380
- """Determine the provider based on the model name."""
381
- for provider, config in MODEL_CONFIGS.items():
382
- if model in config["models"]:
383
- return provider
384
-
385
- # If model not found, use a default model
386
- print(f"{BOLD}Warning: Model '{model}' not found, using default model 'exaanswer'{RESET}")
387
- return "exaanswer"
388
-
389
- def convert_model_name(self, model: str) -> str:
390
- """
391
- Ensure the model name is in the correct format.
392
- """
393
- if model in self.AVAILABLE_MODELS:
394
- return model
395
-
396
- # Try to find a matching model
397
- for available_model in self.AVAILABLE_MODELS:
398
- if model.lower() in available_model.lower():
399
- return available_model
400
-
401
- # Default to exaanswer if no match
402
- print(f"{BOLD}Warning: Model '{model}' not found, using default model 'exaanswer'{RESET}")
403
- return "exaanswer"
404
-
405
-
406
- # Simple test if run directly
407
- if __name__ == "__main__":
408
- print("-" * 80)
409
- print(f"{'Model':<50} {'Status':<10} {'Response'}")
410
- print("-" * 80)
411
-
412
- # Test a subset of models to avoid excessive API calls
413
- test_models = [
414
- "exaanswer",
415
- "gemini-2.0-flash",
416
- "deepseek/deepseek-r1:free",
417
- "llama-3.1-8b-instant",
418
- "llama3.1-8b"
419
- ]
420
-
421
- for model in test_models:
422
- try:
423
- client = ExaChat(timeout=60)
424
- # Test with a simple conversation to demonstrate format_prompt usage
425
- response = client.chat.completions.create(
426
- model=model,
427
- messages=[
428
- {"role": "system", "content": "You are a helpful assistant."},
429
- {"role": "user", "content": "Say 'Hello' in one word"},
430
- ],
431
- stream=False
432
- )
433
-
434
- if response and response.choices and response.choices[0].message.content:
435
- status = "✓"
436
- # Truncate response if too long
437
- display_text = response.choices[0].message.content.strip()
438
- display_text = display_text[:50] + "..." if len(display_text) > 50 else display_text
439
- else:
440
- status = "✗"
441
- display_text = "Empty or invalid response"
442
- print(f"{model:<50} {status:<10} {display_text}")
443
- except Exception as e:
444
- print(f"{model:<50} {'✗':<10} {str(e)}")
1
+ import json
2
+ import time
3
+ import uuid
4
+ from typing import Any, Dict, Generator, List, Optional, Union, cast
5
+
6
+ import requests
7
+
8
+ from webscout.Provider.OPENAI.base import (
9
+ BaseChat,
10
+ BaseCompletions,
11
+ OpenAICompatibleProvider,
12
+ SimpleModelList,
13
+ )
14
+ from webscout.Provider.OPENAI.utils import (
15
+ ChatCompletion,
16
+ ChatCompletionChunk,
17
+ ChatCompletionMessage,
18
+ Choice,
19
+ ChoiceDelta,
20
+ CompletionUsage,
21
+ count_tokens,
22
+ )
23
+
24
+ from ...litagent import LitAgent
25
+
26
+ # ANSI escape codes for formatting
27
+ BOLD = "\033[1m"
28
+ RED = "\033[91m"
29
+ RESET = "\033[0m"
30
+
31
+ # Model configurations
32
+ MODEL_CONFIGS = {
33
+ "ayle": {
34
+ "endpoint": "https://ayle.chat/api/chat",
35
+ "models": [
36
+ "gemini-2.5-flash",
37
+ "llama-3.3-70b-versatile",
38
+ "llama-3.3-70b",
39
+ "tngtech/deepseek-r1t2-chimera:free",
40
+ "openai/gpt-oss-120b",
41
+ "qwen-3-235b-a22b-instruct-2507",
42
+ "llama3.1-8b",
43
+ "llama-4-scout-17b-16e-instruct",
44
+ "qwen-3-32b",
45
+ ],
46
+ }
47
+ }
48
+
49
+
50
+ class Completions(BaseCompletions):
51
+ def __init__(self, client: "Ayle"):
52
+ self._client = client
53
+
54
+ def create(
55
+ self,
56
+ *,
57
+ model: str,
58
+ messages: List[Dict[str, str]],
59
+ max_tokens: Optional[int] = None, # Not used directly but kept for compatibility
60
+ stream: bool = False,
61
+ temperature: Optional[float] = None,
62
+ top_p: Optional[float] = None,
63
+ timeout: Optional[int] = None,
64
+ proxies: Optional[Dict[str, str]] = None,
65
+ **kwargs: Any,
66
+ ) -> Union[ChatCompletion, Generator[ChatCompletionChunk, None, None]]:
67
+ """
68
+ Creates a model response for the given chat conversation.
69
+ Mimics openai.chat.completions.create
70
+ """
71
+ # Determine the provider based on the model
72
+ provider = self._client._get_provider_from_model(model)
73
+
74
+ # Build the appropriate payload
75
+ payload = {"messages": messages, "model": model}
76
+
77
+ request_id = f"chatcmpl-{uuid.uuid4()}"
78
+ created_time = int(time.time())
79
+
80
+ if stream:
81
+ return self._create_stream(
82
+ request_id, created_time, model, provider, payload, timeout, proxies
83
+ )
84
+ else:
85
+ return self._create_non_stream(
86
+ request_id, created_time, model, provider, payload, timeout, proxies
87
+ )
88
+
89
+ def _create_stream(
90
+ self,
91
+ request_id: str,
92
+ created_time: int,
93
+ model: str,
94
+ provider: str,
95
+ payload: Dict[str, Any],
96
+ timeout: Optional[int] = None,
97
+ proxies: Optional[Dict[str, str]] = None,
98
+ ) -> Generator[ChatCompletionChunk, None, None]:
99
+ try:
100
+ endpoint = self._client._get_endpoint(provider)
101
+ response = self._client.session.post(
102
+ endpoint,
103
+ headers=self._client.headers,
104
+ json=payload,
105
+ stream=True,
106
+ timeout=timeout or self._client.timeout,
107
+ proxies=proxies or getattr(self._client, "proxies", None),
108
+ )
109
+ response.raise_for_status()
110
+
111
+ # Track token usage across chunks
112
+ completion_tokens = 0
113
+ streaming_text = ""
114
+
115
+ for line in response.iter_lines():
116
+ if not line:
117
+ continue
118
+
119
+ try:
120
+ line_str = line.decode("utf-8")
121
+ if line_str.startswith('0:"'):
122
+ content = json.loads(line_str[2:])
123
+ if content:
124
+ streaming_text += content
125
+ completion_tokens += count_tokens(content)
126
+
127
+ # Create a delta object for this chunk
128
+ delta = ChoiceDelta(content=content)
129
+ choice = Choice(index=0, delta=delta, finish_reason=None)
130
+
131
+ chunk = ChatCompletionChunk(
132
+ id=request_id,
133
+ choices=[choice],
134
+ created=created_time,
135
+ model=model,
136
+ )
137
+
138
+ yield chunk
139
+ except (json.JSONDecodeError, UnicodeDecodeError):
140
+ continue
141
+
142
+ # Final chunk with finish_reason
143
+ delta = ChoiceDelta(content=None)
144
+ choice = Choice(index=0, delta=delta, finish_reason="stop")
145
+
146
+ chunk = ChatCompletionChunk(
147
+ id=request_id,
148
+ choices=[choice],
149
+ created=created_time,
150
+ model=model,
151
+ )
152
+
153
+ yield chunk
154
+
155
+ except requests.exceptions.RequestException as e:
156
+ print(f"{RED}Error during Ayle stream request: {e}{RESET}")
157
+ raise IOError(f"Ayle request failed: {e}") from e
158
+
159
+ def _create_non_stream(
160
+ self,
161
+ request_id: str,
162
+ created_time: int,
163
+ model: str,
164
+ provider: str,
165
+ payload: Dict[str, Any],
166
+ timeout: Optional[int] = None,
167
+ proxies: Optional[Dict[str, str]] = None,
168
+ ) -> ChatCompletion:
169
+ try:
170
+ endpoint = self._client._get_endpoint(provider)
171
+ response = self._client.session.post(
172
+ endpoint,
173
+ headers=self._client.headers,
174
+ json=payload,
175
+ timeout=timeout or self._client.timeout,
176
+ proxies=proxies or getattr(self._client, "proxies", None),
177
+ )
178
+ response.raise_for_status()
179
+
180
+ full_response = ""
181
+ for line in response.iter_lines():
182
+ if line:
183
+ try:
184
+ line_str = line.decode("utf-8")
185
+ if line_str.startswith('0:"'):
186
+ content = json.loads(line_str[2:])
187
+ if content:
188
+ full_response += content
189
+ except (json.JSONDecodeError, UnicodeDecodeError):
190
+ continue
191
+
192
+ # Create usage statistics (estimated)
193
+ prompt_tokens = count_tokens(str(payload.get("messages", "")))
194
+ completion_tokens = count_tokens(full_response)
195
+ total_tokens = prompt_tokens + completion_tokens
196
+
197
+ usage = CompletionUsage(
198
+ prompt_tokens=prompt_tokens,
199
+ completion_tokens=completion_tokens,
200
+ total_tokens=total_tokens,
201
+ )
202
+
203
+ # Create the message object
204
+ message = ChatCompletionMessage(role="assistant", content=full_response)
205
+
206
+ # Create the choice object
207
+ choice = Choice(index=0, message=message, finish_reason="stop")
208
+
209
+ # Create the completion object
210
+ completion = ChatCompletion(
211
+ id=request_id,
212
+ choices=[choice],
213
+ created=created_time,
214
+ model=model,
215
+ usage=usage,
216
+ )
217
+
218
+ return completion
219
+
220
+ except Exception as e:
221
+ print(f"{RED}Error during Ayle non-stream request: {e}{RESET}")
222
+ raise IOError(f"Ayle request failed: {e}") from e
223
+
224
+
225
+ class Chat(BaseChat):
226
+ def __init__(self, client: "Ayle"):
227
+ self.completions = Completions(client)
228
+
229
+
230
+ class Ayle(OpenAICompatibleProvider):
231
+ """
232
+ OpenAI-compatible client for Ayle API.
233
+
234
+ Usage:
235
+ client = Ayle()
236
+ response = client.chat.completions.create(
237
+ model="gemini-2.5-flash",
238
+ messages=[{"role": "user", "content": "Hello!"}]
239
+ )
240
+ print(response.choices[0].message.content)
241
+ """
242
+
243
+ required_auth = False
244
+ AVAILABLE_MODELS = [
245
+ "gemini-2.5-flash",
246
+ "llama-3.3-70b-versatile",
247
+ "llama-3.3-70b",
248
+ "tngtech/deepseek-r1t2-chimera:free",
249
+ "openai/gpt-oss-120b",
250
+ "qwen-3-235b-a22b-instruct-2507",
251
+ "llama3.1-8b",
252
+ "llama-4-scout-17b-16e-instruct",
253
+ "qwen-3-32b",
254
+ ]
255
+
256
+ def __init__(self, timeout: int = 30, temperature: float = 0.5, top_p: float = 1.0):
257
+ """
258
+ Initialize the Ayle client.
259
+
260
+ Args:
261
+ timeout: Request timeout in seconds.
262
+ temperature: Temperature for response generation.
263
+ top_p: Top-p sampling parameter.
264
+ """
265
+ self.timeout = timeout
266
+ self.temperature = temperature
267
+ self.top_p = top_p
268
+
269
+ # Initialize LitAgent for user agent generation
270
+ agent = LitAgent()
271
+
272
+ self.headers = {
273
+ "accept": "*/*",
274
+ "accept-language": "en-US,en;q=0.9",
275
+ "content-type": "application/json",
276
+ "origin": "https://ayle.chat/",
277
+ "referer": "https://ayle.chat/",
278
+ "user-agent": agent.random(),
279
+ }
280
+
281
+ self.session = requests.Session()
282
+ self.session.headers.update(self.headers)
283
+ self.session.cookies.update({"session": uuid.uuid4().hex})
284
+
285
+ # Initialize the chat interface
286
+ self.chat = Chat(self)
287
+
288
+ @property
289
+ def models(self) -> SimpleModelList:
290
+ return SimpleModelList(type(self).AVAILABLE_MODELS)
291
+
292
+ def _get_endpoint(self, provider: str) -> str:
293
+ """Get the API endpoint for the specified provider."""
294
+ return cast(str, MODEL_CONFIGS[provider]["endpoint"])
295
+
296
+ def _get_provider_from_model(self, model: str) -> str:
297
+ """Determine the provider based on the model name."""
298
+ for provider, config in MODEL_CONFIGS.items():
299
+ if model in config["models"]:
300
+ return provider
301
+
302
+ # If model not found, use a default model
303
+ print(f"{BOLD}Warning: Model '{model}' not found, using default model 'ayle'{RESET}")
304
+ return "ayle"
305
+
306
+ def convert_model_name(self, model: str) -> str:
307
+ """
308
+ Ensure the model name is in the correct format.
309
+ """
310
+ if model in self.AVAILABLE_MODELS:
311
+ return model
312
+
313
+ # Try to find a matching model
314
+ for available_model in self.AVAILABLE_MODELS:
315
+ if model.lower() in available_model.lower():
316
+ return available_model
317
+
318
+ # Default to gemini-2.5-flash if no match
319
+ print(
320
+ f"{BOLD}Warning: Model '{model}' not found, using default model 'gemini-2.5-flash'{RESET}"
321
+ )
322
+ return "gemini-2.5-flash"
323
+
324
+
325
+ # Simple test if run directly
326
+ if __name__ == "__main__":
327
+ print("-" * 80)
328
+ print(f"{'Model':<50} {'Status':<10} {'Response'}")
329
+ print("-" * 80)
330
+
331
+ # Test a subset of models to avoid excessive API calls
332
+ test_models = [
333
+ "gemini-2.5-flash",
334
+ ]
335
+
336
+ for model in test_models:
337
+ try:
338
+ client = Ayle(timeout=60)
339
+ # Test with a simple conversation to demonstrate format_prompt usage
340
+ response = client.chat.completions.create(
341
+ model=model,
342
+ messages=[
343
+ {"role": "system", "content": "You are a helpful assistant."},
344
+ {"role": "user", "content": "Say 'Hello' in one word"},
345
+ ],
346
+ stream=False,
347
+ )
348
+
349
+ if (
350
+ isinstance(response, ChatCompletion)
351
+ and response.choices
352
+ and response.choices[0].message
353
+ and response.choices[0].message.content
354
+ ):
355
+ status = "✓"
356
+ # Truncate response if too long
357
+ display_text = response.choices[0].message.content.strip()
358
+ display_text = display_text[:50] + "..." if len(display_text) > 50 else display_text
359
+ else:
360
+ status = "✗"
361
+ display_text = "Empty or invalid response"
362
+ print(f"{model:<50} {status:<10} {display_text}")
363
+ except Exception as e:
364
+ print(f"{model:<50} {'✗':<10} {str(e)}")
365
+ print(f"{model:<50} {'✗':<10} {str(e)}")