webscout 2.6__tar.gz → 2.8__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 (74) hide show
  1. {webscout-2.6 → webscout-2.8}/PKG-INFO +37 -21
  2. {webscout-2.6 → webscout-2.8}/README.md +34 -20
  3. {webscout-2.6 → webscout-2.8}/setup.py +3 -1
  4. webscout-2.8/webscout/LLM.py +100 -0
  5. {webscout-2.6 → webscout-2.8}/webscout/Local/_version.py +1 -1
  6. {webscout-2.6 → webscout-2.8}/webscout/Local/formats.py +154 -88
  7. {webscout-2.6 → webscout-2.8}/webscout/Local/model.py +4 -4
  8. {webscout-2.6 → webscout-2.8}/webscout/Local/thread.py +166 -156
  9. webscout-2.8/webscout/Provider/BasedGPT.py +226 -0
  10. {webscout-2.6 → webscout-2.8}/webscout/Provider/__init__.py +1 -0
  11. {webscout-2.6 → webscout-2.8}/webscout/__init__.py +2 -2
  12. {webscout-2.6 → webscout-2.8}/webscout/cli.py +39 -3
  13. webscout-2.8/webscout/version.py +2 -0
  14. webscout-2.6/webscout/webscout_search_async.py → webscout-2.8/webscout/webscout_search.py +261 -254
  15. webscout-2.8/webscout/webscout_search_async.py +361 -0
  16. {webscout-2.6 → webscout-2.8}/webscout.egg-info/PKG-INFO +37 -21
  17. {webscout-2.6 → webscout-2.8}/webscout.egg-info/SOURCES.txt +1 -0
  18. {webscout-2.6 → webscout-2.8}/webscout.egg-info/requires.txt +2 -0
  19. webscout-2.6/webscout/LLM.py +0 -45
  20. webscout-2.6/webscout/version.py +0 -2
  21. webscout-2.6/webscout/webscout_search.py +0 -78
  22. {webscout-2.6 → webscout-2.8}/DeepWEBS/__init__.py +0 -0
  23. {webscout-2.6 → webscout-2.8}/DeepWEBS/documents/__init__.py +0 -0
  24. {webscout-2.6 → webscout-2.8}/DeepWEBS/documents/query_results_extractor.py +0 -0
  25. {webscout-2.6 → webscout-2.8}/DeepWEBS/documents/webpage_content_extractor.py +0 -0
  26. {webscout-2.6 → webscout-2.8}/DeepWEBS/networks/__init__.py +0 -0
  27. {webscout-2.6 → webscout-2.8}/DeepWEBS/networks/filepath_converter.py +0 -0
  28. {webscout-2.6 → webscout-2.8}/DeepWEBS/networks/google_searcher.py +0 -0
  29. {webscout-2.6 → webscout-2.8}/DeepWEBS/networks/network_configs.py +0 -0
  30. {webscout-2.6 → webscout-2.8}/DeepWEBS/networks/webpage_fetcher.py +0 -0
  31. {webscout-2.6 → webscout-2.8}/DeepWEBS/utilsdw/__init__.py +0 -0
  32. {webscout-2.6 → webscout-2.8}/DeepWEBS/utilsdw/enver.py +0 -0
  33. {webscout-2.6 → webscout-2.8}/DeepWEBS/utilsdw/logger.py +0 -0
  34. {webscout-2.6 → webscout-2.8}/LICENSE.md +0 -0
  35. {webscout-2.6 → webscout-2.8}/setup.cfg +0 -0
  36. {webscout-2.6 → webscout-2.8}/webscout/AIauto.py +0 -0
  37. {webscout-2.6 → webscout-2.8}/webscout/AIbase.py +0 -0
  38. {webscout-2.6 → webscout-2.8}/webscout/AIutel.py +0 -0
  39. {webscout-2.6 → webscout-2.8}/webscout/DWEBS.py +0 -0
  40. {webscout-2.6 → webscout-2.8}/webscout/Local/__init__.py +0 -0
  41. {webscout-2.6 → webscout-2.8}/webscout/Local/samplers.py +0 -0
  42. {webscout-2.6 → webscout-2.8}/webscout/Local/utils.py +0 -0
  43. {webscout-2.6 → webscout-2.8}/webscout/Provider/Berlin4h.py +0 -0
  44. {webscout-2.6 → webscout-2.8}/webscout/Provider/Blackboxai.py +0 -0
  45. {webscout-2.6 → webscout-2.8}/webscout/Provider/ChatGPTUK.py +0 -0
  46. {webscout-2.6 → webscout-2.8}/webscout/Provider/Cohere.py +0 -0
  47. {webscout-2.6 → webscout-2.8}/webscout/Provider/Gemini.py +0 -0
  48. {webscout-2.6 → webscout-2.8}/webscout/Provider/Groq.py +0 -0
  49. {webscout-2.6 → webscout-2.8}/webscout/Provider/Koboldai.py +0 -0
  50. {webscout-2.6 → webscout-2.8}/webscout/Provider/Leo.py +0 -0
  51. {webscout-2.6 → webscout-2.8}/webscout/Provider/Llama2.py +0 -0
  52. {webscout-2.6 → webscout-2.8}/webscout/Provider/OpenGPT.py +0 -0
  53. {webscout-2.6 → webscout-2.8}/webscout/Provider/Openai.py +0 -0
  54. {webscout-2.6 → webscout-2.8}/webscout/Provider/Perplexity.py +0 -0
  55. {webscout-2.6 → webscout-2.8}/webscout/Provider/Phind.py +0 -0
  56. {webscout-2.6 → webscout-2.8}/webscout/Provider/Poe.py +0 -0
  57. {webscout-2.6 → webscout-2.8}/webscout/Provider/Reka.py +0 -0
  58. {webscout-2.6 → webscout-2.8}/webscout/Provider/ThinkAnyAI.py +0 -0
  59. {webscout-2.6 → webscout-2.8}/webscout/Provider/Xjai.py +0 -0
  60. {webscout-2.6 → webscout-2.8}/webscout/Provider/Yepchat.py +0 -0
  61. {webscout-2.6 → webscout-2.8}/webscout/Provider/Youchat.py +0 -0
  62. {webscout-2.6 → webscout-2.8}/webscout/__main__.py +0 -0
  63. {webscout-2.6 → webscout-2.8}/webscout/async_providers.py +0 -0
  64. {webscout-2.6 → webscout-2.8}/webscout/exceptions.py +0 -0
  65. {webscout-2.6 → webscout-2.8}/webscout/g4f.py +0 -0
  66. {webscout-2.6 → webscout-2.8}/webscout/models.py +0 -0
  67. {webscout-2.6 → webscout-2.8}/webscout/tempid.py +0 -0
  68. {webscout-2.6 → webscout-2.8}/webscout/transcriber.py +0 -0
  69. {webscout-2.6 → webscout-2.8}/webscout/utils.py +0 -0
  70. {webscout-2.6 → webscout-2.8}/webscout/voice.py +0 -0
  71. {webscout-2.6 → webscout-2.8}/webscout/webai.py +0 -0
  72. {webscout-2.6 → webscout-2.8}/webscout.egg-info/dependency_links.txt +0 -0
  73. {webscout-2.6 → webscout-2.8}/webscout.egg-info/entry_points.txt +0 -0
  74. {webscout-2.6 → webscout-2.8}/webscout.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: webscout
3
- Version: 2.6
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"
@@ -109,17 +111,18 @@ Search for anything using Google, DuckDuckGo, phind.com, Contains AI models, can
109
111
  - [Available TTS Voices:](#available-tts-voices)
110
112
  - [Exceptions](#exceptions)
111
113
  - [usage of webscout](#usage-of-webscout)
112
- - [1. `text()` - text search by DuckDuckGo.com and Yep.com](#1-text---text-search-by-duckduckgocom-and-yepcom)
113
- - [2. `answers()` - instant answers by DuckDuckGo.com and Yep.com](#2-answers---instant-answers-by-duckduckgocom-and-yepcom)
114
- - [3. `images()` - image search by DuckDuckGo.com and Yep.com](#3-images---image-search-by-duckduckgocom-and-yepcom)
114
+ - [1. `text()` - text search by DuckDuckGo.com](#1-text---text-search-by-duckduckgocom)
115
+ - [2. `answers()` - instant answers by DuckDuckGo.com](#2-answers---instant-answers-by-duckduckgocom)
116
+ - [3. `images()` - image search by DuckDuckGo.com](#3-images---image-search-by-duckduckgocom)
115
117
  - [4. `videos()` - video search by DuckDuckGo.com](#4-videos---video-search-by-duckduckgocom)
116
- - [5. `news()` - news search by DuckDuckGo.com and yep.com](#5-news---news-search-by-duckduckgocom-and-yepcom)
117
- - [6. `maps()` - map search by DuckDuckGo.com and](#6-maps---map-search-by-duckduckgocom-and)
118
- - [7. `translate()` - translation by DuckDuckGo.com and Yep.com](#7-translate---translation-by-duckduckgocom-and-yepcom)
119
- - [8. `suggestions()` - suggestions by DuckDuckGo.com and Yep.com](#8-suggestions---suggestions-by-duckduckgocom-and-yepcom)
118
+ - [5. `news()` - news search by DuckDuckGo.com](#5-news---news-search-by-duckduckgocom)
119
+ - [6. `maps()` - map search by DuckDuckGo.com](#6-maps---map-search-by-duckduckgocom)
120
+ - [7. `translate()` - translation by DuckDuckGo.com](#7-translate---translation-by-duckduckgocom)
121
+ - [8. `suggestions()` - suggestions by DuckDuckGo.com](#8-suggestions---suggestions-by-duckduckgocom)
120
122
  - [ALL acts](#all-acts)
121
123
  - [Webscout Supported Acts:](#webscout-supported-acts)
122
124
  - [usage of webscout AI](#usage-of-webscout-ai)
125
+ - [0. `Duckchat` - chat with LLM](#0-duckchat---chat-with-llm)
123
126
  - [1. `PhindSearch` - Search using Phind.com](#1-phindsearch---search-using-phindcom)
124
127
  - [2. `YepChat` - Chat with mistral 8x7b powered by yepchat](#2-yepchat---chat-with-mistral-8x7b-powered-by-yepchat)
125
128
  - [3. `You.com` - search/chat with you.com](#3-youcom---searchchat-with-youcom)
@@ -134,6 +137,8 @@ Search for anything using Google, DuckDuckGo, phind.com, Contains AI models, can
134
137
  - [12. `Xjai` - chat with free gpt 3.5](#12-xjai---chat-with-free-gpt-35)
135
138
  - [13. `ThinkAny` - AI search engine](#13-thinkany---ai-search-engine)
136
139
  - [14. `chatgptuk` - Chat with gemini-pro](#14-chatgptuk---chat-with-gemini-pro)
140
+ - [15. `poe`- chat with poe](#15-poe--chat-with-poe)
141
+ - [16. `BasedGPT` - chat with GPT](#16-basedgpt---chat-with-gpt)
137
142
  - [`LLM`](#llm)
138
143
  - [`Local-LLM` webscout can now run GGUF models](#local-llm-webscout-can-now-run-gguf-models)
139
144
  - [`LLM` with internet](#llm-with-internet)
@@ -525,12 +530,12 @@ Exceptions:
525
530
 
526
531
  ## usage of webscout
527
532
 
528
- ### 1. `text()` - text search by DuckDuckGo.com and Yep.com
533
+ ### 1. `text()` - text search by DuckDuckGo.com
529
534
 
530
535
  ```python
531
536
  from webscout import WEBS
532
537
 
533
- # Text search for 'live free or die' using DuckDuckGo.com and Yep.com
538
+ # Text search for 'live free or die' using DuckDuckGo.com
534
539
  with WEBS() as WEBS:
535
540
  for r in WEBS.text('live free or die', region='wt-wt', safesearch='off', timelimit='y', max_results=10):
536
541
  print(r)
@@ -539,23 +544,23 @@ with WEBS() as WEBS:
539
544
  print(r)
540
545
  ```
541
546
 
542
- ### 2. `answers()` - instant answers by DuckDuckGo.com and Yep.com
547
+ ### 2. `answers()` - instant answers by DuckDuckGo.com
543
548
 
544
549
  ```python
545
550
  from webscout import WEBS
546
551
 
547
- # Instant answers for the query "sun" using DuckDuckGo.com and Yep.com
552
+ # Instant answers for the query "sun" using DuckDuckGo.com
548
553
  with WEBS() as WEBS:
549
554
  for r in WEBS.answers("sun"):
550
555
  print(r)
551
556
  ```
552
557
 
553
- ### 3. `images()` - image search by DuckDuckGo.com and Yep.com
558
+ ### 3. `images()` - image search by DuckDuckGo.com
554
559
 
555
560
  ```python
556
561
  from webscout import WEBS
557
562
 
558
- # Image search for the keyword 'butterfly' using DuckDuckGo.com and Yep.com
563
+ # Image search for the keyword 'butterfly' using DuckDuckGo.com
559
564
  with WEBS() as WEBS:
560
565
  keywords = 'butterfly'
561
566
  WEBS_images_gen = WEBS.images(
@@ -593,7 +598,7 @@ with WEBS() as WEBS:
593
598
  print(r)
594
599
  ```
595
600
 
596
- ### 5. `news()` - news search by DuckDuckGo.com and yep.com
601
+ ### 5. `news()` - news search by DuckDuckGo.com
597
602
 
598
603
  ```python
599
604
  from webscout import WEBS
@@ -640,7 +645,7 @@ print(formatted_headlines)
640
645
 
641
646
  ```
642
647
 
643
- ### 6. `maps()` - map search by DuckDuckGo.com and
648
+ ### 6. `maps()` - map search by DuckDuckGo.com
644
649
 
645
650
  ```python
646
651
  from webscout import WEBS
@@ -651,24 +656,24 @@ with WEBS() as WEBS:
651
656
  print(r)
652
657
  ```
653
658
 
654
- ### 7. `translate()` - translation by DuckDuckGo.com and Yep.com
659
+ ### 7. `translate()` - translation by DuckDuckGo.com
655
660
 
656
661
  ```python
657
662
  from webscout import WEBS
658
663
 
659
- # Translation of the keyword 'school' to German ('hi') using DuckDuckGo.com and Yep.com
664
+ # Translation of the keyword 'school' to German ('hi') using DuckDuckGo.com
660
665
  with WEBS() as WEBS:
661
666
  keywords = 'school'
662
667
  r = WEBS.translate(keywords, to="hi")
663
668
  print(r)
664
669
  ```
665
670
 
666
- ### 8. `suggestions()` - suggestions by DuckDuckGo.com and Yep.com
671
+ ### 8. `suggestions()` - suggestions by DuckDuckGo.com
667
672
 
668
673
  ```python
669
674
  from webscout import WEBS
670
675
 
671
- # Suggestions for the keyword 'fly' using DuckDuckGo.com and Yep
676
+ # Suggestions for the keyword 'fly' using DuckDuckGo.com
672
677
  with WEBS() as WEBS:
673
678
  for r in WEBS.suggestions("fly"):
674
679
  print(r)
@@ -931,7 +936,12 @@ ___
931
936
  </details>
932
937
 
933
938
  ## usage of webscout AI
934
-
939
+ ### 0. `Duckchat` - chat with LLM
940
+ ```python
941
+ from webscout import WEBS as w
942
+ R = w().chat("hello", model='claude-3-haiku') # GPT-3.5 Turbo
943
+ print(R)
944
+ ```
935
945
  ### 1. `PhindSearch` - Search using Phind.com
936
946
 
937
947
  ```python
@@ -1199,7 +1209,13 @@ ai = ChatGPTUK(
1199
1209
  prompt = "Explain the concept of recursion in simple terms."
1200
1210
  response = ai.chat(prompt)
1201
1211
  print(response)
1212
+
1202
1213
  ```
1214
+ ### 15. `poe`- chat with poe
1215
+ Usage code similar to other proviers
1216
+
1217
+ ### 16. `BasedGPT` - chat with GPT
1218
+ Usage code similar to other providers
1203
1219
  ### `LLM`
1204
1220
  ```python
1205
1221
  from webscout.LLM import LLM
@@ -47,17 +47,18 @@ Search for anything using Google, DuckDuckGo, phind.com, Contains AI models, can
47
47
  - [Available TTS Voices:](#available-tts-voices)
48
48
  - [Exceptions](#exceptions)
49
49
  - [usage of webscout](#usage-of-webscout)
50
- - [1. `text()` - text search by DuckDuckGo.com and Yep.com](#1-text---text-search-by-duckduckgocom-and-yepcom)
51
- - [2. `answers()` - instant answers by DuckDuckGo.com and Yep.com](#2-answers---instant-answers-by-duckduckgocom-and-yepcom)
52
- - [3. `images()` - image search by DuckDuckGo.com and Yep.com](#3-images---image-search-by-duckduckgocom-and-yepcom)
50
+ - [1. `text()` - text search by DuckDuckGo.com](#1-text---text-search-by-duckduckgocom)
51
+ - [2. `answers()` - instant answers by DuckDuckGo.com](#2-answers---instant-answers-by-duckduckgocom)
52
+ - [3. `images()` - image search by DuckDuckGo.com](#3-images---image-search-by-duckduckgocom)
53
53
  - [4. `videos()` - video search by DuckDuckGo.com](#4-videos---video-search-by-duckduckgocom)
54
- - [5. `news()` - news search by DuckDuckGo.com and yep.com](#5-news---news-search-by-duckduckgocom-and-yepcom)
55
- - [6. `maps()` - map search by DuckDuckGo.com and](#6-maps---map-search-by-duckduckgocom-and)
56
- - [7. `translate()` - translation by DuckDuckGo.com and Yep.com](#7-translate---translation-by-duckduckgocom-and-yepcom)
57
- - [8. `suggestions()` - suggestions by DuckDuckGo.com and Yep.com](#8-suggestions---suggestions-by-duckduckgocom-and-yepcom)
54
+ - [5. `news()` - news search by DuckDuckGo.com](#5-news---news-search-by-duckduckgocom)
55
+ - [6. `maps()` - map search by DuckDuckGo.com](#6-maps---map-search-by-duckduckgocom)
56
+ - [7. `translate()` - translation by DuckDuckGo.com](#7-translate---translation-by-duckduckgocom)
57
+ - [8. `suggestions()` - suggestions by DuckDuckGo.com](#8-suggestions---suggestions-by-duckduckgocom)
58
58
  - [ALL acts](#all-acts)
59
59
  - [Webscout Supported Acts:](#webscout-supported-acts)
60
60
  - [usage of webscout AI](#usage-of-webscout-ai)
61
+ - [0. `Duckchat` - chat with LLM](#0-duckchat---chat-with-llm)
61
62
  - [1. `PhindSearch` - Search using Phind.com](#1-phindsearch---search-using-phindcom)
62
63
  - [2. `YepChat` - Chat with mistral 8x7b powered by yepchat](#2-yepchat---chat-with-mistral-8x7b-powered-by-yepchat)
63
64
  - [3. `You.com` - search/chat with you.com](#3-youcom---searchchat-with-youcom)
@@ -72,6 +73,8 @@ Search for anything using Google, DuckDuckGo, phind.com, Contains AI models, can
72
73
  - [12. `Xjai` - chat with free gpt 3.5](#12-xjai---chat-with-free-gpt-35)
73
74
  - [13. `ThinkAny` - AI search engine](#13-thinkany---ai-search-engine)
74
75
  - [14. `chatgptuk` - Chat with gemini-pro](#14-chatgptuk---chat-with-gemini-pro)
76
+ - [15. `poe`- chat with poe](#15-poe--chat-with-poe)
77
+ - [16. `BasedGPT` - chat with GPT](#16-basedgpt---chat-with-gpt)
75
78
  - [`LLM`](#llm)
76
79
  - [`Local-LLM` webscout can now run GGUF models](#local-llm-webscout-can-now-run-gguf-models)
77
80
  - [`LLM` with internet](#llm-with-internet)
@@ -463,12 +466,12 @@ Exceptions:
463
466
 
464
467
  ## usage of webscout
465
468
 
466
- ### 1. `text()` - text search by DuckDuckGo.com and Yep.com
469
+ ### 1. `text()` - text search by DuckDuckGo.com
467
470
 
468
471
  ```python
469
472
  from webscout import WEBS
470
473
 
471
- # Text search for 'live free or die' using DuckDuckGo.com and Yep.com
474
+ # Text search for 'live free or die' using DuckDuckGo.com
472
475
  with WEBS() as WEBS:
473
476
  for r in WEBS.text('live free or die', region='wt-wt', safesearch='off', timelimit='y', max_results=10):
474
477
  print(r)
@@ -477,23 +480,23 @@ with WEBS() as WEBS:
477
480
  print(r)
478
481
  ```
479
482
 
480
- ### 2. `answers()` - instant answers by DuckDuckGo.com and Yep.com
483
+ ### 2. `answers()` - instant answers by DuckDuckGo.com
481
484
 
482
485
  ```python
483
486
  from webscout import WEBS
484
487
 
485
- # Instant answers for the query "sun" using DuckDuckGo.com and Yep.com
488
+ # Instant answers for the query "sun" using DuckDuckGo.com
486
489
  with WEBS() as WEBS:
487
490
  for r in WEBS.answers("sun"):
488
491
  print(r)
489
492
  ```
490
493
 
491
- ### 3. `images()` - image search by DuckDuckGo.com and Yep.com
494
+ ### 3. `images()` - image search by DuckDuckGo.com
492
495
 
493
496
  ```python
494
497
  from webscout import WEBS
495
498
 
496
- # Image search for the keyword 'butterfly' using DuckDuckGo.com and Yep.com
499
+ # Image search for the keyword 'butterfly' using DuckDuckGo.com
497
500
  with WEBS() as WEBS:
498
501
  keywords = 'butterfly'
499
502
  WEBS_images_gen = WEBS.images(
@@ -531,7 +534,7 @@ with WEBS() as WEBS:
531
534
  print(r)
532
535
  ```
533
536
 
534
- ### 5. `news()` - news search by DuckDuckGo.com and yep.com
537
+ ### 5. `news()` - news search by DuckDuckGo.com
535
538
 
536
539
  ```python
537
540
  from webscout import WEBS
@@ -578,7 +581,7 @@ print(formatted_headlines)
578
581
 
579
582
  ```
580
583
 
581
- ### 6. `maps()` - map search by DuckDuckGo.com and
584
+ ### 6. `maps()` - map search by DuckDuckGo.com
582
585
 
583
586
  ```python
584
587
  from webscout import WEBS
@@ -589,24 +592,24 @@ with WEBS() as WEBS:
589
592
  print(r)
590
593
  ```
591
594
 
592
- ### 7. `translate()` - translation by DuckDuckGo.com and Yep.com
595
+ ### 7. `translate()` - translation by DuckDuckGo.com
593
596
 
594
597
  ```python
595
598
  from webscout import WEBS
596
599
 
597
- # Translation of the keyword 'school' to German ('hi') using DuckDuckGo.com and Yep.com
600
+ # Translation of the keyword 'school' to German ('hi') using DuckDuckGo.com
598
601
  with WEBS() as WEBS:
599
602
  keywords = 'school'
600
603
  r = WEBS.translate(keywords, to="hi")
601
604
  print(r)
602
605
  ```
603
606
 
604
- ### 8. `suggestions()` - suggestions by DuckDuckGo.com and Yep.com
607
+ ### 8. `suggestions()` - suggestions by DuckDuckGo.com
605
608
 
606
609
  ```python
607
610
  from webscout import WEBS
608
611
 
609
- # Suggestions for the keyword 'fly' using DuckDuckGo.com and Yep
612
+ # Suggestions for the keyword 'fly' using DuckDuckGo.com
610
613
  with WEBS() as WEBS:
611
614
  for r in WEBS.suggestions("fly"):
612
615
  print(r)
@@ -869,7 +872,12 @@ ___
869
872
  </details>
870
873
 
871
874
  ## usage of webscout AI
872
-
875
+ ### 0. `Duckchat` - chat with LLM
876
+ ```python
877
+ from webscout import WEBS as w
878
+ R = w().chat("hello", model='claude-3-haiku') # GPT-3.5 Turbo
879
+ print(R)
880
+ ```
873
881
  ### 1. `PhindSearch` - Search using Phind.com
874
882
 
875
883
  ```python
@@ -1137,7 +1145,13 @@ ai = ChatGPTUK(
1137
1145
  prompt = "Explain the concept of recursion in simple terms."
1138
1146
  response = ai.chat(prompt)
1139
1147
  print(response)
1148
+
1140
1149
  ```
1150
+ ### 15. `poe`- chat with poe
1151
+ Usage code similar to other proviers
1152
+
1153
+ ### 16. `BasedGPT` - chat with GPT
1154
+ Usage code similar to other providers
1141
1155
  ### `LLM`
1142
1156
  ```python
1143
1157
  from webscout.LLM import LLM
@@ -5,7 +5,7 @@ with open("README.md", encoding="utf-8") as f:
5
5
 
6
6
  setup(
7
7
  name="webscout",
8
- version="2.6",
8
+ version="2.8",
9
9
  description="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",
10
10
  long_description=README,
11
11
  long_description_content_type="text/markdown",
@@ -56,6 +56,8 @@ setup(
56
56
  "clipman",
57
57
  "Helpingai-T2",
58
58
  "playsound",
59
+ "poe_api_wrapper",
60
+ "pyreqwest_impersonate"
59
61
  ],
60
62
  entry_points={
61
63
  "console_scripts": [
@@ -0,0 +1,100 @@
1
+ import requests
2
+ import base64
3
+ from typing import List, Dict, Union
4
+ import json
5
+ import requests
6
+ import base64
7
+ from typing import List, Dict, Union
8
+
9
+ class LLM:
10
+ def __init__(self, model: str, system_message: str = "You are a Helpful AI."):
11
+ self.model = model
12
+ self.conversation_history = [{"role": "system", "content": system_message}]
13
+
14
+ def chat(self, messages: List[Dict[str, str]]) -> Union[str, None]:
15
+ url = "https://api.deepinfra.com/v1/openai/chat/completions"
16
+ headers = {
17
+ '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',
18
+ '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',
19
+ 'Cache-Control': 'no-cache',
20
+ 'Connection': 'keep-alive',
21
+ 'Content-Type': 'application/json',
22
+ 'Origin': 'https://deepinfra.com',
23
+ 'Pragma': 'no-cache',
24
+ 'Referer': 'https://deepinfra.com/',
25
+ 'Sec-Fetch-Dest': 'empty',
26
+ 'Sec-Fetch-Mode': 'cors',
27
+ 'Sec-Fetch-Site': 'same-site',
28
+ 'X-Deepinfra-Source': 'web-embed',
29
+ 'accept': 'text/event-stream',
30
+ 'sec-ch-ua': '"Google Chrome";v="119", "Chromium";v="119", "Not?A_Brand";v="24"',
31
+ 'sec-ch-ua-mobile': '?0',
32
+ 'sec-ch-ua-platform': '"macOS"'
33
+ }
34
+ data = json.dumps(
35
+ {
36
+ 'model': self.model,
37
+ 'messages': messages,
38
+ 'temperature': 0.7,
39
+ 'max_tokens': 8028,
40
+ 'stop': [],
41
+ 'stream': False #dont change it
42
+ }, separators=(',', ':')
43
+ )
44
+ try:
45
+ result = requests.post(url=url, data=data, headers=headers)
46
+ return result.json()['choices'][0]['message']['content']
47
+ except:
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,3 +1,3 @@
1
1
  from llama_cpp import __version__ as __llama_cpp_version__
2
2
 
3
- __version__ = '2.6'
3
+ __version__ = '2.7'