webscout 6.4__py3-none-any.whl → 6.6__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of webscout might be problematic. Click here for more details.
- webscout/AIutel.py +7 -54
- webscout/DWEBS.py +48 -26
- webscout/{YTdownloader.py → Extra/YTToolkit/YTdownloader.py} +990 -1103
- webscout/Extra/YTToolkit/__init__.py +3 -0
- webscout/{transcriber.py → Extra/YTToolkit/transcriber.py} +1 -1
- webscout/Extra/YTToolkit/ytapi/__init__.py +6 -0
- webscout/Extra/YTToolkit/ytapi/channel.py +307 -0
- webscout/Extra/YTToolkit/ytapi/errors.py +13 -0
- webscout/Extra/YTToolkit/ytapi/extras.py +45 -0
- webscout/Extra/YTToolkit/ytapi/https.py +88 -0
- webscout/Extra/YTToolkit/ytapi/patterns.py +61 -0
- webscout/Extra/YTToolkit/ytapi/playlist.py +59 -0
- webscout/Extra/YTToolkit/ytapi/pool.py +8 -0
- webscout/Extra/YTToolkit/ytapi/query.py +37 -0
- webscout/Extra/YTToolkit/ytapi/stream.py +60 -0
- webscout/Extra/YTToolkit/ytapi/utils.py +62 -0
- webscout/Extra/YTToolkit/ytapi/video.py +102 -0
- webscout/Extra/__init__.py +2 -1
- webscout/Extra/autocoder/autocoder_utiles.py +119 -101
- webscout/Extra/autocoder/rawdog.py +679 -680
- webscout/Extra/gguf.py +441 -441
- webscout/Extra/markdownlite/__init__.py +862 -0
- webscout/Extra/weather_ascii.py +2 -2
- webscout/Provider/AISEARCH/__init__.py +2 -0
- webscout/Provider/AISEARCH/ooai.py +155 -0
- webscout/Provider/Amigo.py +70 -85
- webscout/Provider/{prefind.py → Jadve.py} +72 -70
- webscout/Provider/Netwrck.py +235 -0
- webscout/Provider/Openai.py +4 -3
- webscout/Provider/PI.py +292 -221
- webscout/Provider/PizzaGPT.py +3 -3
- webscout/Provider/Reka.py +0 -1
- webscout/Provider/TTS/__init__.py +5 -1
- webscout/Provider/TTS/deepgram.py +183 -0
- webscout/Provider/TTS/elevenlabs.py +137 -0
- webscout/Provider/TTS/gesserit.py +151 -0
- webscout/Provider/TTS/murfai.py +139 -0
- webscout/Provider/TTS/parler.py +134 -107
- webscout/Provider/TTS/streamElements.py +360 -275
- webscout/Provider/TTS/utils.py +280 -0
- webscout/Provider/TTS/voicepod.py +116 -116
- webscout/Provider/TeachAnything.py +15 -2
- webscout/Provider/Youchat.py +42 -8
- webscout/Provider/__init__.py +8 -21
- webscout/Provider/meta.py +794 -779
- webscout/Provider/multichat.py +230 -0
- webscout/Provider/promptrefine.py +2 -2
- webscout/Provider/talkai.py +10 -13
- webscout/Provider/turboseek.py +5 -4
- webscout/Provider/tutorai.py +8 -112
- webscout/Provider/typegpt.py +5 -7
- webscout/Provider/x0gpt.py +81 -9
- webscout/Provider/yep.py +123 -361
- webscout/__init__.py +33 -28
- webscout/conversation.py +24 -9
- webscout/exceptions.py +188 -20
- webscout/litprinter/__init__.py +719 -831
- webscout/litprinter/colors.py +54 -0
- webscout/optimizers.py +420 -270
- webscout/prompt_manager.py +279 -279
- webscout/scout/__init__.py +8 -0
- webscout/scout/core/__init__.py +7 -0
- webscout/scout/core/crawler.py +140 -0
- webscout/scout/core/scout.py +571 -0
- webscout/scout/core/search_result.py +96 -0
- webscout/scout/core/text_analyzer.py +63 -0
- webscout/scout/core/text_utils.py +277 -0
- webscout/scout/core/web_analyzer.py +52 -0
- webscout/scout/core.py +884 -0
- webscout/scout/element.py +460 -0
- webscout/scout/parsers/__init__.py +69 -0
- webscout/scout/parsers/html5lib_parser.py +172 -0
- webscout/scout/parsers/html_parser.py +236 -0
- webscout/scout/parsers/lxml_parser.py +178 -0
- webscout/scout/utils.py +38 -0
- webscout/update_checker.py +184 -125
- webscout/version.py +1 -1
- webscout/zeroart/__init__.py +55 -0
- webscout/zeroart/base.py +60 -0
- webscout/zeroart/effects.py +99 -0
- webscout/zeroart/fonts.py +816 -0
- webscout/zerodir/__init__.py +225 -0
- {webscout-6.4.dist-info → webscout-6.6.dist-info}/METADATA +18 -231
- webscout-6.6.dist-info/RECORD +197 -0
- webscout-6.6.dist-info/top_level.txt +2 -0
- webstoken/__init__.py +30 -0
- webstoken/classifier.py +189 -0
- webstoken/keywords.py +216 -0
- webstoken/language.py +128 -0
- webstoken/ner.py +164 -0
- webstoken/normalizer.py +35 -0
- webstoken/processor.py +77 -0
- webstoken/sentiment.py +206 -0
- webstoken/stemmer.py +73 -0
- webstoken/t.py +75 -0
- webstoken/tagger.py +60 -0
- webstoken/tokenizer.py +158 -0
- webscout/Agents/Onlinesearcher.py +0 -182
- webscout/Agents/__init__.py +0 -2
- webscout/Agents/functioncall.py +0 -248
- webscout/Bing_search.py +0 -251
- webscout/Provider/Perplexity.py +0 -599
- webscout/Provider/RoboCoders.py +0 -206
- webscout/Provider/genspark.py +0 -225
- webscout/Provider/perplexitylabs.py +0 -265
- webscout/Provider/twitterclone.py +0 -251
- webscout/Provider/upstage.py +0 -230
- webscout/gpt4free.py +0 -666
- webscout/requestsHTMLfix.py +0 -775
- webscout/webai.py +0 -2590
- webscout-6.4.dist-info/RECORD +0 -154
- webscout-6.4.dist-info/top_level.txt +0 -1
- /webscout/Provider/{felo_search.py → AISEARCH/felo_search.py} +0 -0
- {webscout-6.4.dist-info → webscout-6.6.dist-info}/LICENSE.md +0 -0
- {webscout-6.4.dist-info → webscout-6.6.dist-info}/WHEEL +0 -0
- {webscout-6.4.dist-info → webscout-6.6.dist-info}/entry_points.txt +0 -0
webscout/Provider/x0gpt.py
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
from typing import Any, Dict
|
|
2
2
|
from uuid import uuid4
|
|
3
3
|
import requests
|
|
4
|
-
|
|
5
4
|
import re
|
|
6
5
|
|
|
7
6
|
from webscout.AIutel import Optimizers
|
|
@@ -9,10 +8,21 @@ from webscout.AIutel import Conversation
|
|
|
9
8
|
from webscout.AIutel import AwesomePrompts
|
|
10
9
|
from webscout.AIbase import Provider
|
|
11
10
|
from webscout import exceptions
|
|
11
|
+
from webscout.litagent import LitAgent
|
|
12
12
|
|
|
13
13
|
class X0GPT(Provider):
|
|
14
14
|
"""
|
|
15
15
|
A class to interact with the x0-gpt.devwtf.in API.
|
|
16
|
+
|
|
17
|
+
Attributes:
|
|
18
|
+
system_prompt (str): The system prompt to define the assistant's role.
|
|
19
|
+
|
|
20
|
+
Examples:
|
|
21
|
+
>>> from webscout.Provider.x0gpt import X0GPT
|
|
22
|
+
>>> ai = X0GPT()
|
|
23
|
+
>>> response = ai.chat("What's the weather today?")
|
|
24
|
+
>>> print(response)
|
|
25
|
+
'The weather today is sunny with a high of 75°F.'
|
|
16
26
|
"""
|
|
17
27
|
|
|
18
28
|
def __init__(
|
|
@@ -26,9 +36,27 @@ class X0GPT(Provider):
|
|
|
26
36
|
proxies: dict = {},
|
|
27
37
|
history_offset: int = 10250,
|
|
28
38
|
act: str = None,
|
|
39
|
+
system_prompt: str = "You are a helpful assistant."
|
|
29
40
|
):
|
|
30
41
|
"""
|
|
31
42
|
Initializes the X0GPT API with given parameters.
|
|
43
|
+
|
|
44
|
+
Args:
|
|
45
|
+
is_conversation (bool): Whether the provider is in conversation mode.
|
|
46
|
+
max_tokens (int): Maximum number of tokens to sample.
|
|
47
|
+
timeout (int): Timeout for API requests.
|
|
48
|
+
intro (str): Introduction message for the conversation.
|
|
49
|
+
filepath (str): Filepath for storing conversation history.
|
|
50
|
+
update_file (bool): Whether to update the conversation history file.
|
|
51
|
+
proxies (dict): Proxies for the API requests.
|
|
52
|
+
history_offset (int): Offset for conversation history.
|
|
53
|
+
act (str): Act for the conversation.
|
|
54
|
+
system_prompt (str): The system prompt to define the assistant's role.
|
|
55
|
+
|
|
56
|
+
Examples:
|
|
57
|
+
>>> ai = X0GPT(system_prompt="You are a friendly assistant.")
|
|
58
|
+
>>> print(ai.system_prompt)
|
|
59
|
+
'You are a friendly assistant.'
|
|
32
60
|
"""
|
|
33
61
|
self.session = requests.Session()
|
|
34
62
|
self.is_conversation = is_conversation
|
|
@@ -36,6 +64,11 @@ class X0GPT(Provider):
|
|
|
36
64
|
self.api_endpoint = "https://x0-gpt.devwtf.in/api/stream/reply"
|
|
37
65
|
self.timeout = timeout
|
|
38
66
|
self.last_response = {}
|
|
67
|
+
self.system_prompt = system_prompt
|
|
68
|
+
|
|
69
|
+
# Initialize LitAgent for user agent generation
|
|
70
|
+
self.agent = LitAgent()
|
|
71
|
+
|
|
39
72
|
self.headers = {
|
|
40
73
|
"authority": "x0-gpt.devwtf.in",
|
|
41
74
|
"method": "POST",
|
|
@@ -53,10 +86,7 @@ class X0GPT(Provider):
|
|
|
53
86
|
"sec-ch-ua": '"Not)A;Brand";v="99", "Microsoft Edge";v="127", "Chromium";v="127"',
|
|
54
87
|
"sec-ch-ua-mobile": "?0",
|
|
55
88
|
"sec-ch-ua-platform": '"Windows"',
|
|
56
|
-
"
|
|
57
|
-
"sec-fetch-mode": "cors",
|
|
58
|
-
"sec-fetch-site": "same-origin",
|
|
59
|
-
"user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.36 Edg/127.0.0.0"
|
|
89
|
+
"user-agent": self.agent.random() # Use LitAgent to generate a random user agent
|
|
60
90
|
}
|
|
61
91
|
|
|
62
92
|
self.__available_optimizers = (
|
|
@@ -88,6 +118,22 @@ class X0GPT(Provider):
|
|
|
88
118
|
) -> Dict[str, Any]:
|
|
89
119
|
"""
|
|
90
120
|
Sends a prompt to the x0-gpt.devwtf.in API and returns the response.
|
|
121
|
+
|
|
122
|
+
Args:
|
|
123
|
+
prompt (str): The prompt to send to the API.
|
|
124
|
+
stream (bool): Whether to stream the response.
|
|
125
|
+
raw (bool): Whether to return the raw response.
|
|
126
|
+
optimizer (str): Optimizer to use for the prompt.
|
|
127
|
+
conversationally (bool): Whether to generate the prompt conversationally.
|
|
128
|
+
|
|
129
|
+
Returns:
|
|
130
|
+
Dict[str, Any]: The API response.
|
|
131
|
+
|
|
132
|
+
Examples:
|
|
133
|
+
>>> ai = X0GPT()
|
|
134
|
+
>>> response = ai.ask("Tell me a joke!")
|
|
135
|
+
>>> print(response)
|
|
136
|
+
{'text': 'Why did the scarecrow win an award? Because he was outstanding in his field!'}
|
|
91
137
|
"""
|
|
92
138
|
conversation_prompt = self.conversation.gen_complete_prompt(prompt)
|
|
93
139
|
if optimizer:
|
|
@@ -102,10 +148,8 @@ class X0GPT(Provider):
|
|
|
102
148
|
|
|
103
149
|
payload = {
|
|
104
150
|
"messages": [
|
|
105
|
-
{
|
|
106
|
-
|
|
107
|
-
"content": conversation_prompt
|
|
108
|
-
}
|
|
151
|
+
{"role": "system", "content": self.system_prompt},
|
|
152
|
+
{"role": "user", "content": conversation_prompt}
|
|
109
153
|
],
|
|
110
154
|
"chatId": uuid4().hex,
|
|
111
155
|
"namespace": None
|
|
@@ -146,6 +190,21 @@ class X0GPT(Provider):
|
|
|
146
190
|
) -> str:
|
|
147
191
|
"""
|
|
148
192
|
Generates a response from the X0GPT API.
|
|
193
|
+
|
|
194
|
+
Args:
|
|
195
|
+
prompt (str): The prompt to send to the API.
|
|
196
|
+
stream (bool): Whether to stream the response.
|
|
197
|
+
optimizer (str): Optimizer to use for the prompt.
|
|
198
|
+
conversationally (bool): Whether to generate the prompt conversationally.
|
|
199
|
+
|
|
200
|
+
Returns:
|
|
201
|
+
str: The API response.
|
|
202
|
+
|
|
203
|
+
Examples:
|
|
204
|
+
>>> ai = X0GPT()
|
|
205
|
+
>>> response = ai.chat("What's the weather today?")
|
|
206
|
+
>>> print(response)
|
|
207
|
+
'The weather today is sunny with a high of 75°F.'
|
|
149
208
|
"""
|
|
150
209
|
|
|
151
210
|
def for_stream():
|
|
@@ -169,6 +228,19 @@ class X0GPT(Provider):
|
|
|
169
228
|
def get_message(self, response: dict) -> str:
|
|
170
229
|
"""
|
|
171
230
|
Extracts the message from the API response.
|
|
231
|
+
|
|
232
|
+
Args:
|
|
233
|
+
response (dict): The API response.
|
|
234
|
+
|
|
235
|
+
Returns:
|
|
236
|
+
str: The message content.
|
|
237
|
+
|
|
238
|
+
Examples:
|
|
239
|
+
>>> ai = X0GPT()
|
|
240
|
+
>>> response = ai.ask("Tell me a joke!")
|
|
241
|
+
>>> message = ai.get_message(response)
|
|
242
|
+
>>> print(message)
|
|
243
|
+
'Why did the scarecrow win an award? Because he was outstanding in his field!'
|
|
172
244
|
"""
|
|
173
245
|
assert isinstance(response, dict), "Response should be of dict data-type only"
|
|
174
246
|
formatted_text = response["text"].replace('\\n', '\n').replace('\\n\\n', '\n\n')
|