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

webscout/LLM.py CHANGED
@@ -1,6 +1,9 @@
1
- import argparse
2
1
  import requests
2
+ import base64
3
+ from typing import List, Dict, Union
3
4
  import json
5
+ import requests
6
+ import base64
4
7
  from typing import List, Dict, Union
5
8
 
6
9
  class LLM:
@@ -43,3 +46,55 @@ class LLM:
43
46
  return result.json()['choices'][0]['message']['content']
44
47
  except:
45
48
  return None
49
+ # def main():
50
+ # llm = LLM(model="meta-llama/Meta-Llama-3-70B-Instruct")
51
+ # messages = [
52
+ # {"role": "user", "content": "Hello, how are you?"}
53
+ # ]
54
+ # response = llm.chat(messages)
55
+ # print(response)
56
+
57
+ # if __name__ == "__main__":
58
+ # main()
59
+
60
+
61
+ class VLM:
62
+ def __init__(self, model: str, system_message: str = "You are a Helpful AI."):
63
+ self.model = model
64
+ self.conversation_history = [{"role": "system", "content": system_message}]
65
+
66
+ def chat(self, messages: List[Dict[str, Union[str, List[Dict[str, Union[str, Dict[str, str]]]]]]]) -> Union[str, None]:
67
+ api_url = "https://api.deepinfra.com/v1/openai/chat/completions"
68
+ headers = {
69
+ 'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36',
70
+ 'Accept-Language': 'en,fr-FR;q=0.9,fr;q=0.8,es-ES;q=0.7,es;q=0.6,en-US;q=0.5,am;q=0.4,de;q=0.3',
71
+ 'Cache-Control': 'no-cache',
72
+ 'Connection': 'keep-alive',
73
+ 'Content-Type': 'application/json',
74
+ 'Origin': 'https://deepinfra.com',
75
+ 'Pragma': 'no-cache',
76
+ 'Referer': 'https://deepinfra.com/',
77
+ 'Sec-Fetch-Dest': 'empty',
78
+ 'Sec-Fetch-Mode': 'cors',
79
+ 'Sec-Fetch-Site': 'same-site',
80
+ 'X-Deepinfra-Source': 'web-embed',
81
+ 'accept': 'text/event-stream',
82
+ 'sec-ch-ua': '"Google Chrome";v="119", "Chromium";v="119", "Not?A_Brand";v="24"',
83
+ 'sec-ch-ua-mobile': '?0',
84
+ 'sec-ch-ua-platform': '"macOS"'
85
+ }
86
+ payload = {
87
+ "model": self.model,
88
+ "messages": messages,
89
+ "stream": False
90
+ }
91
+ try:
92
+ response = requests.post(api_url, headers=headers, json=payload)
93
+ return response.json()['choices'][0]['message']['content']
94
+ except Exception as e:
95
+ print(f"An error occurred: {e}")
96
+ return None
97
+
98
+ def encode_image_to_base64(image_path: str) -> str:
99
+ with open(image_path, "rb") as image_file:
100
+ return base64.b64encode(image_file.read()).decode("utf-8")
@@ -1,3 +1,3 @@
1
1
  from llama_cpp import __version__ as __llama_cpp_version__
2
2
 
3
- __version__ = '2.7'
3
+ __version__ = '2.9'
webscout/Local/utils.py CHANGED
@@ -25,18 +25,19 @@ class _ArrayLike(Iterable):
25
25
  class _SupportsWriteAndFlush(TextIO):
26
26
  pass
27
27
 
28
- def download_model(repo_id: str, filename: str, cache_dir: str = ".cache") -> str:
28
+ def download_model(repo_id: str, filename: str, token: str, cache_dir: str = ".cache") -> str:
29
29
  """
30
30
  Downloads a GGUF model file from Hugging Face Hub.
31
31
 
32
32
  repo_id: The Hugging Face repository ID (e.g., 'facebook/bart-large-cnn').
33
33
  filename: The name of the GGUF file within the repository (e.g., 'model.gguf').
34
+ token: The Hugging Face token for authentication.
34
35
  cache_dir: The directory where the downloaded file should be stored.
35
36
 
36
37
  Returns: The path to the downloaded file.
37
38
  """
38
39
  url = hf_hub_url(repo_id, filename)
39
- filepath = cached_download(url, cache_dir=cache_dir, force_filename=filename)
40
+ filepath = cached_download(url, cache_dir=cache_dir, force_filename=filename, use_auth_token=token)
40
41
  return filepath
41
42
 
42
43
  class GGUFReader:
