webscout 1.0.9__tar.gz → 1.1.1__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.

@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: webscout
3
- Version: 1.0.9
3
+ Version: 1.1.1
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-ai)
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
- - [9. `PhindSearch` - Search using Phind.com](#9-phindsearch---search-using-phindcom)
61
- - [10. `YepChat` - Chat with mistral 8x7b powered by yepchat](#10-yepchat---chat-with-mistral-8x7b-powered-by-yepchat)
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
- - [13. `Prodia` - make image using prodia](#13-prodia---make-image-using-prodia)
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
- ```python
101
- python -m webscout.AI yepchat --message "your_message_here"
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.AI prodia --prompt "car"
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=100,
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=100,
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
- ### 9. `PhindSearch` - Search using Phind.com
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
- ### 10. `YepChat` - Chat with mistral 8x7b powered by yepchat
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
- ### 11. `You.com` - search with you.com
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
- ### 12. `Gemini` - search with google gemini
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
- ### 13. `Prodia` - make image using prodia
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
- - Added Prodia as image generator in webscout.AI
476
-
491
+ 🌌 Added Prodia as an image generator in webscout.AI
492
+
477
493
  ### v1.0.8
478
- - Solved issue related to Gemini and Yep Chat functions in the Webscout package. 🌟
479
- Now, Gemini function returns correct outputs without duplication.
480
- Yep Chat function provides accurate responses without repeating them multiple times. 🚀
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
- - Added gemini as webscout.AI
499
+ 🌟 Added Gemini as part of webscout.AI
484
500
 
485
501
  ### v1.0.6
486
- - Added yep.com as a search engine
487
- - Fixed an error related to translation functionality
488
- - Introduced Phind AI as webscout.AI
489
- - Included YepChat as webscout.AI
490
- - Integrated You.com as webscout.AI
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
@@ -6,11 +6,12 @@ Also containes AI models that you can use
6
6
  - [Table of Contents](#table-of-contents)
7
7
  - [Install](#install)
8
8
  - [CLI version](#cli-version)
9
- - [CLI version of AI](#cli-version-of-ai)
9
+ - [CLI version of webscout.AI](#cli-version-of-webscoutai)
10
+ - [CLI to use LLM](#cli-to-use-llm)
10
11
  - [Regions](#regions)
11
12
  - [WEBS and AsyncWEBS classes](#webs-and-asyncwebs-classes)
12
13
  - [Exceptions](#exceptions)
13
- - [usage](#usage)
14
+ - [usage of webscout](#usage-of-webscout)
14
15
  - [1. `text()` - text search by DuckDuckGo.com and Yep.com](#1-text---text-search-by-duckduckgocom-and-yepcom)
15
16
  - [2. `answers()` - instant answers by DuckDuckGo.com and Yep.com](#2-answers---instant-answers-by-duckduckgocom-and-yepcom)
16
17
  - [3. `images()` - image search by DuckDuckGo.com and Yep.com](#3-images---image-search-by-duckduckgocom-and-yepcom)
@@ -19,12 +20,17 @@ Also containes AI models that you can use
19
20
  - [6. `maps()` - map search by DuckDuckGo.com and](#6-maps---map-search-by-duckduckgocom-and)
20
21
  - [7. `translate()` - translation by DuckDuckGo.com and Yep.com](#7-translate---translation-by-duckduckgocom-and-yepcom)
21
22
  - [8. `suggestions()` - suggestions by DuckDuckGo.com and Yep.com](#8-suggestions---suggestions-by-duckduckgocom-and-yepcom)
22
- - [9. `PhindSearch` - Search using Phind.com](#9-phindsearch---search-using-phindcom)
23
- - [10. `YepChat` - Chat with mistral 8x7b powered by yepchat](#10-yepchat---chat-with-mistral-8x7b-powered-by-yepchat)
24
- - [11. `You.com` - search with you.com](#11-youcom---search-with-youcom)
25
- - [12. `Gemini` - search with google gemini](#12-gemini---search-with-google-gemini)
26
- - [13. `Prodia` - make image using prodia](#13-prodia---make-image-using-prodia)
23
+ - [usage of webscout.AI](#usage-of-webscoutai)
24
+ - [1. `PhindSearch` - Search using Phind.com](#1-phindsearch---search-using-phindcom)
25
+ - [2. `YepChat` - Chat with mistral 8x7b powered by yepchat](#2-yepchat---chat-with-mistral-8x7b-powered-by-yepchat)
26
+ - [3. `You.com` - search with you.com](#3-youcom---search-with-youcom)
27
+ - [4. `Gemini` - search with google gemini](#4-gemini---search-with-google-gemini)
28
+ - [usage of image generator from Webscout.AI](#usage-of-image-generator-from-webscoutai)
29
+ - [5. `Prodia` - make image using prodia](#5-prodia---make-image-using-prodia)
30
+ - [usage of special .LLM file from webscout (webscout.LLM)](#usage-of-special-llm-file-from-webscout-webscoutllm)
31
+ - [`LLM`](#llm)
27
32
  - [Version History](#version-history)
33
+ - [v1.1.0](#v110)
28
34
  - [v1.0.9](#v109)
29
35
  - [v1.0.8](#v108)
30
36
  - [v1.0.7](#v107)
@@ -53,26 +59,22 @@ python -m webscout --help
53
59
  | python -m webscout version | A command-line interface command that prints and returns the version of the program. |
54
60
  | python -m webscout videos -k Text | CLI function to perform a videos search using DuckDuckGo API. |
55
61
 
56
- ## CLI version of AI
62
+ ## CLI version of webscout.AI
57
63
 
58
- ```python3
59
- python -m webscout.AI phindsearch --query "your_query_here"
60
- ```
61
64
 
62
- ```python
63
- python -m webscout.AI yepchat --message "your_message_here"
64
- ```
65
+ | Command | Description |
66
+ |--------------------------------------------|--------------------------------------------------------------------------------------------------------|
67
+ | `python -m webscout.AI phindsearch --query "your_query_here"` | CLI function to perform a search query using Webscout.AI's Phindsearch feature. |
68
+ | `python -m webscout.AI yepchat --message "your_message_here"` | CLI function to send a message using Webscout.AI's Yepchat feature. |
69
+ | `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. |
70
+ | `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. |
71
+ | `python -m webscout.AI prodia --prompt "car"` | CLI function to generate content related to a prompt using Webscout.AI's Prodia feature. |
65
72
 
66
- ```python
67
- python -m webscout.AI youchat --prompt "your_prompt_here"
68
- ```
69
73
 
70
- ```python
71
- python -m webscout.AI gemini --message "tell me about gemma 7b"
72
- ```
73
74
 
75
+ ## CLI to use LLM
74
76
  ```python
75
- python -m webscout.AI prodia --prompt "car"
77
+ python -m webscout.LLM model_name
76
78
  ```
77
79
  [Go To TOP](#TOP)
78
80
 
@@ -223,8 +225,7 @@ This ensures proper resource management and cleanup, as the context manager will
223
225
  Exceptions:
224
226
  - `WebscoutE`: Raised when there is a generic exception during the API request.
225
227
 
226
- ## usage
227
- 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:
228
+ ## usage of webscout
228
229
 
229
230
  ### 1. `text()` - text search by DuckDuckGo.com and Yep.com
230
231
 
@@ -264,11 +265,10 @@ with WEBS() as WEBS:
264
265
  region="wt-wt",
265
266
  safesearch="off",
266
267
  size=None,
267
- color="Monochrome",
268
268
  type_image=None,
269
269
  layout=None,
270
270
  license_image=None,
271
- max_results=100,
271
+ max_results=10,
272
272
  )
273
273
  for r in WEBS_images_gen:
274
274
  print(r)
@@ -289,7 +289,7 @@ with WEBS() as WEBS:
289
289
  timelimit="w",
290
290
  resolution="high",
291
291
  duration="medium",
292
- max_results=100,
292
+ max_results=10,
293
293
  )
294
294
  for r in WEBS_videos_gen:
295
295
  print(r)
@@ -343,15 +343,13 @@ with WEBS() as WEBS:
343
343
  from webscout import WEBS
344
344
 
345
345
  # Suggestions for the keyword 'fly' using DuckDuckGo.com and Yep
346
- #
347
-
348
- .com
349
346
  with WEBS() as WEBS:
350
347
  for r in WEBS.suggestions("fly"):
351
348
  print(r)
352
349
  ```
350
+ ## usage of webscout.AI
353
351
 
354
- ### 9. `PhindSearch` - Search using Phind.com
352
+ ### 1. `PhindSearch` - Search using Phind.com
355
353
  Thanks to Empyros for PhindSearch function
356
354
  ```python
357
355
  from webscout.AI import PhindSearch
@@ -363,7 +361,7 @@ WEBSAI = PhindSearch(query)
363
361
 
364
362
  WEBSAI.search()
365
363
  ```
366
- ### 10. `YepChat` - Chat with mistral 8x7b powered by yepchat
364
+ ### 2. `YepChat` - Chat with mistral 8x7b powered by yepchat
367
365
  Thanks To Divyansh Shukla for This code
368
366
  ```python
369
367
  from webscout.AI import YepChat
@@ -383,7 +381,7 @@ if __name__ == "__main__":
383
381
  main()
384
382
  ```
385
383
 
386
- ### 11. `You.com` - search with you.com
384
+ ### 3. `You.com` - search with you.com
387
385
  ```python
388
386
  from webscout.AI import youChat
389
387
 
@@ -406,7 +404,7 @@ while True:
406
404
  print("⚠️ An error occurred:", e)
407
405
  ```
408
406
 
409
- ### 12. `Gemini` - search with google gemini
407
+ ### 4. `Gemini` - search with google gemini
410
408
 
411
409
  ```python
412
410
  from webscout.AI import Gemini
@@ -420,7 +418,8 @@ response = gemini.chat("Your message here")
420
418
  # Print the response from the Gemini assistant
421
419
  print(response)
422
420
  ```
423
- ### 13. `Prodia` - make image using prodia
421
+ ## usage of image generator from Webscout.AI
422
+ ### 5. `Prodia` - make image using prodia
424
423
  ```python
425
424
  from webscout.AI import Prodia
426
425
 
@@ -430,23 +429,40 @@ prompt = "A beautiful sunset over the ocean"
430
429
  # Use the prodia_cli method to generate an image based on the prompt
431
430
  Prodia.prodia_cli(prompt)
432
431
  ```
432
+ ## usage of special .LLM file from webscout (webscout.LLM)
433
+
434
+ ### `LLM`
435
+ ```python
436
+ from webscout.LLM import LLM
437
+
438
+ def chat(model_name):
439
+ AI = LLM(model_name)
440
+ AI.chat()
441
+
442
+ if __name__ == "__main__":
443
+ 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.
444
+ chat(model_name)
445
+ ```
433
446
 
434
447
  ## Version History
448
+ ### v1.1.0
449
+ 🌟 Added LLMs as webscout.LLM
450
+ 🔧 Resolved issue related to Prodia functionality
435
451
 
436
452
  ### v1.0.9
437
- - Added Prodia as image generator in webscout.AI
438
-
453
+ 🌌 Added Prodia as an image generator in webscout.AI
454
+
439
455
  ### v1.0.8
440
- - Solved issue related to Gemini and Yep Chat functions in the Webscout package. 🌟
441
- Now, Gemini function returns correct outputs without duplication.
442
- Yep Chat function provides accurate responses without repeating them multiple times. 🚀
456
+ 🚀 Solved issues related to Gemini and Yep Chat functions within the Webscout package.
457
+ 🌟 Gemini function now provides correct outputs without duplication.
458
+ 🌟 Yep Chat function delivers accurate responses without repeating them multiple times.
443
459
 
444
460
  ### v1.0.7
445
- - Added gemini as webscout.AI
461
+ 🌟 Added Gemini as part of webscout.AI
446
462
 
447
463
  ### v1.0.6
448
- - Added yep.com as a search engine
449
- - Fixed an error related to translation functionality
450
- - Introduced Phind AI as webscout.AI
451
- - Included YepChat as webscout.AI
452
- - Integrated You.com as webscout.AI
464
+ 🌟 Integrated yep.com as a search engine
465
+ 🔧 Resolved error associated with the translation feature
466
+ 🌟 Introduced Phind AI within webscout.AI
467
+ 🌟 Included YepChat as part of webscout.AI
468
+ 🌟 Integrated You.com as part of webscout.AI
@@ -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.0.9", # Use the version variable from the version.py file
13
+ version="1.1.1", # 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",
@@ -48,6 +48,7 @@ setup(
48
48
  "webscout-ai-phindsearch = webscout.AI:phindsearch",
49
49
  "webscout-ai-yepchat = webscout.AI:yepchat",
50
50
  "webscout-ai = webscout.AI:cli",
51
+ "webscout-llm = webscout.LLM:chat",
51
52
  ],
52
53
  },
53
54
  extras_require={
@@ -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.
@@ -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()
@@ -0,0 +1,2 @@
1
+ __version__ = "1.1.1"
2
+
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: webscout
3
- Version: 1.0.9
3
+ Version: 1.1.1
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-ai)
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
- - [9. `PhindSearch` - Search using Phind.com](#9-phindsearch---search-using-phindcom)
61
- - [10. `YepChat` - Chat with mistral 8x7b powered by yepchat](#10-yepchat---chat-with-mistral-8x7b-powered-by-yepchat)
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
- - [13. `Prodia` - make image using prodia](#13-prodia---make-image-using-prodia)
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
- ```python
101
- python -m webscout.AI yepchat --message "your_message_here"
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.AI prodia --prompt "car"
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=100,
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=100,
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
- ### 9. `PhindSearch` - Search using Phind.com
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
- ### 10. `YepChat` - Chat with mistral 8x7b powered by yepchat
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
- ### 11. `You.com` - search with you.com
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
- ### 12. `Gemini` - search with google gemini
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
- ### 13. `Prodia` - make image using prodia
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
- - Added Prodia as image generator in webscout.AI
476
-
491
+ 🌌 Added Prodia as an image generator in webscout.AI
492
+
477
493
  ### v1.0.8
478
- - Solved issue related to Gemini and Yep Chat functions in the Webscout package. 🌟
479
- Now, Gemini function returns correct outputs without duplication.
480
- Yep Chat function provides accurate responses without repeating them multiple times. 🚀
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
- - Added gemini as webscout.AI
499
+ 🌟 Added Gemini as part of webscout.AI
484
500
 
485
501
  ### v1.0.6
486
- - Added yep.com as a search engine
487
- - Fixed an error related to translation functionality
488
- - Introduced Phind AI as webscout.AI
489
- - Included YepChat as webscout.AI
490
- - Integrated You.com as webscout.AI
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
@@ -2,6 +2,7 @@ LICENSE.md
2
2
  README.md
3
3
  setup.py
4
4
  webscout/AI.py
5
+ webscout/LLM.py
5
6
  webscout/__init__.py
6
7
  webscout/__main__.py
7
8
  webscout/cli.py
@@ -3,3 +3,4 @@ WEBS = webscout.cli:cli
3
3
  webscout-ai = webscout.AI:cli
4
4
  webscout-ai-phindsearch = webscout.AI:phindsearch
5
5
  webscout-ai-yepchat = webscout.AI:yepchat
6
+ webscout-llm = webscout.LLM:chat
@@ -1 +0,0 @@
1
- __version__ = "1.0.9"
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes