webscout 7.5__py3-none-any.whl → 7.7__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/AIauto.py +5 -53
- webscout/AIutel.py +8 -318
- webscout/DWEBS.py +460 -489
- webscout/Extra/YTToolkit/YTdownloader.py +14 -53
- webscout/Extra/YTToolkit/transcriber.py +12 -13
- webscout/Extra/YTToolkit/ytapi/video.py +0 -1
- webscout/Extra/__init__.py +0 -1
- webscout/Extra/autocoder/__init__.py +9 -9
- webscout/Extra/autocoder/autocoder_utiles.py +193 -199
- webscout/Extra/autocoder/rawdog.py +789 -677
- webscout/Extra/gguf.py +682 -428
- webscout/Extra/weather.py +178 -156
- webscout/Extra/weather_ascii.py +70 -17
- webscout/Litlogger/core/logger.py +1 -2
- webscout/Litlogger/handlers/file.py +1 -1
- webscout/Litlogger/styles/formats.py +0 -2
- webscout/Litlogger/utils/detectors.py +0 -1
- webscout/Provider/AISEARCH/DeepFind.py +0 -1
- webscout/Provider/AISEARCH/ISou.py +1 -22
- webscout/Provider/AISEARCH/felo_search.py +0 -1
- webscout/Provider/AllenAI.py +28 -30
- webscout/Provider/C4ai.py +29 -11
- webscout/Provider/ChatGPTClone.py +226 -0
- webscout/Provider/ChatGPTGratis.py +24 -56
- webscout/Provider/DeepSeek.py +25 -17
- webscout/Provider/Deepinfra.py +115 -48
- webscout/Provider/Gemini.py +1 -1
- webscout/Provider/Glider.py +33 -12
- webscout/Provider/HF_space/qwen_qwen2.py +2 -2
- webscout/Provider/HeckAI.py +23 -7
- webscout/Provider/Hunyuan.py +272 -0
- webscout/Provider/Jadve.py +20 -5
- webscout/Provider/LambdaChat.py +391 -0
- webscout/Provider/Netwrck.py +42 -19
- webscout/Provider/OLLAMA.py +256 -32
- webscout/Provider/PI.py +4 -2
- webscout/Provider/Perplexitylabs.py +26 -6
- webscout/Provider/PizzaGPT.py +10 -51
- webscout/Provider/TTI/AiForce/async_aiforce.py +4 -37
- webscout/Provider/TTI/AiForce/sync_aiforce.py +41 -38
- webscout/Provider/TTI/FreeAIPlayground/__init__.py +9 -9
- webscout/Provider/TTI/FreeAIPlayground/async_freeaiplayground.py +179 -206
- webscout/Provider/TTI/FreeAIPlayground/sync_freeaiplayground.py +180 -192
- webscout/Provider/TTI/MagicStudio/__init__.py +2 -0
- webscout/Provider/TTI/MagicStudio/async_magicstudio.py +111 -0
- webscout/Provider/TTI/MagicStudio/sync_magicstudio.py +109 -0
- webscout/Provider/TTI/PollinationsAI/async_pollinations.py +5 -24
- webscout/Provider/TTI/PollinationsAI/sync_pollinations.py +2 -22
- webscout/Provider/TTI/__init__.py +2 -3
- webscout/Provider/TTI/aiarta/async_aiarta.py +14 -14
- webscout/Provider/TTI/aiarta/sync_aiarta.py +52 -21
- webscout/Provider/TTI/artbit/async_artbit.py +3 -32
- webscout/Provider/TTI/artbit/sync_artbit.py +3 -31
- webscout/Provider/TTI/fastflux/__init__.py +22 -0
- webscout/Provider/TTI/fastflux/async_fastflux.py +261 -0
- webscout/Provider/TTI/fastflux/sync_fastflux.py +252 -0
- webscout/Provider/TTI/piclumen/__init__.py +22 -22
- webscout/Provider/TTI/piclumen/sync_piclumen.py +232 -232
- webscout/Provider/TTS/__init__.py +2 -2
- webscout/Provider/TTS/deepgram.py +12 -39
- webscout/Provider/TTS/elevenlabs.py +14 -40
- webscout/Provider/TTS/gesserit.py +11 -35
- webscout/Provider/TTS/murfai.py +13 -39
- webscout/Provider/TTS/parler.py +17 -40
- webscout/Provider/TTS/speechma.py +180 -0
- webscout/Provider/TTS/streamElements.py +17 -44
- webscout/Provider/TextPollinationsAI.py +39 -59
- webscout/Provider/Venice.py +25 -8
- webscout/Provider/WebSim.py +227 -0
- webscout/Provider/WiseCat.py +27 -5
- webscout/Provider/Youchat.py +64 -37
- webscout/Provider/__init__.py +12 -7
- webscout/Provider/akashgpt.py +20 -5
- webscout/Provider/flowith.py +33 -7
- webscout/Provider/freeaichat.py +32 -45
- webscout/Provider/koala.py +20 -5
- webscout/Provider/labyrinth.py +239 -0
- webscout/Provider/learnfastai.py +28 -15
- webscout/Provider/llamatutor.py +1 -1
- webscout/Provider/llmchat.py +30 -8
- webscout/Provider/multichat.py +65 -9
- webscout/Provider/sonus.py +208 -0
- webscout/Provider/talkai.py +1 -0
- webscout/Provider/turboseek.py +3 -0
- webscout/Provider/tutorai.py +2 -0
- webscout/Provider/typegpt.py +155 -65
- webscout/Provider/uncovr.py +297 -0
- webscout/Provider/x0gpt.py +3 -1
- webscout/Provider/yep.py +102 -20
- webscout/__init__.py +3 -0
- webscout/cli.py +53 -40
- webscout/conversation.py +1 -10
- webscout/litagent/__init__.py +2 -2
- webscout/litagent/agent.py +356 -20
- webscout/litagent/constants.py +34 -5
- webscout/litprinter/__init__.py +0 -3
- webscout/models.py +181 -0
- webscout/optimizers.py +1 -1
- webscout/prompt_manager.py +2 -8
- webscout/scout/core/scout.py +1 -4
- webscout/scout/core/search_result.py +1 -1
- webscout/scout/core/text_utils.py +1 -1
- webscout/scout/core.py +2 -5
- webscout/scout/element.py +1 -1
- webscout/scout/parsers/html_parser.py +1 -1
- webscout/scout/utils.py +0 -1
- webscout/swiftcli/__init__.py +1 -3
- webscout/tempid.py +1 -1
- webscout/update_checker.py +1 -3
- webscout/version.py +1 -1
- webscout/webscout_search_async.py +1 -2
- webscout/yep_search.py +297 -297
- {webscout-7.5.dist-info → webscout-7.7.dist-info}/LICENSE.md +4 -4
- {webscout-7.5.dist-info → webscout-7.7.dist-info}/METADATA +127 -405
- {webscout-7.5.dist-info → webscout-7.7.dist-info}/RECORD +118 -117
- webscout/Extra/autollama.py +0 -231
- webscout/Provider/Amigo.py +0 -274
- webscout/Provider/Bing.py +0 -243
- webscout/Provider/DiscordRocks.py +0 -253
- webscout/Provider/TTI/blackbox/__init__.py +0 -4
- webscout/Provider/TTI/blackbox/async_blackbox.py +0 -212
- webscout/Provider/TTI/blackbox/sync_blackbox.py +0 -199
- webscout/Provider/TTI/deepinfra/__init__.py +0 -4
- webscout/Provider/TTI/deepinfra/async_deepinfra.py +0 -227
- webscout/Provider/TTI/deepinfra/sync_deepinfra.py +0 -199
- webscout/Provider/TTI/imgninza/__init__.py +0 -4
- webscout/Provider/TTI/imgninza/async_ninza.py +0 -214
- webscout/Provider/TTI/imgninza/sync_ninza.py +0 -209
- webscout/Provider/TTS/voicepod.py +0 -117
- {webscout-7.5.dist-info → webscout-7.7.dist-info}/WHEEL +0 -0
- {webscout-7.5.dist-info → webscout-7.7.dist-info}/entry_points.txt +0 -0
- {webscout-7.5.dist-info → webscout-7.7.dist-info}/top_level.txt +0 -0
webscout/Provider/Youchat.py
CHANGED
|
@@ -2,6 +2,7 @@ from uuid import uuid4
|
|
|
2
2
|
from re import findall
|
|
3
3
|
import json
|
|
4
4
|
|
|
5
|
+
|
|
5
6
|
from webscout.AIutel import Optimizers
|
|
6
7
|
from webscout.AIutel import Conversation
|
|
7
8
|
from webscout.AIutel import AwesomePrompts, sanitize_stream
|
|
@@ -11,6 +12,7 @@ from typing import Any, AsyncGenerator, Dict
|
|
|
11
12
|
|
|
12
13
|
import cloudscraper
|
|
13
14
|
|
|
15
|
+
|
|
14
16
|
class YouChat(Provider):
|
|
15
17
|
"""
|
|
16
18
|
This class provides methods for interacting with the You.com chat API in a consistent provider structure.
|
|
@@ -18,31 +20,36 @@ class YouChat(Provider):
|
|
|
18
20
|
|
|
19
21
|
# Updated available models based on provided "aiModels" list
|
|
20
22
|
AVAILABLE_MODELS = [
|
|
21
|
-
"
|
|
22
|
-
"
|
|
23
|
-
"
|
|
24
|
-
"
|
|
25
|
-
"
|
|
23
|
+
# "gpt_4_5_preview", #isProOnly": true,
|
|
24
|
+
# "openai_o3_mini_high", #isProOnly": true,
|
|
25
|
+
# "openai_o3_mini_medium", #isProOnly": true,
|
|
26
|
+
# "openai_o1", #isProOnly": true,
|
|
27
|
+
# "openai_o1_preview", #isProOnly": true,
|
|
28
|
+
# "openai_o1_mini", #isProOnly": true,
|
|
26
29
|
"gpt_4o_mini",
|
|
27
30
|
"gpt_4o",
|
|
28
31
|
"gpt_4_turbo",
|
|
29
|
-
"gpt_4",
|
|
30
|
-
"
|
|
31
|
-
"
|
|
32
|
-
"
|
|
32
|
+
# "gpt_4", #isProOnly": true,
|
|
33
|
+
# "claude_3_7_sonnet_thinking", #isProOnly": true,
|
|
34
|
+
# "claude_3_7_sonnet", #isProOnly": true,
|
|
35
|
+
# "claude_3_5_sonnet", #isProOnly": true,
|
|
36
|
+
# "claude_3_opus", #isProOnly": true,
|
|
33
37
|
"claude_3_sonnet",
|
|
34
38
|
"claude_3_5_haiku",
|
|
35
|
-
"
|
|
36
|
-
"
|
|
37
|
-
"
|
|
38
|
-
"
|
|
39
|
+
# "qwq_32b", #isProOnly": true,
|
|
40
|
+
"qwen2p5_72b",
|
|
41
|
+
"qwen2p5_coder_32b",
|
|
42
|
+
# "deepseek_r1", #isProOnly": true,
|
|
43
|
+
# "deepseek_v3", #isProOnly": true,
|
|
44
|
+
"grok_2",
|
|
45
|
+
# "llama3_3_70b", #isProOnly": false, "isAllowedForUserChatModes": false,
|
|
46
|
+
# "llama3_2_90b", #isProOnly": false, "isAllowedForUserChatModes": false,
|
|
39
47
|
"llama3_1_405b",
|
|
40
48
|
"mistral_large_2",
|
|
49
|
+
"gemini_2_flash",
|
|
41
50
|
"gemini_1_5_flash",
|
|
42
51
|
"gemini_1_5_pro",
|
|
43
52
|
"databricks_dbrx_instruct",
|
|
44
|
-
"qwen2p5_72b",
|
|
45
|
-
"qwen2p5_coder_32b",
|
|
46
53
|
"command_r_plus",
|
|
47
54
|
"solar_1_mini",
|
|
48
55
|
"dolphin_2_5"
|
|
@@ -59,7 +66,7 @@ class YouChat(Provider):
|
|
|
59
66
|
proxies: dict = {},
|
|
60
67
|
history_offset: int = 10250,
|
|
61
68
|
act: str = None,
|
|
62
|
-
model: str = "
|
|
69
|
+
model: str = "gemini_2_flash",
|
|
63
70
|
):
|
|
64
71
|
"""Instantiates YouChat
|
|
65
72
|
|
|
@@ -157,30 +164,44 @@ class YouChat(Provider):
|
|
|
157
164
|
f"Optimizer is not one of {self.__available_optimizers}"
|
|
158
165
|
)
|
|
159
166
|
|
|
160
|
-
|
|
161
|
-
|
|
167
|
+
trace_id = str(uuid4())
|
|
168
|
+
conversation_turn_id = str(uuid4())
|
|
169
|
+
|
|
170
|
+
# Updated query parameters to match the new API format
|
|
171
|
+
params = {
|
|
162
172
|
"page": 1,
|
|
163
173
|
"count": 10,
|
|
164
174
|
"safeSearch": "Moderate",
|
|
165
175
|
"mkt": "en-IN",
|
|
166
|
-
"
|
|
176
|
+
"enable_worklow_generation_ux": "true",
|
|
167
177
|
"domain": "youchat",
|
|
168
|
-
"use_personalization_extraction": "
|
|
169
|
-
"
|
|
170
|
-
"
|
|
171
|
-
"
|
|
172
|
-
"conversationTurnId": str(uuid4()),
|
|
178
|
+
"use_personalization_extraction": "true",
|
|
179
|
+
"queryTraceId": trace_id,
|
|
180
|
+
"chatId": trace_id,
|
|
181
|
+
"conversationTurnId": conversation_turn_id,
|
|
173
182
|
"pastChatLength": 0,
|
|
174
|
-
"
|
|
175
|
-
"
|
|
176
|
-
"
|
|
177
|
-
"traceId":
|
|
183
|
+
"selectedChatMode": "custom",
|
|
184
|
+
"selectedAiModel": self.model,
|
|
185
|
+
"enable_agent_clarification_questions": "true",
|
|
186
|
+
"traceId": f"{trace_id}|{conversation_turn_id}|{uuid4()}",
|
|
187
|
+
"use_nested_youchat_updates": "true"
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
# New payload format is JSON
|
|
191
|
+
payload = {
|
|
192
|
+
"query": conversation_prompt,
|
|
178
193
|
"chat": "[]"
|
|
179
194
|
}
|
|
180
195
|
|
|
181
196
|
def for_stream():
|
|
182
|
-
response = self.session.
|
|
183
|
-
self.chat_endpoint,
|
|
197
|
+
response = self.session.post(
|
|
198
|
+
self.chat_endpoint,
|
|
199
|
+
headers=self.headers,
|
|
200
|
+
cookies=self.cookies,
|
|
201
|
+
params=params,
|
|
202
|
+
data=json.dumps(payload),
|
|
203
|
+
stream=True,
|
|
204
|
+
timeout=self.timeout
|
|
184
205
|
)
|
|
185
206
|
if not response.ok:
|
|
186
207
|
raise exceptions.FailedToGenerateResponseError(
|
|
@@ -188,6 +209,8 @@ class YouChat(Provider):
|
|
|
188
209
|
)
|
|
189
210
|
|
|
190
211
|
streaming_text = ""
|
|
212
|
+
found_marker = False # Flag to track if we've passed the '####' marker
|
|
213
|
+
|
|
191
214
|
for value in response.iter_lines(
|
|
192
215
|
decode_unicode=True,
|
|
193
216
|
chunk_size=self.stream_chunk_size,
|
|
@@ -197,11 +220,19 @@ class YouChat(Provider):
|
|
|
197
220
|
if bool(value) and value.startswith('data: ') and 'youChatToken' in value:
|
|
198
221
|
data = json.loads(value[6:])
|
|
199
222
|
token = data.get('youChatToken', '')
|
|
200
|
-
|
|
223
|
+
|
|
224
|
+
# Check if this is the marker with '####'
|
|
225
|
+
if token == '####':
|
|
226
|
+
found_marker = True
|
|
227
|
+
continue # Skip the marker itself
|
|
228
|
+
|
|
229
|
+
# Only process tokens after the marker has been found
|
|
230
|
+
if found_marker and token:
|
|
201
231
|
streaming_text += token
|
|
202
232
|
yield token if raw else dict(text=token)
|
|
203
233
|
except json.decoder.JSONDecodeError:
|
|
204
234
|
pass
|
|
235
|
+
|
|
205
236
|
self.last_response.update(dict(text=streaming_text))
|
|
206
237
|
self.conversation.update_chat_history(
|
|
207
238
|
prompt, self.get_message(self.last_response)
|
|
@@ -252,10 +283,6 @@ class YouChat(Provider):
|
|
|
252
283
|
def get_message(self, response: dict) -> str:
|
|
253
284
|
"""Retrieves message only from response
|
|
254
285
|
|
|
255
|
-
Args:
|
|
256
|
-
response (dict): Response generated by `self.ask`
|
|
257
|
-
|
|
258
|
-
Returns:
|
|
259
286
|
str: Message extracted
|
|
260
287
|
"""
|
|
261
288
|
assert isinstance(response, dict), "Response should be of dict data-type only"
|
|
@@ -264,6 +291,6 @@ class YouChat(Provider):
|
|
|
264
291
|
if __name__ == '__main__':
|
|
265
292
|
from rich import print
|
|
266
293
|
ai = YouChat(timeout=5000)
|
|
267
|
-
response = ai.chat(
|
|
294
|
+
response = ai.chat("hi", stream=True)
|
|
268
295
|
for chunk in response:
|
|
269
|
-
print(chunk, end="", flush=True)
|
|
296
|
+
print(chunk, end="", flush=True)
|
webscout/Provider/__init__.py
CHANGED
|
@@ -23,7 +23,6 @@ from .Llama3 import *
|
|
|
23
23
|
from .DARKAI import *
|
|
24
24
|
from .koala import *
|
|
25
25
|
from .meta import *
|
|
26
|
-
from .DiscordRocks import *
|
|
27
26
|
from .julius import *
|
|
28
27
|
from .Youchat import *
|
|
29
28
|
from .yep import *
|
|
@@ -39,14 +38,12 @@ from .cerebras import *
|
|
|
39
38
|
from .lepton import *
|
|
40
39
|
from .geminiapi import *
|
|
41
40
|
from .elmo import *
|
|
42
|
-
from .Bing import *
|
|
43
41
|
from .GPTWeb import *
|
|
44
42
|
from .Netwrck import Netwrck
|
|
45
43
|
from .llamatutor import *
|
|
46
44
|
from .promptrefine import *
|
|
47
45
|
from .tutorai import *
|
|
48
46
|
from .ChatGPTES import *
|
|
49
|
-
from .Amigo import *
|
|
50
47
|
from .bagoodex import *
|
|
51
48
|
from .aimathgpt import *
|
|
52
49
|
from .gaurish import *
|
|
@@ -81,8 +78,15 @@ from .GithubChat import *
|
|
|
81
78
|
from .copilot import *
|
|
82
79
|
from .C4ai import *
|
|
83
80
|
from .flowith import *
|
|
81
|
+
from .sonus import *
|
|
82
|
+
from .uncovr import *
|
|
83
|
+
from .labyrinth import *
|
|
84
|
+
from .WebSim import *
|
|
85
|
+
from .LambdaChat import *
|
|
86
|
+
from .ChatGPTClone import *
|
|
84
87
|
__all__ = [
|
|
85
88
|
'LLAMA',
|
|
89
|
+
'LabyrinthAI',
|
|
86
90
|
'Flowith',
|
|
87
91
|
'C4ai',
|
|
88
92
|
'Venice',
|
|
@@ -98,7 +102,7 @@ __all__ = [
|
|
|
98
102
|
'IBMGranite',
|
|
99
103
|
'QwenLM',
|
|
100
104
|
'ChatGPTGratis',
|
|
101
|
-
|
|
105
|
+
'LambdaChat',
|
|
102
106
|
'TextPollinationsAI',
|
|
103
107
|
'GliderAI',
|
|
104
108
|
'Cohere',
|
|
@@ -123,7 +127,6 @@ __all__ = [
|
|
|
123
127
|
'KOALA',
|
|
124
128
|
'Meta',
|
|
125
129
|
'AskMyAI',
|
|
126
|
-
'DiscordRocks',
|
|
127
130
|
'PiAI',
|
|
128
131
|
'Julius',
|
|
129
132
|
'YouChat',
|
|
@@ -138,17 +141,17 @@ __all__ = [
|
|
|
138
141
|
'Cerebras',
|
|
139
142
|
'Lepton',
|
|
140
143
|
'GEMINIAPI',
|
|
144
|
+
'SonusAI',
|
|
141
145
|
'Cleeai',
|
|
142
146
|
'Elmo',
|
|
147
|
+
'ChatGPTClone',
|
|
143
148
|
'Free2GPT',
|
|
144
|
-
'Bing',
|
|
145
149
|
'GPTWeb',
|
|
146
150
|
'Netwrck',
|
|
147
151
|
'LlamaTutor',
|
|
148
152
|
'PromptRefine',
|
|
149
153
|
'TutorAI',
|
|
150
154
|
'ChatGPTES',
|
|
151
|
-
'AmigoChat',
|
|
152
155
|
'Bagoodex',
|
|
153
156
|
'AIMathGPT',
|
|
154
157
|
'GaurishCerebras',
|
|
@@ -166,4 +169,6 @@ __all__ = [
|
|
|
166
169
|
'FreeAIChat',
|
|
167
170
|
'ElectronHub',
|
|
168
171
|
'GithubChat',
|
|
172
|
+
'UncovrAI',
|
|
173
|
+
'WebSim',
|
|
169
174
|
]
|
webscout/Provider/akashgpt.py
CHANGED
|
@@ -308,8 +308,23 @@ class AkashGPT(Provider):
|
|
|
308
308
|
return response.get("text", "")
|
|
309
309
|
|
|
310
310
|
if __name__ == "__main__":
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
311
|
+
print("-" * 80)
|
|
312
|
+
print(f"{'Model':<50} {'Status':<10} {'Response'}")
|
|
313
|
+
print("-" * 80)
|
|
314
|
+
|
|
315
|
+
for model in AkashGPT.AVAILABLE_MODELS:
|
|
316
|
+
try:
|
|
317
|
+
test_ai = AkashGPT(model=model, timeout=60)
|
|
318
|
+
response = test_ai.chat("Say 'Hello' in one word")
|
|
319
|
+
response_text = response
|
|
320
|
+
|
|
321
|
+
if response_text and len(response_text.strip()) > 0:
|
|
322
|
+
status = "✓"
|
|
323
|
+
# Truncate response if too long
|
|
324
|
+
display_text = response_text.strip()[:50] + "..." if len(response_text.strip()) > 50 else response_text.strip()
|
|
325
|
+
else:
|
|
326
|
+
status = "✗"
|
|
327
|
+
display_text = "Empty or invalid response"
|
|
328
|
+
print(f"{model:<50} {status:<10} {display_text}")
|
|
329
|
+
except Exception as e:
|
|
330
|
+
print(f"{model:<50} {'✗':<10} {str(e)}")
|
webscout/Provider/flowith.py
CHANGED
|
@@ -109,6 +109,17 @@ class Flowith(Provider):
|
|
|
109
109
|
|
|
110
110
|
return text.strip()
|
|
111
111
|
|
|
112
|
+
def decode_response(self, content):
|
|
113
|
+
"""Try to decode the response content using multiple encodings."""
|
|
114
|
+
encodings = ['utf-8', 'latin1', 'iso-8859-1', 'cp1252']
|
|
115
|
+
for encoding in encodings:
|
|
116
|
+
try:
|
|
117
|
+
return content.decode(encoding)
|
|
118
|
+
except UnicodeDecodeError:
|
|
119
|
+
continue
|
|
120
|
+
# If all encodings fail, try to decode with 'latin1' as it can decode any byte
|
|
121
|
+
return content.decode('latin1')
|
|
122
|
+
|
|
112
123
|
def ask(
|
|
113
124
|
self,
|
|
114
125
|
prompt: str,
|
|
@@ -143,8 +154,8 @@ class Flowith(Provider):
|
|
|
143
154
|
f"Request failed with status code {response.status_code}"
|
|
144
155
|
)
|
|
145
156
|
|
|
146
|
-
# Get the response text
|
|
147
|
-
response_text = response.
|
|
157
|
+
# Get the response text using our multi-encoding decoder
|
|
158
|
+
response_text = self.decode_response(response.content).strip()
|
|
148
159
|
|
|
149
160
|
# Clean the response
|
|
150
161
|
cleaned_text = self.clean_response(response_text)
|
|
@@ -174,8 +185,23 @@ class Flowith(Provider):
|
|
|
174
185
|
return response["text"]
|
|
175
186
|
|
|
176
187
|
if __name__ == "__main__":
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
188
|
+
print("-" * 80)
|
|
189
|
+
print(f"{'Model':<50} {'Status':<10} {'Response'}")
|
|
190
|
+
print("-" * 80)
|
|
191
|
+
|
|
192
|
+
for model in Flowith.AVAILABLE_MODELS:
|
|
193
|
+
try:
|
|
194
|
+
test_ai = Flowith(model=model, timeout=60)
|
|
195
|
+
response = test_ai.chat("Say 'Hello' in one word")
|
|
196
|
+
response_text = response
|
|
197
|
+
|
|
198
|
+
if response_text and len(response_text.strip()) > 0:
|
|
199
|
+
status = "✓"
|
|
200
|
+
# Truncate response if too long
|
|
201
|
+
display_text = response_text.strip()[:50] + "..." if len(response_text.strip()) > 50 else response_text.strip()
|
|
202
|
+
else:
|
|
203
|
+
status = "✗"
|
|
204
|
+
display_text = "Empty or invalid response"
|
|
205
|
+
print(f"{model:<50} {status:<10} {display_text}")
|
|
206
|
+
except Exception as e:
|
|
207
|
+
print(f"{model:<50} {'✗':<10} {str(e)}")
|
webscout/Provider/freeaichat.py
CHANGED
|
@@ -9,11 +9,10 @@ from webscout.AIutel import AwesomePrompts, sanitize_stream
|
|
|
9
9
|
from webscout.AIbase import Provider, AsyncProvider
|
|
10
10
|
from webscout import exceptions
|
|
11
11
|
from webscout import LitAgent
|
|
12
|
-
from webscout.Litlogger import Logger, LogFormat
|
|
13
12
|
|
|
14
13
|
class FreeAIChat(Provider):
|
|
15
14
|
"""
|
|
16
|
-
A class to interact with the FreeAIChat API with
|
|
15
|
+
A class to interact with the FreeAIChat API with LitAgent user-agent.
|
|
17
16
|
"""
|
|
18
17
|
|
|
19
18
|
AVAILABLE_MODELS = [
|
|
@@ -23,10 +22,10 @@ class FreeAIChat(Provider):
|
|
|
23
22
|
"gemini-1.5-pro",
|
|
24
23
|
"gemini-1.5-flash",
|
|
25
24
|
"gemini-2.0-pro-exp-02-05",
|
|
26
|
-
"deepseek-r1",
|
|
25
|
+
# "deepseek-r1", >>>> NOT WORKING
|
|
27
26
|
"deepseek-v3",
|
|
28
|
-
"Deepseek r1 14B",
|
|
29
|
-
"Deepseek r1 32B",
|
|
27
|
+
# "Deepseek r1 14B", >>>> NOT WORKING
|
|
28
|
+
# "Deepseek r1 32B", >>>> NOT WORKING
|
|
30
29
|
"o3-mini-high",
|
|
31
30
|
"o3-mini-medium",
|
|
32
31
|
"o3-mini-low",
|
|
@@ -36,10 +35,10 @@ class FreeAIChat(Provider):
|
|
|
36
35
|
"o1-mini",
|
|
37
36
|
"GPT-4o",
|
|
38
37
|
"Qwen coder",
|
|
39
|
-
"Qwen 2.5 72B",
|
|
38
|
+
# "Qwen 2.5 72B", >>>> NOT WORKING
|
|
40
39
|
"Llama 3.1 405B",
|
|
41
|
-
"llama3.1-70b-fast",
|
|
42
|
-
"Llama 3.3 70B",
|
|
40
|
+
# "llama3.1-70b-fast", >>>> NOT WORKING
|
|
41
|
+
# "Llama 3.3 70B", >>>> NOT WORKING
|
|
43
42
|
"claude 3.5 haiku",
|
|
44
43
|
"claude 3.5 sonnet",
|
|
45
44
|
]
|
|
@@ -57,9 +56,8 @@ class FreeAIChat(Provider):
|
|
|
57
56
|
act: str = None,
|
|
58
57
|
model: str = "GPT-4o",
|
|
59
58
|
system_prompt: str = "You are a helpful AI assistant.",
|
|
60
|
-
logging: bool = False
|
|
61
59
|
):
|
|
62
|
-
"""Initializes the FreeAIChat API client
|
|
60
|
+
"""Initializes the FreeAIChat API client."""
|
|
63
61
|
if model not in self.AVAILABLE_MODELS:
|
|
64
62
|
raise ValueError(f"Invalid model: {model}. Choose from: {self.AVAILABLE_MODELS}")
|
|
65
63
|
|
|
@@ -102,14 +100,6 @@ class FreeAIChat(Provider):
|
|
|
102
100
|
)
|
|
103
101
|
self.conversation.history_offset = history_offset
|
|
104
102
|
|
|
105
|
-
self.logger = Logger(
|
|
106
|
-
name="FreeAIChat",
|
|
107
|
-
format=LogFormat.MODERN_EMOJI,
|
|
108
|
-
) if logging else None
|
|
109
|
-
|
|
110
|
-
if self.logger:
|
|
111
|
-
self.logger.info(f"FreeAIChat initialized successfully with model: {model}")
|
|
112
|
-
|
|
113
103
|
def ask(
|
|
114
104
|
self,
|
|
115
105
|
prompt: str,
|
|
@@ -124,11 +114,7 @@ class FreeAIChat(Provider):
|
|
|
124
114
|
conversation_prompt = getattr(Optimizers, optimizer)(
|
|
125
115
|
conversation_prompt if conversationally else prompt
|
|
126
116
|
)
|
|
127
|
-
if self.logger:
|
|
128
|
-
self.logger.debug(f"Applied optimizer: {optimizer}")
|
|
129
117
|
else:
|
|
130
|
-
if self.logger:
|
|
131
|
-
self.logger.error(f"Invalid optimizer requested: {optimizer}")
|
|
132
118
|
raise Exception(f"Optimizer is not one of {self.__available_optimizers}")
|
|
133
119
|
|
|
134
120
|
messages = [
|
|
@@ -148,13 +134,9 @@ class FreeAIChat(Provider):
|
|
|
148
134
|
}
|
|
149
135
|
|
|
150
136
|
def for_stream():
|
|
151
|
-
if self.logger:
|
|
152
|
-
self.logger.debug("Sending streaming request to FreeAIChat API...")
|
|
153
137
|
try:
|
|
154
138
|
with requests.post(self.url, headers=self.headers, json=payload, stream=True, timeout=self.timeout) as response:
|
|
155
139
|
if response.status_code != 200:
|
|
156
|
-
if self.logger:
|
|
157
|
-
self.logger.error(f"Request failed with status code {response.status_code}")
|
|
158
140
|
raise exceptions.FailedToGenerateResponseError(
|
|
159
141
|
f"Request failed with status code {response.status_code}"
|
|
160
142
|
)
|
|
@@ -177,17 +159,11 @@ class FreeAIChat(Provider):
|
|
|
177
159
|
resp = dict(text=content)
|
|
178
160
|
yield resp if raw else resp
|
|
179
161
|
except json.JSONDecodeError:
|
|
180
|
-
if self.logger:
|
|
181
|
-
self.logger.error("JSON decode error in streaming data")
|
|
182
162
|
pass
|
|
183
163
|
|
|
184
164
|
self.conversation.update_chat_history(prompt, streaming_text)
|
|
185
|
-
if self.logger:
|
|
186
|
-
self.logger.info("Streaming response completed successfully")
|
|
187
165
|
|
|
188
166
|
except requests.RequestException as e:
|
|
189
|
-
if self.logger:
|
|
190
|
-
self.logger.error(f"Request failed: {e}")
|
|
191
167
|
raise exceptions.FailedToGenerateResponseError(f"Request failed: {e}")
|
|
192
168
|
|
|
193
169
|
def for_non_stream():
|
|
@@ -234,18 +210,29 @@ class FreeAIChat(Provider):
|
|
|
234
210
|
except (UnicodeError, AttributeError) as e:
|
|
235
211
|
return text
|
|
236
212
|
return text
|
|
237
|
-
|
|
238
213
|
|
|
239
214
|
if __name__ == "__main__":
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
215
|
+
print("-" * 80)
|
|
216
|
+
print(f"{'Model':<50} {'Status':<10} {'Response'}")
|
|
217
|
+
print("-" * 80)
|
|
218
|
+
|
|
219
|
+
for model in FreeAIChat.AVAILABLE_MODELS:
|
|
220
|
+
try:
|
|
221
|
+
test_ai = FreeAIChat(model=model, timeout=60)
|
|
222
|
+
response = test_ai.chat("Say 'Hello' in one word", stream=True)
|
|
223
|
+
response_text = ""
|
|
224
|
+
for chunk in response:
|
|
225
|
+
response_text += chunk
|
|
226
|
+
print(f"\r{model:<50} {'Testing...':<10}", end="", flush=True)
|
|
227
|
+
|
|
228
|
+
if response_text and len(response_text.strip()) > 0:
|
|
229
|
+
status = "✓"
|
|
230
|
+
# Clean and truncate response
|
|
231
|
+
clean_text = response_text.strip().encode('utf-8', errors='ignore').decode('utf-8')
|
|
232
|
+
display_text = clean_text[:50] + "..." if len(clean_text) > 50 else clean_text
|
|
233
|
+
else:
|
|
234
|
+
status = "✗"
|
|
235
|
+
display_text = "Empty or invalid response"
|
|
236
|
+
print(f"\r{model:<50} {status:<10} {display_text}")
|
|
237
|
+
except Exception as e:
|
|
238
|
+
print(f"\r{model:<50} {'✗':<10} {str(e)}")
|
webscout/Provider/koala.py
CHANGED
|
@@ -246,8 +246,23 @@ class KOALA(Provider):
|
|
|
246
246
|
assert isinstance(response, dict), "Response should be of dict data-type only"
|
|
247
247
|
return response["text"].replace('\\n', '\n').replace('\\n\\n', '\n\n')
|
|
248
248
|
if __name__ == '__main__':
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
249
|
+
print("-" * 80)
|
|
250
|
+
print(f"{'Model':<50} {'Status':<10} {'Response'}")
|
|
251
|
+
print("-" * 80)
|
|
252
|
+
|
|
253
|
+
for model in KOALA.AVAILABLE_MODELS:
|
|
254
|
+
try:
|
|
255
|
+
test_ai = KOALA(model=model, timeout=60)
|
|
256
|
+
response = test_ai.chat("Say 'Hello' in one word")
|
|
257
|
+
response_text = response
|
|
258
|
+
|
|
259
|
+
if response_text and len(response_text.strip()) > 0:
|
|
260
|
+
status = "✓"
|
|
261
|
+
# Truncate response if too long
|
|
262
|
+
display_text = response_text.strip()[:50] + "..." if len(response_text.strip()) > 50 else response_text.strip()
|
|
263
|
+
else:
|
|
264
|
+
status = "✗"
|
|
265
|
+
display_text = "Empty or invalid response"
|
|
266
|
+
print(f"{model:<50} {status:<10} {display_text}")
|
|
267
|
+
except Exception as e:
|
|
268
|
+
print(f"{model:<50} {'✗':<10} {str(e)}")
|