webscout 7.9__py3-none-any.whl → 8.1__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 (69) hide show
  1. webscout/Extra/GitToolkit/__init__.py +10 -0
  2. webscout/Extra/GitToolkit/gitapi/__init__.py +12 -0
  3. webscout/Extra/GitToolkit/gitapi/repository.py +195 -0
  4. webscout/Extra/GitToolkit/gitapi/user.py +96 -0
  5. webscout/Extra/GitToolkit/gitapi/utils.py +62 -0
  6. webscout/Extra/YTToolkit/ytapi/video.py +232 -103
  7. webscout/Provider/AISEARCH/DeepFind.py +1 -1
  8. webscout/Provider/AISEARCH/ISou.py +1 -1
  9. webscout/Provider/AISEARCH/__init__.py +6 -1
  10. webscout/Provider/AISEARCH/felo_search.py +1 -1
  11. webscout/Provider/AISEARCH/genspark_search.py +1 -1
  12. webscout/Provider/AISEARCH/hika_search.py +194 -0
  13. webscout/Provider/AISEARCH/iask_search.py +436 -0
  14. webscout/Provider/AISEARCH/monica_search.py +246 -0
  15. webscout/Provider/AISEARCH/scira_search.py +320 -0
  16. webscout/Provider/AISEARCH/webpilotai_search.py +281 -0
  17. webscout/Provider/AllenAI.py +255 -122
  18. webscout/Provider/DeepSeek.py +1 -2
  19. webscout/Provider/Deepinfra.py +17 -9
  20. webscout/Provider/ExaAI.py +261 -0
  21. webscout/Provider/ExaChat.py +8 -1
  22. webscout/Provider/GithubChat.py +2 -1
  23. webscout/Provider/Jadve.py +2 -2
  24. webscout/Provider/Netwrck.py +3 -2
  25. webscout/Provider/OPENAI/__init__.py +17 -0
  26. webscout/Provider/OPENAI/base.py +46 -0
  27. webscout/Provider/OPENAI/c4ai.py +347 -0
  28. webscout/Provider/OPENAI/chatgptclone.py +460 -0
  29. webscout/Provider/OPENAI/deepinfra.py +284 -0
  30. webscout/Provider/OPENAI/exaai.py +419 -0
  31. webscout/Provider/OPENAI/exachat.py +421 -0
  32. webscout/Provider/OPENAI/freeaichat.py +355 -0
  33. webscout/Provider/OPENAI/glider.py +314 -0
  34. webscout/Provider/OPENAI/heckai.py +337 -0
  35. webscout/Provider/OPENAI/llmchatco.py +325 -0
  36. webscout/Provider/OPENAI/netwrck.py +348 -0
  37. webscout/Provider/OPENAI/scirachat.py +459 -0
  38. webscout/Provider/OPENAI/sonus.py +294 -0
  39. webscout/Provider/OPENAI/typegpt.py +361 -0
  40. webscout/Provider/OPENAI/utils.py +211 -0
  41. webscout/Provider/OPENAI/venice.py +428 -0
  42. webscout/Provider/OPENAI/wisecat.py +381 -0
  43. webscout/Provider/OPENAI/x0gpt.py +389 -0
  44. webscout/Provider/OPENAI/yep.py +329 -0
  45. webscout/Provider/OpenGPT.py +199 -0
  46. webscout/Provider/PI.py +39 -24
  47. webscout/Provider/Venice.py +1 -1
  48. webscout/Provider/Youchat.py +326 -296
  49. webscout/Provider/__init__.py +16 -6
  50. webscout/Provider/ai4chat.py +58 -56
  51. webscout/Provider/akashgpt.py +34 -22
  52. webscout/Provider/freeaichat.py +1 -1
  53. webscout/Provider/labyrinth.py +121 -20
  54. webscout/Provider/llmchatco.py +306 -0
  55. webscout/Provider/scira_chat.py +274 -0
  56. webscout/Provider/typefully.py +280 -0
  57. webscout/Provider/typegpt.py +3 -184
  58. webscout/prompt_manager.py +2 -1
  59. webscout/version.py +1 -1
  60. webscout/webscout_search.py +118 -54
  61. webscout/webscout_search_async.py +109 -45
  62. webscout-8.1.dist-info/METADATA +683 -0
  63. {webscout-7.9.dist-info → webscout-8.1.dist-info}/RECORD +67 -33
  64. webscout/Provider/flowith.py +0 -207
  65. webscout-7.9.dist-info/METADATA +0 -995
  66. {webscout-7.9.dist-info → webscout-8.1.dist-info}/LICENSE.md +0 -0
  67. {webscout-7.9.dist-info → webscout-8.1.dist-info}/WHEEL +0 -0
  68. {webscout-7.9.dist-info → webscout-8.1.dist-info}/entry_points.txt +0 -0
  69. {webscout-7.9.dist-info → webscout-8.1.dist-info}/top_level.txt +0 -0
@@ -1,995 +0,0 @@
1
- Metadata-Version: 2.1
2
- Name: webscout
3
- Version: 7.9
4
- Summary: Search for anything using Google, DuckDuckGo, phind.com, Contains AI models, can transcribe yt videos, temporary email and phone number generation, has TTS support, webai (terminal gpt and open interpreter) and offline LLMs and more
5
- Author: OEvortex
6
- Author-email: helpingai5@gmail.com
7
- License: HelpingAI
8
- Project-URL: Source, https://github.com/OE-LUCIFER/Webscout
9
- Project-URL: Tracker, https://github.com/OE-LUCIFER/Webscout/issues
10
- Project-URL: YouTube, https://youtube.com/@OEvortex
11
- Classifier: Development Status :: 5 - Production/Stable
12
- Classifier: Intended Audience :: Developers
13
- Classifier: License :: Other/Proprietary License
14
- Classifier: Operating System :: OS Independent
15
- Classifier: Programming Language :: Python :: 3
16
- Classifier: Programming Language :: Python :: 3.9
17
- Classifier: Programming Language :: Python :: 3.10
18
- Classifier: Programming Language :: Python :: 3.11
19
- Classifier: Programming Language :: Python :: 3.12
20
- Classifier: Programming Language :: Python :: 3.13
21
- Classifier: Programming Language :: Python :: Implementation :: CPython
22
- Classifier: Topic :: Internet :: WWW/HTTP :: Indexing/Search
23
- Classifier: Topic :: Software Development :: Libraries :: Python Modules
24
- Requires-Python: >=3.9
25
- Description-Content-Type: text/markdown
26
- License-File: LICENSE.md
27
- Requires-Dist: setuptools
28
- Requires-Dist: wheel
29
- Requires-Dist: pip
30
- Requires-Dist: nodriver
31
- Requires-Dist: mistune
32
- Requires-Dist: tenacity
33
- Requires-Dist: curl-cffi
34
- Requires-Dist: nest-asyncio
35
- Requires-Dist: websocket-client
36
- Requires-Dist: colorama
37
- Requires-Dist: rich
38
- Requires-Dist: markdownify
39
- Requires-Dist: requests
40
- Requires-Dist: google-generativeai
41
- Requires-Dist: lxml>=5.2.2
42
- Requires-Dist: termcolor
43
- Requires-Dist: orjson
44
- Requires-Dist: PyYAML
45
- Requires-Dist: ollama
46
- Requires-Dist: pillow
47
- Requires-Dist: bson
48
- Requires-Dist: cloudscraper
49
- Requires-Dist: html5lib
50
- Requires-Dist: aiofiles
51
- Requires-Dist: openai
52
- Requires-Dist: prompt-toolkit
53
- Requires-Dist: primp
54
- Requires-Dist: pyreqwest-impersonate
55
- Requires-Dist: gradio-client
56
- Requires-Dist: psutil
57
- Requires-Dist: aiohttp
58
- Provides-Extra: dev
59
- Requires-Dist: ruff>=0.1.6; extra == "dev"
60
- Requires-Dist: pytest>=7.4.2; extra == "dev"
61
-
62
-
63
- <div align="center">
64
- <a href="https://github.com/OEvortex/Webscout">
65
- <!-- Consider adding a dedicated Webscout logo here if you have one -->
66
- <img src="https://img.shields.io/badge/WebScout-Ultimate%20Toolkit-blue?style=for-the-badge&logo=python&logoColor=white" alt="WebScout Logo">
67
- </a>
68
- <br/>
69
- <h1>Webscout</h1>
70
- <p><strong>Your All-in-One Python Toolkit for Web Search, AI Interaction, Digital Utilities, and More.</strong></p>
71
- <p>
72
- Access diverse search engines, cutting-edge AI models, temporary communication tools, media utilities, developer helpers, and powerful CLI interfaces – all through one unified library.
73
- </p>
74
-
75
- <!-- Badges -->
76
- <p>
77
- <a href="https://pypi.org/project/webscout/"><img src="https://img.shields.io/pypi/v/webscout.svg?style=flat-square&logo=pypi&label=PyPI" alt="PyPI Version"></a>
78
- <a href="https://pepy.tech/project/webscout"><img src="https://static.pepy.tech/badge/webscout/month?style=flat-square" alt="Monthly Downloads"></a>
79
- <a href="https://pepy.tech/project/webscout"><img src="https://static.pepy.tech/badge/webscout?style=flat-square" alt="Total Downloads"></a>
80
- <a href="#"><img src="https://img.shields.io/pypi/pyversions/webscout?style=flat-square&logo=python" alt="Python Version"></a>
81
- <!-- Add License Badge if applicable: <a href="LICENSE"><img src="https://img.shields.io/pypi/l/webscout?style=flat-square" alt="License"></a> -->
82
- <!-- Add Build Status Badge if applicable -->
83
- </p>
84
-
85
- <!-- Social/Support Links -->
86
- <div>
87
- <a href="https://t.me/PyscoutAI"><img alt="Telegram Group" src="https://img.shields.io/badge/Telegram%20Group-2CA5E0?style=for-the-badge&logo=telegram&logoColor=white"></a>
88
- <a href="https://t.me/ANONYMOUS_56788"><img alt="Developer Telegram" src="https://img.shields.io/badge/Developer%20Contact-2CA5E0?style=for-the-badge&logo=telegram&logoColor=white"></a>
89
- <a href="https://youtube.com/@OEvortex"><img alt="YouTube" src="https://img.shields.io/badge/YouTube-FF0000?style=for-the-badge&logo=youtube&logoColor=white"></a>
90
- <a href="https://www.linkedin.com/in/oe-vortex-29a407265/"><img alt="LinkedIn" src="https://img.shields.io/badge/LinkedIn-0077B5?style=for-the-badge&logo=linkedin&logoColor=white"></a>
91
- <a href="https://www.instagram.com/oevortex/"><img alt="Instagram" src="https://img.shields.io/badge/Instagram-E4405F?style=for-the-badge&logo=instagram&logoColor=white"></a>
92
- <a href="https://buymeacoffee.com/oevortex"><img alt="Buy Me A Coffee" src="https://img.shields.io/badge/Buy%20Me%20A%20Coffee-FFDD00?style=for-the-badge&logo=buymeacoffee&logoColor=black"></a>
93
- </div>
94
- </div>
95
-
96
-
97
- ## 🚀 Features
98
-
99
- * **Comprehensive Search:** Leverage Google, DuckDuckGo for diverse search results.
100
- * **AI Powerhouse:** Access and interact with various AI models, including OpenAI, Cohere, and more.
101
- * **[YouTube Toolkit](webscout/Extra/YTToolkit):** Advanced YouTube video and transcript management with multi-language support, versatile downloading, and intelligent data extraction
102
- * **[GitAPI](webscout/Extra/GitToolkit/gitapi):** Powerful GitHub data extraction toolkit for seamless repository and user information retrieval, featuring commit tracking, issue management, and comprehensive user analytics - all without authentication requirements for public data
103
- * **[Tempmail](webscout/Extra/tempmail/README.md) & Temp Number:** Generate temporary email addresses and phone numbers for enhanced privacy.
104
- * **[Text-to-Speech (TTS)](webscout/Provider/TTS/README.md):** Convert text into natural-sounding speech using multiple AI-powered providers like ElevenLabs, StreamElements, and Voicepods.
105
- * **GGUF Conversion & Quantization:** Convert and quantize Hugging Face models to GGUF format.
106
- * **[SwiftCLI](webscout/swiftcli/Readme.md):** A powerful and elegant CLI framework that makes it easy to create beautiful command-line interfaces.
107
- * **[LitPrinter](webscout/litprinter/Readme.md):** Provides beautiful, styled console output with rich formatting and colors
108
- * **[LitLogger](webscout/litlogger/Readme.md):** Simplifies logging with customizable formats and color schemes
109
- * **[LitAgent](webscout/litagent/Readme.md):** Powerful and modern user agent generator that keeps your requests fresh and undetectable
110
- * **[Text-to-Image](webscout/Provider/TTI/README.md):** Generate high-quality images using a wide range of AI art providers
111
- * **[Scout](webscout/scout/README.md):** Advanced web parsing and crawling library with intelligent HTML/XML parsing, web crawling, and Markdown conversion
112
- * **[Awesome Prompts (Act)](webscout/Extra/Act.md):** A curated collection of system prompts designed to transform Webscout into specialized personas, enhancing its ability to assist with specific tasks. Simply prefix your request with the act name or index number to leverage these tailored capabilities.
113
- * **[Weather Tool kit](webscout/Extra/weather.md)** Webscout provides tools to retrieve weather information.
114
- * **[AIsearch](webscout/Provider/AISEARCH)** AI Search Providers offer powerful and flexible AI-powered search Search Engine
115
-
116
- ## ⚙️ Installation
117
-
118
- ```python
119
- pip install -U webscout
120
- ```
121
-
122
- ## 🖥️ CLI Usage
123
-
124
- ```python3
125
- python -m webscout --help
126
- ```
127
-
128
- | Command | Description |
129
- |-------------------------------------------|-------------------------------------------------------------------------------------------------------|
130
- | python -m webscout answers -k Text | CLI function to perform an answers search using Webscout. |
131
- | python -m webscout chat | Interactive AI chat using DuckDuckGo's AI. |
132
- | python -m webscout images -k Text | CLI function to perform an images search using Webscout. |
133
- | python -m webscout maps -k Text | CLI function to perform a maps search using Webscout. |
134
- | python -m webscout news -k Text | CLI function to perform a news search using Webscout. |
135
- | python -m webscout suggestions -k Text | CLI function to perform a suggestions search using Webscout. |
136
- | python -m webscout text -k Text | CLI function to perform a text search using Webscout. |
137
- | python -m webscout translate -k Text | CLI function to perform translate using Webscout. |
138
- | python -m webscout version | A command-line interface command that prints and returns the version of the program. |
139
- | python -m webscout videos -k Text | CLI function to perform a videos search using DuckDuckGo API. |
140
- | python -m webscout weather -l qazigund | CLI function to get weather information for a location using Webscout. |
141
-
142
- ## ✉️ TempMail and VNEngine
143
-
144
- ```python
145
- import json
146
- import asyncio
147
- from webscout import VNEngine
148
- from webscout import TempMail
149
-
150
- async def main():
151
- vn = VNEngine()
152
- countries = vn.get_online_countries()
153
- if countries:
154
- country = countries[0]['country']
155
- numbers = vn.get_country_numbers(country)
156
- if numbers:
157
- number = numbers[0]['full_number']
158
- inbox = vn.get_number_inbox(country, number)
159
-
160
- # Serialize inbox data to JSON string
161
- json_data = json.dumps(inbox, ensure_ascii=False, indent=4)
162
-
163
- # Print with UTF-8 encoding
164
- print(json_data)
165
-
166
- async with TempMail() as client:
167
- domains = await client.get_domains()
168
- print("Available Domains:", domains)
169
- email_response = await client.create_email(alias="testuser")
170
- print("Created Email:", email_response)
171
- messages = await client.get_messages(email_response.email)
172
- print("Messages:", messages)
173
- await client.delete_email(email_response.email, email_response.token)
174
- print("Email Deleted")
175
-
176
- if __name__ == "__main__":
177
- asyncio.run(main())
178
- ```
179
-
180
- ...
181
-
182
- ### 🔍 `YepSearch` - Search using Yep.com
183
-
184
- ```python
185
- from webscout import YepSearch
186
-
187
- # Initialize YepSearch
188
- yep = YepSearch(
189
- timeout=20, # Optional: Set custom timeout
190
- proxies=None, # Optional: Use proxies
191
- verify=True # Optional: SSL verification
192
- )
193
-
194
- # Text Search
195
- text_results = yep.text(
196
- keywords="artificial intelligence",
197
- region="all", # Optional: Region for results
198
- safesearch="moderate", # Optional: "on", "moderate", "off"
199
- max_results=10 # Optional: Limit number of results
200
- )
201
- print(text_results)
202
-
203
- # Image Search
204
- image_results = yep.images(
205
- keywords="nature photography",
206
- region="all",
207
- safesearch="moderate",
208
- max_results=10
209
- )
210
- print(image_results)
211
-
212
-
213
- # Suggestions
214
- suggestions = yep.suggestions("hist")
215
- print(suggestions)
216
- ```
217
-
218
- ## 🔍 GoogleSearch (formerly DWEBS)
219
-
220
- ```python
221
- from webscout import GoogleSearch
222
-
223
- # Initialize GoogleSearch
224
- google = GoogleSearch(
225
- timeout=10, # Optional: Set custom timeout
226
- proxies=None, # Optional: Use proxies
227
- verify=True # Optional: SSL verification
228
- )
229
-
230
- # Text Search
231
- text_results = google.text(
232
- keywords="artificial intelligence",
233
- region="us", # Optional: Region for results
234
- safesearch="moderate", # Optional: "on", "moderate", "off"
235
- max_results=10 # Optional: Limit number of results
236
- )
237
- for result in text_results:
238
- print(f"Title: {result.title}")
239
- print(f"URL: {result.url}")
240
- print(f"Description: {result.description}")
241
- print("---")
242
-
243
- # News Search
244
- news_results = google.news(
245
- keywords="technology trends",
246
- region="us",
247
- safesearch="moderate",
248
- max_results=5
249
- )
250
- for result in news_results:
251
- print(f"Title: {result.title}")
252
- print(f"URL: {result.url}")
253
- print(f"Description: {result.description}")
254
- print("---")
255
-
256
- # Get search suggestions
257
- suggestions = google.suggestions("how to")
258
- print(suggestions)
259
-
260
- # Legacy usage is still supported
261
- from webscout import search
262
- results = search("Python programming", num_results=5)
263
- for url in results:
264
- print(url)
265
- ```
266
-
267
- ## 🦆 WEBS and AsyncWEBS
268
-
269
- The `WEBS` and `AsyncWEBS` classes are used to retrieve search results from DuckDuckGo.com.
270
-
271
- To use the `AsyncWEBS` class, you can perform asynchronous operations using Python's `asyncio` library.
272
-
273
- To initialize an instance of the `WEBS` or `AsyncWEBS` classes, you can provide the following optional arguments:
274
-
275
- **Example - WEBS:**
276
-
277
- ```python
278
- from webscout import WEBS
279
-
280
- R = WEBS().text("python programming", max_results=5)
281
- print(R)
282
- ```
283
-
284
- **Example - AsyncWEBS:**
285
-
286
- ```python
287
- import asyncio
288
- import logging
289
- import sys
290
- from itertools import chain
291
- from random import shuffle
292
- import requests
293
- from webscout import AsyncWEBS
294
-
295
- # If you have proxies, define them here
296
- proxies = None
297
-
298
- if sys.platform.lower().startswith("win"):
299
- asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy())
300
-
301
- def get_words():
302
- word_site = "https://www.mit.edu/~ecprice/wordlist.10000"
303
- resp = requests.get(word_site)
304
- words = resp.text.splitlines()
305
- return words
306
-
307
- async def aget_results(word):
308
- async with AsyncWEBS(proxies=proxies) as WEBS:
309
- results = await WEBS.text(word, max_results=None)
310
- return results
311
-
312
- async def main():
313
- words = get_words()
314
- shuffle(words)
315
- tasks = [aget_results(word) for word in words[:10]]
316
- results = await asyncio.gather(*tasks)
317
- print(f"Done")
318
- for r in chain.from_iterable(results):
319
- print(r)
320
-
321
- logging.basicConfig(level=logging.DEBUG)
322
-
323
- await main()
324
- ```
325
-
326
- **Important Note:** The `WEBS` and `AsyncWEBS` classes should always be used as a context manager (with statement). This ensures proper resource management and cleanup, as the context manager will automatically handle opening and closing the HTTP client connection.
327
-
328
- ## ⚠️ Exceptions
329
-
330
- **Exceptions:**
331
-
332
- * `WebscoutE`: Raised when there is a generic exception during the API request.
333
-
334
- ## 💻 Usage of WEBS
335
-
336
- ### 1. `text()` - Text Search by DuckDuckGo.com
337
-
338
- ```python
339
- from webscout import WEBS
340
-
341
- # Text search for 'live free or die' using DuckDuckGo.com
342
- with WEBS() as WEBS:
343
- for r in WEBS.text('live free or die', region='wt-wt', safesearch='off', timelimit='y', max_results=10):
344
- print(r)
345
-
346
- for r in WEBS.text('live free or die', region='wt-wt', safesearch='off', timelimit='y', max_results=10):
347
- print(r)
348
- ```
349
-
350
- ### 2. `answers()` - Instant Answers by DuckDuckGo.com
351
-
352
- ```python
353
- from webscout import WEBS
354
-
355
- # Instant answers for the query "sun" using DuckDuckGo.com
356
- with WEBS() as WEBS:
357
- for r in WEBS.answers("sun"):
358
- print(r)
359
- ```
360
-
361
- ### 3. `images()` - Image Search by DuckDuckGo.com
362
-
363
- ```python
364
- from webscout import WEBS
365
-
366
- # Image search for the keyword 'butterfly' using DuckDuckGo.com
367
- with WEBS() as WEBS:
368
- keywords = 'butterfly'
369
- WEBS_images_gen = WEBS.images(
370
- keywords,
371
- region="wt-wt",
372
- safesearch="off",
373
- size=None,
374
- type_image=None,
375
- layout=None,
376
- license_image=None,
377
- max_results=10,
378
- )
379
- for r in WEBS_images_gen:
380
- print(r)
381
- ```
382
-
383
- ### 4. `videos()` - Video Search by DuckDuckGo.com
384
-
385
- ```python
386
- from webscout import WEBS
387
-
388
- # Video search for the keyword 'tesla' using DuckDuckGo.com
389
- with WEBS() as WEBS:
390
- keywords = 'tesla'
391
- WEBS_videos_gen = WEBS.videos(
392
- keywords,
393
- region="wt-wt",
394
- safesearch="off",
395
- timelimit="w",
396
- resolution="high",
397
- duration="medium",
398
- max_results=10,
399
- )
400
- for r in WEBS_videos_gen:
401
- print(r)
402
- ```
403
-
404
- ### 5. `news()` - News Search by DuckDuckGo.com
405
-
406
- ```python
407
- from webscout import WEBS
408
- import datetime
409
-
410
- def fetch_news(keywords, timelimit):
411
- news_list = []
412
- with WEBS() as webs_instance:
413
- WEBS_news_gen = webs_instance.news(
414
- keywords,
415
- region="wt-wt",
416
- safesearch="off",
417
- timelimit=timelimit,
418
- max_results=20
419
- )
420
- for r in WEBS_news_gen:
421
- # Convert the date to a human-readable format using datetime
422
- r['date'] = datetime.datetime.fromisoformat(r['date']).strftime('%B %d, %Y')
423
- news_list.append(r)
424
- return news_list
425
-
426
- def _format_headlines(news_list, max_headlines: int = 100):
427
- headlines = []
428
- for idx, news_item in enumerate(news_list):
429
- if idx >= max_headlines:
430
- break
431
- new_headline = f"{idx + 1}. {news_item['title'].strip()} "
432
- new_headline += f"(URL: {news_item['url'].strip()}) "
433
- new_headline += f"{news_item['body'].strip()}"
434
- new_headline += "\n"
435
- headlines.append(new_headline)
436
-
437
- headlines = "\n".join(headlines)
438
- return headlines
439
-
440
- # Example usage
441
- keywords = 'latest AI news'
442
- timelimit = 'd'
443
- news_list = fetch_news(keywords, timelimit)
444
-
445
- # Format and print the headlines
446
- formatted_headlines = _format_headlines(news_list)
447
- print(formatted_headlines)
448
-
449
- ```
450
-
451
- ### 6. `maps()` - Map Search by DuckDuckGo.com
452
-
453
- ```python
454
- from webscout import WEBS
455
-
456
- # Map search for the keyword 'school' in 'anantnag' using DuckDuckGo.com
457
- with WEBS() as WEBS:
458
- for r in WEBS.maps("school", place="anantnag", max_results=50):
459
- print(r)
460
- ```
461
-
462
- ### 7. `translate()` - Translation by DuckDuckGo.com
463
-
464
- ```python
465
- from webscout import WEBS
466
-
467
- # Translation of the keyword 'school' to German ('hi') using DuckDuckGo.com
468
- with WEBS() as WEBS:
469
- keywords = 'school'
470
- r = WEBS.translate(keywords, to="hi")
471
- print(r)
472
- ```
473
-
474
- ### 8. `suggestions()` - Suggestions by DuckDuckGo.com
475
-
476
- ```python
477
- from webscout import WEBS
478
-
479
- # Suggestions for the keyword 'fly' using DuckDuckGo.com
480
- with WEBS() as WEBS:
481
- for r in WEBS.suggestions("fly"):
482
- print(r)
483
- ```
484
-
485
- ### 9. `weather()` - Weather Information by DuckDuckGo.com
486
-
487
- ```python
488
- from webscout import WEBS
489
-
490
- # Get weather information for a location using DuckDuckGo.com
491
- with WEBS() as webs:
492
- weather_data = webs.weather("New York")
493
- print(weather_data)
494
-
495
- ```
496
-
497
- #### 📜 List Available LLM Models
498
-
499
- Retrieve a comprehensive list of all supported LLMs.
500
-
501
- ```python
502
- from webscout import model
503
- from rich import print
504
-
505
- all_models = model.llm.list()
506
- print("Available models:")
507
- print(all_models)
508
- ```
509
-
510
- #### 📊 LLM Model Summary
511
-
512
- Obtain a summary of the available LLMs, including provider details.
513
-
514
- ```python
515
- from webscout import model
516
- from rich import print
517
-
518
- summary = model.llm.summary()
519
- print("Summary of models:")
520
- print(summary)
521
- ```
522
-
523
- #### 🔍 Provider-Specific LLM Models
524
-
525
- Filter and display LLMs available from a specific provider.
526
-
527
- ```python
528
- from webscout import model
529
- from rich import print
530
-
531
- provider_name = "PerplexityLabs" # Example provider
532
- available_models = model.llm.get(provider_name)
533
-
534
- if isinstance(available_models, list):
535
- print(f"Available models for {provider_name}: {', '.join(available_models)}")
536
- else:
537
- print(f"Available models for {provider_name}: {available_models}")
538
- ```
539
-
540
- ### TTS Voices
541
-
542
- #### 🎤 List Available TTS Voices
543
-
544
- Retrieve a comprehensive list of all supported TTS voices.
545
-
546
- ```python
547
- from webscout import model
548
- from rich import print
549
-
550
- all_voices = model.tts.list()
551
- print("Available TTS voices:")
552
- print(all_voices)
553
- ```
554
-
555
- #### 📊 TTS Voice Summary
556
-
557
- Obtain a summary of the available TTS voices, including provider details.
558
-
559
- ```python
560
- from webscout import model
561
- from rich import print
562
-
563
- summary = model.tts.summary()
564
- print("Summary of TTS voices:")
565
- print(summary)
566
- ```
567
-
568
- #### 🔍 Provider-Specific TTS Voices
569
-
570
- Filter and display TTS voices available from a specific provider.
571
-
572
- ```python
573
- from webscout import model
574
- from rich import print
575
-
576
- provider_name = "ElevenlabsTTS" # Example provider
577
- available_voices = model.tts.get(provider_name)
578
-
579
- if isinstance(available_voices, list):
580
- print(f"Available voices for {provider_name}: {', '.join(available_voices)}")
581
- elif isinstance(available_voices, dict):
582
- print(f"Available voices for {provider_name}:")
583
- for voice_name, voice_id in available_voices.items():
584
- print(f" - {voice_name}: {voice_id}")
585
- else:
586
- print(f"Available voices for {provider_name}: {available_voices}")
587
- ```
588
-
589
- ### 💬 `Duckchat` - Chat with LLM
590
-
591
- ```python
592
- from webscout import WEBS as w
593
- R = w().chat("Who are you", model='gpt-4o-mini') # mixtral-8x7b, llama-3.1-70b, claude-3-haiku, gpt-4o-mini
594
- print(R)
595
- ```
596
-
597
- ### 🔎 `PhindSearch` - Search using Phind.com
598
-
599
- ```python
600
- from webscout import PhindSearch
601
-
602
- # Create an instance of the PHIND class
603
- ph = PhindSearch()
604
-
605
- # Define a prompt to send to the AI
606
- prompt = "write a essay on phind"
607
-
608
- # Use the 'ask' method to send the prompt and receive a response
609
- response = ph.ask(prompt)
610
-
611
- # Extract and print the message from the response
612
- message = ph.get_message(response)
613
- print(message)
614
- ```
615
-
616
- **Using phindv2:**
617
-
618
- ```python
619
- from webscout import Phindv2
620
-
621
- # Create an instance of the PHIND class
622
- ph = Phindv2()
623
-
624
- # Define a prompt to send to the AI
625
- prompt = ""
626
-
627
- # Use the 'ask' method to send the prompt and receive a response
628
- response = ph.ask(prompt)
629
-
630
- # Extract and print the message from the response
631
- message = ph.get_message(response)
632
- print(message)
633
- ```
634
-
635
- ### ♊ `Gemini` - Search with Google Gemini
636
-
637
- ```python
638
- import webscout
639
- from webscout import GEMINI
640
- from rich import print
641
- COOKIE_FILE = "cookies.json"
642
-
643
- # Optional: Provide proxy details if needed
644
- PROXIES = {}
645
-
646
- # Initialize GEMINI with cookie file and optional proxies
647
- gemini = GEMINI(cookie_file=COOKIE_FILE, proxy=PROXIES)
648
-
649
- # Ask a question and print the response
650
- response = gemini.chat("websearch about HelpingAI and who is its developer")
651
- print(response)
652
- ```
653
-
654
- ### 💬 `YEPCHAT`
655
-
656
- ```python
657
- from webscout import YEPCHAT
658
- ai = YEPCHAT()
659
- response = ai.chat(input(">>> "))
660
- for chunk in response:
661
- print(chunk, end="", flush=True)
662
-
663
- ```
664
-
665
- ### ⬛ `BlackBox` - Search/Chat with BlackBox
666
-
667
- ```python
668
- from webscout import BLACKBOXAI
669
- from rich import print
670
-
671
- ai = BLACKBOXAI(
672
- is_conversation=True,
673
- max_tokens=800,
674
- timeout=30,
675
- intro=None,
676
- filepath=None,
677
- update_file=True,
678
- proxies={},
679
- history_offset=10250,
680
- act=None,
681
- model=None # You can specify a model if needed
682
- )
683
-
684
-
685
- # Define a prompt to send to the AI
686
- prompt = "Tell me about india"
687
- # Use the 'chat' method to send the prompt and receive a response
688
- r = ai.chat(prompt)
689
- print(r)
690
- ```
691
-
692
- ### 🤖 `Meta AI` - Chat with Meta AI
693
-
694
- ```python
695
- from webscout import Meta
696
- from rich import print
697
- # **For unauthenticated usage**
698
- meta_ai = Meta()
699
-
700
- # Simple text prompt
701
- response = meta_ai.chat("What is the capital of France?")
702
- print(response)
703
-
704
- # Streaming response
705
- for chunk in meta_ai.chat("Tell me a story about a cat."):
706
- print(chunk, end="", flush=True)
707
-
708
- # **For authenticated usage (including image generation)**
709
- fb_email = "abcd@abc.com"
710
- fb_password = "qwertfdsa"
711
- meta_ai = Meta(fb_email=fb_email, fb_password=fb_password)
712
-
713
- # Text prompt with web search
714
- response = meta_ai.ask("what is currently happning in bangladesh in aug 2024")
715
- print(response["message"]) # Access the text message
716
- print("Sources:", response["sources"]) # Access sources (if any)
717
-
718
- # Image generation
719
- response = meta_ai.ask("Create an image of a cat wearing a hat.")
720
- print(response["message"]) # Print the text message from the response
721
- for media in response["media"]:
722
- print(media["url"]) # Access image URLs
723
-
724
- ```
725
-
726
- ### `KOBOLDAI`
727
-
728
- ```python
729
- from webscout import KOBOLDAI
730
-
731
- # Instantiate the KOBOLDAI class with default parameters
732
- koboldai = KOBOLDAI()
733
-
734
- # Define a prompt to send to the AI
735
- prompt = "What is the capital of France?"
736
-
737
- # Use the 'ask' method to get a response from the AI
738
- response = koboldai.ask(prompt)
739
-
740
- # Extract and print the message from the response
741
- message = koboldai.get_message(response)
742
- print(message)
743
-
744
- ```
745
-
746
- ### `Reka` - Chat with Reka
747
-
748
- ```python
749
- from webscout import REKA
750
-
751
- a = REKA(is_conversation=True, max_tokens=8000, timeout=30,api_key="")
752
-
753
- prompt = "tell me about india"
754
- response_str = a.chat(prompt)
755
- print(response_str)
756
- ```
757
-
758
- ### `Cohere` - Chat with Cohere
759
-
760
- ```python
761
- from webscout import Cohere
762
-
763
- a = Cohere(is_conversation=True, max_tokens=8000, timeout=30,api_key="")
764
-
765
- prompt = "tell me about india"
766
- response_str = a.chat(prompt)
767
- print(response_str)
768
- ```
769
-
770
- ### `Deepinfra`
771
-
772
- ```python
773
- from webscout import DeepInfra
774
-
775
- ai = DeepInfra(
776
- is_conversation=True,
777
- model= "Qwen/Qwen2-72B-Instruct",
778
- max_tokens=800,
779
- timeout=30,
780
- intro=None,
781
- filepath=None,
782
- update_file=True,
783
- proxies={},
784
- history_offset=10250,
785
- act=None,
786
- )
787
-
788
- prompt = "what is meaning of life"
789
-
790
- response = ai.ask(prompt)
791
-
792
- # Extract and print the message from the response
793
- message = ai.get_message(response)
794
- print(message)
795
- ```
796
-
797
- ### `GROQ`
798
-
799
- ```python
800
- from webscout import GROQ
801
- ai = GROQ(api_key="")
802
- response = ai.chat("What is the meaning of life?")
803
- print(response)
804
- #----------------------TOOL CALL------------------
805
- from webscout import GROQ # Adjust import based on your project structure
806
- from webscout import WEBS
807
- import json
808
-
809
- # Initialize the GROQ client
810
- client = GROQ(api_key="")
811
- MODEL = 'llama3-groq-70b-8192-tool-use-preview'
812
-
813
- # Function to evaluate a mathematical expression
814
- def calculate(expression):
815
- """Evaluate a mathematical expression"""
816
- try:
817
- result = eval(expression)
818
- return json.dumps({"result": result})
819
- except Exception as e:
820
- return json.dumps({"error": str(e)})
821
-
822
- # Function to perform a text search using DuckDuckGo.com
823
- def search(query):
824
- """Perform a text search using DuckDuckGo.com"""
825
- try:
826
- results = WEBS().text(query, max_results=5)
827
- return json.dumps({"results": results})
828
- except Exception as e:
829
- return json.dumps({"error": str(e)})
830
-
831
- # Add the functions to the provider
832
- client.add_function("calculate", calculate)
833
- client.add_function("search", search)
834
-
835
- # Define the tools
836
- tools = [
837
- {
838
- "type": "function",
839
- "function": {
840
- "name": "calculate",
841
- "description": "Evaluate a mathematical expression",
842
- "parameters": {
843
- "type": "object",
844
- "properties": {
845
- "expression": {
846
- "type": "string",
847
- "description": "The mathematical expression to evaluate",
848
- }
849
- },
850
- "required": ["expression"],
851
- },
852
- }
853
- },
854
- {
855
- "type": "function",
856
- "function": {
857
- "name": "search",
858
- "description": "Perform a text search using DuckDuckGo.com and Yep.com",
859
- "parameters": {
860
- "type": "object",
861
- "properties": {
862
- "query": {
863
- "type": "string",
864
- "description": "The search query to execute",
865
- }
866
- },
867
- "required": ["query"],
868
- },
869
- }
870
- }
871
- ]
872
-
873
-
874
- user_prompt_calculate = "What is 25 * 4 + 10?"
875
- response_calculate = client.chat(user_prompt_calculate, tools=tools)
876
- print(response_calculate)
877
-
878
- user_prompt_search = "Find information on HelpingAI and who is its developer"
879
- response_search = client.chat(user_prompt_search, tools=tools)
880
- print(response_search)
881
-
882
- ```
883
-
884
- ### `LLama 70b` - Chat with Meta's Llama 3 70b
885
-
886
- ```python
887
-
888
- from webscout import LLAMA
889
-
890
- llama = LLAMA()
891
-
892
- r = llama.chat("What is the meaning of life?")
893
- print(r)
894
- ```
895
-
896
- ### `AndiSearch`
897
-
898
- ```python
899
- from webscout import AndiSearch
900
- a = AndiSearch()
901
- print(a.chat("HelpingAI-9B"))
902
- ```
903
-
904
- ### `LLAMA`, `C4ai`, `Venice`, `Copilot`, `HuggingFaceChat`, `TwoAI`, `HeckAI`, `AllenAI`, `PerplexityLabs`, `AkashGPT`, `DeepSeek`, `WiseCat`, `IBMGranite`, `QwenLM`, `ChatGPTGratis`, `TextPollinationsAI`, `GliderAI`, `Cohere`, `REKA`, `GROQ`, `AsyncGROQ`, `OPENAI`, `AsyncOPENAI`, `KOBOLDAI`, `AsyncKOBOLDAI`, `BLACKBOXAI`, `PhindSearch`, `GEMINI`, `DeepInfra`, `AI4Chat`, `Phindv2`, `OLLAMA`, `AndiSearch`, `PIZZAGPT`, `Sambanova`, `KOALA`, `Meta`, `AskMyAI`, `PiAI`, `Julius`, `YouChat`, `YEPCHAT`, `Cloudflare`, `TurboSeek`, `TeachAnything`, `AI21`, `Chatify`, `X0GPT`, `Cerebras`, `Lepton`, `GEMINIAPI`, `Cleeai`, `Elmo`, `Free2GPT`, `GPTWeb`, `Netwrck`, `LlamaTutor`, `PromptRefine`, `TutorAI`, `ChatGPTES`, `Bagoodex`, `AIMathGPT`, `GaurishCerebras`, `GeminiPro`, `LLMChat`, `Talkai`, `Llama3Mitril`, `Marcus`, `TypeGPT`, `Netwrck`, `MultiChatAI`, `JadveOpenAI`, `ChatGLM`, `NousHermes`, `FreeAIChat`, `ElectronHub`, `GithubChat`, `Flowith`, `SonusAI`, `UncovrAI`, `LabyrinthAI`, `WebSim`, `LambdaChat`, `ChatGPTClone`, `VercelAI`, `ExaChat`, `AskSteve`, `Aitopia`, `SearchChatAI`
905
-
906
- Code is similar to other providers.
907
-
908
- ### `LLM`
909
-
910
- ```python
911
- from webscout.LLM import LLM, VLM
912
-
913
- # Chat with text
914
- llm = LLM("meta-llama/Meta-Llama-3-70B-Instruct")
915
- response = llm.chat([{"role": "user", "content": "What's good?"}])
916
-
917
- # Chat with images
918
- vlm = VLM("cogvlm-grounding-generalist")
919
- response = vlm.chat([{
920
- "role": "user",
921
- "content": [
922
- {"type": "image", "image_url": "cool_pic.jpg"},
923
- {"type": "text", "text": "What's in this image?"}
924
- ]
925
- }])
926
- ```
927
-
928
- ## GGUF
929
-
930
- Webscout provides tools to convert and quantize Hugging Face models into the GGUF format for use with offline LLMs.
931
-
932
- **Example:**
933
-
934
- ```python
935
- from webscout.Extra.gguf import ModelConverter
936
- """
937
- Valid quantization methods:
938
- "q2_k", "q3_k_l", "q3_k_m", "q3_k_s",
939
- "q4_0", "q4_1", "q4_k_m", "q4_k_s",
940
- "q5_0", "q5_1", "q5_k_m", "q5_k_s",
941
- "q6_k", "q8_0"
942
- """
943
- # Create a converter instance
944
- converter = ModelConverter(
945
- model_id="prithivMLmods/QWQ-500M",
946
- quantization_methods="q2_k"
947
- )
948
-
949
- # Run the conversion
950
- converter.convert()
951
- ```
952
-
953
- **Command Line Usage:**
954
-
955
- * **GGUF Conversion:**
956
-
957
- ```bash
958
- python -m webscout.Extra.gguf convert -m "prithivMLmods/QWQ-500M" -q "q2_k"
959
- ```
960
-
961
- **Note:**
962
-
963
- * Replace `"your_username"` and `"your_hf_token"` with your actual Hugging Face credentials.
964
- * The `model_path` in `autollama` is the Hugging Face model ID, and `gguf_file` is the GGUF file ID.
965
-
966
- <div align="center">
967
- <!-- Replace `#` with your actual links -->
968
- <a href="https://t.me/PyscoutAI"><img alt="Telegram" src="https://img.shields.io/badge/Telegram-2CA5E0?style=for-the-badge&logo=telegram&logoColor=white"></a>
969
- <a href="https://www.instagram.com/oevortex/"><img alt="Instagram" src="https://img.shields.io/badge/Instagram-E4405F?style=for-the-badge&logo=instagram&logoColor=white"></a>
970
- <a href="https://www.linkedin.com/in/oe-vortex-29a407265/"><img alt="LinkedIn" src="https://img.shields.io/badge/LinkedIn-0077B5?style=for-the-badge&logo=linkedin&logoColor=white"></a>
971
- <a href="https://buymeacoffee.com/oevortex"><img alt="Buy Me A Coffee" src="https://img.shields.io/badge/Buy%20Me%20A%20Coffee-FFDD00?style=for-the-badge&logo=buymeacoffee&logoColor=black"></a>
972
- </div>
973
-
974
- <div align="center">
975
- <!-- Replace `#` with your actual links -->
976
- <a href="https://youtube.com/@OEvortex">▶️ Vortex's YouTube Channel</a>
977
- </div>
978
- <div align="center">
979
- <a href="https://t.me/ANONYMOUS_56788">📢 Anonymous Coder's Telegram</a>
980
- </div>
981
-
982
- ## 🤝 Contributing
983
-
984
- Contributions are welcome! If you'd like to contribute to Webscout, please follow these steps:
985
-
986
- 1. Fork the repository.
987
- 2. Create a new branch for your feature or bug fix.
988
- 3. Make your changes and commit them with descriptive messages.
989
- 4. Push your branch to your forked repository.
990
- 5. Submit a pull request to the main repository.
991
-
992
- ## 🙏 Acknowledgments
993
-
994
- * All the amazing developers who have contributed to the project!
995
- * The open-source community for their support and inspiration.