webscout/version.py CHANGED
@@ -1,2 +1,2 @@
1
- __version__ = "2.7"
1
+ __version__ = "2.9"
2
2
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: webscout
3
- Version: 2.7
3
+ Version: 2.9
4
4
  Summary: Search for anything using Google, DuckDuckGo, phind.com, Contains AI models, can transcribe yt videos, temporary email and phone number generation, has TTS support, webai (terminal gpt and open interpreter) and offline LLMs
5
5
  Author: OEvortex
6
6
  Author-email: helpingai5@gmail.com
@@ -52,6 +52,8 @@ Requires-Dist: tls-client
52
52
  Requires-Dist: clipman
53
53
  Requires-Dist: Helpingai-T2
54
54
  Requires-Dist: playsound
55
+ Requires-Dist: poe-api-wrapper
56
+ Requires-Dist: pyreqwest-impersonate
55
57
  Provides-Extra: dev
56
58
  Requires-Dist: ruff >=0.1.6 ; extra == 'dev'
57
59
  Requires-Dist: pytest >=7.4.2 ; extra == 'dev'
@@ -59,6 +61,7 @@ Provides-Extra: local
59
61
  Requires-Dist: llama-cpp-python ; extra == 'local'
60
62
  Requires-Dist: colorama ; extra == 'local'
61
63
  Requires-Dist: numpy ; extra == 'local'
64
+ Requires-Dist: huggingface-hub ; extra == 'local'
62
65
 
63
66
  <div align="center">
64
67
  <!-- Replace `#` with your actual links -->
@@ -14,7 +14,7 @@ webscout/AIauto.py,sha256=xPGr_Z0h27XXNh4Wiufjn9TksDOqxqlaGcLUYKNP55w,18246
14
14
  webscout/AIbase.py,sha256=GoHbN8r0gq2saYRZv6LA-Fr9Jlcjv80STKFXUq2ZeGU,4710
15
15
  webscout/AIutel.py,sha256=YirhjJGkPWtv1Ceh0Mu4gVczXcOwW-LDhjfesWPHDwI,33256
16
16
  webscout/DWEBS.py,sha256=QT-7-dUgWhQ_H7EVZD53AVyXxyskoPMKCkFIpzkN56Q,7332
17
- webscout/LLM.py,sha256=CiDz0okZNEoXuxMwadZnwRGSLpqk2zg0vzvXSxQZjcE,1910
17
+ webscout/LLM.py,sha256=LbGCZdJf8A5dwfoGS4tyy39tAh5BDdhMZP0ScKaaQfU,4184
18
18
  webscout/__init__.py,sha256=QCcZuzCLjMjk7229CU50V1hgvvp6pB_vDDE3NvXRVHg,1840
19
19
  webscout/__main__.py,sha256=ZtTRgsRjUi2JOvYFLF1ZCh55Sdoz94I-BS-TlJC7WDU,126
20
20
  webscout/async_providers.py,sha256=holBv5SxanxVXc_92CBBaXHlB2IakB_fHnhyZaFjYF8,684
@@ -25,18 +25,18 @@ webscout/models.py,sha256=5iQIdtedT18YuTZ3npoG7kLMwcrKwhQ7928dl_7qZW0,692
25
25
  webscout/tempid.py,sha256=5oc3UbXhPGKxrMRTfRABT-V-dNzH_hOKWtLYM6iCWd4,5896
26
26
  webscout/transcriber.py,sha256=EddvTSq7dPJ42V3pQVnGuEiYQ7WjJ9uyeR9kMSxN7uY,20622
27
27
  webscout/utils.py,sha256=CxeXvp0rWIulUrEaPZMaNfg_tSuQLRSV8uuHA2chyKE,2603
28
- webscout/version.py,sha256=b9bayAJW34HKes4lYXQfEKUVAD2JpNlMxJN-rAKR0Xs,23
28
+ webscout/version.py,sha256=oUZS6cJqcn6yjv-XNLbwyvxLWIalOba-cFuLM6eoaWU,23
29
29
  webscout/voice.py,sha256=0QjXTHAQmCK07IDZXRc7JXem47cnPJH7u3X0sVP1-UQ,967
30
30
  webscout/webai.py,sha256=GqJs_4KSas9xOvEZ7cDAwo88OVsPoJnJWmnZ68qRQ0g,85324
31
31
  webscout/webscout_search.py,sha256=8tDmlskNtIUAM41dqIc387ufC1YunovTm6w5NqeM_yQ,42650
