webscout 1.0.6__py3-none-any.whl → 1.0.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/AI.py CHANGED
@@ -13,6 +13,8 @@ from uuid import uuid4
13
13
  from re import findall
14
14
  from requests.exceptions import RequestException
15
15
  from curl_cffi.requests import get, RequestsError
16
+ import g4f
17
+ #------------------------------------------------------phind--------------------------------------------------------
16
18
  class PhindSearch:
17
19
  def __init__(self, query):
18
20
  self.query = query
@@ -51,7 +53,7 @@ class PhindSearch:
51
53
  """Use webscout.AI."""
52
54
  search_instance = PhindSearch(query)
53
55
  search_instance.search()
54
-
56
+ #------------------------------------------------------yep.com--------------------------------------------------------
55
57
  class YepChat:
56
58
  def __init__(self, message="hello"):
57
59
  self.url = "https://api.yep.com/v1/chat/completions"
@@ -96,11 +98,9 @@ class YepChat:
96
98
  try:
97
99
  myval = eval(myline)
98
100
  if "choices" in myval and "delta" in myval["choices"][0] and "content" in myval["choices"][0]["delta"]:
99
- print(myval["choices"][0]["delta"]["content"], flush=True, end="")
100
101
  myset += myval["choices"][0]["delta"]["content"]
101
102
  except:
102
103
  continue
103
- print(myset)
104
104
  return myset
105
105
 
106
106
  @staticmethod
@@ -108,8 +108,9 @@ class YepChat:
108
108
  """Sends a request to the Yep API and processes the response."""
109
109
  yep_chat = YepChat(message=message)
110
110
  response = yep_chat.send_request()
111
- yep_chat.process_response(response)
112
-
111
+ processed_response = yep_chat.process_response(response)
112
+ print(processed_response)
113
+ #------------------------------------------------------youchat--------------------------------------------------------
113
114
  class youChat:
114
115
  """
115
116
  This class provides methods for generating completions based on prompts.
@@ -168,7 +169,36 @@ class youChat:
168
169
  you_chat = youChat()
169
170
  completion = you_chat.create(prompt)
170
171
  print(completion)
172
+ #------------------------------------------------------Gemini--------------------------------------------------------
173
+ class Gemini:
174
+ def __init__(self):
175
+ self.messages = []
176
+
177
+ def chat(self, *args):
178
+ assert args != ()
179
+
180
+ message = " ".join(args)
181
+ self.messages.append({"role": "user", "content": message})
182
+
183
+ response = g4f.ChatCompletion.create(
184
+ model=g4f.models.default,
185
+ provider=g4f.Provider.Gemini,
186
+ messages=self.messages,
187
+ stream=True,
188
+ )
189
+ ms = ""
190
+ for message in response:
191
+ ms += message
192
+ print(ms.strip(), end="", flush=True) # Ensure no trailing whitespace is printed
193
+ print()
194
+ self.messages.append({"role": "assistant", "content": ms.strip()}) # Strip whitespace from the message content
195
+ return ms.strip() # Return the message without trailing whitespace
171
196
 
197
+ @staticmethod
198
+ def chat_cli(message):
199
+ """Generate completion based on the provided message"""
200
+ gemini = Gemini()
201
+ gemini.chat(message)
172
202
 
173
203
  @click.group()
174
204
  def cli():
@@ -189,5 +219,10 @@ def yepchat(message):
189
219
  def youchat(prompt):
190
220
  youChat.chat_cli(prompt)
191
221
 
222
+ @cli.command()
223
+ @click.option('--message', prompt='Enter your message', help='The message to send.')
224
+ def gemini(message):
225
+ Gemini.chat_cli(message)
226
+
192
227
  if __name__ == '__main__':
193
228
  cli()
webscout/version.py CHANGED
@@ -1 +1 @@
1
- __version__ = "1.0.6"
1
+ __version__ = "1.0.8"
@@ -0,0 +1,50 @@
1
+ ****************************************
2
+ **** HelpingAI Simplified Universal License ****
3
+ ****************************************
4
+
5
+ Version 1.0
6
+
7
+ ### Introduction
8
+
9
+ This HelpingAI Simplified Universal License (HSUL) governs HelpingAI's content, including computer programs, scripts, datasets, documents, images, audio recordings, videos, and other digital assets. The HSUL provides simple, universal terms for accessing, modifying, and sharing resources while embracing ethical development practices.
10
+
11
+ ### Grant of Rights
12
+
13
+ Under the HSUL, HelpingAI authorizes you to copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Content, subject to the terms and conditions detailed in this document.
14
+
15
+ ### Conditions
16
+
17
+ To qualify for the rights granted in section 1, you must strictly adhere to the following conditions:
18
+
19
+ 2.1. **Redistributions of Source Code.**
20
+ If you redistribute the Source Code, you must include the entire HSUL with your distribution. Furthermore, you must add prominent notifications in all affected files stating:
21
+
22
+ > "This Work is released under the HelpingAI Simplified Universal License v1.0."
23
+
24
+ 2.2. **Binary Form Redistributions.**
25
+ If you distribute Binaries generated from the Source Code, you must ensure the inclusion of the following statement in your distribution:
26
+
27
+ > "This Work is based upon the HelpingAI Simplified Universally Licensed Work, under the HelpingAI Simplified Universal License v1.0."
28
+
29
+ 2.3. **Notification of Changes.**
30
+ Clearly indicate any alterations you introduce to the Source Code or Documentation via prominent comments detailing the nature and scope of the change(s). Reference the date and originator of the modifications.
31
+
32
+ 2.4. **Branding Attribution.**
33
+ Do not remove or alter any HelpingAI branding, logos, or notices included in the Content without explicit prior consent from HelpingAI.
34
+
35
+ 2.5. **Exclusion of Warranty.**
36
+ The Content is delivered "AS IS," bereft of any implicit guarantee, including — though not constrained to — warranties pertaining to marketability, applicability for a particular purpose, and non-infringement.
37
+
38
+ 2.6. **Limitation of Liability.**
39
+ To the maximum extent allowed by law, neither HelpingAI nor any contributor shall bear responsibility for any loss, personal injury, property damage, indirect, special, incidental, or consequential damages stemming from or relating to the Content or its employment.
40
+
41
+ 2.7. **Governing Law.**
42
+ This HSUL shall be managed and construed according to the laws of the jurisdiction where HelpingAI primarily operates.
43
+
44
+ ### Definitions
45
+
46
+ 3.1. **"Source Code"** signifies the preferred form for editing the Content, typically represented by human-readable programming languages, scripts, or documentation formats.
47
+
48
+ 3.2. **"Binaries"** denote compiled forms of the Source Code, executables, libraries, or similar artifacts built from the Source Code.
49
+
50
+ By leveraging this Content, you confirm your approval of the HSUL and pledge to honor its terms and conditions. If you disagree with the HSUL's rules, refrain from engaging with the Content.
@@ -1,19 +1,22 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: webscout
3
- Version: 1.0.6
3
+ Version: 1.0.8
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
- Author: OEvortex, Zaid
5
+ Author: OEvortex
6
6
  Author-email: helpingai5@gmail.com
7
+ License: HelpingAI Simplified Universal License
8
+ Project-URL: Documentation, https://github.com/OE-LUCIFER/Webscout/wiki
9
+ Project-URL: Source, https://github.com/OE-LUCIFER/Webscout
10
+ Project-URL: Tracker, https://github.com/OE-LUCIFER/Webscout/issues
11
+ Project-URL: YouTube, https://youtube.com/@OEvortex
7
12
  Classifier: Development Status :: 5 - Production/Stable
8
- Classifier: License :: OSI Approved :: MIT License
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: License :: Other/Proprietary License
9
15
  Classifier: Operating System :: OS Independent
10
16
  Classifier: Programming Language :: Python :: 3
11
- Classifier: Programming Language :: Python :: 3 :: Only
12
17
  Classifier: Programming Language :: Python :: 3.8
13
18
  Classifier: Programming Language :: Python :: 3.9
14
19
  Classifier: Programming Language :: Python :: 3.10
15
- Classifier: Programming Language :: Python :: 3.11
16
- Classifier: Programming Language :: Python :: 3.12
17
20
  Classifier: Programming Language :: Python :: Implementation :: CPython
18
21
  Classifier: Topic :: Internet :: WWW/HTTP :: Indexing/Search
19
22
  Classifier: Topic :: Software Development :: Libraries :: Python Modules
@@ -28,6 +31,7 @@ Requires-Dist: selenium >=4.1.3
28
31
  Requires-Dist: tqdm >=4.64.0
29
32
  Requires-Dist: webdriver-manager >=3.5.4
30
33
  Requires-Dist: halo >=0.0.31
34
+ Requires-Dist: g4f >=0.2.2.3
31
35
  Provides-Extra: dev
32
36
  Requires-Dist: ruff >=0.1.6 ; extra == 'dev'
33
37
  Requires-Dist: pytest >=7.4.2 ; extra == 'dev'
@@ -38,14 +42,13 @@ Also containes AI models that you can use
38
42
 
39
43
  ## Table of Contents
40
44
  - [Table of Contents](#table-of-contents)
41
- - [What is new](#what-is-new)
42
- - [What is next](#what-is-next)
43
45
  - [Install](#install)
44
46
  - [CLI version](#cli-version)
45
47
  - [CLI version of AI](#cli-version-of-ai)
46
48
  - [Regions](#regions)
47
49
  - [WEBS and AsyncWEBS classes](#webs-and-asyncwebs-classes)
48
50
  - [Exceptions](#exceptions)
51
+ - [usage](#usage)
49
52
  - [1. `text()` - text search by DuckDuckGo.com and Yep.com](#1-text---text-search-by-duckduckgocom-and-yepcom)
50
53
  - [2. `answers()` - instant answers by DuckDuckGo.com and Yep.com](#2-answers---instant-answers-by-duckduckgocom-and-yepcom)
51
54
  - [3. `images()` - image search by DuckDuckGo.com and Yep.com](#3-images---image-search-by-duckduckgocom-and-yepcom)
@@ -57,16 +60,11 @@ Also containes AI models that you can use
57
60
  - [9. `PhindSearch` - Search using Phind.com](#9-phindsearch---search-using-phindcom)
58
61
  - [10. `YepChat` - Chat with mistral 8x7b powered by yepchat](#10-yepchat---chat-with-mistral-8x7b-powered-by-yepchat)
59
62
  - [11. `You.com` - search with you.com](#11-youcom---search-with-youcom)
63
+ - [12. `Gemini` - search with google gemini](#12-gemini---search-with-google-gemini)
64
+ - [Version History](#version-history)
65
+ - [v1.0.7](#v107)
66
+ - [v1.0.6](#v106)
60
67
 
61
- ## What is new
62
- - Added yep.com as search engine.
63
- - solved a error where translate was not working.
64
- - Added Phind AI as webscout.AI
65
- - Added YepChat as webscout.AI
66
- - Added You.com as webscout.AI
67
- ## What is next
68
- - adding more AI models or fuctions
69
- -
70
68
  ## Install
71
69
  ```python
72
70
  pip install -U webscout
@@ -79,16 +77,22 @@ python -m webscout --help
79
77
  ```
80
78
  ## CLI version of AI
81
79
 
82
- ``python3
80
+ ```python3
83
81
  python -m webscout.AI phindsearch --query "your_query_here"
84
82
  ```
85
83
 
86
84
  ```python
87
85
  python -m webscout.AI yepchat --message "your_message_here"
88
86
  ```
87
+
89
88
  ```python
90
89
  python -m webscout.AI youchat --prompt "your_prompt_here"
91
90
  ```
91
+
92
+ ```python
93
+ python -m webscout.AI gemini --message "tell me about gemma 7b"
94
+ ```
95
+
92
96
  [Go To TOP](#TOP)
93
97
 
94
98
  ## Regions
@@ -238,7 +242,7 @@ This ensures proper resource management and cleanup, as the context manager will
238
242
  Exceptions:
239
243
  - `WebscoutE`: Raised when there is a generic exception during the API request.
240
244
 
241
-
245
+ ## usage
242
246
  Here are the rewritten Python scripts for accessing various functionalities using the WEBS class from the webscout module, in HelpingAI style, for DuckDuckGo.com and Yep.com without explicitly specifying the search engine:
243
247
 
244
248
  ### 1. `text()` - text search by DuckDuckGo.com and Yep.com
@@ -382,8 +386,20 @@ WEBSAI.search()
382
386
  Thanks To Divyansh Shukla for This code
383
387
  ```python
384
388
  from webscout.AI import YepChat
385
- # Example usage of the chat_cli method
386
- YepChat.chat_cli("Hello, how can I help you today?")
389
+
390
+ def main():
391
+ # Initialize the YepChat class with your message
392
+ yep_chat = YepChat(message="who is pm of india")
393
+
394
+ # Send the request and process the response
395
+ response = yep_chat.send_request()
396
+ processed_response = yep_chat.process_response(response)
397
+
398
+ # Print the processed response
399
+ print(processed_response)
400
+
401
+ if __name__ == "__main__":
402
+ main()
387
403
  ```
388
404
 
389
405
  ### 11. `You.com` - search with you.com
@@ -408,3 +424,30 @@ while True:
408
424
  except Exception as e:
409
425
  print("⚠️ An error occurred:", e)
410
426
  ```
427
+
428
+ ### 12. `Gemini` - search with google gemini
429
+
430
+ ```python
431
+ from webscout.AI import Gemini
432
+
433
+ # Create an instance of the Gemini class
434
+ gemini = Gemini()
435
+
436
+ # Use the chat method to send a message to the Gemini assistant
437
+ response = gemini.chat("Your message here")
438
+
439
+ # Print the response from the Gemini assistant
440
+ print(response)
441
+ ```
442
+
443
+ ## Version History
444
+
445
+ ### v1.0.7
446
+ - Added gemini as webscout.AI
447
+
448
+ ### v1.0.6
449
+ - Added yep.com as a search engine
450
+ - Fixed an error related to translation functionality
451
+ - Introduced Phind AI as webscout.AI
452
+ - Included YepChat as webscout.AI
453
+ - Integrated You.com as webscout.AI
@@ -1,16 +1,16 @@
1
- webscout/AI.py,sha256=EsI1ldocPgCaAsOQAAlBZWaIlp-LkEpTnWkSLeVhx7E,6680
1
+ webscout/AI.py,sha256=ylXDsAkdHdcQ-EAKpKlmV_q_x-L8o1q5DAhpnA7VRxs,8229
2
2
  webscout/__init__.py,sha256=vHJGZexYIaWDTHfMimqA7enct9b7zPDf6jLsS7NDBiA,536
3
3
  webscout/__main__.py,sha256=ZtTRgsRjUi2JOvYFLF1ZCh55Sdoz94I-BS-TlJC7WDU,126
4
4
  webscout/cli.py,sha256=9opO5KynQ3LA5gPW2czlmy7-ZdfUae6ccrny3vibqzQ,17757
5
5
  webscout/exceptions.py,sha256=7u52Mt5iyEUCZvaZuEYwQVV8HL8IdZBv1r5s5Ss_xU0,75
6
6
  webscout/models.py,sha256=5iQIdtedT18YuTZ3npoG7kLMwcrKwhQ7928dl_7qZW0,692
7
7
  webscout/utils.py,sha256=M2ocDpYOVd9lTZA3VGdK_p80Xsr-VPeAoUUCFaMWCqk,1610
8
- webscout/version.py,sha256=1HqFYnow__4MUVRI_OMjvzTBzKkReNozOdA96kH53cA,23
8
+ webscout/version.py,sha256=uyL3a6o1xccXPZ2OS65zqIN_lbEMT7PcCxErq7cuWwA,23
9
9
  webscout/webscout_search.py,sha256=_kuNpRhbgge6MubxlsRe9kzBKlHoPEH6-93ILMpycfg,2351
10
10
  webscout/webscout_search_async.py,sha256=lNdR18-y8O9HqFsHvlzBYg18qeI12uLEXIzFMP3D_XU,35070
11
- webscout-1.0.6.dist-info/LICENSE.md,sha256=07ABCXFZBmAyzICIiQbglOYZGERK2umNJCYeOV54FP4,907
12
- webscout-1.0.6.dist-info/METADATA,sha256=BqaiqbfkhBeu5e7GiwtW6z3IlH-NKrIa-0sHd7fYQMk,12404
13
- webscout-1.0.6.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
14
- webscout-1.0.6.dist-info/entry_points.txt,sha256=1naMz1lm0onX0Rn0RRBeGaQJIUKT8V6KASIcGJJHz0M,164
15
- webscout-1.0.6.dist-info/top_level.txt,sha256=nYIw7OKBQDr_Z33IzZUKidRD3zQEo8jOJYkMVMeN334,9
16
- webscout-1.0.6.dist-info/RECORD,,
11
+ webscout-1.0.8.dist-info/LICENSE.md,sha256=mRVwJuT4SXC5O93BFdsfWBjlXjGn2Np90Zm5SocUzM0,3150
12
+ webscout-1.0.8.dist-info/METADATA,sha256=en6z_z4hNpmjlCmTgLGMo-wtnZTotgpFtyDMZFHQsT8,13500
13
+ webscout-1.0.8.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
14
+ webscout-1.0.8.dist-info/entry_points.txt,sha256=1naMz1lm0onX0Rn0RRBeGaQJIUKT8V6KASIcGJJHz0M,164
15
+ webscout-1.0.8.dist-info/top_level.txt,sha256=nYIw7OKBQDr_Z33IzZUKidRD3zQEo8jOJYkMVMeN334,9
16
+ webscout-1.0.8.dist-info/RECORD,,
@@ -1,17 +0,0 @@
1
- 🌟 **HelpingAI Innovator's License 📜**
2
-
3
- 📅 **Copyright: ©️ 2022 HelpingAI**
4
-
5
- 📝 **License Terms & Guidelines:**
6
-
7
- 1. **Empower Innovation:** Embrace the power to innovate, create, and push the boundaries of possibility with HelpingAI.
8
-
9
- 2. **Recognition:** Honor and acknowledge HelpingAI for its original creation and any enhancements or modifications made to the software.
10
-
11
- 3. **Unrestricted Use:** Enjoy the freedom of unrestricted use, modification, and distribution of the software without limitations.
12
-
13
- 4. **Community Collaboration:** Foster a spirit of collaboration by sharing your advancements, insights, and contributions with the wider community.
14
-
15
- 5. **Continuous Advancement:** Commit to the continuous advancement and improvement of AI technology through your dedicated efforts.
16
-
17
- 🚀 **Unlock the Potential of Innovation with the HelpingAI Innovator's License! 🌌**