webscout 1.3.0__tar.gz → 1.3.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of webscout might be problematic. Click here for more details.

Files changed (43) hide show
  1. {webscout-1.3.0 → webscout-1.3.2}/PKG-INFO +110 -21
  2. {webscout-1.3.0 → webscout-1.3.2}/README.md +109 -20
  3. {webscout-1.3.0 → webscout-1.3.2}/setup.py +2 -6
  4. {webscout-1.3.0 → webscout-1.3.2}/webscout/AI.py +887 -26
  5. {webscout-1.3.0 → webscout-1.3.2}/webscout/AIutel.py +6 -6
  6. {webscout-1.3.0 → webscout-1.3.2}/webscout/LLM.py +1 -24
  7. {webscout-1.3.0 → webscout-1.3.2}/webscout/__init__.py +22 -1
  8. webscout-1.3.2/webscout/g4f.py +474 -0
  9. webscout-1.3.2/webscout/version.py +2 -0
  10. webscout-1.3.2/webscout/webai.py +2306 -0
  11. {webscout-1.3.0 → webscout-1.3.2}/webscout.egg-info/PKG-INFO +110 -21
  12. {webscout-1.3.0 → webscout-1.3.2}/webscout.egg-info/SOURCES.txt +2 -0
  13. webscout-1.3.0/webscout/version.py +0 -2
  14. {webscout-1.3.0 → webscout-1.3.2}/DeepWEBS/__init__.py +0 -0
  15. {webscout-1.3.0 → webscout-1.3.2}/DeepWEBS/documents/__init__.py +0 -0
  16. {webscout-1.3.0 → webscout-1.3.2}/DeepWEBS/documents/query_results_extractor.py +0 -0
  17. {webscout-1.3.0 → webscout-1.3.2}/DeepWEBS/documents/webpage_content_extractor.py +0 -0
  18. {webscout-1.3.0 → webscout-1.3.2}/DeepWEBS/networks/__init__.py +0 -0
  19. {webscout-1.3.0 → webscout-1.3.2}/DeepWEBS/networks/filepath_converter.py +0 -0
  20. {webscout-1.3.0 → webscout-1.3.2}/DeepWEBS/networks/google_searcher.py +0 -0
  21. {webscout-1.3.0 → webscout-1.3.2}/DeepWEBS/networks/network_configs.py +0 -0
  22. {webscout-1.3.0 → webscout-1.3.2}/DeepWEBS/networks/webpage_fetcher.py +0 -0
  23. {webscout-1.3.0 → webscout-1.3.2}/DeepWEBS/utilsdw/__init__.py +0 -0
  24. {webscout-1.3.0 → webscout-1.3.2}/DeepWEBS/utilsdw/enver.py +0 -0
  25. {webscout-1.3.0 → webscout-1.3.2}/DeepWEBS/utilsdw/logger.py +0 -0
  26. {webscout-1.3.0 → webscout-1.3.2}/LICENSE.md +0 -0
  27. {webscout-1.3.0 → webscout-1.3.2}/setup.cfg +0 -0
  28. {webscout-1.3.0 → webscout-1.3.2}/webscout/AIbase.py +0 -0
  29. {webscout-1.3.0 → webscout-1.3.2}/webscout/DWEBS.py +0 -0
  30. {webscout-1.3.0 → webscout-1.3.2}/webscout/HelpingAI.py +0 -0
  31. {webscout-1.3.0 → webscout-1.3.2}/webscout/__main__.py +0 -0
  32. {webscout-1.3.0 → webscout-1.3.2}/webscout/cli.py +0 -0
  33. {webscout-1.3.0 → webscout-1.3.2}/webscout/exceptions.py +0 -0
  34. {webscout-1.3.0 → webscout-1.3.2}/webscout/models.py +0 -0
  35. {webscout-1.3.0 → webscout-1.3.2}/webscout/transcriber.py +0 -0
  36. {webscout-1.3.0 → webscout-1.3.2}/webscout/utils.py +0 -0
  37. {webscout-1.3.0 → webscout-1.3.2}/webscout/voice.py +0 -0
  38. {webscout-1.3.0 → webscout-1.3.2}/webscout/webscout_search.py +0 -0
  39. {webscout-1.3.0 → webscout-1.3.2}/webscout/webscout_search_async.py +0 -0
  40. {webscout-1.3.0 → webscout-1.3.2}/webscout.egg-info/dependency_links.txt +0 -0
  41. {webscout-1.3.0 → webscout-1.3.2}/webscout.egg-info/entry_points.txt +0 -0
  42. {webscout-1.3.0 → webscout-1.3.2}/webscout.egg-info/requires.txt +0 -0
  43. {webscout-1.3.0 → webscout-1.3.2}/webscout.egg-info/top_level.txt +0 -0
@@ -1,7 +1,7 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: webscout
3
- Version: 1.3.0
4
- Summary: Search for words, documents, images, videos, news, maps and text translation using the Google, DuckDuckGo.com, yep.com, phind.com, you.com, etc Also containes AI models and now can transcribe yt videos
3
+ Version: 1.3.2
4
+ Summary: Search for words, documents, images, videos, news, maps and text translation using the Google, DuckDuckGo.com, yep.com, phind.com, you.com, etc Also containes AI models, can transcribe yt videos and have TTS support
5
5
  Author: OEvortex
6
6
  Author-email: helpingai5@gmail.com
7
7
  License: HelpingAI Simplified Universal License
@@ -64,7 +64,6 @@ Search for words, documents, images, videos, news, maps and text translation usi
64
64
  - [Table of Contents](#table-of-contents)
65
65
  - [Install](#install)
66
66
  - [CLI version](#cli-version)
67
- - [CLI version of webscout.AI](#cli-version-of-webscoutai)
68
67
  - [CLI to use LLM](#cli-to-use-llm)
69
68
  - [Regions](#regions)
70
69
  - [Transcriber](#transcriber)
@@ -97,8 +96,10 @@ Search for words, documents, images, videos, news, maps and text translation usi
97
96
  - [7. `PERPLEXITY` - Search With PERPLEXITY](#7-perplexity---search-with-perplexity)
98
97
  - [8. `OpenGPT` - chat With OPENGPT](#8-opengpt---chat-with-opengpt)
99
98
  - [9. `KOBOLDIA` -](#9-koboldia--)
99
+ - [10. `Sean` - chat With Sean](#10-sean---chat-with-sean)
100
100
  - [usage of special .LLM file from webscout (webscout.LLM)](#usage-of-special-llm-file-from-webscout-webscoutllm)
101
101
  - [`LLM`](#llm)
102
+ - [`LLM` with internet](#llm-with-internet)
102
103
 
103
104
  ## Install
104
105
  ```python
@@ -124,19 +125,6 @@ python -m webscout --help
124
125
 
125
126
 
126
127
 
127
- ## CLI version of webscout.AI
128
- | Command | Description |
129
- |-----------------------------------------------|--------------------------------------------------------------------------------------------------------|
130
- | `python -m webscout.AI phindsearch --prompt "your search query"` | CLI function to perform a search query using Webscout.AI's Phindsearch feature. |
131
- | `python -m webscout.AI yepchat --message "your_message_here"` | CLI function to send a message using Webscout.AI's Yepchat feature. |
132
- | `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. |
133
- | `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. |
134
- | `python -m webscout.AI prodia --prompt "car"` | CLI function to generate content related to a prompt using Webscout.AI's Prodia feature. |
135
- | `python -m webscout.AI blackboxai --prompt "Your prompt here"` | CLI function to perform a search using Webscout.AI's Blackbox search feature. |
136
- | `python -m webscout.AI perplexity --prompt "Your prompt here"` | CLI function to perform a search using Webscout.AI's PERPLEXITY feature. |
137
- | `python -m webscout.AI opengpt --prompt "Your prompt here"` | CLI function to perform a search using Webscout.AI's OPENGPT feature. |
138
-
139
-
140
128
  ## CLI to use LLM
141
129
  ```python
142
130
  python -m webscout.LLM model_name
@@ -696,6 +684,16 @@ response = koboldai.ask(prompt)
696
684
  message = koboldai.get_message(response)
697
685
  print(message)
698
686
 
687
+ ```
688
+ ### 10. `Sean` - chat With Sean
689
+ ```python
690
+ from webscout.AI import Sean
691
+
692
+ a = Sean(is_conversation=True, max_tokens=8000, timeout=30)
693
+ # This example sends a simple greeting and prints the response
694
+ prompt = "tell me about india"
695
+ response_str = a.chat(prompt)
696
+ print(response_str)
699
697
  ```
700
698
 
701
699
  ## usage of special .LLM file from webscout (webscout.LLM)
@@ -704,11 +702,102 @@ print(message)
704
702
  ```python
705
703
  from webscout.LLM import LLM
706
704
 
707
- def chat(model_name, system_message="You are Jarvis"):# system prompt
708
- AI = LLM(model_name, system_message)
709
- AI.chat()
705
+ # Read the system message from the file
706
+ with open('system.txt', 'r') as file:
707
+ system_message = file.read()
708
+
709
+ # Initialize the LLM class with the model name and system message
710
+ llm = LLM(model="microsoft/WizardLM-2-8x22B", system_message=system_message)
711
+
712
+ while True:
713
+ # Get the user input
714
+ user_input = input("User: ")
715
+
716
+ # Define the messages to be sent
717
+ messages = [
718
+ {"role": "user", "content": user_input}
719
+ ]
720
+
721
+ # Use the mistral_chat method to get the response
722
+ response = llm.chat(messages)
723
+
724
+ # Print the response
725
+ print("AI: ", response)
726
+ ```
727
+ ### `LLM` with internet
728
+ ```python
729
+ from __future__ import annotations
730
+ from typing import List, Optional
731
+
732
+ from webscout import LLM
733
+ from webscout import WEBS
734
+ import warnings
735
+
736
+ system_message: str = (
737
+ "As AI, you possess internet access and are capable of executing real-time web searches based on user inputs. "
738
+ "You shall utilize this capability to enrich conversations, offer informed insights, and augment your ability to "
739
+ "respond accurately and thoroughly. However, refrain from stating 'You have provided a list of strings,' ensuring "
740
+ "seamless interactions with users. Embrace a responsive demeanor, harnessing available online resources to address "
741
+ "queries, share pertinent content, and facilitate meaningful exchanges. By doing so, you create value through "
742
+ "connection and engagement, ultimately enhancing overall user satisfaction and experience. Additionally, "
743
+ "continue upholding the principles of respect, impartiality, and intellectual integrity throughout all interactions."
744
+ )
745
+
746
+ # Ignore the specific UserWarning
747
+ warnings.filterwarnings("ignore", category=UserWarning, module="curl_cffi.aio", lineno=205)
748
+ LLM = LLM(model="meta-llama/Meta-Llama-3-70B-Instruct", system_message=system_message)
749
+
750
+
751
+ def chat(
752
+ user_input: str, webs: WEBS, max_results: int = 10
753
+ ) -> Optional[str]:
754
+ """
755
+ Chat function to perform a web search based on the user input and generate a response using the LLM model.
756
+
757
+ Parameters
758
+ ----------
759
+ user_input : str
760
+ The user input to be used for the web search
761
+ webs : WEBS
762
+ The web search instance to be used to perform the search
763
+ max_results : int, optional
764
+ The maximum number of search results to include in the response, by default 10
765
+
766
+ Returns
767
+ -------
768
+ Optional[str]
769
+ The response generated by the LLM model, or None if there is no response
770
+ """
771
+ # Perform a web search based on the user input
772
+ search_results: List[str] = []
773
+ for r in webs.text(
774
+ user_input, region="wt-wt", safesearch="off", timelimit="y", max_results=max_results
775
+ ):
776
+ search_results.append(str(r)) # Convert each result to a string
777
+
778
+ # Define the messages to be sent, including the user input, search results, and system message
779
+ messages = [
780
+ {"role": "user", "content": user_input + "\n" + "websearch results are:" + "\n".join(search_results)},
781
+ ]
782
+
783
+ # Use the chat method to get the response
784
+ response = LLM.chat(messages)
785
+
786
+ return response
787
+
710
788
 
711
789
  if __name__ == "__main__":
712
- model_name = "mistralai/Mistral-7B-Instruct-v0.2" # name of the model you wish to use It supports ALL text generation models on deepinfra.com.
713
- chat(model_name)
790
+ while True:
791
+ # Get the user input
792
+ user_input = input("User: ")
793
+
794
+ # Perform a web search based on the user input
795
+ with WEBS() as webs:
796
+ response = chat(user_input, webs)
797
+
798
+ # Print the response
799
+ if response:
800
+ print("AI:", response)
801
+ else:
802
+ print("No response")
714
803
  ```
@@ -12,7 +12,6 @@ Search for words, documents, images, videos, news, maps and text translation usi
12
12
  - [Table of Contents](#table-of-contents)
13
13
  - [Install](#install)
14
14
  - [CLI version](#cli-version)
15
- - [CLI version of webscout.AI](#cli-version-of-webscoutai)
16
15
  - [CLI to use LLM](#cli-to-use-llm)
17
16
  - [Regions](#regions)
18
17
  - [Transcriber](#transcriber)
@@ -45,8 +44,10 @@ Search for words, documents, images, videos, news, maps and text translation usi
45
44
  - [7. `PERPLEXITY` - Search With PERPLEXITY](#7-perplexity---search-with-perplexity)
46
45
  - [8. `OpenGPT` - chat With OPENGPT](#8-opengpt---chat-with-opengpt)
47
46
  - [9. `KOBOLDIA` -](#9-koboldia--)
47
+ - [10. `Sean` - chat With Sean](#10-sean---chat-with-sean)
48
48
  - [usage of special .LLM file from webscout (webscout.LLM)](#usage-of-special-llm-file-from-webscout-webscoutllm)
49
49
  - [`LLM`](#llm)
50
+ - [`LLM` with internet](#llm-with-internet)
50
51
 
51
52
  ## Install
52
53
  ```python
@@ -72,19 +73,6 @@ python -m webscout --help
72
73
 
73
74
 
74
75
 
75
- ## CLI version of webscout.AI
76
- | Command | Description |
77
- |-----------------------------------------------|--------------------------------------------------------------------------------------------------------|
78
- | `python -m webscout.AI phindsearch --prompt "your search query"` | CLI function to perform a search query using Webscout.AI's Phindsearch feature. |
79
- | `python -m webscout.AI yepchat --message "your_message_here"` | CLI function to send a message using Webscout.AI's Yepchat feature. |
80
- | `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. |
81
- | `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. |
82
- | `python -m webscout.AI prodia --prompt "car"` | CLI function to generate content related to a prompt using Webscout.AI's Prodia feature. |
83
- | `python -m webscout.AI blackboxai --prompt "Your prompt here"` | CLI function to perform a search using Webscout.AI's Blackbox search feature. |
84
- | `python -m webscout.AI perplexity --prompt "Your prompt here"` | CLI function to perform a search using Webscout.AI's PERPLEXITY feature. |
85
- | `python -m webscout.AI opengpt --prompt "Your prompt here"` | CLI function to perform a search using Webscout.AI's OPENGPT feature. |
86
-
87
-
88
76
  ## CLI to use LLM
89
77
  ```python
90
78
  python -m webscout.LLM model_name
@@ -644,6 +632,16 @@ response = koboldai.ask(prompt)
644
632
  message = koboldai.get_message(response)
645
633
  print(message)
646
634
 
635
+ ```
636
+ ### 10. `Sean` - chat With Sean
637
+ ```python
638
+ from webscout.AI import Sean
639
+
640
+ a = Sean(is_conversation=True, max_tokens=8000, timeout=30)
641
+ # This example sends a simple greeting and prints the response
642
+ prompt = "tell me about india"
643
+ response_str = a.chat(prompt)
644
+ print(response_str)
647
645
  ```
648
646
 
649
647
  ## usage of special .LLM file from webscout (webscout.LLM)
@@ -652,11 +650,102 @@ print(message)
652
650
  ```python
653
651
  from webscout.LLM import LLM
654
652
 
655
- def chat(model_name, system_message="You are Jarvis"):# system prompt
656
- AI = LLM(model_name, system_message)
657
- AI.chat()
653
+ # Read the system message from the file
654
+ with open('system.txt', 'r') as file:
655
+ system_message = file.read()
658
656
 
659
- if __name__ == "__main__":
660
- model_name = "mistralai/Mistral-7B-Instruct-v0.2" # name of the model you wish to use It supports ALL text generation models on deepinfra.com.
661
- chat(model_name)
657
+ # Initialize the LLM class with the model name and system message
658
+ llm = LLM(model="microsoft/WizardLM-2-8x22B", system_message=system_message)
659
+
660
+ while True:
661
+ # Get the user input
662
+ user_input = input("User: ")
663
+
664
+ # Define the messages to be sent
665
+ messages = [
666
+ {"role": "user", "content": user_input}
667
+ ]
668
+
669
+ # Use the mistral_chat method to get the response
670
+ response = llm.chat(messages)
671
+
672
+ # Print the response
673
+ print("AI: ", response)
662
674
  ```
675
+ ### `LLM` with internet
676
+ ```python
677
+ from __future__ import annotations
678
+ from typing import List, Optional
679
+
680
+ from webscout import LLM
681
+ from webscout import WEBS
682
+ import warnings
683
+
684
+ system_message: str = (
685
+ "As AI, you possess internet access and are capable of executing real-time web searches based on user inputs. "
686
+ "You shall utilize this capability to enrich conversations, offer informed insights, and augment your ability to "
687
+ "respond accurately and thoroughly. However, refrain from stating 'You have provided a list of strings,' ensuring "
688
+ "seamless interactions with users. Embrace a responsive demeanor, harnessing available online resources to address "
689
+ "queries, share pertinent content, and facilitate meaningful exchanges. By doing so, you create value through "
690
+ "connection and engagement, ultimately enhancing overall user satisfaction and experience. Additionally, "
691
+ "continue upholding the principles of respect, impartiality, and intellectual integrity throughout all interactions."
692
+ )
693
+
694
+ # Ignore the specific UserWarning
695
+ warnings.filterwarnings("ignore", category=UserWarning, module="curl_cffi.aio", lineno=205)
696
+ LLM = LLM(model="meta-llama/Meta-Llama-3-70B-Instruct", system_message=system_message)
697
+
698
+
699
+ def chat(
700
+ user_input: str, webs: WEBS, max_results: int = 10
701
+ ) -> Optional[str]:
702
+ """
703
+ Chat function to perform a web search based on the user input and generate a response using the LLM model.
704
+
705
+ Parameters
706
+ ----------
707
+ user_input : str
708
+ The user input to be used for the web search
709
+ webs : WEBS
710
+ The web search instance to be used to perform the search
711
+ max_results : int, optional
712
+ The maximum number of search results to include in the response, by default 10
713
+
714
+ Returns
715
+ -------
716
+ Optional[str]
717
+ The response generated by the LLM model, or None if there is no response
718
+ """
719
+ # Perform a web search based on the user input
720
+ search_results: List[str] = []
721
+ for r in webs.text(
722
+ user_input, region="wt-wt", safesearch="off", timelimit="y", max_results=max_results
723
+ ):
724
+ search_results.append(str(r)) # Convert each result to a string
725
+
726
+ # Define the messages to be sent, including the user input, search results, and system message
727
+ messages = [
728
+ {"role": "user", "content": user_input + "\n" + "websearch results are:" + "\n".join(search_results)},
729
+ ]
730
+
731
+ # Use the chat method to get the response
732
+ response = LLM.chat(messages)
733
+
734
+ return response
735
+
736
+
737
+ if __name__ == "__main__":
738
+ while True:
739
+ # Get the user input
740
+ user_input = input("User: ")
741
+
742
+ # Perform a web search based on the user input
743
+ with WEBS() as webs:
744
+ response = chat(user_input, webs)
745
+
746
+ # Print the response
747
+ if response:
748
+ print("AI:", response)
749
+ else:
750
+ print("No response")
751
+ ```
@@ -1,16 +1,12 @@
1
1
  from setuptools import setup, find_packages
2
2
 
3
- # version = None
4
- # with open("webscout/version.py") as version_file:
5
- # exec(version_file.read())
6
-
7
3
  with open("README.md", encoding="utf-8") as f:
8
4
  README = f.read()
9
5
 
10
6
  setup(
11
7
  name="webscout",
12
- version="1.3.0",
13
- description="Search for words, documents, images, videos, news, maps and text translation using the Google, DuckDuckGo.com, yep.com, phind.com, you.com, etc Also containes AI models and now can transcribe yt videos",
8
+ version="1.3.2",
9
+ description="Search for words, documents, images, videos, news, maps and text translation using the Google, DuckDuckGo.com, yep.com, phind.com, you.com, etc Also containes AI models, can transcribe yt videos and have TTS support",
14
10
  long_description=README,
15
11
  long_description_content_type="text/markdown",
16
12
  author="OEvortex",