webscout 1.0.9__py3-none-any.whl → 1.1.0__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 +1 -1
- webscout/LLM.py +67 -0
- webscout/version.py +2 -1
- {webscout-1.0.9.dist-info → webscout-1.1.0.dist-info}/METADATA +62 -46
- {webscout-1.0.9.dist-info → webscout-1.1.0.dist-info}/RECORD +9 -8
- {webscout-1.0.9.dist-info → webscout-1.1.0.dist-info}/entry_points.txt +1 -0
- {webscout-1.0.9.dist-info → webscout-1.1.0.dist-info}/LICENSE.md +0 -0
- {webscout-1.0.9.dist-info → webscout-1.1.0.dist-info}/WHEEL +0 -0
- {webscout-1.0.9.dist-info → webscout-1.1.0.dist-info}/top_level.txt +0 -0
webscout/AI.py
CHANGED
|
@@ -267,7 +267,7 @@ class Prodia:
|
|
|
267
267
|
image.show()
|
|
268
268
|
except Exception as e:
|
|
269
269
|
print(f"An error occurred: {e}")
|
|
270
|
-
|
|
270
|
+
#-------------------------------------------------------Pollination--------------------------------------------------------------------------------------
|
|
271
271
|
class Pollinations:
|
|
272
272
|
"""
|
|
273
273
|
This class provides methods for generating images based on prompts.
|
webscout/LLM.py
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import argparse
|
|
2
|
+
import requests
|
|
3
|
+
import json
|
|
4
|
+
from typing import List, Dict, Union
|
|
5
|
+
|
|
6
|
+
class LLM:
|
|
7
|
+
def __init__(self, model: str):
|
|
8
|
+
self.model = model
|
|
9
|
+
self.conversation_history = [{"role": "system", "content": "You are a Helpful AI."}]
|
|
10
|
+
|
|
11
|
+
def mistral_chat(self, messages: List[Dict[str, str]]) -> Union[str, None]:
|
|
12
|
+
url = "https://api.deepinfra.com/v1/openai/chat/completions"
|
|
13
|
+
headers = {
|
|
14
|
+
'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',
|
|
15
|
+
'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',
|
|
16
|
+
'Cache-Control': 'no-cache',
|
|
17
|
+
'Connection': 'keep-alive',
|
|
18
|
+
'Content-Type': 'application/json',
|
|
19
|
+
'Origin': 'https://deepinfra.com',
|
|
20
|
+
'Pragma': 'no-cache',
|
|
21
|
+
'Referer': 'https://deepinfra.com/',
|
|
22
|
+
'Sec-Fetch-Dest': 'empty',
|
|
23
|
+
'Sec-Fetch-Mode': 'cors',
|
|
24
|
+
'Sec-Fetch-Site': 'same-site',
|
|
25
|
+
'X-Deepinfra-Source': 'web-embed',
|
|
26
|
+
'accept': 'text/event-stream',
|
|
27
|
+
'sec-ch-ua': '"Google Chrome";v="119", "Chromium";v="119", "Not?A_Brand";v="24"',
|
|
28
|
+
'sec-ch-ua-mobile': '?0',
|
|
29
|
+
'sec-ch-ua-platform': '"macOS"'
|
|
30
|
+
}
|
|
31
|
+
data = json.dumps(
|
|
32
|
+
{
|
|
33
|
+
'model': self.model,
|
|
34
|
+
'messages': messages,
|
|
35
|
+
'temperature': 0.7,
|
|
36
|
+
'max_tokens': 4028,
|
|
37
|
+
'stop': [],
|
|
38
|
+
'stream': False
|
|
39
|
+
}, separators=(',', ':')
|
|
40
|
+
)
|
|
41
|
+
try:
|
|
42
|
+
result = requests.post(url=url, data=data, headers=headers)
|
|
43
|
+
return result.json()['choices'][0]['message']['content']
|
|
44
|
+
except:
|
|
45
|
+
return None
|
|
46
|
+
|
|
47
|
+
def chat(self):
|
|
48
|
+
while True:
|
|
49
|
+
prompt = input("👦: ")
|
|
50
|
+
user_message = {"role": "user", "content": prompt}
|
|
51
|
+
self.conversation_history.append(user_message)
|
|
52
|
+
try:
|
|
53
|
+
resp = self.mistral_chat(self.conversation_history)
|
|
54
|
+
print(f"🤖: {resp}")
|
|
55
|
+
self.conversation_history.append({"role": "assistant", "content": resp})
|
|
56
|
+
except Exception as e:
|
|
57
|
+
print(f"🤖: Oops, something went wrong: {e}! Looks like even AI needs some oiling sometimes.")
|
|
58
|
+
|
|
59
|
+
if __name__ == "__main__":
|
|
60
|
+
parser = argparse.ArgumentParser(description='LLM CLI', epilog='To use a specific model, run:\n'
|
|
61
|
+
'python -m webscout.LLM model_name\n'
|
|
62
|
+
'Replace "model_name" with the name of the model you wish to use It supports ALL text generation models on deepinfra.com.')
|
|
63
|
+
parser.add_argument('model', type=str, help='Model to use for text generation. Specify the full model name, e.g., "mistralai/Mistral-7B-Instruct-v0.1".')
|
|
64
|
+
args = parser.parse_args()
|
|
65
|
+
|
|
66
|
+
LLM = LLM(args.model)
|
|
67
|
+
LLM.chat()
|
webscout/version.py
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
__version__ = "1.0
|
|
1
|
+
__version__ = "1.1.0"
|
|
2
|
+
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: webscout
|
|
3
|
-
Version: 1.0
|
|
3
|
+
Version: 1.1.0
|
|
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
|
|
@@ -44,11 +44,12 @@ Also containes AI models that you can use
|
|
|
44
44
|
- [Table of Contents](#table-of-contents)
|
|
45
45
|
- [Install](#install)
|
|
46
46
|
- [CLI version](#cli-version)
|
|
47
|
-
- [CLI version of AI](#cli-version-of-
|
|
47
|
+
- [CLI version of webscout.AI](#cli-version-of-webscoutai)
|
|
48
|
+
- [CLI to use LLM](#cli-to-use-llm)
|
|
48
49
|
- [Regions](#regions)
|
|
49
50
|
- [WEBS and AsyncWEBS classes](#webs-and-asyncwebs-classes)
|
|
50
51
|
- [Exceptions](#exceptions)
|
|
51
|
-
- [usage](#usage)
|
|
52
|
+
- [usage of webscout](#usage-of-webscout)
|
|
52
53
|
- [1. `text()` - text search by DuckDuckGo.com and Yep.com](#1-text---text-search-by-duckduckgocom-and-yepcom)
|
|
53
54
|
- [2. `answers()` - instant answers by DuckDuckGo.com and Yep.com](#2-answers---instant-answers-by-duckduckgocom-and-yepcom)
|
|
54
55
|
- [3. `images()` - image search by DuckDuckGo.com and Yep.com](#3-images---image-search-by-duckduckgocom-and-yepcom)
|
|
@@ -57,12 +58,17 @@ Also containes AI models that you can use
|
|
|
57
58
|
- [6. `maps()` - map search by DuckDuckGo.com and](#6-maps---map-search-by-duckduckgocom-and)
|
|
58
59
|
- [7. `translate()` - translation by DuckDuckGo.com and Yep.com](#7-translate---translation-by-duckduckgocom-and-yepcom)
|
|
59
60
|
- [8. `suggestions()` - suggestions by DuckDuckGo.com and Yep.com](#8-suggestions---suggestions-by-duckduckgocom-and-yepcom)
|
|
60
|
-
|
|
61
|
-
- [
|
|
62
|
-
- [
|
|
63
|
-
- [
|
|
64
|
-
- [
|
|
61
|
+
- [usage of webscout.AI](#usage-of-webscoutai)
|
|
62
|
+
- [1. `PhindSearch` - Search using Phind.com](#1-phindsearch---search-using-phindcom)
|
|
63
|
+
- [2. `YepChat` - Chat with mistral 8x7b powered by yepchat](#2-yepchat---chat-with-mistral-8x7b-powered-by-yepchat)
|
|
64
|
+
- [3. `You.com` - search with you.com](#3-youcom---search-with-youcom)
|
|
65
|
+
- [4. `Gemini` - search with google gemini](#4-gemini---search-with-google-gemini)
|
|
66
|
+
- [usage of image generator from Webscout.AI](#usage-of-image-generator-from-webscoutai)
|
|
67
|
+
- [5. `Prodia` - make image using prodia](#5-prodia---make-image-using-prodia)
|
|
68
|
+
- [usage of special .LLM file from webscout (webscout.LLM)](#usage-of-special-llm-file-from-webscout-webscoutllm)
|
|
69
|
+
- [`LLM`](#llm)
|
|
65
70
|
- [Version History](#version-history)
|
|
71
|
+
- [v1.1.0](#v110)
|
|
66
72
|
- [v1.0.9](#v109)
|
|
67
73
|
- [v1.0.8](#v108)
|
|
68
74
|
- [v1.0.7](#v107)
|
|
@@ -91,26 +97,22 @@ python -m webscout --help
|
|
|
91
97
|
| python -m webscout version | A command-line interface command that prints and returns the version of the program. |
|
|
92
98
|
| python -m webscout videos -k Text | CLI function to perform a videos search using DuckDuckGo API. |
|
|
93
99
|
|
|
94
|
-
## CLI version of AI
|
|
100
|
+
## CLI version of webscout.AI
|
|
95
101
|
|
|
96
|
-
```python3
|
|
97
|
-
python -m webscout.AI phindsearch --query "your_query_here"
|
|
98
|
-
```
|
|
99
102
|
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
+
| Command | Description |
|
|
104
|
+
|--------------------------------------------|--------------------------------------------------------------------------------------------------------|
|
|
105
|
+
| `python -m webscout.AI phindsearch --query "your_query_here"` | CLI function to perform a search query using Webscout.AI's Phindsearch feature. |
|
|
106
|
+
| `python -m webscout.AI yepchat --message "your_message_here"` | CLI function to send a message using Webscout.AI's Yepchat feature. |
|
|
107
|
+
| `python -m webscout.AI youchat --prompt "your_prompt_here"` | CLI function to generate a response based on a prompt using Webscout.AI's Youchat feature. |
|
|
108
|
+
| `python -m webscout.AI gemini --message "tell me about gemma 7b"` | CLI function to get information about a specific topic using Webscout.AI's Gemini feature. |
|
|
109
|
+
| `python -m webscout.AI prodia --prompt "car"` | CLI function to generate content related to a prompt using Webscout.AI's Prodia feature. |
|
|
103
110
|
|
|
104
|
-
```python
|
|
105
|
-
python -m webscout.AI youchat --prompt "your_prompt_here"
|
|
106
|
-
```
|
|
107
111
|
|
|
108
|
-
```python
|
|
109
|
-
python -m webscout.AI gemini --message "tell me about gemma 7b"
|
|
110
|
-
```
|
|
111
112
|
|
|
113
|
+
## CLI to use LLM
|
|
112
114
|
```python
|
|
113
|
-
python -m webscout.
|
|
115
|
+
python -m webscout.LLM model_name
|
|
114
116
|
```
|
|
115
117
|
[Go To TOP](#TOP)
|
|
116
118
|
|
|
@@ -261,8 +263,7 @@ This ensures proper resource management and cleanup, as the context manager will
|
|
|
261
263
|
Exceptions:
|
|
262
264
|
- `WebscoutE`: Raised when there is a generic exception during the API request.
|
|
263
265
|
|
|
264
|
-
## usage
|
|
265
|
-
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:
|
|
266
|
+
## usage of webscout
|
|
266
267
|
|
|
267
268
|
### 1. `text()` - text search by DuckDuckGo.com and Yep.com
|
|
268
269
|
|
|
@@ -302,11 +303,10 @@ with WEBS() as WEBS:
|
|
|
302
303
|
region="wt-wt",
|
|
303
304
|
safesearch="off",
|
|
304
305
|
size=None,
|
|
305
|
-
color="Monochrome",
|
|
306
306
|
type_image=None,
|
|
307
307
|
layout=None,
|
|
308
308
|
license_image=None,
|
|
309
|
-
max_results=
|
|
309
|
+
max_results=10,
|
|
310
310
|
)
|
|
311
311
|
for r in WEBS_images_gen:
|
|
312
312
|
print(r)
|
|
@@ -327,7 +327,7 @@ with WEBS() as WEBS:
|
|
|
327
327
|
timelimit="w",
|
|
328
328
|
resolution="high",
|
|
329
329
|
duration="medium",
|
|
330
|
-
max_results=
|
|
330
|
+
max_results=10,
|
|
331
331
|
)
|
|
332
332
|
for r in WEBS_videos_gen:
|
|
333
333
|
print(r)
|
|
@@ -381,15 +381,13 @@ with WEBS() as WEBS:
|
|
|
381
381
|
from webscout import WEBS
|
|
382
382
|
|
|
383
383
|
# Suggestions for the keyword 'fly' using DuckDuckGo.com and Yep
|
|
384
|
-
#
|
|
385
|
-
|
|
386
|
-
.com
|
|
387
384
|
with WEBS() as WEBS:
|
|
388
385
|
for r in WEBS.suggestions("fly"):
|
|
389
386
|
print(r)
|
|
390
387
|
```
|
|
388
|
+
## usage of webscout.AI
|
|
391
389
|
|
|
392
|
-
###
|
|
390
|
+
### 1. `PhindSearch` - Search using Phind.com
|
|
393
391
|
Thanks to Empyros for PhindSearch function
|
|
394
392
|
```python
|
|
395
393
|
from webscout.AI import PhindSearch
|
|
@@ -401,7 +399,7 @@ WEBSAI = PhindSearch(query)
|
|
|
401
399
|
|
|
402
400
|
WEBSAI.search()
|
|
403
401
|
```
|
|
404
|
-
###
|
|
402
|
+
### 2. `YepChat` - Chat with mistral 8x7b powered by yepchat
|
|
405
403
|
Thanks To Divyansh Shukla for This code
|
|
406
404
|
```python
|
|
407
405
|
from webscout.AI import YepChat
|
|
@@ -421,7 +419,7 @@ if __name__ == "__main__":
|
|
|
421
419
|
main()
|
|
422
420
|
```
|
|
423
421
|
|
|
424
|
-
###
|
|
422
|
+
### 3. `You.com` - search with you.com
|
|
425
423
|
```python
|
|
426
424
|
from webscout.AI import youChat
|
|
427
425
|
|
|
@@ -444,7 +442,7 @@ while True:
|
|
|
444
442
|
print("⚠️ An error occurred:", e)
|
|
445
443
|
```
|
|
446
444
|
|
|
447
|
-
###
|
|
445
|
+
### 4. `Gemini` - search with google gemini
|
|
448
446
|
|
|
449
447
|
```python
|
|
450
448
|
from webscout.AI import Gemini
|
|
@@ -458,7 +456,8 @@ response = gemini.chat("Your message here")
|
|
|
458
456
|
# Print the response from the Gemini assistant
|
|
459
457
|
print(response)
|
|
460
458
|
```
|
|
461
|
-
|
|
459
|
+
## usage of image generator from Webscout.AI
|
|
460
|
+
### 5. `Prodia` - make image using prodia
|
|
462
461
|
```python
|
|
463
462
|
from webscout.AI import Prodia
|
|
464
463
|
|
|
@@ -468,23 +467,40 @@ prompt = "A beautiful sunset over the ocean"
|
|
|
468
467
|
# Use the prodia_cli method to generate an image based on the prompt
|
|
469
468
|
Prodia.prodia_cli(prompt)
|
|
470
469
|
```
|
|
470
|
+
## usage of special .LLM file from webscout (webscout.LLM)
|
|
471
|
+
|
|
472
|
+
### `LLM`
|
|
473
|
+
```python
|
|
474
|
+
from webscout.LLM import LLM
|
|
475
|
+
|
|
476
|
+
def chat(model_name):
|
|
477
|
+
AI = LLM(model_name)
|
|
478
|
+
AI.chat()
|
|
479
|
+
|
|
480
|
+
if __name__ == "__main__":
|
|
481
|
+
model_name = "mistralai/Mistral-7B-Instruct-v0.1" # name of the model you wish to use It supports ALL text generation models on deepinfra.com.
|
|
482
|
+
chat(model_name)
|
|
483
|
+
```
|
|
471
484
|
|
|
472
485
|
## Version History
|
|
486
|
+
### v1.1.0
|
|
487
|
+
🌟 Added LLMs as webscout.LLM
|
|
488
|
+
🔧 Resolved issue related to Prodia functionality
|
|
473
489
|
|
|
474
490
|
### v1.0.9
|
|
475
|
-
|
|
476
|
-
|
|
491
|
+
🌌 Added Prodia as an image generator in webscout.AI
|
|
492
|
+
|
|
477
493
|
### v1.0.8
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
494
|
+
🚀 Solved issues related to Gemini and Yep Chat functions within the Webscout package.
|
|
495
|
+
🌟 Gemini function now provides correct outputs without duplication.
|
|
496
|
+
🌟 Yep Chat function delivers accurate responses without repeating them multiple times.
|
|
481
497
|
|
|
482
498
|
### v1.0.7
|
|
483
|
-
|
|
499
|
+
🌟 Added Gemini as part of webscout.AI
|
|
484
500
|
|
|
485
501
|
### v1.0.6
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
502
|
+
🌟 Integrated yep.com as a search engine
|
|
503
|
+
🔧 Resolved error associated with the translation feature
|
|
504
|
+
🌟 Introduced Phind AI within webscout.AI
|
|
505
|
+
🌟 Included YepChat as part of webscout.AI
|
|
506
|
+
🌟 Integrated You.com as part of webscout.AI
|
|
@@ -1,16 +1,17 @@
|
|
|
1
|
-
webscout/AI.py,sha256=
|
|
1
|
+
webscout/AI.py,sha256=HUolkJnL_ZPHzp2itGA9lgORLqspjq_79LUPGM-JT70,14030
|
|
2
|
+
webscout/LLM.py,sha256=uyS8BmkFJcWEnfUzOgzcqIw96mF1p-oFqQjJntYn85U,3105
|
|
2
3
|
webscout/__init__.py,sha256=vHJGZexYIaWDTHfMimqA7enct9b7zPDf6jLsS7NDBiA,536
|
|
3
4
|
webscout/__main__.py,sha256=ZtTRgsRjUi2JOvYFLF1ZCh55Sdoz94I-BS-TlJC7WDU,126
|
|
4
5
|
webscout/cli.py,sha256=9opO5KynQ3LA5gPW2czlmy7-ZdfUae6ccrny3vibqzQ,17757
|
|
5
6
|
webscout/exceptions.py,sha256=7u52Mt5iyEUCZvaZuEYwQVV8HL8IdZBv1r5s5Ss_xU0,75
|
|
6
7
|
webscout/models.py,sha256=5iQIdtedT18YuTZ3npoG7kLMwcrKwhQ7928dl_7qZW0,692
|
|
7
8
|
webscout/utils.py,sha256=M2ocDpYOVd9lTZA3VGdK_p80Xsr-VPeAoUUCFaMWCqk,1610
|
|
8
|
-
webscout/version.py,sha256=
|
|
9
|
+
webscout/version.py,sha256=n_RJkcUU1vhYJL1FcReI98Gdzz-G65pYUOJu9K9rJco,25
|
|
9
10
|
webscout/webscout_search.py,sha256=_kuNpRhbgge6MubxlsRe9kzBKlHoPEH6-93ILMpycfg,2351
|
|
10
11
|
webscout/webscout_search_async.py,sha256=lNdR18-y8O9HqFsHvlzBYg18qeI12uLEXIzFMP3D_XU,35070
|
|
11
|
-
webscout-1.0.
|
|
12
|
-
webscout-1.0.
|
|
13
|
-
webscout-1.0.
|
|
14
|
-
webscout-1.0.
|
|
15
|
-
webscout-1.0.
|
|
16
|
-
webscout-1.0.
|
|
12
|
+
webscout-1.1.0.dist-info/LICENSE.md,sha256=mRVwJuT4SXC5O93BFdsfWBjlXjGn2Np90Zm5SocUzM0,3150
|
|
13
|
+
webscout-1.1.0.dist-info/METADATA,sha256=YUGyziqnSd0kqR0yMFGtg7LYbqp8WJZJ5cHPunHKQxw,17493
|
|
14
|
+
webscout-1.1.0.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
|
|
15
|
+
webscout-1.1.0.dist-info/entry_points.txt,sha256=8-93eRslYrzTHs5E-6yFRJrve00C9q-SkXJD113jzRY,197
|
|
16
|
+
webscout-1.1.0.dist-info/top_level.txt,sha256=nYIw7OKBQDr_Z33IzZUKidRD3zQEo8jOJYkMVMeN334,9
|
|
17
|
+
webscout-1.1.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|