webscout 6.0__py3-none-any.whl → 6.2__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


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

Files changed (63) hide show
  1. webscout/AIauto.py +77 -259
  2. webscout/Agents/Onlinesearcher.py +22 -10
  3. webscout/Agents/functioncall.py +2 -2
  4. webscout/Bard.py +21 -21
  5. webscout/Extra/autollama.py +37 -20
  6. webscout/Local/__init__.py +6 -7
  7. webscout/Local/formats.py +406 -194
  8. webscout/Local/model.py +1074 -477
  9. webscout/Local/samplers.py +108 -144
  10. webscout/Local/thread.py +251 -410
  11. webscout/Local/ui.py +401 -0
  12. webscout/Local/utils.py +338 -136
  13. webscout/Provider/Amigo.py +51 -38
  14. webscout/Provider/Deepseek.py +7 -6
  15. webscout/Provider/EDITEE.py +2 -2
  16. webscout/Provider/GPTWeb.py +1 -1
  17. webscout/Provider/Llama3.py +1 -1
  18. webscout/Provider/NinjaChat.py +200 -0
  19. webscout/Provider/OLLAMA.py +1 -1
  20. webscout/Provider/Perplexity.py +1 -1
  21. webscout/Provider/Reka.py +12 -5
  22. webscout/Provider/TTI/AIuncensored.py +103 -0
  23. webscout/Provider/TTI/Nexra.py +3 -3
  24. webscout/Provider/TTI/__init__.py +4 -2
  25. webscout/Provider/TTI/aiforce.py +2 -2
  26. webscout/Provider/TTI/imgninza.py +136 -0
  27. webscout/Provider/TTI/talkai.py +116 -0
  28. webscout/Provider/TeachAnything.py +0 -3
  29. webscout/Provider/Youchat.py +1 -1
  30. webscout/Provider/__init__.py +16 -12
  31. webscout/Provider/{ChatHub.py → aimathgpt.py} +72 -88
  32. webscout/Provider/cerebras.py +143 -123
  33. webscout/Provider/cleeai.py +1 -1
  34. webscout/Provider/felo_search.py +1 -1
  35. webscout/Provider/gaurish.py +207 -0
  36. webscout/Provider/geminiprorealtime.py +160 -0
  37. webscout/Provider/genspark.py +1 -1
  38. webscout/Provider/julius.py +8 -3
  39. webscout/Provider/learnfastai.py +1 -1
  40. webscout/Provider/{aigames.py → llmchat.py} +74 -84
  41. webscout/Provider/promptrefine.py +3 -1
  42. webscout/Provider/talkai.py +196 -0
  43. webscout/Provider/turboseek.py +3 -8
  44. webscout/Provider/tutorai.py +1 -1
  45. webscout/__init__.py +2 -43
  46. webscout/exceptions.py +5 -1
  47. webscout/tempid.py +4 -73
  48. webscout/utils.py +3 -0
  49. webscout/version.py +1 -1
  50. webscout/webai.py +1 -1
  51. webscout/webscout_search.py +154 -123
  52. {webscout-6.0.dist-info → webscout-6.2.dist-info}/METADATA +164 -245
  53. {webscout-6.0.dist-info → webscout-6.2.dist-info}/RECORD +57 -55
  54. webscout/Local/rawdog.py +0 -946
  55. webscout/Provider/BasedGPT.py +0 -214
  56. webscout/Provider/TTI/amigo.py +0 -148
  57. webscout/Provider/bixin.py +0 -264
  58. webscout/Provider/xdash.py +0 -182
  59. webscout/websx_search.py +0 -19
  60. {webscout-6.0.dist-info → webscout-6.2.dist-info}/LICENSE.md +0 -0
  61. {webscout-6.0.dist-info → webscout-6.2.dist-info}/WHEEL +0 -0
  62. {webscout-6.0.dist-info → webscout-6.2.dist-info}/entry_points.txt +0 -0
  63. {webscout-6.0.dist-info → webscout-6.2.dist-info}/top_level.txt +0 -0
@@ -1,6 +1,4 @@
1
1
  import requests
2
-
3
-
4
2
  import json
5
3
 
6
4
  from webscout.AIutel import Optimizers
@@ -138,16 +136,13 @@ class TurboSeek(Provider):
138
136
  raise exceptions.FailedToGenerateResponseError(
139
137
  f"Failed to generate response - ({response.status_code}, {response.reason}) - {response.text}"
140
138
  )
141
- print(response.text)
142
139
  streaming_text = ""
143
140
  for value in response.iter_lines(
144
- decode_unicode=True,
145
141
  chunk_size=self.stream_chunk_size,
146
- delimiter="\n",
147
142
  ):
148
143
  try:
149
- if bool(value) and value.startswith("data: "):
150
- data = json.loads(value[6:])
144
+ if value and value.startswith(b"data: "): #Check for bytes and decode
145
+ data = json.loads(value[6:].decode('utf-8')) # Decode manually
151
146
  if "text" in data:
152
147
  streaming_text += data["text"]
153
148
  resp = dict(text=streaming_text)
@@ -217,4 +212,4 @@ if __name__ == '__main__':
217
212
  ai = TurboSeek()
218
213
  response = ai.chat("hi")
219
214
  for chunk in response:
220
- print(chunk, end="", flush=True)
215
+ print(chunk, end="", flush=True)
@@ -349,6 +349,6 @@ if __name__ == "__main__":
349
349
  from rich import print
350
350
 
351
351
  ai = TutorAI()
352
- response = ai.chat(input(">>> "), attachment_path='photo_2024-07-06_22-19-42.jpg')
352
+ response = ai.chat(input(">>> "), attachment_path=None)
353
353
  for chunk in response:
354
354
  print(chunk, end="", flush=True)
webscout/__init__.py CHANGED
@@ -5,60 +5,19 @@ from .DWEBS import *
5
5
  from .transcriber import *
6
6
  from .requestsHTMLfix import *
7
7
  from .tempid import *
8
- from .websx_search import WEBSX
9
8
  from .LLM import VLM, LLM
10
9
  from .YTdownloader import *
11
10
  from .Bing_search import *
12
- import g4f
13
11
  from .YTdownloader import *
14
12
  from .Provider import *
15
13
  from .Provider.TTI import *
16
14
  from .Provider.TTS import *
17
- from .Extra import gguf
18
- from .Extra import autollama
19
- from .Extra import weather_ascii, weather
15
+ from .Extra import *
16
+
20
17
  from .Agents import *
21
18
 
22
19
  __repo__ = "https://github.com/OE-LUCIFER/Webscout"
23
20
 
24
- webai = [
25
- "leo",
26
- "openai",
27
- "opengpt",
28
- "koboldai",
29
- "gemini",
30
- "phind",
31
- "blackboxai",
32
- "g4fauto",
33
- "perplexity",
34
- "groq",
35
- "reka",
36
- "cohere",
37
- "yepchat",
38
- "you",
39
- "xjai",
40
- "thinkany",
41
- "berlin4h",
42
- "chatgptuk",
43
- "auto",
44
- "poe",
45
- "basedgpt",
46
- "deepseek",
47
- "deepinfra",
48
- "vtlchat",
49
- "geminiflash",
50
- "geminipro",
51
- "ollama",
52
- "andi",
53
- "llama3"
54
- ]
55
-
56
- gpt4free_providers = [
57
- provider.__name__ for provider in g4f.Provider.__providers__ # if provider.working
58
- ]
59
-
60
- available_providers = webai + gpt4free_providers
61
-
62
21
 
63
22
  import logging
64
23
  logging.getLogger("webscout").addHandler(logging.NullHandler())
webscout/exceptions.py CHANGED
@@ -5,7 +5,9 @@ class WebscoutE(Exception):
5
5
  class RatelimitE(Exception):
6
6
  """Raised for rate limit exceeded errors during API requests."""
7
7
 
8
-
8
+ class ConversationLimitException(Exception):
9
+ """Raised for conversation limit exceeded errors during API requests."""
10
+ pass
9
11
  class TimeoutE(Exception):
10
12
  """Raised for timeout errors during API requests."""
11
13
 
@@ -23,3 +25,5 @@ class FacebookInvalidCredentialsException(Exception):
23
25
  class FacebookRegionBlocked(Exception):
24
26
  pass
25
27
 
28
+ class ModelUnloadedException(Exception):
29
+ pass
webscout/tempid.py CHANGED
@@ -1,3 +1,4 @@
1
+ import json
1
2
  import aiohttp
2
3
  from dataclasses import dataclass
3
4
  from bs4 import BeautifulSoup
@@ -33,7 +34,7 @@ class MessageResponseModel:
33
34
  email_to: str | None
34
35
 
35
36
 
36
- class Client:
37
+ class TempMail:
37
38
  def __init__(self):
