webscout 7.7__py3-none-any.whl → 7.9__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 +2 -1
- webscout/Bard.py +12 -29
- webscout/DWEBS.py +477 -461
- webscout/Extra/__init__.py +2 -0
- webscout/Extra/autocoder/__init__.py +9 -9
- webscout/Extra/autocoder/{rawdog.py → autocoder.py} +849 -790
- webscout/Extra/autocoder/autocoder_utiles.py +332 -194
- webscout/Extra/gguf.py +682 -682
- webscout/Extra/tempmail/__init__.py +26 -0
- webscout/Extra/tempmail/async_utils.py +141 -0
- webscout/Extra/tempmail/base.py +156 -0
- webscout/Extra/tempmail/cli.py +187 -0
- webscout/Extra/tempmail/mail_tm.py +361 -0
- webscout/Extra/tempmail/temp_mail_io.py +292 -0
- webscout/Provider/AI21.py +1 -1
- webscout/Provider/AISEARCH/DeepFind.py +2 -2
- webscout/Provider/AISEARCH/ISou.py +2 -2
- webscout/Provider/AISEARCH/felo_search.py +6 -6
- webscout/Provider/AISEARCH/genspark_search.py +1 -1
- webscout/Provider/Aitopia.py +292 -0
- webscout/Provider/AllenAI.py +1 -1
- webscout/Provider/Andi.py +3 -3
- webscout/Provider/C4ai.py +1 -1
- webscout/Provider/ChatGPTES.py +3 -5
- webscout/Provider/ChatGPTGratis.py +4 -4
- webscout/Provider/Chatify.py +2 -2
- webscout/Provider/Cloudflare.py +3 -2
- webscout/Provider/DeepSeek.py +2 -2
- webscout/Provider/Deepinfra.py +288 -286
- webscout/Provider/ElectronHub.py +709 -634
- webscout/Provider/ExaChat.py +325 -0
- webscout/Provider/Free2GPT.py +2 -2
- webscout/Provider/Gemini.py +167 -179
- webscout/Provider/GithubChat.py +1 -1
- webscout/Provider/Glider.py +4 -4
- webscout/Provider/Groq.py +41 -27
- webscout/Provider/HF_space/qwen_qwen2.py +1 -1
- webscout/Provider/HeckAI.py +1 -1
- webscout/Provider/HuggingFaceChat.py +1 -1
- webscout/Provider/Hunyuan.py +1 -1
- webscout/Provider/Jadve.py +3 -3
- webscout/Provider/Koboldai.py +3 -3
- webscout/Provider/LambdaChat.py +3 -2
- webscout/Provider/Llama.py +3 -5
- webscout/Provider/Llama3.py +4 -12
- webscout/Provider/Marcus.py +3 -3
- webscout/Provider/OLLAMA.py +8 -8
- webscout/Provider/Openai.py +7 -3
- webscout/Provider/PI.py +1 -1
- webscout/Provider/Perplexitylabs.py +1 -1
- webscout/Provider/Phind.py +1 -1
- webscout/Provider/PizzaGPT.py +1 -1
- webscout/Provider/QwenLM.py +4 -7
- webscout/Provider/TTI/FreeAIPlayground/async_freeaiplayground.py +3 -1
- webscout/Provider/TTI/FreeAIPlayground/sync_freeaiplayground.py +3 -3
- webscout/Provider/TTI/ImgSys/__init__.py +23 -0
- webscout/Provider/TTI/ImgSys/async_imgsys.py +202 -0
- webscout/Provider/TTI/ImgSys/sync_imgsys.py +195 -0
- webscout/Provider/TTI/__init__.py +3 -1
- webscout/Provider/TTI/artbit/async_artbit.py +1 -1
- webscout/Provider/TTI/artbit/sync_artbit.py +1 -1
- webscout/Provider/TTI/huggingface/async_huggingface.py +1 -1
- webscout/Provider/TTI/huggingface/sync_huggingface.py +1 -1
- webscout/Provider/TTI/piclumen/__init__.py +22 -22
- webscout/Provider/TTI/piclumen/sync_piclumen.py +232 -232
- webscout/Provider/TTI/pixelmuse/__init__.py +4 -0
- webscout/Provider/TTI/pixelmuse/async_pixelmuse.py +249 -0
- webscout/Provider/TTI/pixelmuse/sync_pixelmuse.py +182 -0
- webscout/Provider/TTI/talkai/sync_talkai.py +1 -1
- webscout/Provider/TTS/utils.py +1 -1
- webscout/Provider/TeachAnything.py +1 -1
- webscout/Provider/TextPollinationsAI.py +232 -230
- webscout/Provider/TwoAI.py +1 -2
- webscout/Provider/Venice.py +4 -2
- webscout/Provider/VercelAI.py +234 -0
- webscout/Provider/WebSim.py +3 -2
- webscout/Provider/WiseCat.py +10 -12
- webscout/Provider/Youchat.py +1 -1
- webscout/Provider/__init__.py +10 -4
- webscout/Provider/ai4chat.py +1 -1
- webscout/Provider/aimathgpt.py +2 -6
- webscout/Provider/akashgpt.py +1 -1
- webscout/Provider/askmyai.py +4 -4
- webscout/Provider/{DARKAI.py → asksteve.py} +56 -77
- webscout/Provider/bagoodex.py +2 -2
- webscout/Provider/cerebras.py +1 -1
- webscout/Provider/chatglm.py +4 -4
- webscout/Provider/cleeai.py +1 -0
- webscout/Provider/copilot.py +21 -9
- webscout/Provider/elmo.py +1 -1
- webscout/Provider/flowith.py +1 -1
- webscout/Provider/freeaichat.py +64 -31
- webscout/Provider/gaurish.py +3 -5
- webscout/Provider/geminiprorealtime.py +1 -1
- webscout/Provider/granite.py +4 -4
- webscout/Provider/hermes.py +5 -5
- webscout/Provider/julius.py +1 -1
- webscout/Provider/koala.py +1 -1
- webscout/Provider/lepton.py +1 -1
- webscout/Provider/llama3mitril.py +4 -4
- webscout/Provider/llamatutor.py +1 -1
- webscout/Provider/llmchat.py +3 -3
- webscout/Provider/meta.py +1 -1
- webscout/Provider/multichat.py +10 -10
- webscout/Provider/promptrefine.py +1 -1
- webscout/Provider/searchchat.py +293 -0
- webscout/Provider/sonus.py +2 -2
- webscout/Provider/talkai.py +2 -2
- webscout/Provider/turboseek.py +1 -1
- webscout/Provider/tutorai.py +1 -1
- webscout/Provider/typegpt.py +5 -42
- webscout/Provider/uncovr.py +312 -297
- webscout/Provider/x0gpt.py +1 -1
- webscout/Provider/yep.py +64 -12
- webscout/__init__.py +3 -1
- webscout/cli.py +59 -98
- webscout/conversation.py +350 -17
- webscout/litprinter/__init__.py +59 -667
- webscout/optimizers.py +419 -419
- webscout/tempid.py +11 -11
- webscout/update_checker.py +14 -12
- webscout/utils.py +2 -2
- webscout/version.py +1 -1
- webscout/webscout_search.py +146 -87
- webscout/webscout_search_async.py +148 -27
- {webscout-7.7.dist-info → webscout-7.9.dist-info}/METADATA +92 -66
- webscout-7.9.dist-info/RECORD +248 -0
- webscout/Provider/EDITEE.py +0 -192
- webscout/litprinter/colors.py +0 -54
- webscout-7.7.dist-info/RECORD +0 -234
- {webscout-7.7.dist-info → webscout-7.9.dist-info}/LICENSE.md +0 -0
- {webscout-7.7.dist-info → webscout-7.9.dist-info}/WHEEL +0 -0
- {webscout-7.7.dist-info → webscout-7.9.dist-info}/entry_points.txt +0 -0
- {webscout-7.7.dist-info → webscout-7.9.dist-info}/top_level.txt +0 -0
|
@@ -1,230 +1,232 @@
|
|
|
1
|
-
import requests
|
|
2
|
-
import json
|
|
3
|
-
from typing import Any, Dict, Generator
|
|
4
|
-
from webscout.AIutel import Optimizers, Conversation, AwesomePrompts
|
|
5
|
-
from webscout.AIbase import Provider
|
|
6
|
-
from webscout import exceptions
|
|
7
|
-
from webscout import LitAgent as Lit
|
|
8
|
-
|
|
9
|
-
class TextPollinationsAI(Provider):
|
|
10
|
-
"""
|
|
11
|
-
A class to interact with the Pollinations AI API.
|
|
12
|
-
"""
|
|
13
|
-
|
|
14
|
-
AVAILABLE_MODELS = [
|
|
15
|
-
"openai",
|
|
16
|
-
"openai-large",
|
|
17
|
-
"openai-reasoning",
|
|
18
|
-
"qwen-coder",
|
|
19
|
-
"llama",
|
|
20
|
-
"mistral",
|
|
21
|
-
"unity",
|
|
22
|
-
"midijourney",
|
|
23
|
-
"rtist",
|
|
24
|
-
"searchgpt",
|
|
25
|
-
"evil",
|
|
26
|
-
|
|
27
|
-
"
|
|
28
|
-
"
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
"gemini",
|
|
33
|
-
"gemini-
|
|
34
|
-
"hormoz",
|
|
35
|
-
"hypnosis-tracy",
|
|
36
|
-
"
|
|
37
|
-
"
|
|
38
|
-
|
|
39
|
-
"
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
"
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
self.
|
|
64
|
-
self.
|
|
65
|
-
self.
|
|
66
|
-
self.
|
|
67
|
-
self.
|
|
68
|
-
self.
|
|
69
|
-
self.
|
|
70
|
-
|
|
71
|
-
self.
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
'
|
|
75
|
-
'
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
self.
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
)
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
)
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
if line
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
content =
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
print("-" * 80)
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
print(f"\r{model:<50} {
|
|
1
|
+
import requests
|
|
2
|
+
import json
|
|
3
|
+
from typing import Union, Any, Dict, Generator
|
|
4
|
+
from webscout.AIutel import Optimizers, Conversation, AwesomePrompts
|
|
5
|
+
from webscout.AIbase import Provider
|
|
6
|
+
from webscout import exceptions
|
|
7
|
+
from webscout.litagent import LitAgent as Lit
|
|
8
|
+
|
|
9
|
+
class TextPollinationsAI(Provider):
|
|
10
|
+
"""
|
|
11
|
+
A class to interact with the Pollinations AI API.
|
|
12
|
+
"""
|
|
13
|
+
|
|
14
|
+
AVAILABLE_MODELS = [
|
|
15
|
+
"openai", # OpenAI GPT-4o-mini
|
|
16
|
+
"openai-large", # OpenAI GPT-4o
|
|
17
|
+
"openai-reasoning", # OpenAI o3-mini
|
|
18
|
+
"qwen-coder", # Qwen 2.5 Coder 32B
|
|
19
|
+
"llama", # Llama 3.3 70B
|
|
20
|
+
"mistral", # Mistral Small 3
|
|
21
|
+
"unity", # Unity Mistral Large
|
|
22
|
+
"midijourney", # Midijourney
|
|
23
|
+
"rtist", # Rtist
|
|
24
|
+
"searchgpt", # SearchGPT
|
|
25
|
+
"evil", # Evil
|
|
26
|
+
"deepseek-reasoning", # DeepSeek-R1 Distill Qwen 32B
|
|
27
|
+
"deepseek-reasoning-large",# DeepSeek R1 - Llama 70B
|
|
28
|
+
# "llamalight", # Llama 3.1 8B Instruct # >>> NOT WORKING
|
|
29
|
+
"phi", # Phi-4 Instruct
|
|
30
|
+
"llama-vision", # Llama 3.2 11B Vision
|
|
31
|
+
"pixtral", # Pixtral 12B
|
|
32
|
+
"gemini", # Gemini 2.0 Flash
|
|
33
|
+
"gemini-reasoning", # Gemini 2.0 Flash Thinking
|
|
34
|
+
"hormoz", # Hormoz 8b
|
|
35
|
+
"hypnosis-tracy", # Hypnosis Tracy 7B
|
|
36
|
+
"mistral-roblox", # Mistral Roblox on Scaleway
|
|
37
|
+
"roblox-rp", # Roblox Roleplay Assistant
|
|
38
|
+
"deepseek", # DeepSeek-V3
|
|
39
|
+
"qwen-reasoning", # Qwen QWQ 32B - Advanced Reasoning
|
|
40
|
+
"sur", # Sur AI Assistant (Mistral)
|
|
41
|
+
"llama-scaleway", # Llama (Scaleway)
|
|
42
|
+
"openai-audio", # OpenAI GPT-4o-audio-preview
|
|
43
|
+
]
|
|
44
|
+
|
|
45
|
+
def __init__(
|
|
46
|
+
self,
|
|
47
|
+
is_conversation: bool = True,
|
|
48
|
+
max_tokens: int = 8096,
|
|
49
|
+
timeout: int = 30,
|
|
50
|
+
intro: str = None,
|
|
51
|
+
filepath: str = None,
|
|
52
|
+
update_file: bool = True,
|
|
53
|
+
proxies: dict = {},
|
|
54
|
+
history_offset: int = 10250,
|
|
55
|
+
act: str = None,
|
|
56
|
+
model: str = "openai-large",
|
|
57
|
+
system_prompt: str = "You are a helpful AI assistant.",
|
|
58
|
+
):
|
|
59
|
+
"""Initializes the TextPollinationsAI API client."""
|
|
60
|
+
if model not in self.AVAILABLE_MODELS:
|
|
61
|
+
raise ValueError(f"Invalid model: {model}. Choose from: {self.AVAILABLE_MODELS}")
|
|
62
|
+
|
|
63
|
+
self.session = requests.Session()
|
|
64
|
+
self.is_conversation = is_conversation
|
|
65
|
+
self.max_tokens_to_sample = max_tokens
|
|
66
|
+
self.api_endpoint = "https://text.pollinations.ai/openai"
|
|
67
|
+
self.stream_chunk_size = 64
|
|
68
|
+
self.timeout = timeout
|
|
69
|
+
self.last_response = {}
|
|
70
|
+
self.model = model
|
|
71
|
+
self.system_prompt = system_prompt
|
|
72
|
+
|
|
73
|
+
self.headers = {
|
|
74
|
+
'Accept': '*/*',
|
|
75
|
+
'Accept-Language': 'en-US,en;q=0.9',
|
|
76
|
+
'User-Agent': Lit().random(),
|
|
77
|
+
'Content-Type': 'application/json',
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
self.session.headers.update(self.headers)
|
|
81
|
+
self.session.proxies = proxies
|
|
82
|
+
|
|
83
|
+
self.__available_optimizers = (
|
|
84
|
+
method for method in dir(Optimizers)
|
|
85
|
+
if callable(getattr(Optimizers, method)) and not method.startswith("__")
|
|
86
|
+
)
|
|
87
|
+
|
|
88
|
+
Conversation.intro = (
|
|
89
|
+
AwesomePrompts().get_act(
|
|
90
|
+
act, raise_not_found=True, default=None, case_insensitive=True
|
|
91
|
+
)
|
|
92
|
+
if act
|
|
93
|
+
else intro or Conversation.intro
|
|
94
|
+
)
|
|
95
|
+
|
|
96
|
+
self.conversation = Conversation(
|
|
97
|
+
is_conversation, self.max_tokens_to_sample, filepath, update_file
|
|
98
|
+
)
|
|
99
|
+
self.conversation.history_offset = history_offset
|
|
100
|
+
|
|
101
|
+
def ask(
|
|
102
|
+
self,
|
|
103
|
+
prompt: str,
|
|
104
|
+
stream: bool = False,
|
|
105
|
+
raw: bool = False,
|
|
106
|
+
optimizer: str = None,
|
|
107
|
+
conversationally: bool = False,
|
|
108
|
+
) -> Union[Dict[str, Any], Generator[Any, None, None]]:
|
|
109
|
+
"""Chat with AI"""
|
|
110
|
+
conversation_prompt = self.conversation.gen_complete_prompt(prompt)
|
|
111
|
+
if optimizer:
|
|
112
|
+
if optimizer in self.__available_optimizers:
|
|
113
|
+
conversation_prompt = getattr(Optimizers, optimizer)(
|
|
114
|
+
conversation_prompt if conversationally else prompt
|
|
115
|
+
)
|
|
116
|
+
else:
|
|
117
|
+
raise Exception(f"Optimizer is not one of {self.__available_optimizers}")
|
|
118
|
+
|
|
119
|
+
payload = {
|
|
120
|
+
"messages": [
|
|
121
|
+
{"role": "system", "content": self.system_prompt},
|
|
122
|
+
{"role": "user", "content": conversation_prompt}
|
|
123
|
+
],
|
|
124
|
+
"model": self.model,
|
|
125
|
+
"stream": stream,
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
def for_stream():
|
|
129
|
+
response = self.session.post(
|
|
130
|
+
self.api_endpoint,
|
|
131
|
+
headers=self.headers,
|
|
132
|
+
json=payload,
|
|
133
|
+
stream=True,
|
|
134
|
+
timeout=self.timeout
|
|
135
|
+
)
|
|
136
|
+
|
|
137
|
+
if not response.ok:
|
|
138
|
+
raise exceptions.FailedToGenerateResponseError(
|
|
139
|
+
f"Failed to generate response - ({response.status_code}, {response.reason}) - {response.text}"
|
|
140
|
+
)
|
|
141
|
+
|
|
142
|
+
full_response = ""
|
|
143
|
+
for line in response.iter_lines():
|
|
144
|
+
if line:
|
|
145
|
+
line = line.decode('utf-8').strip()
|
|
146
|
+
if line == "data: [DONE]":
|
|
147
|
+
break
|
|
148
|
+
if line.startswith('data: '):
|
|
149
|
+
try:
|
|
150
|
+
json_data = json.loads(line[6:])
|
|
151
|
+
if 'choices' in json_data and len(json_data['choices']) > 0:
|
|
152
|
+
choice = json_data['choices'][0]
|
|
153
|
+
if 'delta' in choice and 'content' in choice['delta']:
|
|
154
|
+
content = choice['delta']['content']
|
|
155
|
+
else:
|
|
156
|
+
content = ""
|
|
157
|
+
full_response += content
|
|
158
|
+
yield content if raw else dict(text=content)
|
|
159
|
+
except json.JSONDecodeError:
|
|
160
|
+
continue
|
|
161
|
+
|
|
162
|
+
self.last_response.update(dict(text=full_response))
|
|
163
|
+
self.conversation.update_chat_history(
|
|
164
|
+
prompt, self.get_message(self.last_response)
|
|
165
|
+
)
|
|
166
|
+
|
|
167
|
+
def for_non_stream():
|
|
168
|
+
for _ in for_stream():
|
|
169
|
+
pass
|
|
170
|
+
return self.last_response
|
|
171
|
+
|
|
172
|
+
return for_stream() if stream else for_non_stream()
|
|
173
|
+
|
|
174
|
+
def chat(
|
|
175
|
+
self,
|
|
176
|
+
prompt: str,
|
|
177
|
+
stream: bool = False,
|
|
178
|
+
optimizer: str = None,
|
|
179
|
+
conversationally: bool = False,
|
|
180
|
+
) -> Union[str, Generator[str, None, None]]:
|
|
181
|
+
"""Generate response as a string"""
|
|
182
|
+
def for_stream():
|
|
183
|
+
for response in self.ask(
|
|
184
|
+
prompt, True, optimizer=optimizer, conversationally=conversationally
|
|
185
|
+
):
|
|
186
|
+
yield self.get_message(response)
|
|
187
|
+
|
|
188
|
+
def for_non_stream():
|
|
189
|
+
return self.get_message(
|
|
190
|
+
self.ask(
|
|
191
|
+
prompt,
|
|
192
|
+
False,
|
|
193
|
+
optimizer=optimizer,
|
|
194
|
+
conversationally=conversationally,
|
|
195
|
+
)
|
|
196
|
+
)
|
|
197
|
+
|
|
198
|
+
return for_stream() if stream else for_non_stream()
|
|
199
|
+
|
|
200
|
+
def get_message(self, response: dict) -> str:
|
|
201
|
+
"""Retrieves message only from response"""
|
|
202
|
+
assert isinstance(response, dict), "Response should be of dict data-type only"
|
|
203
|
+
return response["text"]
|
|
204
|
+
|
|
205
|
+
if __name__ == "__main__":
|
|
206
|
+
print("-" * 80)
|
|
207
|
+
print(f"{'Model':<50} {'Status':<10} {'Response'}")
|
|
208
|
+
print("-" * 80)
|
|
209
|
+
|
|
210
|
+
# Test all available models
|
|
211
|
+
working = 0
|
|
212
|
+
total = len(TextPollinationsAI.AVAILABLE_MODELS)
|
|
213
|
+
|
|
214
|
+
for model in TextPollinationsAI.AVAILABLE_MODELS:
|
|
215
|
+
try:
|
|
216
|
+
test_ai = TextPollinationsAI(model=model, timeout=60)
|
|
217
|
+
response = test_ai.chat("Say 'Hello' in one word", stream=True)
|
|
218
|
+
response_text = ""
|
|
219
|
+
for chunk in response:
|
|
220
|
+
response_text += chunk
|
|
221
|
+
print(f"\r{model:<50} {'Testing...':<10}", end="", flush=True)
|
|
222
|
+
|
|
223
|
+
if response_text and len(response_text.strip()) > 0:
|
|
224
|
+
status = "✓"
|
|
225
|
+
# Truncate response if too long
|
|
226
|
+
display_text = response_text.strip()[:50] + "..." if len(response_text.strip()) > 50 else response_text.strip()
|
|
227
|
+
else:
|
|
228
|
+
status = "✗"
|
|
229
|
+
display_text = "Empty or invalid response"
|
|
230
|
+
print(f"\r{model:<50} {status:<10} {display_text}")
|
|
231
|
+
except Exception as e:
|
|
232
|
+
print(f"\r{model:<50} {'✗':<10} {str(e)}")
|
webscout/Provider/TwoAI.py
CHANGED
|
@@ -8,8 +8,7 @@ from webscout.AIutel import Conversation
|
|
|
8
8
|
from webscout.AIutel import AwesomePrompts, sanitize_stream
|
|
9
9
|
from webscout.AIbase import Provider, AsyncProvider
|
|
10
10
|
from webscout import exceptions
|
|
11
|
-
from webscout import LitAgent
|
|
12
|
-
|
|
11
|
+
from webscout.litagent import LitAgent
|
|
13
12
|
class TwoAI(Provider):
|
|
14
13
|
"""
|
|
15
14
|
A class to interact with the Two AI API with LitAgent user-agent.
|
webscout/Provider/Venice.py
CHANGED
|
@@ -8,7 +8,7 @@ from webscout.AIutel import Conversation
|
|
|
8
8
|
from webscout.AIutel import AwesomePrompts, sanitize_stream
|
|
9
9
|
from webscout.AIbase import Provider
|
|
10
10
|
from webscout import exceptions
|
|
11
|
-
from webscout import LitAgent
|
|
11
|
+
from webscout.litagent import LitAgent
|
|
12
12
|
|
|
13
13
|
class Venice(Provider):
|
|
14
14
|
"""
|
|
@@ -18,7 +18,9 @@ class Venice(Provider):
|
|
|
18
18
|
AVAILABLE_MODELS = [
|
|
19
19
|
"llama-3.3-70b",
|
|
20
20
|
"llama-3.2-3b-akash",
|
|
21
|
-
"qwen2dot5-coder-32b"
|
|
21
|
+
"qwen2dot5-coder-32b",
|
|
22
|
+
"deepseek-coder-v2-lite",
|
|
23
|
+
|
|
22
24
|
]
|
|
23
25
|
|
|
24
26
|
def __init__(
|