32
32
  webscout/webscout_search_async.py,sha256=ecn9b0J6YtAxMER80iUF1cgn_eh3Ysj7jFpievJzDbE,14471
33
33
  webscout/Local/__init__.py,sha256=0yXXihFek7VCugUjjCI67i3yZ_PQ8mw3MMVlWGpMmLM,217
34
- webscout/Local/_version.py,sha256=efRFdwc7BqYaf299BGKcfpk-Cqn-BCRNBQJMDD0KVZM,83
34
+ webscout/Local/_version.py,sha256=_4faCzosNaazujtNZJP12bI38sKMaj4KxGdcGvcGPdY,83
35
35
  webscout/Local/formats.py,sha256=BiZZSoN3e8S6-S-ykBL9ogSUs0vK11GaZ3ghc9U8GRk,18994
36
36
  webscout/Local/model.py,sha256=f6Ug0tVH4MXCzelfevxBtHJXyml2C3ribnLGJ6HfCGU,27618
37
37
  webscout/Local/samplers.py,sha256=qXwU4eLXER-2aCYzcJcTgA6BeFmi5GMpTDUX1C9pTN4,4372
38
38
  webscout/Local/thread.py,sha256=KkxTTQLhAiZqfcM4ZS9GCp5SNxVu984YFcmIL4a6pA8,26925
39
- webscout/Local/utils.py,sha256=OHMHnemIdfwVAfi45SHMTYZgIUv_zgKLHaw6pEmftdU,6108
39
+ webscout/Local/utils.py,sha256=CSt9IqHhVGk_nJEnKvSFbLhC5nNf01e0MtwpgMmF9pA,6197
40
40
  webscout/Provider/BasedGPT.py,sha256=eijTnqsecFQuHtspXDHryvh42caE_yANJI7gw9wiG7Y,8191
41
41
  webscout/Provider/Berlin4h.py,sha256=-O6BRkLusUEdYXcyQ09iY86dFl9WoiA4mlmZ_DLZbos,8342
42
42
  webscout/Provider/Blackboxai.py,sha256=8B5wT_eb86RVZ5uOqwvgVC5QATl0uEMCli0n4SDwt1M,16743
@@ -58,9 +58,9 @@ webscout/Provider/Xjai.py,sha256=gI9FqEodS-jHfFM_CsDPmTb_wL5NU2q__2fg9hqVoEc,880
58
58
  webscout/Provider/Yepchat.py,sha256=E0tv3Zfoqs1Sw8Pe-6_5d--_1LESm8mjw536DWclJk8,19398
59
59
  webscout/Provider/Youchat.py,sha256=JAZYwcj0Kl1UUgqN0rD3TKaReA1G-cmIlW_4mog1j_c,7756
60
60
  webscout/Provider/__init__.py,sha256=FsMWjMRgwARRVbXU1nApZdYum3UDcAfPJizfvIFnCjk,1372
61
- webscout-2.7.dist-info/LICENSE.md,sha256=mRVwJuT4SXC5O93BFdsfWBjlXjGn2Np90Zm5SocUzM0,3150
62
- webscout-2.7.dist-info/METADATA,sha256=_HoJfv6obPJKjW14493lyewdUr1v0B2c6q3dqoHSwps,47665
63
- webscout-2.7.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
64
- webscout-2.7.dist-info/entry_points.txt,sha256=Hh4YIIjvkqB9SVxZ2ri4DZUkgEu_WF_5_r_nZDIvfG8,73
65
- webscout-2.7.dist-info/top_level.txt,sha256=OD5YKy6Y3hldL7SmuxsiEDxAG4LgdSSWwzYk22MF9fk,18
66
- webscout-2.7.dist-info/RECORD,,
61
+ webscout-2.9.dist-info/LICENSE.md,sha256=mRVwJuT4SXC5O93BFdsfWBjlXjGn2Np90Zm5SocUzM0,3150
62
+ webscout-2.9.dist-info/METADATA,sha256=5BOE1otHk0pZ9Z-WGuUViM7Q9nyRkCvNNIpP_yxdyCI,47786
63
+ webscout-2.9.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
64
+ webscout-2.9.dist-info/entry_points.txt,sha256=Hh4YIIjvkqB9SVxZ2ri4DZUkgEu_WF_5_r_nZDIvfG8,73
65
+ webscout-2.9.dist-info/top_level.txt,sha256=OD5YKy6Y3hldL7SmuxsiEDxAG4LgdSSWwzYk22MF9fk,18
66
+ webscout-2.9.dist-info/RECORD,,
File without changes