webscout 5.8__py3-none-any.whl → 6.0__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/Provider/Amigo.py +267 -0
- webscout/Provider/ChatHub.py +209 -0
- webscout/Provider/Chatify.py +3 -3
- webscout/Provider/Cloudflare.py +3 -3
- webscout/Provider/DARKAI.py +1 -1
- webscout/Provider/Deepinfra.py +95 -389
- webscout/Provider/Deepseek.py +4 -6
- webscout/Provider/DiscordRocks.py +3 -3
- webscout/Provider/Free2GPT.py +3 -3
- webscout/Provider/OLLAMA.py +4 -4
- webscout/Provider/RUBIKSAI.py +3 -3
- webscout/Provider/TTI/WebSimAI.py +142 -0
- webscout/Provider/TTI/__init__.py +3 -1
- webscout/Provider/TTI/amigo.py +148 -0
- webscout/Provider/TTS/__init__.py +2 -1
- webscout/Provider/TTS/parler.py +108 -0
- webscout/Provider/Youchat.py +4 -5
- webscout/Provider/__init__.py +10 -5
- webscout/Provider/ai4chat.py +3 -2
- webscout/Provider/bagoodex.py +145 -0
- webscout/Provider/bixin.py +3 -3
- webscout/Provider/cleeai.py +3 -3
- webscout/Provider/elmo.py +2 -5
- webscout/Provider/julius.py +6 -40
- webscout/Provider/learnfastai.py +253 -0
- webscout/Provider/llamatutor.py +2 -2
- webscout/Provider/prefind.py +232 -0
- webscout/Provider/promptrefine.py +3 -3
- webscout/Provider/turboseek.py +1 -1
- webscout/Provider/twitterclone.py +25 -41
- webscout/Provider/upstage.py +3 -3
- webscout/Provider/x0gpt.py +6 -6
- webscout/version.py +1 -1
- {webscout-5.8.dist-info → webscout-6.0.dist-info}/METADATA +187 -121
- {webscout-5.8.dist-info → webscout-6.0.dist-info}/RECORD +39 -32
- {webscout-5.8.dist-info → webscout-6.0.dist-info}/WHEEL +1 -1
- webscout/Provider/Poe.py +0 -208
- {webscout-5.8.dist-info → webscout-6.0.dist-info}/LICENSE.md +0 -0
- {webscout-5.8.dist-info → webscout-6.0.dist-info}/entry_points.txt +0 -0
- {webscout-5.8.dist-info → webscout-6.0.dist-info}/top_level.txt +0 -0
|
@@ -149,45 +149,31 @@ class AIUncensored(Provider):
|
|
|
149
149
|
|
|
150
150
|
|
|
151
151
|
def for_stream():
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
if decoded_line:
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
if content
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
except json.JSONDecodeError:
|
|
175
|
-
if data_str != "[DONE]":
|
|
176
|
-
return None
|
|
177
|
-
else:
|
|
178
|
-
|
|
179
|
-
raise exceptions.FailedToGenerateResponseError(
|
|
180
|
-
f"Request failed with status code: {response.status_code}"
|
|
181
|
-
)
|
|
182
|
-
self.last_response = {"text": full_content}
|
|
183
|
-
|
|
152
|
+
with requests.post(self.api_endpoint, headers=self.headers, json=payload, stream=True, timeout=self.timeout) as response:
|
|
153
|
+
|
|
154
|
+
if response.status_code == 200:
|
|
155
|
+
full_content = ''
|
|
156
|
+
for line in response.iter_lines():
|
|
157
|
+
decoded_line = line.decode('utf-8').strip()
|
|
158
|
+
if decoded_line:
|
|
159
|
+
|
|
160
|
+
if decoded_line == "data: [DONE]":
|
|
161
|
+
|
|
162
|
+
break
|
|
163
|
+
if decoded_line.startswith("data: "):
|
|
164
|
+
data_str = decoded_line[len("data: "):]
|
|
165
|
+
try:
|
|
166
|
+
data_json = json.loads(data_str)
|
|
167
|
+
content = data_json.get("data", "")
|
|
168
|
+
if content:
|
|
169
|
+
full_content += content
|
|
170
|
+
yield content if raw else dict(text=content)
|
|
171
|
+
except json.JSONDecodeError:
|
|
172
|
+
raise Exception
|
|
173
|
+
self.last_response.update(dict(text=full_content))
|
|
184
174
|
self.conversation.update_chat_history(
|
|
185
175
|
prompt, self.get_message(self.last_response)
|
|
186
176
|
)
|
|
187
|
-
except requests.exceptions.RequestException as e:
|
|
188
|
-
|
|
189
|
-
raise exceptions.FailedToGenerateResponseError(f"An error occurred: {e}")
|
|
190
|
-
|
|
191
177
|
def for_non_stream():
|
|
192
178
|
|
|
193
179
|
for _ in for_stream():
|
|
@@ -252,9 +238,7 @@ class AIUncensored(Provider):
|
|
|
252
238
|
|
|
253
239
|
if __name__ == "__main__":
|
|
254
240
|
from rich import print
|
|
255
|
-
ai = AIUncensored()
|
|
256
|
-
|
|
257
|
-
response = ai.chat(user_input)
|
|
241
|
+
ai = AIUncensored(timeout=5000)
|
|
242
|
+
response = ai.chat("write a poem about AI", stream=True)
|
|
258
243
|
for chunk in response:
|
|
259
|
-
print(chunk, end="", flush=True)
|
|
260
|
-
print() # For a newline after streaming completes
|
|
244
|
+
print(chunk, end="", flush=True)
|
webscout/Provider/upstage.py
CHANGED
|
@@ -159,7 +159,7 @@ class Upstage(Provider):
|
|
|
159
159
|
content = json_data['choices'][0]['delta'].get('content', '')
|
|
160
160
|
if content:
|
|
161
161
|
streaming_response += content
|
|
162
|
-
yield content if raw else dict(text=
|
|
162
|
+
yield content if raw else dict(text=content)
|
|
163
163
|
except json.JSONDecodeError:
|
|
164
164
|
print(f"Error decoding JSON: {data}")
|
|
165
165
|
|
|
@@ -224,7 +224,7 @@ class Upstage(Provider):
|
|
|
224
224
|
return response["text"]
|
|
225
225
|
if __name__ == '__main__':
|
|
226
226
|
from rich import print
|
|
227
|
-
ai = Upstage()
|
|
228
|
-
response = ai.chat("
|
|
227
|
+
ai = Upstage(timeout=5000)
|
|
228
|
+
response = ai.chat("write a poem about AI", stream=True)
|
|
229
229
|
for chunk in response:
|
|
230
230
|
print(chunk, end="", flush=True)
|
webscout/Provider/x0gpt.py
CHANGED
|
@@ -118,13 +118,13 @@ class X0GPT(Provider):
|
|
|
118
118
|
f"Failed to generate response - ({response.status_code}, {response.reason}) - {response.text}"
|
|
119
119
|
)
|
|
120
120
|
streaming_response = ""
|
|
121
|
-
for line in response.iter_lines(decode_unicode=True
|
|
121
|
+
for line in response.iter_lines(decode_unicode=True):
|
|
122
122
|
if line:
|
|
123
123
|
match = re.search(r'0:"(.*?)"', line)
|
|
124
124
|
if match:
|
|
125
125
|
content = match.group(1)
|
|
126
126
|
streaming_response += content
|
|
127
|
-
yield content if raw else dict(text=
|
|
127
|
+
yield content if raw else dict(text=content)
|
|
128
128
|
self.last_response.update(dict(text=streaming_response))
|
|
129
129
|
self.conversation.update_chat_history(
|
|
130
130
|
prompt, self.get_message(self.last_response)
|
|
@@ -152,7 +152,7 @@ class X0GPT(Provider):
|
|
|
152
152
|
for response in self.ask(
|
|
153
153
|
prompt, True, optimizer=optimizer, conversationally=conversationally
|
|
154
154
|
):
|
|
155
|
-
yield self.get_message(response)
|
|
155
|
+
yield self.get_message(response)
|
|
156
156
|
|
|
157
157
|
def for_non_stream():
|
|
158
158
|
return self.get_message(
|
|
@@ -162,7 +162,7 @@ class X0GPT(Provider):
|
|
|
162
162
|
optimizer=optimizer,
|
|
163
163
|
conversationally=conversationally,
|
|
164
164
|
)
|
|
165
|
-
)
|
|
165
|
+
)
|
|
166
166
|
|
|
167
167
|
return for_stream() if stream else for_non_stream()
|
|
168
168
|
|
|
@@ -176,7 +176,7 @@ class X0GPT(Provider):
|
|
|
176
176
|
|
|
177
177
|
if __name__ == "__main__":
|
|
178
178
|
from rich import print
|
|
179
|
-
ai = X0GPT()
|
|
180
|
-
response = ai.chat("
|
|
179
|
+
ai = X0GPT(timeout=5000)
|
|
180
|
+
response = ai.chat("write a poem about AI", stream=True)
|
|
181
181
|
for chunk in response:
|
|
182
182
|
print(chunk, end="", flush=True)
|
webscout/version.py
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
__version__ = "
|
|
1
|
+
__version__ = "6.0"
|
|
2
2
|
__prog__ = "webscout"
|