webscout 1.1.1__tar.gz → 1.1.2__tar.gz

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 (24) hide show
  1. {webscout-1.1.1/webscout.egg-info → webscout-1.1.2}/PKG-INFO +3 -1
  2. {webscout-1.1.1 → webscout-1.1.2}/setup.py +3 -1
  3. {webscout-1.1.1 → webscout-1.1.2}/webscout/AI.py +2 -4
  4. webscout-1.1.2/webscout/HelpingAI.py +192 -0
  5. webscout-1.1.2/webscout/version.py +2 -0
  6. {webscout-1.1.1 → webscout-1.1.2/webscout.egg-info}/PKG-INFO +3 -1
  7. {webscout-1.1.1 → webscout-1.1.2}/webscout.egg-info/SOURCES.txt +1 -0
  8. {webscout-1.1.1 → webscout-1.1.2}/webscout.egg-info/requires.txt +2 -0
  9. webscout-1.1.1/webscout/version.py +0 -2
  10. {webscout-1.1.1 → webscout-1.1.2}/LICENSE.md +0 -0
  11. {webscout-1.1.1 → webscout-1.1.2}/README.md +0 -0
  12. {webscout-1.1.1 → webscout-1.1.2}/setup.cfg +0 -0
  13. {webscout-1.1.1 → webscout-1.1.2}/webscout/LLM.py +0 -0
  14. {webscout-1.1.1 → webscout-1.1.2}/webscout/__init__.py +0 -0
  15. {webscout-1.1.1 → webscout-1.1.2}/webscout/__main__.py +0 -0
  16. {webscout-1.1.1 → webscout-1.1.2}/webscout/cli.py +0 -0
  17. {webscout-1.1.1 → webscout-1.1.2}/webscout/exceptions.py +0 -0
  18. {webscout-1.1.1 → webscout-1.1.2}/webscout/models.py +0 -0
  19. {webscout-1.1.1 → webscout-1.1.2}/webscout/utils.py +0 -0
  20. {webscout-1.1.1 → webscout-1.1.2}/webscout/webscout_search.py +0 -0
  21. {webscout-1.1.1 → webscout-1.1.2}/webscout/webscout_search_async.py +0 -0
  22. {webscout-1.1.1 → webscout-1.1.2}/webscout.egg-info/dependency_links.txt +0 -0
  23. {webscout-1.1.1 → webscout-1.1.2}/webscout.egg-info/entry_points.txt +0 -0
  24. {webscout-1.1.1 → webscout-1.1.2}/webscout.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: webscout
3
- Version: 1.1.1
3
+ Version: 1.1.2
4
4
  Summary: Search for words, documents, images, videos, news, maps and text translation using the DuckDuckGo.com, yep.com, phind.com and you.com Also containes AI models
5
5
  Author: OEvortex
6
6
  Author-email: helpingai5@gmail.com
@@ -32,6 +32,8 @@ Requires-Dist: tqdm>=4.64.0
32
32
  Requires-Dist: webdriver-manager>=3.5.4
33
33
  Requires-Dist: halo>=0.0.31
34
34
  Requires-Dist: g4f>=0.2.2.3
35
+ Requires-Dist: rich
36
+ Requires-Dist: python-dotenv
35
37
  Provides-Extra: dev
36
38
  Requires-Dist: ruff>=0.1.6; extra == "dev"
37
39
  Requires-Dist: pytest>=7.4.2; extra == "dev"
@@ -10,7 +10,7 @@ with open("README.md", encoding="utf-8") as f:
10
10
 
