webscout 2.7__py3-none-any.whl → 2.8__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,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: webscout
3
- Version: 2.7
3
+ Version: 2.8
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'
@@ -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
@@ -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.8.dist-info/LICENSE.md,sha256=mRVwJuT4SXC5O93BFdsfWBjlXjGn2Np90Zm5SocUzM0,3150
62
+ webscout-2.8.dist-info/METADATA,sha256=BcLCjHQ08-IqsCMkte4JOt1lUg5Li9CpUcZrI0Or2fs,47735
63
+ webscout-2.8.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
64
+ webscout-2.8.dist-info/entry_points.txt,sha256=Hh4YIIjvkqB9SVxZ2ri4DZUkgEu_WF_5_r_nZDIvfG8,73
65
+ webscout-2.8.dist-info/top_level.txt,sha256=OD5YKy6Y3hldL7SmuxsiEDxAG4LgdSSWwzYk22MF9fk,18
66
+ webscout-2.8.dist-info/RECORD,,
File without changes