webscout 6.4__py3-none-any.whl → 6.6__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 (116) hide show
  1. webscout/AIutel.py +7 -54
  2. webscout/DWEBS.py +48 -26
  3. webscout/{YTdownloader.py → Extra/YTToolkit/YTdownloader.py} +990 -1103
  4. webscout/Extra/YTToolkit/__init__.py +3 -0
  5. webscout/{transcriber.py → Extra/YTToolkit/transcriber.py} +1 -1
  6. webscout/Extra/YTToolkit/ytapi/__init__.py +6 -0
  7. webscout/Extra/YTToolkit/ytapi/channel.py +307 -0
  8. webscout/Extra/YTToolkit/ytapi/errors.py +13 -0
  9. webscout/Extra/YTToolkit/ytapi/extras.py +45 -0
  10. webscout/Extra/YTToolkit/ytapi/https.py +88 -0
  11. webscout/Extra/YTToolkit/ytapi/patterns.py +61 -0
  12. webscout/Extra/YTToolkit/ytapi/playlist.py +59 -0
  13. webscout/Extra/YTToolkit/ytapi/pool.py +8 -0
  14. webscout/Extra/YTToolkit/ytapi/query.py +37 -0
  15. webscout/Extra/YTToolkit/ytapi/stream.py +60 -0
  16. webscout/Extra/YTToolkit/ytapi/utils.py +62 -0
  17. webscout/Extra/YTToolkit/ytapi/video.py +102 -0
  18. webscout/Extra/__init__.py +2 -1
  19. webscout/Extra/autocoder/autocoder_utiles.py +119 -101
  20. webscout/Extra/autocoder/rawdog.py +679 -680
  21. webscout/Extra/gguf.py +441 -441
  22. webscout/Extra/markdownlite/__init__.py +862 -0
  23. webscout/Extra/weather_ascii.py +2 -2
  24. webscout/Provider/AISEARCH/__init__.py +2 -0
  25. webscout/Provider/AISEARCH/ooai.py +155 -0
  26. webscout/Provider/Amigo.py +70 -85
  27. webscout/Provider/{prefind.py → Jadve.py} +72 -70
  28. webscout/Provider/Netwrck.py +235 -0
  29. webscout/Provider/Openai.py +4 -3
  30. webscout/Provider/PI.py +292 -221
  31. webscout/Provider/PizzaGPT.py +3 -3
  32. webscout/Provider/Reka.py +0 -1
  33. webscout/Provider/TTS/__init__.py +5 -1
  34. webscout/Provider/TTS/deepgram.py +183 -0
  35. webscout/Provider/TTS/elevenlabs.py +137 -0
  36. webscout/Provider/TTS/gesserit.py +151 -0
  37. webscout/Provider/TTS/murfai.py +139 -0
  38. webscout/Provider/TTS/parler.py +134 -107
  39. webscout/Provider/TTS/streamElements.py +360 -275
  40. webscout/Provider/TTS/utils.py +280 -0
  41. webscout/Provider/TTS/voicepod.py +116 -116
  42. webscout/Provider/TeachAnything.py +15 -2
  43. webscout/Provider/Youchat.py +42 -8
  44. webscout/Provider/__init__.py +8 -21
  45. webscout/Provider/meta.py +794 -779
  46. webscout/Provider/multichat.py +230 -0
  47. webscout/Provider/promptrefine.py +2 -2
  48. webscout/Provider/talkai.py +10 -13
  49. webscout/Provider/turboseek.py +5 -4
  50. webscout/Provider/tutorai.py +8 -112
  51. webscout/Provider/typegpt.py +5 -7
  52. webscout/Provider/x0gpt.py +81 -9
  53. webscout/Provider/yep.py +123 -361
  54. webscout/__init__.py +33 -28
  55. webscout/conversation.py +24 -9
  56. webscout/exceptions.py +188 -20
  57. webscout/litprinter/__init__.py +719 -831
  58. webscout/litprinter/colors.py +54 -0
  59. webscout/optimizers.py +420 -270
  60. webscout/prompt_manager.py +279 -279
  61. webscout/scout/__init__.py +8 -0
  62. webscout/scout/core/__init__.py +7 -0
  63. webscout/scout/core/crawler.py +140 -0
  64. webscout/scout/core/scout.py +571 -0
  65. webscout/scout/core/search_result.py +96 -0
  66. webscout/scout/core/text_analyzer.py +63 -0
  67. webscout/scout/core/text_utils.py +277 -0
  68. webscout/scout/core/web_analyzer.py +52 -0
  69. webscout/scout/core.py +884 -0
  70. webscout/scout/element.py +460 -0
  71. webscout/scout/parsers/__init__.py +69 -0
  72. webscout/scout/parsers/html5lib_parser.py +172 -0
  73. webscout/scout/parsers/html_parser.py +236 -0
  74. webscout/scout/parsers/lxml_parser.py +178 -0
  75. webscout/scout/utils.py +38 -0
  76. webscout/update_checker.py +184 -125
  77. webscout/version.py +1 -1
  78. webscout/zeroart/__init__.py +55 -0
  79. webscout/zeroart/base.py +60 -0
  80. webscout/zeroart/effects.py +99 -0
  81. webscout/zeroart/fonts.py +816 -0
  82. webscout/zerodir/__init__.py +225 -0
  83. {webscout-6.4.dist-info → webscout-6.6.dist-info}/METADATA +18 -231
  84. webscout-6.6.dist-info/RECORD +197 -0
  85. webscout-6.6.dist-info/top_level.txt +2 -0
  86. webstoken/__init__.py +30 -0
  87. webstoken/classifier.py +189 -0
  88. webstoken/keywords.py +216 -0
  89. webstoken/language.py +128 -0
  90. webstoken/ner.py +164 -0
  91. webstoken/normalizer.py +35 -0
  92. webstoken/processor.py +77 -0
  93. webstoken/sentiment.py +206 -0
  94. webstoken/stemmer.py +73 -0
  95. webstoken/t.py +75 -0
  96. webstoken/tagger.py +60 -0
  97. webstoken/tokenizer.py +158 -0
  98. webscout/Agents/Onlinesearcher.py +0 -182
  99. webscout/Agents/__init__.py +0 -2
  100. webscout/Agents/functioncall.py +0 -248
  101. webscout/Bing_search.py +0 -251
  102. webscout/Provider/Perplexity.py +0 -599
  103. webscout/Provider/RoboCoders.py +0 -206
  104. webscout/Provider/genspark.py +0 -225
  105. webscout/Provider/perplexitylabs.py +0 -265
  106. webscout/Provider/twitterclone.py +0 -251
  107. webscout/Provider/upstage.py +0 -230
  108. webscout/gpt4free.py +0 -666
  109. webscout/requestsHTMLfix.py +0 -775
  110. webscout/webai.py +0 -2590
  111. webscout-6.4.dist-info/RECORD +0 -154
  112. webscout-6.4.dist-info/top_level.txt +0 -1
  113. /webscout/Provider/{felo_search.py → AISEARCH/felo_search.py} +0 -0
  114. {webscout-6.4.dist-info → webscout-6.6.dist-info}/LICENSE.md +0 -0
  115. {webscout-6.4.dist-info → webscout-6.6.dist-info}/WHEEL +0 -0
  116. {webscout-6.4.dist-info → webscout-6.6.dist-info}/entry_points.txt +0 -0
@@ -0,0 +1,225 @@
1
+ """
2
+ ZeroDir: A zero-dependency app directories management library
3
+
4
+ Provides cross-platform directory management for application data,
5
+ configuration, and cache without external dependencies.
6
+ """
7
+
8
+ import os
9
+ import sys
10
+ import json
11
+ import platform
12
+ import tempfile
13
+ import shutil
14
+ import hashlib
15
+ import time
16
+ import datetime
17
+
18
+ class ZeroDirs:
19
+ def __init__(self, app_name, app_author=None):
20
+ """
21
+ Initialize ZeroDirs with application details
22
+
23
+ :param app_name: Name of the application
24
+ :param app_author: Author/Company name (optional)
25
+ """
26
+ self.app_name = app_name
27
+ self.app_author = app_author or os.getlogin()
28
+ self._init_dirs()
29
+
30
+ def _init_dirs(self):
31
+ """Initialize application directories"""
32
+ self.user_data_dir = self._get_user_data_dir()
33
+ self.user_config_dir = self._get_user_config_dir()
34
+ self.user_cache_dir = self._get_user_cache_dir()
35
+ self.user_log_dir = self._get_user_log_dir()
36
+ self.temp_dir = self._get_temp_dir()
37
+
38
+ # Create directories if they don't exist
39
+ for directory in [
40
+ self.user_data_dir,
41
+ self.user_config_dir,
42
+ self.user_cache_dir,
43
+ self.user_log_dir,
44
+ self.temp_dir
45
+ ]:
46
+ os.makedirs(directory, exist_ok=True)
47
+
48
+ def _get_user_data_dir(self):
49
+ """Get user data directory"""
50
+ system = platform.system().lower()
51
+ if system == 'windows':
52
+ base = os.path.expandvars('%LOCALAPPDATA%')
53
+ return os.path.join(base, self.app_author, self.app_name)
54
+ elif system == 'darwin': # macOS
55
+ return os.path.expanduser(f'~/Library/Application Support/{self.app_name}')
56
+ else: # Linux and other Unix-like
57
+ xdg_data_home = os.environ.get('XDG_DATA_HOME') or os.path.expanduser('~/.local/share')
58
+ return os.path.join(xdg_data_home, self.app_name)
59
+
60
+ def _get_user_config_dir(self):
61
+ """Get user configuration directory"""
62
+ system = platform.system().lower()
63
+ if system == 'windows':
64
+ base = os.path.expandvars('%APPDATA%')
65
+ return os.path.join(base, self.app_author, self.app_name)
66
+ elif system == 'darwin': # macOS
67
+ return os.path.expanduser(f'~/Library/Preferences/{self.app_name}')
68
+ else: # Linux and other Unix-like
69
+ xdg_config_home = os.environ.get('XDG_CONFIG_HOME') or os.path.expanduser('~/.config')
70
+ return os.path.join(xdg_config_home, self.app_name)
71
+
72
+ def _get_user_cache_dir(self):
73
+ """Get user cache directory"""
74
+ system = platform.system().lower()
75
+ if system == 'windows':
76
+ base = os.path.expandvars('%LOCALAPPDATA%')
77
+ return os.path.join(base, self.app_author, self.app_name, 'Cache')
78
+ elif system == 'darwin': # macOS
79
+ return os.path.expanduser(f'~/Library/Caches/{self.app_name}')
80
+ else: # Linux and other Unix-like
81
+ xdg_cache_home = os.environ.get('XDG_CACHE_HOME') or os.path.expanduser('~/.cache')
82
+ return os.path.join(xdg_cache_home, self.app_name)
83
+
84
+ def _get_user_log_dir(self):
85
+ """Get user log directory"""
86
+ system = platform.system().lower()
87
+ if system == 'windows':
88
+ base = os.path.expandvars('%LOCALAPPDATA%')
89
+ return os.path.join(base, self.app_author, self.app_name, 'Logs')
90
+ elif system == 'darwin': # macOS
91
+ return os.path.expanduser(f'~/Library/Logs/{self.app_name}')
92
+ else: # Linux and other Unix-like
93
+ xdg_data_home = os.environ.get('XDG_DATA_HOME') or os.path.expanduser('~/.local/share')
94
+ return os.path.join(xdg_data_home, self.app_name, 'logs')
95
+
96
+ def _get_temp_dir(self):
97
+ """Get temporary directory for the application"""
98
+ return os.path.join(tempfile.gettempdir(), f'{self.app_name}_temp')
99
+
100
+ def save_config(self, config_data, filename='config.json'):
101
+ """
102
+ Save configuration data to config directory
103
+
104
+ :param config_data: Dictionary of configuration data
105
+ :param filename: Name of the config file (default: config.json)
106
+ :return: Path to saved config file
107
+ """
108
+ config_path = os.path.join(self.user_config_dir, filename)
109
+ with open(config_path, 'w') as f:
110
+ json.dump(config_data, f, indent=4)
111
+ return config_path
112
+
113
+ def load_config(self, filename='config.json'):
114
+ """
115
+ Load configuration data from config directory
116
+
117
+ :param filename: Name of the config file (default: config.json)
118
+ :return: Dictionary of configuration data or None if file doesn't exist
119
+ """
120
+ config_path = os.path.join(self.user_config_dir, filename)
121
+ if os.path.exists(config_path):
122
+ with open(config_path, 'r') as f:
123
+ return json.load(f)
124
+ return None
125
+
126
+ def cache_file(self, content, filename=None, extension=None):
127
+ """
128
+ Cache a file with optional naming and extension
129
+
130
+ :param content: File content or bytes
131
+ :param filename: Optional custom filename
132
+ :param extension: Optional file extension
133
+ :return: Path to cached file
134
+ """
135
+ if not filename:
136
+ # Generate a hash-based filename if not provided
137
+ content_hash = hashlib.md5(str(content).encode()).hexdigest()
138
+ filename = f'{content_hash}{extension or ""}'
139
+
140
+ cache_path = os.path.join(self.user_cache_dir, filename)
141
+
142
+ # Write content to file
143
+ with open(cache_path, 'wb' if isinstance(content, bytes) else 'w') as f:
144
+ f.write(content)
145
+
146
+ return cache_path
147
+
148
+ def clear_cache(self, max_age_days=30):
149
+ """
150
+ Clear cache directory, optionally removing files older than max_age_days
151
+
152
+ :param max_age_days: Maximum age of files to keep (default: 30 days)
153
+ :return: Number of files deleted
154
+ """
155
+ current_time = time.time()
156
+
157
+ deleted_count = 0
158
+ for filename in os.listdir(self.user_cache_dir):
159
+ filepath = os.path.join(self.user_cache_dir, filename)
160
+
161
+ # Check file age
162
+ file_age_days = (current_time - os.path.getctime(filepath)) / (24 * 3600)
163
+
164
+ if file_age_days > max_age_days:
165
+ try:
166
+ os.remove(filepath)
167
+ deleted_count += 1
168
+ except Exception:
169
+ pass
170
+
171
+ return deleted_count
172
+
173
+ def log(self, message, filename='app.log', level='INFO'):
174
+ """
175
+ Log a message to the log directory
176
+
177
+ :param message: Log message
178
+ :param filename: Log filename (default: app.log)
179
+ :param level: Log level (default: INFO)
180
+ """
181
+ log_path = os.path.join(self.user_log_dir, filename)
182
+
183
+ with open(log_path, 'a') as log_file:
184
+ timestamp = datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S')
185
+ log_file.write(f'[{level}] {timestamp}: {message}\n')
186
+
187
+ def user_data_dir(app_name, app_author=None):
188
+ """
189
+ Quick function to get user data directory
190
+
191
+ :param app_name: Name of the application
192
+ :param app_author: Author/Company name (optional)
193
+ :return: Path to user data directory
194
+ """
195
+ return ZeroDirs(app_name, app_author).user_data_dir
196
+
197
+ def user_config_dir(app_name, app_author=None):
198
+ """
199
+ Quick function to get user config directory
200
+
201
+ :param app_name: Name of the application
202
+ :param app_author: Author/Company name (optional)
203
+ :return: Path to user config directory
204
+ """
205
+ return ZeroDirs(app_name, app_author).user_config_dir
206
+
207
+ def user_cache_dir(app_name, app_author=None):
208
+ """
209
+ Quick function to get user cache directory
210
+
211
+ :param app_name: Name of the application
212
+ :param app_author: Author/Company name (optional)
213
+ :return: Path to user cache directory
214
+ """
215
+ return ZeroDirs(app_name, app_author).user_cache_dir
216
+
217
+ def user_log_dir(app_name, app_author=None):
218
+ """
219
+ Quick function to get user log directory
220
+
221
+ :param app_name: Name of the application
222
+ :param app_author: Author/Company name (optional)
223
+ :return: Path to user log directory
224
+ """
225
+ return ZeroDirs(app_name, app_author).user_log_dir
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: webscout
3
- Version: 6.4
3
+ Version: 6.6
4
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
5
  Author: OEvortex
6
6
  Author-email: helpingai5@gmail.com
@@ -24,14 +24,14 @@ Classifier: Topic :: Software Development :: Libraries :: Python Modules
24
24
  Requires-Python: >=3.7
25
25
  Description-Content-Type: text/markdown
26
26
  License-File: LICENSE.md
27
+ Requires-Dist: setuptools
28
+ Requires-Dist: wheel
29
+ Requires-Dist: pip
27
30
  Requires-Dist: mistune
28
31
  Requires-Dist: tenacity
29
32
  Requires-Dist: curl-cffi
30
33
  Requires-Dist: nest-asyncio
31
- Requires-Dist: g4f>=0.2.2.3
32
- Requires-Dist: g4f[webdriver]
33
34
  Requires-Dist: rich
34
- Requires-Dist: beautifulsoup4
35
35
  Requires-Dist: markdownify
36
36
  Requires-Dist: requests
37
37
  Requires-Dist: google-generativeai
@@ -39,12 +39,10 @@ Requires-Dist: lxml>=5.2.2
39
39
  Requires-Dist: termcolor
40
40
  Requires-Dist: orjson
41
41
  Requires-Dist: PyYAML
42
- Requires-Dist: appdirs
43
42
  Requires-Dist: tls-client
44
43
  Requires-Dist: clipman
45
44
  Requires-Dist: playsound
46
45
  Requires-Dist: ollama
47
- Requires-Dist: pyfiglet
48
46
  Requires-Dist: pillow
49
47
  Requires-Dist: bson
50
48
  Requires-Dist: cloudscraper
@@ -53,7 +51,6 @@ Requires-Dist: openai
53
51
  Requires-Dist: prompt-toolkit
54
52
  Requires-Dist: primp
55
53
  Requires-Dist: pyreqwest-impersonate
56
- Requires-Dist: lxml-html-clean
57
54
  Requires-Dist: gradio-client
58
55
  Requires-Dist: psutil
59
56
  Requires-Dist: yaspin
@@ -69,6 +66,7 @@ Requires-Dist: unicorn; extra == "local"
69
66
 
70
67
  <div align="center">
71
68
  <!-- Replace `#` with your actual links -->
69
+
72
70
  <a href="https://t.me/official_helpingai"><img alt="Telegram" src="https://img.shields.io/badge/Telegram-2CA5E0?style=for-the-badge&logo=telegram&logoColor=white"></a>
73
71
  <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>
74
72
  <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>
@@ -103,24 +101,24 @@ Requires-Dist: unicorn; extra == "local"
103
101
  </div>
104
102
 
105
103
  ## 🚀 Features
106
- * **Comprehensive Search:** Leverage Google, DuckDuckGo, and Phind.com for diverse search results.
104
+ * **Comprehensive Search:** Leverage Google, DuckDuckGo for diverse search results.
107
105
  * **AI Powerhouse:** Access and interact with various AI models, including OpenAI, Cohere, and more.
108
- * **YouTube Toolkit:** Transcribe YouTube videos effortlessly and download audio/video content.
106
+ * **[YouTube Toolkit](webscout/Extra/YTToolkit):** Advanced YouTube video and transcript management with multi-language support, versatile downloading, and intelligent data extraction
109
107
  * **Tempmail & Temp Number:** Generate temporary email addresses and phone numbers for enhanced privacy.
110
- * **Text-to-Speech (TTS):** Convert text into natural-sounding speech using various TTS providers.
111
- * **WebAI:** Experience the power of terminal-based GPT and an open interpreter for code execution and more.
108
+ * **[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.
112
109
  * **Offline LLMs:** Utilize powerful language models offline with GGUF support.
113
110
  * **Extensive Provider Ecosystem:** Explore a vast collection of providers, including BasedGPT, DeepSeek, and many others.
114
111
  * **Local LLM Execution:** Run GGUF models locally with minimal configuration.
115
112
  * **Rawdog Scripting:** Execute Python scripts directly within your terminal using the `rawdog` feature.
116
113
  * **GGUF Conversion & Quantization:** Convert and quantize Hugging Face models to GGUF format.
117
114
  * **Autollama:** Download Hugging Face models and automatically convert them for Ollama compatibility.
118
- * **Function Calling (Beta):** Experiment with function calling capabilities for enhanced AI interactions.
119
115
  * **[SwiftCLI](webscout/swiftcli/Readme.md):** A powerful and elegant CLI framework that makes it easy to create beautiful command-line interfaces.
120
116
  * **[LitPrinter](webscout/litprinter/Readme.md):** Provides beautiful, styled console output with rich formatting and colors
121
117
  * **[LitLogger](webscout/litlogger/Readme.md):** Simplifies logging with customizable formats and color schemes
122
118
  * **[LitAgent](webscout/litagent/Readme.md):** Powerful and modern user agent generator that keeps your requests fresh and undetectable
123
119
  * **[Text-to-Image](webscout/Provider/TTI/README.md):** Generate high-quality images using a wide range of AI art providers
120
+ * **[MarkdownLite](webscout/Extra/markdownlite/README.md):** Powerful HTML to Markdown conversion library with advanced parsing and structured output
121
+ * **[Scout](webscout/scout/README.md):** Advanced web parsing and crawling library with intelligent HTML/XML parsing, web crawling, and Markdown conversion
124
122
 
125
123
  ## ⚙️ Installation
126
124
  ```python
@@ -226,29 +224,7 @@ python -m webscout --help
226
224
 
227
225
  [Go To TOP](#webscout-️)
228
226
 
229
- ## ⬇️ YTdownloader
230
227
 
231
- ```python
232
- from os import rename, getcwd
233
- from webscout import YTdownloader
234
- def download_audio(video_id):
235
- youtube_link = video_id
236
- handler = YTdownloader.Handler(query=youtube_link)
237
- for third_query_data in handler.run(format='mp3', quality='128kbps', limit=1):
238
- audio_path = handler.save(third_query_data, dir=getcwd())
239
- rename(audio_path, "audio.mp3")
240
-
241
- def download_video(video_id):
242
- youtube_link = video_id
243
- handler = YTdownloader.Handler(query=youtube_link)
244
- for third_query_data in handler.run(format='mp4', quality='auto', limit=1):
245
- video_path = handler.save(third_query_data, dir=getcwd())
246
- rename(video_path, "video.mp4")
247
-
248
- if __name__ == "__main__":
249
- # download_audio("https://www.youtube.com/watch?v=c0tMvzB0OKw")
250
- download_video("https://www.youtube.com/watch?v=c0tMvzB0OKw")
251
- ```
252
228
 
253
229
  ## ☀️ Weather
254
230
 
@@ -304,20 +280,7 @@ if __name__ == "__main__":
304
280
  asyncio.run(main())
305
281
  ```
306
282
 
307
- ## 📝 Transcriber
308
283
 
309
- The `transcriber` function in Webscout is a handy tool that transcribes YouTube videos.
310
-
311
- **Example:**
312
-
313
- ```python
314
- from webscout import YTTranscriber
315
- yt = YTTranscriber()
316
- from rich import print
317
- video_url = input("Enter the YouTube video URL: ")
318
- transcript = yt.get_transcript(video_url, languages=None)
319
- print(transcript)
320
- ```
321
284
 
322
285
  ## 🔍 GoogleS (formerly DWEBS)
323
286
 
@@ -330,16 +293,6 @@ for result in results:
330
293
  print(result)
331
294
  ```
332
295
 
333
- ### BingS
334
-
335
- ```python
336
- from webscout import BingS
337
- from rich import print
338
- searcher = BingS()
339
- results = searcher.search("HelpingAI-9B", max_results=20, extract_webpage_text=True, max_extract_characters=1000)
340
- for result in results:
341
- print(result)
342
- ```
343
296
 
344
297
  ## 🦆 WEBS and AsyncWEBS
345
298
 
@@ -901,40 +854,11 @@ print(response)
901
854
 
902
855
  ```python
903
856
  from webscout import YEPCHAT
904
- ai = YEPCHAT(Tools=False)
857
+ ai = YEPCHAT()
905
858
  response = ai.chat(input(">>> "))
906
859
  for chunk in response:
907
860
  print(chunk, end="", flush=True)
908
- #---------------Tool Call-------------
909
-
910
- from rich import print
911
- from webscout import YEPCHAT
912
- def get_current_time():
913
- import datetime
914
- return f"The current time is {datetime.datetime.now().strftime('%H:%M:%S')}"
915
- def get_weather(location: str) -> str:
916
- return f"The weather in {location} is sunny."
917
-
918
-
919
- ai = YEPCHAT(Tools=True) # Set Tools=True to use tools in the chat.
920
-
921
- ai.tool_registry.register_tool("get_current_time", get_current_time, "Gets the current time.")
922
- ai.tool_registry.register_tool(
923
- "get_weather",
924
- get_weather,
925
- "Gets the weather for a given location.",
926
- parameters={
927
- "type": "object",
928
- "properties": {
929
- "location": {"title": "Location", "type": "string"}
930
- },
931
- "required": ["location"]
932
- },
933
- )
934
861
 
935
- response = ai.chat(input(">>> "))
936
- for chunk in response:
937
- print(chunk, end="", flush=True)
938
862
  ```
939
863
 
940
864
  ### ⬛ `BlackBox` - Search/Chat with BlackBox
@@ -956,35 +880,15 @@ ai = BLACKBOXAI(
956
880
  model=None # You can specify a model if needed
957
881
  )
958
882
 
959
- # Start an infinite loop for continuous interaction
960
- while True:
961
- # Define a prompt to send to the AI
962
- prompt = input("Enter your prompt: ")
963
-
964
- # Check if the user wants to exit the loop
965
- if prompt.lower() == "exit":
966
- break
967
-
968
- # Use the 'chat' method to send the prompt and receive a response
969
- r = ai.chat(prompt)
970
- print(r)
971
- ```
972
-
973
- ### ❓ `PERPLEXITY` - Search with PERPLEXITY
974
-
975
- ```python
976
- from webscout import Perplexity
977
- from rich import print
978
-
979
- perplexity = Perplexity()
980
- # Stream the response
981
- response = perplexity.chat(input(">>> "))
982
- for chunk in response:
983
- print(chunk, end="", flush=True)
984
883
 
985
- perplexity.close()
884
+ # Define a prompt to send to the AI
885
+ prompt = "Tell me about india"
886
+ # Use the 'chat' method to send the prompt and receive a response
887
+ r = ai.chat(prompt)
888
+ print(r)
986
889
  ```
987
890
 
891
+
988
892
  ### 🤖 `Meta AI` - Chat with Meta AI
989
893
 
990
894
  ```python
@@ -1226,125 +1130,8 @@ a = AndiSearch()
1226
1130
  print(a.chat("HelpingAI-9B"))
1227
1131
  ```
1228
1132
 
1229
- ### 📞 Function Calling (Beta)
1230
-
1231
- ```python
1232
- import json
1233
- import logging
1234
- from webscout import Julius, WEBS
1235
- from webscout.Agents.functioncall import FunctionCallingAgent
1236
- from rich import print
1237
-
1238
- class FunctionExecutor:
1239
- def __init__(self, llama):
1240
- self.llama = llama
1241
-
1242
- def execute_web_search(self, arguments):
1243
- query = arguments.get("query")
1244
- if not query:
1245
- return "Please provide a search query."
1246
- with WEBS() as webs:
1247
- search_results = webs.text(query, max_results=5)
1248
- prompt = (
1249
- f"Based on the following search results:\n\n{search_results}\n\n"
1250
- f"Question: {query}\n\n"
1251
- "Please provide a comprehensive answer to the question based on the search results above. "
1252
- "Include relevant webpage URLs in your answer when appropriate. "
1253
- "If the search results don't contain relevant information, please state that and provide the best answer you can based on your general knowledge."
1254
- )
1255
- return self.llama.chat(prompt)
1256
-
1257
- def execute_general_ai(self, arguments):
1258
- question = arguments.get("question")
1259
- if not question:
1260
- return "Please provide a question."
1261
- return self.llama.chat(question)
1262
-
1263
- def execute_UserDetail(self, arguments):
1264
- name = arguments.get("name")
1265
- age = arguments.get("age")
1266
- return f"User details - Name: {name}, Age: {age}"
1267
-
1268
- def main():
1269
- tools = [
1270
- {
1271
- "type": "function",
1272
- "function": {
1273
- "name": "UserDetail",
1274
- "parameters": {
1275
- "type": "object",
1276
- "properties": {
1277
- "name": {"title": "Name", "type": "string"},
1278
- "age": {"title": "Age", "type": "integer"}
1279
- },
1280
- "required": ["name", "age"]
1281
- }
1282
- }
1283
- },
1284
- {
1285
- "type": "function",
1286
- "function": {
1287
- "name": "web_search",
1288
- "description": "Search the web for information using Google Search.",
1289
- "parameters": {
1290
- "type": "object",
1291
- "properties": {
1292
- "query": {
1293
- "type": "string",
1294
- "description": "The search query to be executed."
1295
- }
1296
- },
1297
- "required": ["query"]
1298
- }
1299
- }
1300
- },
1301
- {
1302
- "type": "function",
1303
- "function": {
1304
- "name": "general_ai",
1305
- "description": "Use general AI knowledge to answer the question",
1306
- "parameters": {
1307
- "type": "object",
1308
- "properties": {
1309
- "question": {"type": "string", "description": "The question to answer"}
1310
- },
1311
- "required": ["question"]
1312
- }
1313
- }
1314
- }
1315
- ]
1316
-
1317
- agent = FunctionCallingAgent(tools=tools)
1318
- llama = Julius()
1319
- function_executor = FunctionExecutor(llama)
1320
-
1321
- user_input = input(">>> ")
1322
- function_call_data = agent.function_call_handler(user_input)
1323
- print(f"Function Call Data: {function_call_data}")
1324
-
1325
- try:
1326
- if "error" not in function_call_data:
1327
- function_name = function_call_data.get("tool_name")
1328
- arguments = function_call_data.get("tool_input", {})
1329
-
1330
- execute_function = getattr(function_executor, f"execute_{function_name}", None)
1331
- if execute_function:
1332
- result = execute_function(arguments)
1333
- print("Function Execution Result:")
1334
- for c in result:
1335
- print(c, end="", flush=True)
1336
- else:
1337
- print(f"Unknown function: {function_name}")
1338
- else:
1339
- print(f"Error: {function_call_data['error']}")
1340
- except Exception as e:
1341
- print(f"An error occurred: {str(e)}")
1342
-
1343
- if __name__ == "__main__":
1344
- main()
1345
- ```
1346
1133
 
1347
- ### LLAMA3, pizzagpt, RUBIKSAI, Koala, Darkai, AI4Chat, Farfalle, PIAI, Felo, Julius, YouChat, YEPCHAT, Cloudflare, TurboSeek, Editee, AI21, Chatify, Cerebras, X0GPT, Lepton, GEMINIAPI, Cleeai, Elmo, Genspark, Upstage, Free2GPT, Bing, DiscordRocks, GPTWeb, LlamaTutor, PromptRefine, AIUncensored, TutorAI, ChatGPTES, Bagoodex, ChatHub, AmigoChat, AIMathGPT, GaurishCerebras, NinjaChat, GeminiPro, Talkai, LLMChat, AskMyAI, Llama3Mitril, Marcus, PerplexityLabs, TypeGPT, Mhystical
1134
+ ### LLAMA3, pizzagpt, RUBIKSAI, Koala, Darkai, AI4Chat, Farfalle, PIAI, Felo, Julius, YouChat, YEPCHAT, Cloudflare, TurboSeek, Editee, AI21, Chatify, Cerebras, X0GPT, Lepton, GEMINIAPI, Cleeai, Elmo, Free2GPT, Bing, DiscordRocks, GPTWeb, LlamaTutor, PromptRefine, TutorAI, ChatGPTES, Bagoodex, ChatHub, AmigoChat, AIMathGPT, GaurishCerebras, NinjaChat, GeminiPro, Talkai, LLMChat, AskMyAI, Llama3Mitril, Marcus, TypeGPT, Mhystical, Netwrck, MultiChatAI, JadveOpenAI, OOAi
1348
1135
 
1349
1136
  Code is similar to other providers.
1350
1137