38
39
  self._session = aiohttp.ClientSession(
39
40
  base_url="https://api.internal.temp-mail.io",
@@ -51,7 +52,7 @@ class Client:
51
52
  async def __aenter__(self):
52
53
  return self
53
54
 
54
- async def __aexit__(self) -> None:
55
+ async def __aexit__(self, exc_type, exc_val, exc_tb):
55
56
  await self.close()
56
57
  return None
57
58
 
@@ -80,76 +81,6 @@ class Client:
80
81
  return [MessageResponseModel(message['attachments'], message['body_html'], message['body_text'], message['cc'], message['created_at'], message['from'], message['id'], message['subject'], message['to']) for message in response_json]
81
82
 
82
83
 
83
- class TemporaryPhoneNumber:
84
- def __init__(self):
85
- self.maxpages = {"UK": 59, "US": 3, "France": 73, "Netherlands": 60, "Finland": 47}
86
- self.minpages = {"UK": 20, "US": 1, "France": 20, "Netherlands": 20, "Finland": 20}
87
- self.plist = {"UK": "+44", "US": "+1", "France": "+33", "Netherlands": "+31", "Finland": "+358"}
88
- self.countries = {"44": "UK", "1": "US", "33": "France", "31": "Netherlands", "358": "Finland"}
89
-
90
- def get_number(self, country="UK"):
91
- if country == "Random":
92
- country = random.choice(list(self.countries.values()))
93
- if country not in self.countries.values():
94
- raise ValueError("Unsupported Country")
95
-
96
- session = tls_client.Session(client_identifier="chrome112", random_tls_extension_order=True)
97
- maxpage = self.maxpages[country]
98
- minpage = self.minpages[country]
99
- page = random.randint(minpage, maxpage)
100
-
101
- if page == 1:
102
- res = session.get(f"https://temporary-phone-number.com/{country}-Phone-Number")
103
- else:
104
- res = session.get(f"https://temporary-phone-number.com/{country}-Phone-Number/page{page}")
105
-
106
- soup = BeautifulSoup(res.content, "lxml")
107
- numbers = []
108
- p = self.plist[country]
109
- for a in soup.find_all("a"):
110
- a = a.get("title", "none")
111
- if f"{country} Phone Number {p}" in a:
112
- a = a.replace(f"{country} Phone Number ", "").replace(" ", "")
113
- numbers.append(a)
114
- return random.choice(numbers)
115
-
116
- def get_messages(self, number: str):
117
- number = number.replace("+", "")
118
- try:
119
- i = int(number)
120
- except:
121
- raise ValueError("Wrong Number")
122
-
123
- country = None
124
- for key, value in self.countries.items():
125
- if number.startswith(key):
126
- country = value
127
-
128
- if country == None:
129
- raise ValueError("Unsupported Country")
130
-
131
- session = tls_client.Session(client_identifier="chrome112", random_tls_extension_order=True)
132
- res = session.get(f"https://temporary-phone-number.com/{country}-Phone-Number/{number}")
133
-
134
- if res.status_code == 404:
135
- raise ValueError("Number doesn't exist")
136
-
137
- soup = BeautifulSoup(res.content, "lxml")
138
- messages = []
139
- message = {"content": None, "frm": "", "time": ""}
140
-
141
- for div in soup.find_all("div"):
142
- divclass = div.get("class", "None")[0]
143
- if divclass == "direct-chat-info":
144
- message["frm"] = div.text.split("\n")[1].replace("From ", "")
145
- message["time"] = div.text.split("\n")[2]
146
- if divclass == "direct-chat-text":
147
- message["content"] = div.text
148
- messages.append(sms_message(content=message["content"], frm=message["frm"], time=message["time"]))
149
- message = {"content": None, "frm": "", "time": ""}
150
-
151
- return messages
152
-
153
84
  class VNEngine:
154
85
  def __init__(self) -> NoReturn:
155
86
  self.lang: str = "?lang=en"
@@ -198,4 +129,4 @@ class sms_message:
198
129
  def __init__(self, content, frm, time):
199
130
  self.content = content
200
131
  self.frm = frm
201
- self.time = time
132
+ self.time = time
webscout/utils.py CHANGED
@@ -16,6 +16,9 @@ except ImportError:
16
16
 
17
17
  REGEX_STRIP_TAGS = re.compile("<.*?>")
18
18
 
19
+ def _expand_proxy_tb_alias(proxy: str | None) -> str | None:
20
+ """Expand "tb" to a full proxy URL if applicable."""
21
+ return "socks5://127.0.0.1:9150" if proxy == "tb" else proxy
19
22
 
20
23
  def json_dumps(obj: Any) -> str:
21
24
  try:
webscout/version.py CHANGED
@@ -1,2 +1,2 @@
1
- __version__ = "6.0"
1
+ __version__ = "6.2"
2
2
  __prog__ = "webscout"
webscout/webai.py CHANGED
@@ -30,7 +30,7 @@ from .AIutel import default_path
30
30
  from .AIutel import AwesomePrompts
31
31
  from .AIutel import RawDog
32
32
  from .AIutel import Audio
33
- from webscout import available_providers
33
+ from .AIutel import available_providers
34
34
  from colorama import Fore
35
35
  from colorama import init as init_colorama
36
36
  from dotenv import load_dotenv