webscout 8.3.5__py3-none-any.whl → 8.3.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.

Files changed (159) hide show
  1. webscout/AIutel.py +2 -0
  2. webscout/Bard.py +12 -6
  3. webscout/DWEBS.py +66 -57
  4. webscout/Provider/{UNFINISHED → AISEARCH}/PERPLEXED_search.py +34 -74
  5. webscout/Provider/AISEARCH/__init__.py +18 -11
  6. webscout/Provider/AISEARCH/scira_search.py +3 -1
  7. webscout/Provider/Aitopia.py +2 -3
  8. webscout/Provider/Andi.py +3 -3
  9. webscout/Provider/ChatGPTClone.py +1 -1
  10. webscout/Provider/ChatSandbox.py +1 -0
  11. webscout/Provider/Cloudflare.py +1 -1
  12. webscout/Provider/Cohere.py +1 -0
  13. webscout/Provider/Deepinfra.py +13 -10
  14. webscout/Provider/ExaAI.py +1 -1
  15. webscout/Provider/ExaChat.py +1 -80
  16. webscout/Provider/Flowith.py +6 -1
  17. webscout/Provider/Gemini.py +7 -5
  18. webscout/Provider/GeminiProxy.py +1 -0
  19. webscout/Provider/GithubChat.py +4 -1
  20. webscout/Provider/Groq.py +1 -1
  21. webscout/Provider/HeckAI.py +8 -4
  22. webscout/Provider/Jadve.py +23 -38
  23. webscout/Provider/K2Think.py +308 -0
  24. webscout/Provider/Koboldai.py +8 -186
  25. webscout/Provider/LambdaChat.py +2 -4
  26. webscout/Provider/Nemotron.py +3 -4
  27. webscout/Provider/Netwrck.py +6 -8
  28. webscout/Provider/OLLAMA.py +1 -0
  29. webscout/Provider/OPENAI/Cloudflare.py +6 -7
  30. webscout/Provider/OPENAI/FalconH1.py +2 -7
  31. webscout/Provider/OPENAI/FreeGemini.py +6 -8
  32. webscout/Provider/OPENAI/{monochat.py → K2Think.py} +180 -77
  33. webscout/Provider/OPENAI/NEMOTRON.py +3 -6
  34. webscout/Provider/OPENAI/PI.py +5 -4
  35. webscout/Provider/OPENAI/Qwen3.py +2 -3
  36. webscout/Provider/OPENAI/README.md +2 -1
  37. webscout/Provider/OPENAI/TogetherAI.py +52 -57
  38. webscout/Provider/OPENAI/TwoAI.py +3 -4
  39. webscout/Provider/OPENAI/__init__.py +17 -56
  40. webscout/Provider/OPENAI/ai4chat.py +313 -303
  41. webscout/Provider/OPENAI/base.py +9 -29
  42. webscout/Provider/OPENAI/chatgpt.py +7 -2
  43. webscout/Provider/OPENAI/chatgptclone.py +4 -7
  44. webscout/Provider/OPENAI/chatsandbox.py +84 -59
  45. webscout/Provider/OPENAI/deepinfra.py +12 -6
  46. webscout/Provider/OPENAI/e2b.py +60 -8
  47. webscout/Provider/OPENAI/flowith.py +4 -3
  48. webscout/Provider/OPENAI/generate_api_key.py +48 -0
  49. webscout/Provider/OPENAI/heckai.py +4 -1
  50. webscout/Provider/OPENAI/netwrck.py +9 -12
  51. webscout/Provider/OPENAI/refact.py +274 -0
  52. webscout/Provider/OPENAI/scirachat.py +6 -0
  53. webscout/Provider/OPENAI/textpollinations.py +3 -14
  54. webscout/Provider/OPENAI/toolbaz.py +14 -10
  55. webscout/Provider/OpenGPT.py +1 -1
  56. webscout/Provider/Openai.py +150 -402
  57. webscout/Provider/PI.py +1 -0
  58. webscout/Provider/Perplexitylabs.py +1 -2
  59. webscout/Provider/QwenLM.py +107 -89
  60. webscout/Provider/STT/__init__.py +17 -2
  61. webscout/Provider/{Llama3.py → Sambanova.py} +9 -10
  62. webscout/Provider/StandardInput.py +1 -1
  63. webscout/Provider/TTI/__init__.py +18 -12
  64. webscout/Provider/TTI/bing.py +14 -2
  65. webscout/Provider/TTI/together.py +10 -9
  66. webscout/Provider/TTS/README.md +0 -1
  67. webscout/Provider/TTS/__init__.py +18 -11
  68. webscout/Provider/TTS/base.py +479 -159
  69. webscout/Provider/TTS/deepgram.py +409 -156
  70. webscout/Provider/TTS/elevenlabs.py +425 -111
  71. webscout/Provider/TTS/freetts.py +317 -140
  72. webscout/Provider/TTS/gesserit.py +192 -128
  73. webscout/Provider/TTS/murfai.py +248 -113
  74. webscout/Provider/TTS/openai_fm.py +347 -129
  75. webscout/Provider/TTS/speechma.py +620 -586
  76. webscout/Provider/TeachAnything.py +1 -0
  77. webscout/Provider/TextPollinationsAI.py +5 -15
  78. webscout/Provider/TogetherAI.py +136 -142
  79. webscout/Provider/TwoAI.py +53 -309
  80. webscout/Provider/TypliAI.py +2 -1
  81. webscout/Provider/{GizAI.py → UNFINISHED/GizAI.py} +1 -1
  82. webscout/Provider/UNFINISHED/VercelAIGateway.py +339 -0
  83. webscout/Provider/Venice.py +2 -1
  84. webscout/Provider/VercelAI.py +1 -0
  85. webscout/Provider/WiseCat.py +2 -1
  86. webscout/Provider/WrDoChat.py +2 -1
  87. webscout/Provider/__init__.py +18 -174
  88. webscout/Provider/ai4chat.py +1 -1
  89. webscout/Provider/akashgpt.py +7 -10
  90. webscout/Provider/cerebras.py +194 -38
  91. webscout/Provider/chatglm.py +170 -83
  92. webscout/Provider/cleeai.py +1 -2
  93. webscout/Provider/deepseek_assistant.py +1 -1
  94. webscout/Provider/elmo.py +1 -1
  95. webscout/Provider/geminiapi.py +1 -1
  96. webscout/Provider/granite.py +1 -1
  97. webscout/Provider/hermes.py +1 -3
  98. webscout/Provider/julius.py +1 -0
  99. webscout/Provider/learnfastai.py +1 -1
  100. webscout/Provider/llama3mitril.py +1 -1
  101. webscout/Provider/llmchat.py +1 -1
  102. webscout/Provider/llmchatco.py +1 -1
  103. webscout/Provider/meta.py +3 -3
  104. webscout/Provider/oivscode.py +2 -2
  105. webscout/Provider/scira_chat.py +51 -124
  106. webscout/Provider/searchchat.py +1 -0
  107. webscout/Provider/sonus.py +1 -1
  108. webscout/Provider/toolbaz.py +15 -11
  109. webscout/Provider/turboseek.py +31 -22
  110. webscout/Provider/typefully.py +2 -1
  111. webscout/Provider/x0gpt.py +1 -0
  112. webscout/Provider/yep.py +2 -1
  113. webscout/conversation.py +22 -20
  114. webscout/sanitize.py +14 -10
  115. webscout/scout/README.md +20 -23
  116. webscout/scout/core/crawler.py +125 -38
  117. webscout/scout/core/scout.py +26 -5
  118. webscout/tempid.py +6 -0
  119. webscout/version.py +1 -1
  120. webscout/webscout_search.py +13 -6
  121. webscout/webscout_search_async.py +10 -8
  122. webscout/yep_search.py +13 -5
  123. {webscout-8.3.5.dist-info → webscout-8.3.7.dist-info}/METADATA +3 -1
  124. {webscout-8.3.5.dist-info → webscout-8.3.7.dist-info}/RECORD +132 -155
  125. webscout/Provider/AllenAI.py +0 -440
  126. webscout/Provider/Blackboxai.py +0 -793
  127. webscout/Provider/FreeGemini.py +0 -250
  128. webscout/Provider/Glider.py +0 -225
  129. webscout/Provider/Hunyuan.py +0 -283
  130. webscout/Provider/MCPCore.py +0 -322
  131. webscout/Provider/MiniMax.py +0 -207
  132. webscout/Provider/OPENAI/BLACKBOXAI.py +0 -1045
  133. webscout/Provider/OPENAI/MiniMax.py +0 -298
  134. webscout/Provider/OPENAI/autoproxy.py +0 -1067
  135. webscout/Provider/OPENAI/c4ai.py +0 -394
  136. webscout/Provider/OPENAI/copilot.py +0 -305
  137. webscout/Provider/OPENAI/glider.py +0 -330
  138. webscout/Provider/OPENAI/mcpcore.py +0 -431
  139. webscout/Provider/OPENAI/multichat.py +0 -378
  140. webscout/Provider/Reka.py +0 -214
  141. webscout/Provider/TTS/sthir.py +0 -94
  142. webscout/Provider/UNFINISHED/fetch_together_models.py +0 -90
  143. webscout/Provider/asksteve.py +0 -220
  144. webscout/Provider/copilot.py +0 -422
  145. webscout/Provider/freeaichat.py +0 -294
  146. webscout/Provider/koala.py +0 -182
  147. webscout/Provider/lmarena.py +0 -198
  148. webscout/Provider/monochat.py +0 -275
  149. webscout/Provider/multichat.py +0 -375
  150. webscout/Provider/scnet.py +0 -244
  151. webscout/Provider/talkai.py +0 -194
  152. /webscout/Provider/{Marcus.py → UNFINISHED/Marcus.py} +0 -0
  153. /webscout/Provider/{Qodo.py → UNFINISHED/Qodo.py} +0 -0
  154. /webscout/Provider/{XenAI.py → UNFINISHED/XenAI.py} +0 -0
  155. /webscout/Provider/{samurai.py → UNFINISHED/samurai.py} +0 -0
  156. {webscout-8.3.5.dist-info → webscout-8.3.7.dist-info}/WHEEL +0 -0
  157. {webscout-8.3.5.dist-info → webscout-8.3.7.dist-info}/entry_points.txt +0 -0
  158. {webscout-8.3.5.dist-info → webscout-8.3.7.dist-info}/licenses/LICENSE.md +0 -0
  159. {webscout-8.3.5.dist-info → webscout-8.3.7.dist-info}/top_level.txt +0 -0
@@ -1,113 +1,248 @@
1
- import time
2
- import requests
3
- import pathlib
4
- import tempfile
5
- from io import BytesIO
6
- from urllib.parse import urlencode
7
- from webscout import exceptions
8
- from webscout.litagent import LitAgent
9
- from concurrent.futures import ThreadPoolExecutor, as_completed
10
- from . import utils
11
- from .base import BaseTTSProvider
12
-
13
- class MurfAITTS(BaseTTSProvider):
14
- """Text-to-speech provider using the MurfAITTS API."""
15
- # Request headers
16
- headers: dict[str, str] = {
17
- "User-Agent": LitAgent().random()
18
- }
19
- all_voices: dict[str, str] = {"Hazel": "en-UK-hazel"}
20
-
21
- def __init__(self, timeout: int = 20, proxies: dict = None):
22
- """Initializes the MurfAITTS TTS client."""
23
- super().__init__()
24
- self.session = requests.Session()
25
- self.session.headers.update(self.headers)
26
- if proxies:
27
- self.session.proxies.update(proxies)
28
- self.timeout = timeout
29
-
30
- def tts(self, text: str, voice: str = "Hazel", verbose:bool = True) -> str:
31
- """Converts text to speech using the MurfAITTS API and saves it to a file."""
32
- assert (
33
- voice in self.all_voices
34
- ), f"Voice '{voice}' not one of [{', '.join(self.all_voices.keys())}]"
35
-
36
- filename = pathlib.Path(tempfile.mktemp(suffix=".mp3", dir=self.temp_dir))
37
-
38
- voice_id = self.all_voices[voice]
39
-
40
- # Split text into sentences
41
- sentences = utils.split_sentences(text)
42
-
43
- # Function to request audio for each chunk
44
- def generate_audio_for_chunk(part_text: str, part_number: int):
45
- while True:
46
- try:
47
- params: dict[str, str] = {
48
- "name": voice_id,
49
- "text": part_text
50
- }
51
- encode_param: str = urlencode(params)
52
- response = self.session.get(f"https://murf.ai/Prod/anonymous-tts/audio?{encode_param}", headers=self.headers, timeout=self.timeout)
53
- response.raise_for_status()
54
-
55
- # Check if the request was successful
56
- if response.ok and response.status_code == 200:
57
- if verbose:
58
- print(f"[debug] Chunk {part_number} processed successfully")
59
- return part_number, response.content
60
- else:
61
- if verbose:
62
- print(f"[debug] No data received for chunk {part_number}. Retrying...")
63
- except requests.RequestException as e:
64
- if verbose:
65
- print(f"[debug] Error for chunk {part_number}: {e}. Retrying...")
66
- time.sleep(1)
67
- try:
68
- # Using ThreadPoolExecutor to handle requests concurrently
69
- with ThreadPoolExecutor() as executor:
70
- futures = {executor.submit(generate_audio_for_chunk, sentence.strip(), chunk_num): chunk_num
71
- for chunk_num, sentence in enumerate(sentences, start=1)}
72
-
73
- # Dictionary to store results with order preserved
74
- audio_chunks = {}
75
-
76
- for future in as_completed(futures):
77
- chunk_num = futures[future]
78
- try:
79
- part_number, audio_data = future.result()
80
- audio_chunks[part_number] = audio_data # Store the audio data in correct sequence
81
- except Exception as e:
82
- if verbose:
83
- print(f"[debug] Failed to generate audio for chunk {chunk_num}: {e}")
84
-
85
- # Combine audio chunks in the correct sequence
86
- combined_audio = BytesIO()
87
- for part_number in sorted(audio_chunks.keys()):
88
- combined_audio.write(audio_chunks[part_number])
89
- if verbose:
90
- print(f"[debug] Added chunk {part_number} to the combined file.")
91
-
92
- # Save the combined audio data to a single file
93
- with open(filename, 'wb') as f:
94
- f.write(combined_audio.getvalue())
95
- if verbose:
96
- print(f"[debug] Final Audio Saved as {filename}")
97
- return filename.as_posix()
98
-
99
- except requests.exceptions.RequestException as e:
100
- if verbose:
101
- print(f"[debug] Failed to perform the operation: {e}")
102
- raise exceptions.FailedToGenerateResponseError(
103
- f"Failed to perform the operation: {e}"
104
- )
105
-
106
- # Example usage
107
- if __name__ == "__main__":
108
- murfai = MurfAITTS()
109
- text = "This is a test of the MurfAITTS text-to-speech API. It supports multiple sentences and advanced logging."
110
-
111
- print("[debug] Generating audio...")
112
- audio_file = murfai.tts(text, voice="Hazel")
113
- print(f"Audio saved to: {audio_file}")
1
+ import time
2
+ import requests
3
+ import pathlib
4
+ import tempfile
5
+ from io import BytesIO
6
+ from urllib.parse import urlencode
7
+ from webscout import exceptions
8
+ from webscout.litagent import LitAgent
9
+ from concurrent.futures import ThreadPoolExecutor, as_completed
10
+ from . import utils
11
+ from .base import BaseTTSProvider
12
+
13
+
14
+ class MurfAITTS(BaseTTSProvider):
15
+ """
16
+ Text-to-speech provider using the MurfAITTS API with OpenAI-compatible interface.
17
+
18
+ This provider follows the OpenAI TTS API structure with support for:
19
+ - Multiple TTS models (gpt-4o-mini-tts, tts-1, tts-1-hd)
20
+ - Multiple voices with OpenAI-style naming
21
+ - Voice instructions for controlling speech aspects
22
+ - Multiple output formats (mp3, wav, aac, flac, opus, pcm)
23
+ - Streaming support
24
+ """
25
+
26
+ # Override supported models for MurfAI (set to None as requested)
27
+ SUPPORTED_MODELS = None
28
+
29
+ # Override supported voices with real MurfAI voice names
30
+ SUPPORTED_VOICES = [
31
+ "Hazel" # English (UK) female voice
32
+ ]
33
+
34
+ # Override supported formats
35
+ SUPPORTED_FORMATS = [
36
+ "mp3", # Default format for MurfAI
37
+ "wav" # Alternative format
38
+ ]
39
+
40
+ # Request headers
41
+ headers: dict[str, str] = {
42
+ "User-Agent": LitAgent().random()
43
+ }
44
+
45
+ # Voice mapping from real names to MurfAI voice IDs
46
+ voice_mapping: dict[str, str] = {
47
+ "Hazel": "en-UK-hazel"
48
+ }
49
+
50
+ def __init__(self, timeout: int = 20, proxies: dict = None):
51
+ """Initializes the MurfAITTS TTS client."""
52
+ super().__init__()
53
+ self.session = requests.Session()
54
+ self.session.headers.update(self.headers)
55
+ if proxies:
56
+ self.session.proxies.update(proxies)
57
+ self.timeout = timeout
58
+
59
+ def tts(self, text: str, voice: str = "Hazel", verbose: bool = False, **kwargs) -> str:
60
+ """
61
+ Converts text to speech using the MurfAITTS API and saves it to a file.
62
+
63
+ Args:
64
+ text (str): The text to convert to speech
65
+ voice (str): The voice to use (default: "Hazel")
66
+ verbose (bool): Whether to print debug information
67
+ **kwargs: Additional parameters (model, response_format, instructions)
68
+
69
+ Returns:
70
+ str: Path to the generated audio file
71
+ """
72
+ # Validate input parameters
73
+ if not text or not isinstance(text, str):
74
+ raise ValueError("Input text must be a non-empty string")
75
+ if len(text) > 10000:
76
+ raise ValueError("Input text exceeds maximum allowed length of 10,000 characters")
77
+
78
+ # Use default voice if not provided
79
+ if voice is None:
80
+ voice = "Hazel"
81
+
82
+ # Validate voice using base class method
83
+ self.validate_voice(voice)
84
+
85
+ # Map real voice name to MurfAI voice ID
86
+ voice_id = self.voice_mapping.get(voice, "en-UK-hazel") # Default to Hazel
87
+
88
+ # Get response format from kwargs or use default
89
+ response_format = kwargs.get('response_format', 'mp3')
90
+ response_format = self.validate_format(response_format)
91
+
92
+ # Create temporary file with appropriate extension
93
+ file_extension = f".{response_format}" if response_format != "pcm" else ".wav"
94
+ filename = pathlib.Path(tempfile.mktemp(suffix=file_extension, dir=self.temp_dir))
95
+
96
+ # Split text into sentences
97
+ sentences = utils.split_sentences(text)
98
+
99
+ # Function to request audio for each chunk
100
+ def generate_audio_for_chunk(part_text: str, part_number: int):
101
+ while True:
102
+ try:
103
+ params: dict[str, str] = {
104
+ "name": voice_id,
105
+ "text": part_text
106
+ }
107
+ encode_param: str = urlencode(params)
108
+ response = self.session.get(f"https://murf.ai/Prod/anonymous-tts/audio?{encode_param}", headers=self.headers, timeout=self.timeout)
109
+ response.raise_for_status()
110
+
111
+ # Check if the request was successful
112
+ if response.ok and response.status_code == 200:
113
+ if verbose:
114
+ print(f"[debug] Chunk {part_number} processed successfully")
115
+ return part_number, response.content
116
+ else:
117
+ if verbose:
118
+ print(f"[debug] No data received for chunk {part_number}. Retrying...")
119
+ except requests.RequestException as e:
120
+ if verbose:
121
+ print(f"[debug] Error for chunk {part_number}: {e}. Retrying...")
122
+ time.sleep(1)
123
+ try:
124
+ # Using ThreadPoolExecutor to handle requests concurrently
125
+ with ThreadPoolExecutor() as executor:
126
+ futures = {executor.submit(generate_audio_for_chunk, sentence.strip(), chunk_num): chunk_num
127
+ for chunk_num, sentence in enumerate(sentences, start=1)}
128
+
129
+ # Dictionary to store results with order preserved
130
+ audio_chunks = {}
131
+
132
+ for future in as_completed(futures):
133
+ chunk_num = futures[future]
134
+ try:
135
+ part_number, audio_data = future.result()
136
+ audio_chunks[part_number] = audio_data # Store the audio data in correct sequence
137
+ except Exception as e:
138
+ if verbose:
139
+ print(f"[debug] Failed to generate audio for chunk {chunk_num}: {e}")
140
+
141
+ # Combine audio chunks in the correct sequence
142
+ combined_audio = BytesIO()
143
+ for part_number in sorted(audio_chunks.keys()):
144
+ combined_audio.write(audio_chunks[part_number])
145
+ if verbose:
146
+ print(f"[debug] Added chunk {part_number} to the combined file.")
147
+
148
+ # Save the combined audio data to a single file
149
+ with open(filename, 'wb') as f:
150
+ f.write(combined_audio.getvalue())
151
+ if verbose:
152
+ print(f"[debug] Final Audio Saved as {filename}")
153
+ return filename.as_posix()
154
+
155
+ except requests.exceptions.RequestException as e:
156
+ if verbose:
157
+ print(f"[debug] Failed to perform the operation: {e}")
158
+ raise exceptions.FailedToGenerateResponseError(
159
+ f"Failed to perform the operation: {e}"
160
+ )
161
+
162
+ def create_speech(
163
+ self,
164
+ input: str,
165
+ model: str = "gpt-4o-mini-tts",
166
+ voice: str = "Hazel",
167
+ response_format: str = "mp3",
168
+ instructions: str = None,
169
+ verbose: bool = False
170
+ ) -> str:
171
+ """
172
+ OpenAI-compatible speech creation interface.
173
+
174
+ Args:
175
+ input (str): The text to convert to speech
176
+ model (str): The TTS model to use
177
+ voice (str): The voice to use
178
+ response_format (str): Audio format
179
+ instructions (str): Voice instructions (not used by MurfAI)
180
+ verbose (bool): Whether to print debug information
181
+
182
+ Returns:
183
+ str: Path to the generated audio file
184
+ """
185
+ return self.tts(
186
+ text=input,
187
+ voice=voice,
188
+ response_format=response_format,
189
+ verbose=verbose
190
+ )
191
+
192
+ def stream_audio(
193
+ self,
194
+ input: str,
195
+ model: str = "gpt-4o-mini-tts",
196
+ voice: str = "Hazel",
197
+ response_format: str = "mp3",
198
+ instructions: str = None,
199
+ chunk_size: int = 1024,
200
+ verbose: bool = False
201
+ ):
202
+ """
203
+ Stream audio response in chunks.
204
+
205
+ Args:
206
+ input (str): The text to convert to speech
207
+ model (str): The TTS model to use
208
+ voice (str): The voice to use
209
+ response_format (str): Audio format
210
+ instructions (str): Voice instructions
211
+ chunk_size (int): Size of audio chunks to yield
212
+ verbose (bool): Whether to print debug information
213
+
214
+ Yields:
215
+ bytes: Audio data chunks
216
+ """
217
+ # Generate the audio file using create_speech
218
+ audio_file = self.create_speech(
219
+ input=input,
220
+ model=model,
221
+ voice=voice,
222
+ response_format=response_format,
223
+ instructions=instructions,
224
+ verbose=verbose
225
+ )
226
+
227
+ # Stream the file in chunks
228
+ with open(audio_file, 'rb') as f:
229
+ while chunk := f.read(chunk_size):
230
+ yield chunk
231
+
232
+ # Example usage
233
+ if __name__ == "__main__":
234
+ murfai = MurfAITTS()
235
+ text = "This is a test of the MurfAITTS text-to-speech API. It supports multiple sentences and advanced logging."
236
+
237
+ print("[debug] Generating audio...")
238
+ try:
239
+ audio_file = murfai.create_speech(
240
+ input=text,
241
+ model="gpt-4o-mini-tts",
242
+ voice="Hazel",
243
+ response_format="mp3",
244
+ verbose=True
245
+ )
246
+ print(f"Audio saved to: {audio_file}")
247
+ except Exception as e:
248
+ print(f"Error: {e}")