11
11
  setup(
12
12
  name="webscout",
13
- version="1.1.1", # Use the version variable from the version.py file
13
+ version="1.1.2", # Use the version variable from the version.py file
14
14
  description="Search for words, documents, images, videos, news, maps and text translation using the DuckDuckGo.com, yep.com, phind.com and you.com Also containes AI models",
15
15
  long_description=README,
16
16
  long_description_content_type="text/markdown",
@@ -41,6 +41,8 @@ setup(
41
41
  "webdriver-manager>=3.5.4",
42
42
  "halo>=0.0.31",
43
43
  "g4f>=0.2.2.3",
44
+ "rich",
45
+ "python-dotenv",
44
46
  ],
45
47
  entry_points={
46
48
  "console_scripts": [
@@ -44,7 +44,7 @@ class PhindSearch:
44
44
 
45
45
  for text in paragraph_texts:
46
46
  spinner.stop()
47
- print(text)
47
+ return text
48
48
 
49
49
  finally:
50
50
  self.driver.quit()
@@ -193,8 +193,6 @@ class Gemini:
193
193
  ms = ""
194
194
  for message in response:
195
195
  ms += message
196
- print(ms.strip(), end="", flush=True) # Ensure no trailing whitespace is printed
197
- print()
198
196
  self.messages.append({"role": "assistant", "content": ms.strip()}) # Strip whitespace from the message content
199
197
  return ms.strip() # Return the message without trailing whitespace
200
198
 
@@ -202,7 +200,7 @@ class Gemini:
202
200
  def chat_cli(message):
203
201
  """Generate completion based on the provided message"""
204
202
  gemini = Gemini()
205
- gemini.chat(message)
203
+ return gemini.chat(message)
206
204
  #------------------------------------------------Prodia-------------------------------------------------------------------------
207
205
  class Prodia:
208
206
  """
@@ -0,0 +1,192 @@
1
+ import warnings
2
+ from selenium import webdriver
3
+ from selenium.webdriver.chrome.options import Options
4
+ from selenium.webdriver.common.by import By
5
+ from selenium.common.exceptions import NoSuchElementException
6
+ import time
7
+ import os
8
+ import requests
9
+ from rich import print
10
+ from dotenv import load_dotenv
11
+ import random
12
+ import string
13
+ import json
14
+ from typing import NoReturn, List, Dict, Union
15
+ import requests
16
+ from uuid import uuid4
17
+ from re import findall
18
+ from curl_cffi.requests import get, RequestsError
19
+ import time
20
+ from selenium import webdriver
21
+ from selenium.webdriver.chrome.options import Options
22
+ from selenium.webdriver.common.by import By
23
+ from selenium.webdriver.support import expected_conditions as EC
24
+ from selenium.webdriver.support.ui import WebDriverWait
25
+ from halo import Halo
26
+
27
+ class ChatBot:
28
+ def __init__(self):
29
+ load_dotenv()
30
+ options = Options()
31
+ options.add_argument('--no-sandbox')
32
+ options.add_argument('--headless')
33
+ options.add_argument('--disable-dev-shm-usage')
34
+ options.add_argument("start-maximized")
35
+ options.add_argument("disable-infobars")
36
+ options.add_argument("--disable-extensions")
37
+ options.add_argument("--disable-gpu")
38
+ options.add_argument("--disable-dev-shm-usage")
39
+ options.add_argument('--log-level=3') # Add this line
40
+ warnings.simplefilter("ignore")
41
+ # Initialize WebDriver
42
+ self.driver = webdriver.Chrome(options=options)
43
+
44
+ self.HelpingAI = os.getenv('HELPING_AI_URL')
45
+ # Navigate to the target URL
46
+ self.driver.get(self.HelpingAI)
47
+ time.sleep(7)
48
+
49
+ # Security Bypass: Refresh the page if the title contains 'just a moment'
50
+ while 'just a moment' in self.driver.title.lower():
51
+ self.driver.refresh()
52
+
53
+ # Initialize Chat_Num
54
+ self.Chat_Num = 2
55
+
56
+ # Function to increment Chat_Num
57
+ def increment_chat_num(self):
58
+ self.Chat_Num = str(int(self.Chat_Num) + 1)
59
+
60
+ # Function to send a query and retrieve response
61
+ def send_query(self, query):
62
+ text_box_xpath = "/html/body/div[1]/main/div[1]/div/div/div/div/div/div/div/form/fieldset/textarea"
63
+ send_button_xpath = "/html/body/div[1]/main/div[1]/div/div/div/div/div/div/div/form/fieldset/button"
64
+ response_xpath = f"/html/body/div[1]/main/div[1]/div/div/div/div/div/div/div/div/div/div[{self.Chat_Num}]/div[2]"
65
+ button_xpath = f"/html/body/div[1]/main/div[1]/div/div/div/div/div/div/div/div/div/div[{self.Chat_Num}]/div[1]/div/form/div/div[1]/button"
66
+
67
+ # Find the text box, enter query, and click send
68
+ text_box = self.driver.find_element(by=By.XPATH, value=text_box_xpath)
69
+ text_box.clear()
70
+ text_box.send_keys(query)
71
+ time.sleep(0.25) # Pause for 1 second after typing query
72
+
73
+ send_button = self.driver.find_element(by=By.XPATH, value=send_button_xpath)
74
+ send_button.click()
75
+
76
+ # Continuously check for the presence of the button every second
77
+ while True:
78
+ try:
79
+ button = self.driver.find_element(by=By.XPATH, value=button_xpath)
80
+ # If the button is found, retrieve and print the response
81
+ response = self.driver.find_element(by=By.XPATH, value=response_xpath).text
82
+ print("🤖:", response)
83
+ break
84
+ except NoSuchElementException:
85
+ time.sleep(0.25) # If the button is not found, wait for 1 second before checking again
86
+
87
+ self.increment_chat_num()
88
+
89
+ # Function to ask the user for a query, send it, and print the response
90
+ def query_chat(self):
91
+ while True:
92
+ query = input("🧑: ")
93
+ if query.lower() == 'exit':
94
+ break
95
+
96
+ self.send_query(query)
97
+ time.sleep(0.25) # Pause for 1 second before asking for the next query
98
+
99
+ # Close the browser window
100
+ def close(self):
101
+ self.driver.quit()
102
+
103
+ class WEBS:
104
+ def __init__(self):
105
+ load_dotenv()
106
+ options = Options()
107
+ options.add_argument('--no-sandbox')
108
+ options.add_argument('--headless')
109
+ options.add_argument('--disable-dev-shm-usage')
110
+ options.add_argument("start-maximized")
111
+ options.add_argument("disable-infobars")
112
+ options.add_argument("--disable-extensions")
113
+ options.add_argument("--disable-gpu")
114
+ options.add_argument("--disable-dev-shm-usage")
115
+ options.add_argument('--log-level=3')
116
+ warnings.simplefilter("ignore")
117
+ # Initialize WebDriver without specifying the path to the driver
118
+ self.driver = webdriver.Chrome(options=options)
119
+
120
+ self.HelpingAI = os.getenv('HELPING_AI_URL')
121
+ # Navigate to the target URL
122
+ self.driver.get(self.HelpingAI)
123
+ time.sleep(7)
124
+
125
+ # Security Bypass: Refresh the page if the title contains 'just a moment'
126
+ while 'just a moment' in self.driver.title.lower():
127
+ self.driver.refresh()
128
+
129
+ # Initialize Chat_Num
130
+ self.Chat_Num = 2
131
+
132
+ # Function to increment Chat_Num
133
+ def increment_chat_num(self):
134
+ self.Chat_Num = str(int(self.Chat_Num) + 1)
135
+
136
+ # Function to send a query and retrieve response
137
+ def send_query(self, prompt):
138
+ text_box_xpath = "/html/body/div[1]/main/div[1]/div/div/div/div/div/div/div/form/fieldset/textarea"
139
+ send_button_xpath = "/html/body/div[1]/main/div[1]/div/div/div/div/div/div/div/form/fieldset/button"
140
+ response_xpath = f"/html/body/div[1]/main/div[1]/div/div/div/div/div/div/div/div/div/div[{self.Chat_Num}]/div[2]"
141
+ button_xpath = f"/html/body/div[1]/main/div[1]/div/div/div/div/div/div/div/div/div/div[{self.Chat_Num}]/div[1]/div/form/div/div[1]/button"
142
+
143
+ # Find the text box, enter prompt, and click send
144
+ text_box = self.driver.find_element(by=By.XPATH, value=text_box_xpath)
145
+ text_box.clear()
146
+ text_box.send_keys(prompt)
147
+ time.sleep(1) # Pause for 1 second after typing prompt
148
+
149
+ send_button = self.driver.find_element(by=By.XPATH, value=send_button_xpath)
150
+ send_button.click()
151
+
152
+ # Continuously check for the presence of the button every second
153
+ while True:
154
+ try:
155
+ button = self.driver.find_element(by=By.XPATH, value=button_xpath)
156
+ # If the button is found, retrieve and print the response
157
+ response = self.driver.find_element(by=By.XPATH, value=response_xpath).text
158
+ print("🤖:", response)
159
+ break
160
+ except NoSuchElementException:
161
+ time.sleep(0.25) # If the button is not found, wait for 1 second before checking again
162
+
163
+ self.increment_chat_num()
164
+
165
+ # Function to perform web search
166
+ def web_search(self, query):
167
+ url = os.getenv('WEB_SEARCH_URL')
168
+ payload = {"query": query}
169
+ response = requests.post(url, json=payload)
170
+
171
+ if response.status_code == 200:
172
+ return response.json()
173
+ else:
174
+ print("Error:", response.status_code)
175
+
176
+ # Function to ask the user for a prompt, send it, and print the response
177
+ def query_chat(self):
178
+ while True:
179
+ prompt = input("🧑: ")
180
+ if prompt.lower() == 'exit':
181
+ break
182
+
183
+ # Perform web search
184
+ search_results = self.web_search(prompt)
185
+
186
+ # Pass the search results and the prompt to the AI
187
+ self.send_query(f"users question:{prompt} web search results: {search_results} Answer in HelpingAI style**note you have internet access and only use search_results when necessary also dont give links or urls (when users is asking something that needs realtime data)**")
188
+ time.sleep(0.25) # Pause for 1 second before asking for the next prompt
189
+
190
+ # Close the browser window
191
+ def close(self):
192
+ self.driver.quit()
@@ -0,0 +1,2 @@
1
+ __version__ = "1.1.2"
2
+
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: webscout
3
- Version: 1.1.1
3
+ Version: 1.1.2
4
4
  Summary: Search for words, documents, images, videos, news, maps and text translation using the DuckDuckGo.com, yep.com, phind.com and you.com Also containes AI models
5
5
  Author: OEvortex
6
6
  Author-email: helpingai5@gmail.com
@@ -32,6 +32,8 @@ Requires-Dist: tqdm>=4.64.0
32
32
  Requires-Dist: webdriver-manager>=3.5.4
33
33
  Requires-Dist: halo>=0.0.31
34
34
  Requires-Dist: g4f>=0.2.2.3
35
+ Requires-Dist: rich
36
+ Requires-Dist: python-dotenv
35
37
  Provides-Extra: dev
36
38
  Requires-Dist: ruff>=0.1.6; extra == "dev"
37
39
  Requires-Dist: pytest>=7.4.2; extra == "dev"
@@ -2,6 +2,7 @@ LICENSE.md
2
2
  README.md
3
3
  setup.py
4
4
  webscout/AI.py
5
+ webscout/HelpingAI.py
5
6
  webscout/LLM.py
6
7
  webscout/__init__.py
7
8
  webscout/__main__.py
@@ -8,6 +8,8 @@ tqdm>=4.64.0
8
8
  webdriver-manager>=3.5.4
9
9
  halo>=0.0.31
10
10
  g4f>=0.2.2.3
11
+ rich
12
+ python-dotenv
11
13
 
12
14
  [dev]
13
15
  ruff>=0.1.6
@@ -1,2 +0,0 @@
1
- __version__ = "1.1.1"
2
-
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes