webscout 1.3.3__tar.gz → 1.3.6__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.
- {webscout-1.3.3 → webscout-1.3.6}/DeepWEBS/networks/webpage_fetcher.py +8 -10
- webscout-1.3.6/DeepWEBS/utilsdw/enver.py +78 -0
- {webscout-1.3.3 → webscout-1.3.6}/PKG-INFO +70 -3
- {webscout-1.3.3 → webscout-1.3.6}/README.md +69 -2
- {webscout-1.3.3 → webscout-1.3.6}/setup.py +2 -2
- {webscout-1.3.3 → webscout-1.3.6}/webscout/AI.py +641 -10
- {webscout-1.3.3 → webscout-1.3.6}/webscout/AIutel.py +22 -3
- {webscout-1.3.3 → webscout-1.3.6}/webscout/__init__.py +4 -2
- {webscout-1.3.3 → webscout-1.3.6}/webscout/g4f.py +1 -1
- webscout-1.3.6/webscout/version.py +2 -0
- {webscout-1.3.3 → webscout-1.3.6}/webscout/webai.py +70 -7
- {webscout-1.3.3 → webscout-1.3.6}/webscout.egg-info/PKG-INFO +70 -3
- webscout-1.3.3/DeepWEBS/utilsdw/enver.py +0 -60
- webscout-1.3.3/webscout/version.py +0 -2
- {webscout-1.3.3 → webscout-1.3.6}/DeepWEBS/__init__.py +0 -0
- {webscout-1.3.3 → webscout-1.3.6}/DeepWEBS/documents/__init__.py +0 -0
- {webscout-1.3.3 → webscout-1.3.6}/DeepWEBS/documents/query_results_extractor.py +0 -0
- {webscout-1.3.3 → webscout-1.3.6}/DeepWEBS/documents/webpage_content_extractor.py +0 -0
- {webscout-1.3.3 → webscout-1.3.6}/DeepWEBS/networks/__init__.py +0 -0
- {webscout-1.3.3 → webscout-1.3.6}/DeepWEBS/networks/filepath_converter.py +0 -0
- {webscout-1.3.3 → webscout-1.3.6}/DeepWEBS/networks/google_searcher.py +0 -0
- {webscout-1.3.3 → webscout-1.3.6}/DeepWEBS/networks/network_configs.py +0 -0
- {webscout-1.3.3 → webscout-1.3.6}/DeepWEBS/utilsdw/__init__.py +0 -0
- {webscout-1.3.3 → webscout-1.3.6}/DeepWEBS/utilsdw/logger.py +0 -0
- {webscout-1.3.3 → webscout-1.3.6}/LICENSE.md +0 -0
- {webscout-1.3.3 → webscout-1.3.6}/setup.cfg +0 -0
- {webscout-1.3.3 → webscout-1.3.6}/webscout/AIbase.py +0 -0
- {webscout-1.3.3 → webscout-1.3.6}/webscout/DWEBS.py +0 -0
- {webscout-1.3.3 → webscout-1.3.6}/webscout/HelpingAI.py +0 -0
- {webscout-1.3.3 → webscout-1.3.6}/webscout/LLM.py +0 -0
- {webscout-1.3.3 → webscout-1.3.6}/webscout/__main__.py +0 -0
- {webscout-1.3.3 → webscout-1.3.6}/webscout/cli.py +0 -0
- {webscout-1.3.3 → webscout-1.3.6}/webscout/exceptions.py +0 -0
- {webscout-1.3.3 → webscout-1.3.6}/webscout/models.py +0 -0
- {webscout-1.3.3 → webscout-1.3.6}/webscout/transcriber.py +0 -0
- {webscout-1.3.3 → webscout-1.3.6}/webscout/utils.py +0 -0
- {webscout-1.3.3 → webscout-1.3.6}/webscout/voice.py +0 -0
- {webscout-1.3.3 → webscout-1.3.6}/webscout/webscout_search.py +0 -0
- {webscout-1.3.3 → webscout-1.3.6}/webscout/webscout_search_async.py +0 -0
- {webscout-1.3.3 → webscout-1.3.6}/webscout.egg-info/SOURCES.txt +0 -0
- {webscout-1.3.3 → webscout-1.3.6}/webscout.egg-info/dependency_links.txt +0 -0
- {webscout-1.3.3 → webscout-1.3.6}/webscout.egg-info/entry_points.txt +0 -0
- {webscout-1.3.3 → webscout-1.3.6}/webscout.egg-info/requires.txt +0 -0
- {webscout-1.3.3 → webscout-1.3.6}/webscout.egg-info/top_level.txt +0 -0
|
@@ -78,20 +78,18 @@ class BatchWebpageFetcher:
|
|
|
78
78
|
self.urls = urls
|
|
79
79
|
self.total_count = len(self.urls)
|
|
80
80
|
|
|
81
|
-
with concurrent.futures.
|
|
81
|
+
with concurrent.futures.ProcessPoolExecutor() as executor:
|
|
82
82
|
futures = [
|
|
83
|
-
executor.submit(
|
|
83
|
+
executor.submit(WebpageFetcher().fetch, url, overwrite, output_parent)
|
|
84
84
|
for url in urls
|
|
85
85
|
]
|
|
86
86
|
concurrent.futures.wait(futures)
|
|
87
87
|
|
|
88
|
+
self.url_and_html_path_list = [
|
|
89
|
+
{"url": future.result().url, "html_path": str(future.result().html_path)}
|
|
90
|
+
for future in futures
|
|
91
|
+
]
|
|
92
|
+
|
|
88
93
|
return self.url_and_html_path_list
|
|
89
94
|
|
|
90
|
-
|
|
91
|
-
urls = [
|
|
92
|
-
"https://stackoverflow.com/questions/295135/turn-a-string-into-a-valid-filename",
|
|
93
|
-
"https://www.liaoxuefeng.com/wiki/1016959663602400/1017495723838528",
|
|
94
|
-
"https://docs.python.org/zh-cn/3/tutorial/interpreter.html",
|
|
95
|
-
]
|
|
96
|
-
batch_webpage_fetcher = BatchWebpageFetcher()
|
|
97
|
-
batch_webpage_fetcher.fetch(urls=urls, overwrite=True, output_parent="python tutorials")
|
|
95
|
+
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import json
|
|
2
|
+
import os
|
|
3
|
+
from pathlib import Path
|
|
4
|
+
from typing import Dict, Optional
|
|
5
|
+
|
|
6
|
+
from DeepWEBS.utilsdw.logger import OSLogger
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class OSEnver:
|
|
10
|
+
"""Manages the OS environment variables."""
|
|
11
|
+
|
|
12
|
+
def __init__(self) -> None:
|
|
13
|
+
"""Initializes the OSEnver object."""
|
|
14
|
+
self.envs_stack: list[Dict[str, str]] = []
|
|
15
|
+
self.envs: Dict[str, str] = os.environ.copy()
|
|
16
|
+
|
|
17
|
+
def store_envs(self) -> None:
|
|
18
|
+
"""Stores a copy of the current environment variables on a stack."""
|
|
19
|
+
self.envs_stack.append(self.envs.copy())
|
|
20
|
+
|
|
21
|
+
def restore_envs(self) -> None:
|
|
22
|
+
"""Restores environment variables from the top of the stack."""
|
|
23
|
+
self.envs = self.envs_stack.pop()
|
|
24
|
+
|
|
25
|
+
def set_envs(
|
|
26
|
+
self,
|
|
27
|
+
secrets: bool = True,
|
|
28
|
+
proxies: Optional[str] = None,
|
|
29
|
+
store_envs: bool = True,
|
|
30
|
+
) -> None:
|
|
31
|
+
"""Sets environment variables based on the contents of secrets.json.
|
|
32
|
+
|
|
33
|
+
Args:
|
|
34
|
+
secrets (bool): Whether to load secrets from secrets.json.
|
|
35
|
+
proxies (Optional[str]): Proxy URL to set as environment variable.
|
|
36
|
+
store_envs (bool): Whether to store a copy of the environment variables
|
|
37
|
+
on the stack.
|
|
38
|
+
"""
|
|
39
|
+
if store_envs:
|
|
40
|
+
self.store_envs()
|
|
41
|
+
|
|
42
|
+
if secrets:
|
|
43
|
+
secrets_path = Path(__file__).parents[1] / "secrets.json"
|
|
44
|
+
if secrets_path.exists():
|
|
45
|
+
with open(secrets_path, "r") as rf:
|
|
46
|
+
secrets = json.load(rf)
|
|
47
|
+
else:
|
|
48
|
+
secrets = {}
|
|
49
|
+
|
|
50
|
+
if proxies:
|
|
51
|
+
for proxy_env in ["http_proxy", "https_proxy"]:
|
|
52
|
+
if isinstance(proxies, str):
|
|
53
|
+
self.envs[proxy_env] = proxies
|
|
54
|
+
elif "http_proxy" in secrets.keys():
|
|
55
|
+
self.envs[proxy_env] = secrets["http_proxy"]
|
|
56
|
+
elif os.getenv("http_proxy"):
|
|
57
|
+
self.envs[proxy_env] = os.getenv("http_proxy")
|
|
58
|
+
else:
|
|
59
|
+
continue
|
|
60
|
+
|
|
61
|
+
self.proxy = (
|
|
62
|
+
self.envs.get("all_proxy")
|
|
63
|
+
or self.envs.get("http_proxy")
|
|
64
|
+
or self.envs.get("https_proxy")
|
|
65
|
+
or None
|
|
66
|
+
)
|
|
67
|
+
self.requests_proxies = {
|
|
68
|
+
"http": self.proxy,
|
|
69
|
+
"https": self.proxy,
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
if self.proxy:
|
|
73
|
+
OSLogger().note(f"Using proxy: [{self.proxy}]")
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
enver: OSEnver = OSEnver()
|
|
77
|
+
|
|
78
|
+
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: webscout
|
|
3
|
-
Version: 1.3.
|
|
4
|
-
Summary: Search for
|
|
3
|
+
Version: 1.3.6
|
|
4
|
+
Summary: Search for anything using the Google, DuckDuckGo.com, yep.com, phind.com, you.com, etc Also containes AI models, can transcribe yt videos, have TTS support and now has webai(terminal gpt and open interpeter) support
|
|
5
5
|
Author: OEvortex
|
|
6
6
|
Author-email: helpingai5@gmail.com
|
|
7
7
|
License: HelpingAI Simplified Universal License
|
|
@@ -56,7 +56,7 @@ Requires-Dist: pytest>=7.4.2; extra == "dev"
|
|
|
56
56
|
<a href="#"><img alt="Python version" src="https://img.shields.io/pypi/pyversions/webscout"/></a>
|
|
57
57
|
<a href="https://pepy.tech/project/webscout"><img alt="Downloads" src="https://static.pepy.tech/badge/webscout"></a>
|
|
58
58
|
|
|
59
|
-
Search for
|
|
59
|
+
Search for anything using the Google, DuckDuckGo.com, yep.com, phind.com, you.com, etc Also containes AI models, can transcribe yt videos, have TTS support and now has webai(terminal gpt and open interpeter) support
|
|
60
60
|
|
|
61
61
|
|
|
62
62
|
## Table of Contents
|
|
@@ -97,9 +97,12 @@ Search for words, documents, images, videos, news, maps and text translation usi
|
|
|
97
97
|
- [8. `OpenGPT` - chat With OPENGPT](#8-opengpt---chat-with-opengpt)
|
|
98
98
|
- [9. `KOBOLDIA` -](#9-koboldia--)
|
|
99
99
|
- [10. `Sean` - chat With Sean](#10-sean---chat-with-sean)
|
|
100
|
+
- [11. `Reka` - chat with reka](#11-reka---chat-with-reka)
|
|
101
|
+
- [12. `Cohere` - chat with cohere](#12-cohere---chat-with-cohere)
|
|
100
102
|
- [usage of special .LLM file from webscout (webscout.LLM)](#usage-of-special-llm-file-from-webscout-webscoutllm)
|
|
101
103
|
- [`LLM`](#llm)
|
|
102
104
|
- [`LLM` with internet](#llm-with-internet)
|
|
105
|
+
- [`Webai` - terminal gpt and a open interpeter](#webai---terminal-gpt-and-a-open-interpeter)
|
|
103
106
|
|
|
104
107
|
## Install
|
|
105
108
|
```python
|
|
@@ -696,6 +699,27 @@ response_str = a.chat(prompt)
|
|
|
696
699
|
print(response_str)
|
|
697
700
|
```
|
|
698
701
|
|
|
702
|
+
### 11. `Reka` - chat with reka
|
|
703
|
+
```python
|
|
704
|
+
from webscout.AI import REKA
|
|
705
|
+
|
|
706
|
+
a = REKA(is_conversation=True, max_tokens=8000, timeout=30,api_key="")
|
|
707
|
+
|
|
708
|
+
prompt = "tell me about india"
|
|
709
|
+
response_str = a.chat(prompt)
|
|
710
|
+
print(response_str)
|
|
711
|
+
```
|
|
712
|
+
|
|
713
|
+
### 12. `Cohere` - chat with cohere
|
|
714
|
+
```python
|
|
715
|
+
from webscout.AI import Cohere
|
|
716
|
+
|
|
717
|
+
a = Cohere(is_conversation=True, max_tokens=8000, timeout=30,api_key="")
|
|
718
|
+
|
|
719
|
+
prompt = "tell me about india"
|
|
720
|
+
response_str = a.chat(prompt)
|
|
721
|
+
print(response_str)
|
|
722
|
+
```
|
|
699
723
|
## usage of special .LLM file from webscout (webscout.LLM)
|
|
700
724
|
|
|
701
725
|
### `LLM`
|
|
@@ -801,3 +825,46 @@ if __name__ == "__main__":
|
|
|
801
825
|
else:
|
|
802
826
|
print("No response")
|
|
803
827
|
```
|
|
828
|
+
## `Webai` - terminal gpt and a open interpeter
|
|
829
|
+
|
|
830
|
+
```python
|
|
831
|
+
from webscout.webai import Main
|
|
832
|
+
|
|
833
|
+
def use_rawdog_with_webai(prompt):
|
|
834
|
+
"""
|
|
835
|
+
Wrap the webscout default method in a try-except block to catch any unhandled
|
|
836
|
+
exceptions and print a helpful message.
|
|
837
|
+
"""
|
|
838
|
+
try:
|
|
839
|
+
webai_bot = Main(
|
|
840
|
+
max_tokens=500,
|
|
841
|
+
provider="cohere",
|
|
842
|
+
temperature=0.7,
|
|
843
|
+
top_k=40,
|
|
844
|
+
top_p=0.95,
|
|
845
|
+
model="command-r-plus", # Replace with your desired model
|
|
846
|
+
auth="0zoQbKs1AAgd8WrPBO9CTIGgVvm5ZMbDcCqJOVyl", # Replace with your auth key/value (if needed)
|
|
847
|
+
timeout=30,
|
|
848
|
+
disable_conversation=True,
|
|
849
|
+
filepath=None,
|
|
850
|
+
update_file=True,
|
|
851
|
+
intro=None,
|
|
852
|
+
rawdog=True,
|
|
853
|
+
history_offset=10250,
|
|
854
|
+
awesome_prompt=None,
|
|
855
|
+
proxy_path=None,
|
|
856
|
+
quiet=True
|
|
857
|
+
)
|
|
858
|
+
webai_response = webai_bot.default(prompt)
|
|
859
|
+
except Exception as e:
|
|
860
|
+
print("Unexpected error:", e)
|
|
861
|
+
|
|
862
|
+
|
|
863
|
+
if __name__ == "__main__":
|
|
864
|
+
user_prompt = input("Enter your prompt: ")
|
|
865
|
+
use_rawdog_with_webai(user_prompt)
|
|
866
|
+
|
|
867
|
+
```
|
|
868
|
+
```shell
|
|
869
|
+
python -m webscout.webai webai --provider "phind" --rawdog
|
|
870
|
+
```
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
<a href="#"><img alt="Python version" src="https://img.shields.io/pypi/pyversions/webscout"/></a>
|
|
5
5
|
<a href="https://pepy.tech/project/webscout"><img alt="Downloads" src="https://static.pepy.tech/badge/webscout"></a>
|
|
6
6
|
|
|
7
|
-
Search for
|
|
7
|
+
Search for anything using the Google, DuckDuckGo.com, yep.com, phind.com, you.com, etc Also containes AI models, can transcribe yt videos, have TTS support and now has webai(terminal gpt and open interpeter) support
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
## Table of Contents
|
|
@@ -45,9 +45,12 @@ Search for words, documents, images, videos, news, maps and text translation usi
|
|
|
45
45
|
- [8. `OpenGPT` - chat With OPENGPT](#8-opengpt---chat-with-opengpt)
|
|
46
46
|
- [9. `KOBOLDIA` -](#9-koboldia--)
|
|
47
47
|
- [10. `Sean` - chat With Sean](#10-sean---chat-with-sean)
|
|
48
|
+
- [11. `Reka` - chat with reka](#11-reka---chat-with-reka)
|
|
49
|
+
- [12. `Cohere` - chat with cohere](#12-cohere---chat-with-cohere)
|
|
48
50
|
- [usage of special .LLM file from webscout (webscout.LLM)](#usage-of-special-llm-file-from-webscout-webscoutllm)
|
|
49
51
|
- [`LLM`](#llm)
|
|
50
52
|
- [`LLM` with internet](#llm-with-internet)
|
|
53
|
+
- [`Webai` - terminal gpt and a open interpeter](#webai---terminal-gpt-and-a-open-interpeter)
|
|
51
54
|
|
|
52
55
|
## Install
|
|
53
56
|
```python
|
|
@@ -644,6 +647,27 @@ response_str = a.chat(prompt)
|
|
|
644
647
|
print(response_str)
|
|
645
648
|
```
|
|
646
649
|
|
|
650
|
+
### 11. `Reka` - chat with reka
|
|
651
|
+
```python
|
|
652
|
+
from webscout.AI import REKA
|
|
653
|
+
|
|
654
|
+
a = REKA(is_conversation=True, max_tokens=8000, timeout=30,api_key="")
|
|
655
|
+
|
|
656
|
+
prompt = "tell me about india"
|
|
657
|
+
response_str = a.chat(prompt)
|
|
658
|
+
print(response_str)
|
|
659
|
+
```
|
|
660
|
+
|
|
661
|
+
### 12. `Cohere` - chat with cohere
|
|
662
|
+
```python
|
|
663
|
+
from webscout.AI import Cohere
|
|
664
|
+
|
|
665
|
+
a = Cohere(is_conversation=True, max_tokens=8000, timeout=30,api_key="")
|
|
666
|
+
|
|
667
|
+
prompt = "tell me about india"
|
|
668
|
+
response_str = a.chat(prompt)
|
|
669
|
+
print(response_str)
|
|
670
|
+
```
|
|
647
671
|
## usage of special .LLM file from webscout (webscout.LLM)
|
|
648
672
|
|
|
649
673
|
### `LLM`
|
|
@@ -748,4 +772,47 @@ if __name__ == "__main__":
|
|
|
748
772
|
print("AI:", response)
|
|
749
773
|
else:
|
|
750
774
|
print("No response")
|
|
751
|
-
```
|
|
775
|
+
```
|
|
776
|
+
## `Webai` - terminal gpt and a open interpeter
|
|
777
|
+
|
|
778
|
+
```python
|
|
779
|
+
from webscout.webai import Main
|
|
780
|
+
|
|
781
|
+
def use_rawdog_with_webai(prompt):
|
|
782
|
+
"""
|
|
783
|
+
Wrap the webscout default method in a try-except block to catch any unhandled
|
|
784
|
+
exceptions and print a helpful message.
|
|
785
|
+
"""
|
|
786
|
+
try:
|
|
787
|
+
webai_bot = Main(
|
|
788
|
+
max_tokens=500,
|
|
789
|
+
provider="cohere",
|
|
790
|
+
temperature=0.7,
|
|
791
|
+
top_k=40,
|
|
792
|
+
top_p=0.95,
|
|
793
|
+
model="command-r-plus", # Replace with your desired model
|
|
794
|
+
auth="0zoQbKs1AAgd8WrPBO9CTIGgVvm5ZMbDcCqJOVyl", # Replace with your auth key/value (if needed)
|
|
795
|
+
timeout=30,
|
|
796
|
+
disable_conversation=True,
|
|
797
|
+
filepath=None,
|
|
798
|
+
update_file=True,
|
|
799
|
+
intro=None,
|
|
800
|
+
rawdog=True,
|
|
801
|
+
history_offset=10250,
|
|
802
|
+
awesome_prompt=None,
|
|
803
|
+
proxy_path=None,
|
|
804
|
+
quiet=True
|
|
805
|
+
)
|
|
806
|
+
webai_response = webai_bot.default(prompt)
|
|
807
|
+
except Exception as e:
|
|
808
|
+
print("Unexpected error:", e)
|
|
809
|
+
|
|
810
|
+
|
|
811
|
+
if __name__ == "__main__":
|
|
812
|
+
user_prompt = input("Enter your prompt: ")
|
|
813
|
+
use_rawdog_with_webai(user_prompt)
|
|
814
|
+
|
|
815
|
+
```
|
|
816
|
+
```shell
|
|
817
|
+
python -m webscout.webai webai --provider "phind" --rawdog
|
|
818
|
+
```
|
|
@@ -5,8 +5,8 @@ with open("README.md", encoding="utf-8") as f:
|
|
|
5
5
|
|
|
6
6
|
setup(
|
|
7
7
|
name="webscout",
|
|
8
|
-
version="1.3.
|
|
9
|
-
description="Search for
|
|
8
|
+
version="1.3.6",
|
|
9
|
+
description="Search for anything using the Google, DuckDuckGo.com, yep.com, phind.com, you.com, etc Also containes AI models, can transcribe yt videos, have TTS support and now has webai(terminal gpt and open interpeter) support",
|
|
10
10
|
long_description=README,
|
|
11
11
|
long_description_content_type="text/markdown",
|
|
12
12
|
author="OEvortex",
|