webscout 4.7__tar.gz → 4.8__tar.gz
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-4.7/webscout.egg-info → webscout-4.8}/PKG-INFO +227 -252
- {webscout-4.7 → webscout-4.8}/README.md +225 -251
- {webscout-4.7 → webscout-4.8}/setup.py +3 -2
- webscout-4.8/webscout/Agents/functioncall.py +186 -0
- webscout-4.8/webscout/Bard.py +365 -0
- {webscout-4.7 → webscout-4.8}/webscout/Local/_version.py +1 -1
- {webscout-4.7 → webscout-4.8}/webscout/Provider/Andi.py +7 -1
- {webscout-4.7 → webscout-4.8}/webscout/Provider/BasedGPT.py +11 -5
- {webscout-4.7 → webscout-4.8}/webscout/Provider/Berlin4h.py +11 -5
- {webscout-4.7 → webscout-4.8}/webscout/Provider/Blackboxai.py +10 -4
- {webscout-4.7 → webscout-4.8}/webscout/Provider/Cohere.py +11 -5
- {webscout-4.7 → webscout-4.8}/webscout/Provider/DARKAI.py +25 -7
- {webscout-4.7 → webscout-4.8}/webscout/Provider/Deepinfra.py +2 -1
- {webscout-4.7 → webscout-4.8}/webscout/Provider/Deepseek.py +25 -9
- webscout-4.8/webscout/Provider/DiscordRocks.py +389 -0
- webscout-4.8/webscout/Provider/Farfalle.py +227 -0
- {webscout-4.7 → webscout-4.8}/webscout/Provider/Gemini.py +1 -1
- {webscout-4.7 → webscout-4.8}/webscout/Provider/Groq.py +244 -110
- {webscout-4.7 → webscout-4.8}/webscout/Provider/Llama.py +13 -5
- {webscout-4.7 → webscout-4.8}/webscout/Provider/Llama3.py +15 -2
- {webscout-4.7 → webscout-4.8}/webscout/Provider/OLLAMA.py +8 -7
- webscout-4.8/webscout/Provider/Perplexity.py +600 -0
- {webscout-4.7 → webscout-4.8}/webscout/Provider/Phind.py +6 -5
- {webscout-4.7 → webscout-4.8}/webscout/Provider/PizzaGPT.py +7 -1
- {webscout-4.7 → webscout-4.8}/webscout/Provider/__init__.py +12 -31
- webscout-4.8/webscout/Provider/ai4chat.py +193 -0
- {webscout-4.7 → webscout-4.8}/webscout/Provider/koala.py +11 -5
- webscout-4.8/webscout/Provider/liaobots.py +268 -0
- {webscout-4.7 → webscout-4.8}/webscout/Provider/meta.py +2 -1
- {webscout-4.7 → webscout-4.8}/webscout/version.py +1 -1
- {webscout-4.7 → webscout-4.8}/webscout/webai.py +2 -64
- {webscout-4.7 → webscout-4.8}/webscout/webscout_search.py +1 -1
- {webscout-4.7 → webscout-4.8/webscout.egg-info}/PKG-INFO +227 -252
- {webscout-4.7 → webscout-4.8}/webscout.egg-info/SOURCES.txt +5 -10
- {webscout-4.7 → webscout-4.8}/webscout.egg-info/requires.txt +1 -0
- webscout-4.7/webscout/Agents/functioncall.py +0 -126
- webscout-4.7/webscout/Provider/ChatGPTUK.py +0 -214
- webscout-4.7/webscout/Provider/FreeGemini.py +0 -169
- webscout-4.7/webscout/Provider/Geminiflash.py +0 -152
- webscout-4.7/webscout/Provider/Geminipro.py +0 -152
- webscout-4.7/webscout/Provider/Leo.py +0 -469
- webscout-4.7/webscout/Provider/OpenGPT.py +0 -867
- webscout-4.7/webscout/Provider/Perplexity.py +0 -230
- webscout-4.7/webscout/Provider/VTLchat.py +0 -252
- webscout-4.7/webscout/Provider/Xjai.py +0 -230
- webscout-4.7/webscout/Provider/Yepchat.py +0 -478
- webscout-4.7/webscout/Provider/Youchat.py +0 -225
- {webscout-4.7 → webscout-4.8}/LICENSE.md +0 -0
- {webscout-4.7 → webscout-4.8}/setup.cfg +0 -0
- {webscout-4.7 → webscout-4.8}/webscout/AIauto.py +0 -0
- {webscout-4.7 → webscout-4.8}/webscout/AIbase.py +0 -0
- {webscout-4.7 → webscout-4.8}/webscout/AIutel.py +0 -0
- {webscout-4.7 → webscout-4.8}/webscout/Agents/Onlinesearcher.py +0 -0
- {webscout-4.7 → webscout-4.8}/webscout/Agents/__init__.py +0 -0
- {webscout-4.7 → webscout-4.8}/webscout/DWEBS.py +0 -0
- {webscout-4.7 → webscout-4.8}/webscout/Extra/__init__.py +0 -0
- {webscout-4.7 → webscout-4.8}/webscout/Extra/autollama.py +0 -0
- {webscout-4.7 → webscout-4.8}/webscout/Extra/gguf.py +0 -0
- {webscout-4.7 → webscout-4.8}/webscout/Extra/weather.py +0 -0
- {webscout-4.7 → webscout-4.8}/webscout/Extra/weather_ascii.py +0 -0
- {webscout-4.7 → webscout-4.8}/webscout/GoogleS.py +0 -0
- {webscout-4.7 → webscout-4.8}/webscout/LLM.py +0 -0
- {webscout-4.7 → webscout-4.8}/webscout/Local/__init__.py +0 -0
- {webscout-4.7 → webscout-4.8}/webscout/Local/formats.py +0 -0
- {webscout-4.7 → webscout-4.8}/webscout/Local/model.py +0 -0
- {webscout-4.7 → webscout-4.8}/webscout/Local/rawdog.py +0 -0
- {webscout-4.7 → webscout-4.8}/webscout/Local/samplers.py +0 -0
- {webscout-4.7 → webscout-4.8}/webscout/Local/thread.py +0 -0
- {webscout-4.7 → webscout-4.8}/webscout/Local/utils.py +0 -0
- {webscout-4.7 → webscout-4.8}/webscout/Provider/Koboldai.py +0 -0
- {webscout-4.7 → webscout-4.8}/webscout/Provider/Openai.py +0 -0
- {webscout-4.7 → webscout-4.8}/webscout/Provider/Poe.py +0 -0
- {webscout-4.7 → webscout-4.8}/webscout/Provider/RUBIKSAI.py +0 -0
- {webscout-4.7 → webscout-4.8}/webscout/Provider/Reka.py +0 -0
- {webscout-4.7 → webscout-4.8}/webscout/Provider/ThinkAnyAI.py +0 -0
- {webscout-4.7 → webscout-4.8}/webscout/YTdownloader.py +0 -0
- {webscout-4.7 → webscout-4.8}/webscout/__init__.py +0 -0
- {webscout-4.7 → webscout-4.8}/webscout/__main__.py +0 -0
- {webscout-4.7 → webscout-4.8}/webscout/async_providers.py +0 -0
- {webscout-4.7 → webscout-4.8}/webscout/cli.py +0 -0
- {webscout-4.7 → webscout-4.8}/webscout/exceptions.py +0 -0
- {webscout-4.7 → webscout-4.8}/webscout/g4f.py +0 -0
- {webscout-4.7 → webscout-4.8}/webscout/models.py +0 -0
- {webscout-4.7 → webscout-4.8}/webscout/tempid.py +0 -0
- {webscout-4.7 → webscout-4.8}/webscout/transcriber.py +0 -0
- {webscout-4.7 → webscout-4.8}/webscout/utils.py +0 -0
- {webscout-4.7 → webscout-4.8}/webscout/voice.py +0 -0
- {webscout-4.7 → webscout-4.8}/webscout/webscout_search_async.py +0 -0
- {webscout-4.7 → webscout-4.8}/webscout/websx_search.py +0 -0
- {webscout-4.7 → webscout-4.8}/webscout.egg-info/dependency_links.txt +0 -0
- {webscout-4.7 → webscout-4.8}/webscout.egg-info/entry_points.txt +0 -0
- {webscout-4.7 → webscout-4.8}/webscout.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: webscout
|
|
3
|
-
Version: 4.
|
|
3
|
+
Version: 4.8
|
|
4
4
|
Summary: Search for anything using Google, DuckDuckGo, brave, qwant, 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
|
|
@@ -63,6 +63,7 @@ Requires-Dist: pyfiglet
|
|
|
63
63
|
Requires-Dist: yaspin
|
|
64
64
|
Requires-Dist: pillow
|
|
65
65
|
Requires-Dist: requests_html
|
|
66
|
+
Requires-Dist: bson
|
|
66
67
|
Provides-Extra: dev
|
|
67
68
|
Requires-Dist: ruff>=0.1.6; extra == "dev"
|
|
68
69
|
Requires-Dist: pytest>=7.4.2; extra == "dev"
|
|
@@ -103,62 +104,6 @@ Requires-Dist: huggingface_hub[cli]; extra == "local"
|
|
|
103
104
|
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
|
|
104
105
|
|
|
105
106
|
|
|
106
|
-
## Table of Contents
|
|
107
|
-
- [WEBSCOUT](#webscout)
|
|
108
|
-
- [Table of Contents](#table-of-contents)
|
|
109
|
-
- [Install](#install)
|
|
110
|
-
- [CLI version](#cli-version)
|
|
111
|
-
- [Regions](#regions)
|
|
112
|
-
- [Tempmail and Temp number](#tempmail-and-temp-number)
|
|
113
|
-
- [Temp number](#temp-number)
|
|
114
|
-
- [Tempmail](#tempmail)
|
|
115
|
-
- [Transcriber](#transcriber)
|
|
116
|
-
- [DWEBS: Advanced Web Searches](#dwebs-advanced-web-searches)
|
|
117
|
-
- [Activating DWEBS](#activating-dwebs)
|
|
118
|
-
- [Point to remember before using `DWEBS`](#point-to-remember-before-using-dwebs)
|
|
119
|
-
- [Usage Example](#usage-example)
|
|
120
|
-
- [Text-to-Speech:](#text-to-speech)
|
|
121
|
-
- [Available TTS Voices:](#available-tts-voices)
|
|
122
|
-
- [Exceptions](#exceptions)
|
|
123
|
-
- [usage of WEBS](#usage-of-webs)
|
|
124
|
-
- [1. `text()` - text search by DuckDuckGo.com](#1-text---text-search-by-duckduckgocom)
|
|
125
|
-
- [2. `answers()` - instant answers by DuckDuckGo.com](#2-answers---instant-answers-by-duckduckgocom)
|
|
126
|
-
- [3. `images()` - image search by DuckDuckGo.com](#3-images---image-search-by-duckduckgocom)
|
|
127
|
-
- [4. `videos()` - video search by DuckDuckGo.com](#4-videos---video-search-by-duckduckgocom)
|
|
128
|
-
- [5. `news()` - news search by DuckDuckGo.com](#5-news---news-search-by-duckduckgocom)
|
|
129
|
-
- [6. `maps()` - map search by DuckDuckGo.com](#6-maps---map-search-by-duckduckgocom)
|
|
130
|
-
- [7. `translate()` - translation by DuckDuckGo.com](#7-translate---translation-by-duckduckgocom)
|
|
131
|
-
- [8. `suggestions()` - suggestions by DuckDuckGo.com](#8-suggestions---suggestions-by-duckduckgocom)
|
|
132
|
-
- [usage of WEBSX -- Another Websearch thing](#usage-of-websx----another-websearch-thing)
|
|
133
|
-
- [ALL acts](#all-acts)
|
|
134
|
-
- [Webscout Supported Acts:](#webscout-supported-acts)
|
|
135
|
-
- [usage of webscout AI](#usage-of-webscout-ai)
|
|
136
|
-
- [0. `Duckchat` - chat with LLM](#0-duckchat---chat-with-llm)
|
|
137
|
-
- [1. `PhindSearch` - Search using Phind.com](#1-phindsearch---search-using-phindcom)
|
|
138
|
-
- [2. `YepChat` - Chat with mistral 8x7b powered by yepchat](#2-yepchat---chat-with-mistral-8x7b-powered-by-yepchat)
|
|
139
|
-
- [3. `You.com` - search/chat with you.com](#3-youcom---searchchat-with-youcom)
|
|
140
|
-
- [4. `Gemini` - search with google gemini](#4-gemini---search-with-google-gemini)
|
|
141
|
-
- [5. `Berlin4h` - chat with Berlin4h](#5-berlin4h---chat-with-berlin4h)
|
|
142
|
-
- [6. `BlackBox` - Search/chat With BlackBox](#6-blackbox---searchchat-with-blackbox)
|
|
143
|
-
- [7. `PERPLEXITY` - Search With PERPLEXITY](#7-perplexity---search-with-perplexity)
|
|
144
|
-
- [8. `OpenGPT` - chat With OPENGPT](#8-opengpt---chat-with-opengpt)
|
|
145
|
-
- [9. `KOBOLDAI` -](#9-koboldai--)
|
|
146
|
-
- [10. `Reka` - chat with reka](#10-reka---chat-with-reka)
|
|
147
|
-
- [11. `Cohere` - chat with cohere](#11-cohere---chat-with-cohere)
|
|
148
|
-
- [12. `Xjai` - chat with free gpt 3.5](#12-xjai---chat-with-free-gpt-35)
|
|
149
|
-
- [13. `ThinkAny` - AI search engine](#13-thinkany---ai-search-engine)
|
|
150
|
-
- [14. `chatgptuk` - Chat with gemini-pro](#14-chatgptuk---chat-with-gemini-pro)
|
|
151
|
-
- [15. `poe`- chat with poe](#15-poe--chat-with-poe)
|
|
152
|
-
- [16. `BasedGPT` - chat with GPT](#16-basedgpt---chat-with-gpt)
|
|
153
|
-
- [17. `DeepSeek` -chat with deepseek](#17-deepseek--chat-with-deepseek)
|
|
154
|
-
- [18. Deepinfra](#18-deepinfra)
|
|
155
|
-
- [19. Deepinfra - VLM](#19-deepinfra---vlm)
|
|
156
|
-
- [`LLM`](#llm)
|
|
157
|
-
- [`Local-LLM` webscout can now run GGUF models](#local-llm-webscout-can-now-run-gguf-models)
|
|
158
|
-
- [`Local-rawdog`](#local-rawdog)
|
|
159
|
-
- [`LLM` with internet](#llm-with-internet)
|
|
160
|
-
- [`Webai` - terminal gpt and a open interpeter](#webai---terminal-gpt-and-a-open-interpeter)
|
|
161
|
-
|
|
162
107
|
## Install
|
|
163
108
|
```python
|
|
164
109
|
pip install -U webscout
|
|
@@ -530,7 +475,7 @@ You can choose from a wide range of voices, including:
|
|
|
530
475
|
- Standard and WaveNet voices for various languages (e.g., en-US, es-ES, ja-JP, etc.)
|
|
531
476
|
|
|
532
477
|
|
|
533
|
-
The WEBS and AsyncWEBS classes are used to retrieve search results from DuckDuckGo.com
|
|
478
|
+
The WEBS and AsyncWEBS classes are used to retrieve search results from DuckDuckGo.com
|
|
534
479
|
To use the AsyncWEBS class, you can perform asynchronous operations using Python's asyncio library.
|
|
535
480
|
To initialize an instance of the WEBS or AsyncWEBS classes, you can provide the following optional arguments:
|
|
536
481
|
|
|
@@ -1049,23 +994,9 @@ response = ph.ask(prompt)
|
|
|
1049
994
|
message = ph.get_message(response)
|
|
1050
995
|
print(message)
|
|
1051
996
|
```
|
|
1052
|
-
### 2. `YepChat` - Chat with mistral 8x7b powered by yepchat
|
|
1053
|
-
```python
|
|
1054
|
-
from webscout import YEPCHAT
|
|
1055
997
|
|
|
1056
|
-
# Instantiate the YEPCHAT class with default parameters
|
|
1057
|
-
YEPCHAT = YEPCHAT()
|
|
1058
|
-
|
|
1059
|
-
# Define a prompt to send to the AI
|
|
1060
|
-
prompt = "What is the capital of France?"
|
|
1061
|
-
|
|
1062
|
-
# Use the 'cha' method to get a response from the AI
|
|
1063
|
-
r = YEPCHAT.chat(prompt)
|
|
1064
|
-
print(r)
|
|
1065
998
|
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
### 3. `You.com` - search/chat with you.com - Not working
|
|
999
|
+
### . `You.com` - search/chat with you.com - Not working
|
|
1069
1000
|
```python
|
|
1070
1001
|
|
|
1071
1002
|
from webscout import YouChat
|
|
@@ -1092,32 +1023,28 @@ message = ai.get_message(response)
|
|
|
1092
1023
|
print(message)
|
|
1093
1024
|
```
|
|
1094
1025
|
|
|
1095
|
-
###
|
|
1026
|
+
### . `Gemini` - search with google gemini
|
|
1096
1027
|
|
|
1097
1028
|
```python
|
|
1098
1029
|
import webscout
|
|
1099
1030
|
from webscout import GEMINI
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
COOKIE_FILE = "path/to/bard.google.com.cookies.json"
|
|
1031
|
+
from rich import print
|
|
1032
|
+
COOKIE_FILE = "cookies.json"
|
|
1103
1033
|
|
|
1104
1034
|
# Optional: Provide proxy details if needed
|
|
1105
|
-
PROXIES = {
|
|
1106
|
-
"http": "http://proxy_server:port",
|
|
1107
|
-
"https": "https://proxy_server:port",
|
|
1108
|
-
}
|
|
1035
|
+
PROXIES = {}
|
|
1109
1036
|
|
|
1110
1037
|
# Initialize GEMINI with cookie file and optional proxies
|
|
1111
1038
|
gemini = GEMINI(cookie_file=COOKIE_FILE, proxy=PROXIES)
|
|
1112
1039
|
|
|
1113
1040
|
# Ask a question and print the response
|
|
1114
|
-
response = gemini.chat("
|
|
1041
|
+
response = gemini.chat("websearch about HelpingAI and who is its developer")
|
|
1115
1042
|
print(response)
|
|
1116
1043
|
```
|
|
1117
|
-
###
|
|
1044
|
+
### . `Berlin4h` - chat with Berlin4h
|
|
1118
1045
|
```python
|
|
1119
1046
|
from webscout import Berlin4h
|
|
1120
|
-
|
|
1047
|
+
|
|
1121
1048
|
ai = Berlin4h(
|
|
1122
1049
|
is_conversation=True,
|
|
1123
1050
|
max_tokens=800,
|
|
@@ -1135,7 +1062,7 @@ prompt = "Explain the concept of recursion in simple terms."
|
|
|
1135
1062
|
response = ai.chat(prompt)
|
|
1136
1063
|
print(response)
|
|
1137
1064
|
```
|
|
1138
|
-
###
|
|
1065
|
+
### . `BlackBox` - Search/chat With BlackBox
|
|
1139
1066
|
```python
|
|
1140
1067
|
from webscout import BLACKBOXAI
|
|
1141
1068
|
from rich import print
|
|
@@ -1166,18 +1093,20 @@ while True:
|
|
|
1166
1093
|
r = ai.chat(prompt)
|
|
1167
1094
|
print(r)
|
|
1168
1095
|
```
|
|
1169
|
-
###
|
|
1096
|
+
### . `PERPLEXITY` - Search With PERPLEXITY
|
|
1170
1097
|
```python
|
|
1171
|
-
from webscout import
|
|
1172
|
-
|
|
1173
|
-
perplexity = PERPLEXITY()
|
|
1098
|
+
from webscout import Perplexity
|
|
1099
|
+
from rich import print
|
|
1174
1100
|
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
response = perplexity.chat(
|
|
1178
|
-
|
|
1101
|
+
perplexity = Perplexity()
|
|
1102
|
+
# Stream the response
|
|
1103
|
+
response = perplexity.chat(input(">>> "))
|
|
1104
|
+
for chunk in response:
|
|
1105
|
+
print(chunk, end="", flush=True)
|
|
1106
|
+
|
|
1107
|
+
perplexity.close()
|
|
1179
1108
|
```
|
|
1180
|
-
###
|
|
1109
|
+
### `meta ai` - chat With meta ai
|
|
1181
1110
|
```python
|
|
1182
1111
|
from webscout import Meta
|
|
1183
1112
|
from rich import print
|
|
@@ -1209,7 +1138,7 @@ for media in response["media"]:
|
|
|
1209
1138
|
print(media["url"]) # Access image URLs
|
|
1210
1139
|
|
|
1211
1140
|
```
|
|
1212
|
-
###
|
|
1141
|
+
### `KOBOLDAI` -
|
|
1213
1142
|
```python
|
|
1214
1143
|
from webscout import KOBOLDAI
|
|
1215
1144
|
|
|
@@ -1228,7 +1157,7 @@ print(message)
|
|
|
1228
1157
|
|
|
1229
1158
|
```
|
|
1230
1159
|
|
|
1231
|
-
###
|
|
1160
|
+
### `Reka` - chat with reka
|
|
1232
1161
|
```python
|
|
1233
1162
|
from webscout import REKA
|
|
1234
1163
|
|
|
@@ -1239,7 +1168,7 @@ response_str = a.chat(prompt)
|
|
|
1239
1168
|
print(response_str)
|
|
1240
1169
|
```
|
|
1241
1170
|
|
|
1242
|
-
###
|
|
1171
|
+
### `Cohere` - chat with cohere
|
|
1243
1172
|
```python
|
|
1244
1173
|
from webscout import Cohere
|
|
1245
1174
|
|
|
@@ -1250,30 +1179,8 @@ response_str = a.chat(prompt)
|
|
|
1250
1179
|
print(response_str)
|
|
1251
1180
|
```
|
|
1252
1181
|
|
|
1253
|
-
### 12. `Xjai` - chat with free gpt 3.5
|
|
1254
|
-
Gratitude to [Devs do Code](http://www.youtube.com/@DevsDoCode) for their assistance.
|
|
1255
|
-
```python
|
|
1256
|
-
from webscout import Xjai
|
|
1257
|
-
from rich import print
|
|
1258
|
-
|
|
1259
|
-
ai = Xjai(
|
|
1260
|
-
is_conversation=True,
|
|
1261
|
-
max_tokens=800,
|
|
1262
|
-
timeout=30,
|
|
1263
|
-
intro=None,
|
|
1264
|
-
filepath=None,
|
|
1265
|
-
update_file=True,
|
|
1266
|
-
proxies={},
|
|
1267
|
-
history_offset=10250,
|
|
1268
|
-
act=None,
|
|
1269
|
-
)
|
|
1270
|
-
|
|
1271
|
-
prompt = "Tell me about india"
|
|
1272
1182
|
|
|
1273
|
-
|
|
1274
|
-
print(response)
|
|
1275
|
-
```
|
|
1276
|
-
### 13. `ThinkAny` - AI search engine
|
|
1183
|
+
### `ThinkAny` - AI search engine
|
|
1277
1184
|
```python
|
|
1278
1185
|
from webscout import ThinkAnyAI
|
|
1279
1186
|
|
|
@@ -1298,32 +1205,11 @@ response = ai.ask(prompt)
|
|
|
1298
1205
|
message = ai.get_message(response)
|
|
1299
1206
|
print(message)
|
|
1300
1207
|
```
|
|
1301
|
-
### 14. `chatgptuk` - Chat with gemini-pro
|
|
1302
|
-
```python
|
|
1303
|
-
from webscout import ChatGPTUK
|
|
1304
|
-
# Create an instance of the PERPLEXITY class
|
|
1305
|
-
ai = ChatGPTUK(
|
|
1306
|
-
is_conversation=True,
|
|
1307
|
-
max_tokens=800,
|
|
1308
|
-
timeout=30,
|
|
1309
|
-
intro=None,
|
|
1310
|
-
filepath=None,
|
|
1311
|
-
update_file=True,
|
|
1312
|
-
proxies={},
|
|
1313
|
-
history_offset=10250,
|
|
1314
|
-
act=None,
|
|
1315
|
-
)
|
|
1316
1208
|
|
|
1317
|
-
|
|
1318
|
-
prompt = "Explain the concept of recursion in simple terms."
|
|
1319
|
-
response = ai.chat(prompt)
|
|
1320
|
-
print(response)
|
|
1321
|
-
|
|
1322
|
-
```
|
|
1323
|
-
### 15. `poe`- chat with poe
|
|
1209
|
+
### `poe`- chat with poe
|
|
1324
1210
|
Usage code similar to other proviers
|
|
1325
1211
|
|
|
1326
|
-
###
|
|
1212
|
+
### `BasedGPT` - chat with GPT
|
|
1327
1213
|
```
|
|
1328
1214
|
from webscout import BasedGPT
|
|
1329
1215
|
|
|
@@ -1344,14 +1230,14 @@ response = basedgpt.chat(prompt)
|
|
|
1344
1230
|
# Print the AI's response
|
|
1345
1231
|
print(response)
|
|
1346
1232
|
```
|
|
1347
|
-
###
|
|
1233
|
+
### `DeepSeek` -chat with deepseek
|
|
1348
1234
|
```python
|
|
1349
1235
|
from webscout import DeepSeek
|
|
1350
1236
|
from rich import print
|
|
1351
1237
|
|
|
1352
1238
|
ai = DeepSeek(
|
|
1353
1239
|
is_conversation=True,
|
|
1354
|
-
api_key='
|
|
1240
|
+
api_key='cookie,
|
|
1355
1241
|
max_tokens=800,
|
|
1356
1242
|
timeout=30,
|
|
1357
1243
|
intro=None,
|
|
@@ -1370,7 +1256,7 @@ prompt = "Tell me about india"
|
|
|
1370
1256
|
r = ai.chat(prompt)
|
|
1371
1257
|
print(r)
|
|
1372
1258
|
```
|
|
1373
|
-
###
|
|
1259
|
+
### `Deepinfra`
|
|
1374
1260
|
```python
|
|
1375
1261
|
from webscout import DeepInfra
|
|
1376
1262
|
|
|
@@ -1396,7 +1282,7 @@ message = ai.get_message(response)
|
|
|
1396
1282
|
print(message)
|
|
1397
1283
|
```
|
|
1398
1284
|
|
|
1399
|
-
###
|
|
1285
|
+
### `Deepinfra` - VLM
|
|
1400
1286
|
```python
|
|
1401
1287
|
from webscout.Provider import VLM
|
|
1402
1288
|
|
|
@@ -1416,44 +1302,95 @@ response = vlm_instance.chat(prompt)
|
|
|
1416
1302
|
print(response)
|
|
1417
1303
|
|
|
1418
1304
|
```
|
|
1419
|
-
### 20. `VTLchat` - Free gpt3.5
|
|
1420
|
-
```python
|
|
1421
|
-
from webscout import VTLchat
|
|
1422
1305
|
|
|
1423
|
-
provider = VTLchat()
|
|
1424
|
-
response = provider.chat("Hello, how are you?")
|
|
1425
|
-
print(response)
|
|
1426
|
-
```
|
|
1427
1306
|
|
|
1428
|
-
###
|
|
1429
|
-
**Usage similar to other providers**
|
|
1430
|
-
|
|
1431
|
-
### 22. `Ollama` - chat will AI models locally
|
|
1432
|
-
```python
|
|
1433
|
-
from webscout import OLLAMA
|
|
1434
|
-
ollama_provider = OLLAMA(model="qwen2:0.5b")
|
|
1435
|
-
response = ollama_provider.chat("What is the meaning of life?")
|
|
1436
|
-
print(response)
|
|
1437
|
-
```
|
|
1438
|
-
|
|
1439
|
-
### 22. GROQ
|
|
1307
|
+
### GROQ
|
|
1440
1308
|
```python
|
|
1441
1309
|
from webscout import GROQ
|
|
1442
1310
|
ai = GROQ(api_key="")
|
|
1443
1311
|
response = ai.chat("What is the meaning of life?")
|
|
1444
1312
|
print(response)
|
|
1313
|
+
#----------------------TOOL CALL------------------
|
|
1314
|
+
from webscout import GROQ # Adjust import based on your project structure
|
|
1315
|
+
from webscout import WEBS
|
|
1316
|
+
import json
|
|
1445
1317
|
|
|
1446
|
-
|
|
1318
|
+
# Initialize the GROQ client
|
|
1319
|
+
client = GROQ(api_key="")
|
|
1320
|
+
MODEL = 'llama3-groq-70b-8192-tool-use-preview'
|
|
1321
|
+
|
|
1322
|
+
# Function to evaluate a mathematical expression
|
|
1323
|
+
def calculate(expression):
|
|
1324
|
+
"""Evaluate a mathematical expression"""
|
|
1325
|
+
try:
|
|
1326
|
+
result = eval(expression)
|
|
1327
|
+
return json.dumps({"result": result})
|
|
1328
|
+
except Exception as e:
|
|
1329
|
+
return json.dumps({"error": str(e)})
|
|
1330
|
+
|
|
1331
|
+
# Function to perform a text search using DuckDuckGo.com
|
|
1332
|
+
def search(query):
|
|
1333
|
+
"""Perform a text search using DuckDuckGo.com"""
|
|
1334
|
+
try:
|
|
1335
|
+
results = WEBS().text(query, max_results=5)
|
|
1336
|
+
return json.dumps({"results": results})
|
|
1337
|
+
except Exception as e:
|
|
1338
|
+
return json.dumps({"error": str(e)})
|
|
1339
|
+
|
|
1340
|
+
# Add the functions to the provider
|
|
1341
|
+
client.add_function("calculate", calculate)
|
|
1342
|
+
client.add_function("search", search)
|
|
1343
|
+
|
|
1344
|
+
# Define the tools
|
|
1345
|
+
tools = [
|
|
1346
|
+
{
|
|
1347
|
+
"type": "function",
|
|
1348
|
+
"function": {
|
|
1349
|
+
"name": "calculate",
|
|
1350
|
+
"description": "Evaluate a mathematical expression",
|
|
1351
|
+
"parameters": {
|
|
1352
|
+
"type": "object",
|
|
1353
|
+
"properties": {
|
|
1354
|
+
"expression": {
|
|
1355
|
+
"type": "string",
|
|
1356
|
+
"description": "The mathematical expression to evaluate",
|
|
1357
|
+
}
|
|
1358
|
+
},
|
|
1359
|
+
"required": ["expression"],
|
|
1360
|
+
},
|
|
1361
|
+
}
|
|
1362
|
+
},
|
|
1363
|
+
{
|
|
1364
|
+
"type": "function",
|
|
1365
|
+
"function": {
|
|
1366
|
+
"name": "search",
|
|
1367
|
+
"description": "Perform a text search using DuckDuckGo.com and Yep.com",
|
|
1368
|
+
"parameters": {
|
|
1369
|
+
"type": "object",
|
|
1370
|
+
"properties": {
|
|
1371
|
+
"query": {
|
|
1372
|
+
"type": "string",
|
|
1373
|
+
"description": "The search query to execute",
|
|
1374
|
+
}
|
|
1375
|
+
},
|
|
1376
|
+
"required": ["query"],
|
|
1377
|
+
},
|
|
1378
|
+
}
|
|
1379
|
+
}
|
|
1380
|
+
]
|
|
1381
|
+
|
|
1382
|
+
|
|
1383
|
+
user_prompt_calculate = "What is 25 * 4 + 10?"
|
|
1384
|
+
response_calculate = client.chat(user_prompt_calculate, tools=tools)
|
|
1385
|
+
print(response_calculate)
|
|
1386
|
+
|
|
1387
|
+
user_prompt_search = "Find information on HelpingAI and who is its developer"
|
|
1388
|
+
response_search = client.chat(user_prompt_search, tools=tools)
|
|
1389
|
+
print(response_search)
|
|
1447
1390
|
|
|
1448
|
-
### 23. Freegemini - chat with gemini for free
|
|
1449
|
-
```python
|
|
1450
|
-
from webscout import FreeGemini
|
|
1451
|
-
ai = FreeGemini()
|
|
1452
|
-
response = ai.chat("What is the meaning of life?")
|
|
1453
|
-
print(response)
|
|
1454
1391
|
```
|
|
1455
1392
|
|
|
1456
|
-
###
|
|
1393
|
+
### LLama 70b - chat with meta's llama 3 70b
|
|
1457
1394
|
```python
|
|
1458
1395
|
|
|
1459
1396
|
from webscout import LLAMA
|
|
@@ -1463,15 +1400,127 @@ llama = LLAMA()
|
|
|
1463
1400
|
r = llama.chat("What is the meaning of life?")
|
|
1464
1401
|
print(r)
|
|
1465
1402
|
```
|
|
1466
|
-
###
|
|
1403
|
+
### AndiSearch
|
|
1467
1404
|
```python
|
|
1468
1405
|
from webscout import AndiSearch
|
|
1469
1406
|
a = AndiSearch()
|
|
1470
1407
|
print(a.chat("HelpingAI-9B"))
|
|
1471
1408
|
```
|
|
1409
|
+
### Function calling-bete
|
|
1410
|
+
```python
|
|
1411
|
+
import json
|
|
1412
|
+
import logging
|
|
1413
|
+
from webscout import LLAMA3, WEBS
|
|
1414
|
+
from webscout.Agents.functioncall import FunctionCallingAgent
|
|
1415
|
+
|
|
1416
|
+
# Define tools that the agent can use
|
|
1417
|
+
tools = [
|
|
1418
|
+
{
|
|
1419
|
+
"type": "function",
|
|
1420
|
+
"function": {
|
|
1421
|
+
"name": "UserDetail",
|
|
1422
|
+
"parameters": {
|
|
1423
|
+
"type": "object",
|
|
1424
|
+
"title": "UserDetail",
|
|
1425
|
+
"properties": {
|
|
1426
|
+
"name": {
|
|
1427
|
+
"title": "Name",
|
|
1428
|
+
"type": "string"
|
|
1429
|
+
},
|
|
1430
|
+
"age": {
|
|
1431
|
+
"title": "Age",
|
|
1432
|
+
"type": "integer"
|
|
1433
|
+
}
|
|
1434
|
+
},
|
|
1435
|
+
"required": ["name", "age"]
|
|
1436
|
+
}
|
|
1437
|
+
}
|
|
1438
|
+
},
|
|
1439
|
+
{
|
|
1440
|
+
"type": "function",
|
|
1441
|
+
"function": {
|
|
1442
|
+
"name": "web_search",
|
|
1443
|
+
"description": "Search query on google",
|
|
1444
|
+
"parameters": {
|
|
1445
|
+
"type": "object",
|
|
1446
|
+
"properties": {
|
|
1447
|
+
"query": {
|
|
1448
|
+
"type": "string",
|
|
1449
|
+
"description": "web search query"
|
|
1450
|
+
}
|
|
1451
|
+
},
|
|
1452
|
+
"required": ["query"]
|
|
1453
|
+
}
|
|
1454
|
+
}
|
|
1455
|
+
},
|
|
1456
|
+
{ # New general AI tool
|
|
1457
|
+
"type": "function",
|
|
1458
|
+
"function": {
|
|
1459
|
+
"name": "general_ai",
|
|
1460
|
+
"description": "Use general AI knowledge to answer the question",
|
|
1461
|
+
"parameters": {
|
|
1462
|
+
"type": "object",
|
|
1463
|
+
"properties": {
|
|
1464
|
+
"question": {
|
|
1465
|
+
"type": "string",
|
|
1466
|
+
"description": "The question to answer"
|
|
1467
|
+
}
|
|
1468
|
+
},
|
|
1469
|
+
"required": ["question"]
|
|
1470
|
+
}
|
|
1471
|
+
}
|
|
1472
|
+
}
|
|
1473
|
+
]
|
|
1474
|
+
|
|
1475
|
+
# Initialize the FunctionCallingAgent with the specified tools
|
|
1476
|
+
agent = FunctionCallingAgent(tools=tools)
|
|
1477
|
+
llama = LLAMA3()
|
|
1478
|
+
from rich import print
|
|
1479
|
+
# Input message from the user
|
|
1480
|
+
user = input(">>> ")
|
|
1481
|
+
message = user
|
|
1482
|
+
function_call_data = agent.function_call_handler(message)
|
|
1483
|
+
print(f"Function Call Data: {function_call_data}")
|
|
1484
|
+
|
|
1485
|
+
# Check for errors in the function call data
|
|
1486
|
+
if "error" not in function_call_data:
|
|
1487
|
+
function_name = function_call_data.get("tool_name") # Use 'tool_name' instead of 'name'
|
|
1488
|
+
if function_name == "web_search":
|
|
1489
|
+
arguments = function_call_data.get("tool_input", {}) # Get tool input arguments
|
|
1490
|
+
query = arguments.get("query")
|
|
1491
|
+
if query:
|
|
1492
|
+
with WEBS() as webs:
|
|
1493
|
+
search_results = webs.text(query, max_results=5)
|
|
1494
|
+
prompt = (
|
|
1495
|
+
f"Based on the following search results:\n\n{search_results}\n\n"
|
|
1496
|
+
f"Question: {user}\n\n"
|
|
1497
|
+
"Please provide a comprehensive answer to the question based on the search results above. "
|
|
1498
|
+
"Include relevant webpage URLs in your answer when appropriate. "
|
|
1499
|
+
"If the search results don't contain relevant information, please state that and provide the best answer you can based on your general knowledge."
|
|
1500
|
+
)
|
|
1501
|
+
response = llama.chat(prompt)
|
|
1502
|
+
for c in response:
|
|
1503
|
+
print(c, end="", flush=True)
|
|
1472
1504
|
|
|
1473
|
-
|
|
1474
|
-
|
|
1505
|
+
else:
|
|
1506
|
+
print("Please provide a search query.")
|
|
1507
|
+
elif function_name == "general_ai": # Handle general AI tool
|
|
1508
|
+
arguments = function_call_data.get("tool_input", {})
|
|
1509
|
+
question = arguments.get("question")
|
|
1510
|
+
if question:
|
|
1511
|
+
response = llama.chat(question) # Use LLM directly
|
|
1512
|
+
for c in response:
|
|
1513
|
+
print(c, end="", flush=True)
|
|
1514
|
+
else:
|
|
1515
|
+
print("Please provide a question.")
|
|
1516
|
+
else:
|
|
1517
|
+
result = agent.execute_function(function_call_data)
|
|
1518
|
+
print(f"Function Execution Result: {result}")
|
|
1519
|
+
else:
|
|
1520
|
+
print(f"Error: {function_call_data['error']}")
|
|
1521
|
+
```
|
|
1522
|
+
### LLAMA3, pizzagpt, RUBIKSAI, Koala, Darkai, AI4Chat, Farfalle
|
|
1523
|
+
code similar to other provider
|
|
1475
1524
|
### `LLM`
|
|
1476
1525
|
```python
|
|
1477
1526
|
from webscout.LLM import LLM
|
|
@@ -1514,7 +1563,7 @@ from webscout.Local import formats
|
|
|
1514
1563
|
# 1. Download the model
|
|
1515
1564
|
repo_id = "microsoft/Phi-3-mini-4k-instruct-gguf" # Replace with the desired Hugging Face repo
|
|
1516
1565
|
filename = "Phi-3-mini-4k-instruct-q4.gguf" # Replace with the correct filename
|
|
1517
|
-
model_path = download_model(repo_id, filename)
|
|
1566
|
+
model_path = download_model(repo_id, filename, token="")
|
|
1518
1567
|
|
|
1519
1568
|
# 2. Load the model
|
|
1520
1569
|
model = Model(model_path, n_gpu_layers=4)
|
|
@@ -1674,82 +1723,8 @@ autollama(
|
|
|
1674
1723
|
* The `model_path` in `autollama` is the Hugging Face model ID, and `gguf_file` is the GGUF file ID.
|
|
1675
1724
|
|
|
1676
1725
|
|
|
1677
|
-
### `LLM` with internet
|
|
1678
|
-
```python
|
|
1679
|
-
from __future__ import annotations
|
|
1680
|
-
from typing import List, Optional
|
|
1681
|
-
|
|
1682
|
-
from webscout.LLM import LLM
|
|
1683
|
-
from webscout import WEBS
|
|
1684
|
-
import warnings
|
|
1685
|
-
|
|
1686
|
-
system_message: str = (
|
|
1687
|
-
"As an AI assistant, I have been designed with advanced capabilities, including real-time access to online resources. This enables me to enrich our conversations and provide you with informed and accurate responses, drawing from a vast array of information. With each interaction, my goal is to create a seamless and meaningful connection, offering insights and sharing relevant content."
|
|
1688
|
-
"My directives emphasize the importance of respect, impartiality, and intellectual integrity. I am here to provide unbiased responses, ensuring an ethical and respectful exchange. I will respect your privacy and refrain from sharing any personal information that may be obtained during our conversations or through web searches, only utilizing web search functionality when necessary to provide the most accurate and up-to-date information."
|
|
1689
|
-
"Together, let's explore a diverse range of topics, creating an enjoyable and informative experience, all while maintaining the highest standards of privacy and respect"
|
|
1690
|
-
)
|
|
1691
|
-
|
|
1692
|
-
# Ignore the specific UserWarning
|
|
1693
|
-
warnings.filterwarnings("ignore", category=UserWarning, module="curl_cffio", lineno=205)
|
|
1694
|
-
LLM = LLM(model="mistralai/Mixtral-8x22B-Instruct-v0.1", system_message=system_message)
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
def chat(
|
|
1698
|
-
user_input: str, webs: WEBS, max_results: int = 10
|
|
1699
|
-
) -> Optional[str]:
|
|
1700
|
-
"""
|
|
1701
|
-
Chat function to perform a web search based on the user input and generate a response using the LLM model.
|
|
1702
|
-
|
|
1703
|
-
Parameters
|
|
1704
|
-
----------
|
|
1705
|
-
user_input : str
|
|
1706
|
-
The user input to be used for the web search
|
|
1707
|
-
webs : WEBS
|
|
1708
|
-
The web search instance to be used to perform the search
|
|
1709
|
-
max_results : int, optional
|
|
1710
|
-
The maximum number of search results to include in the response, by default 10
|
|
1711
|
-
|
|
1712
|
-
Returns
|
|
1713
|
-
-------
|
|
1714
|
-
Optional[str]
|
|
1715
|
-
The response generated by the LLM model, or None if there is no response
|
|
1716
|
-
"""
|
|
1717
|
-
# Perform a web search based on the user input
|
|
1718
|
-
search_results: List[str] = []
|
|
1719
|
-
for r in webs.text(
|
|
1720
|
-
user_input, region="wt-wt", safesearch="off", timelimit="y", max_results=max_results
|
|
1721
|
-
):
|
|
1722
|
-
search_results.append(str(r)) # Convert each result to a string
|
|
1723
|
-
|
|
1724
|
-
# Define the messages to be sent, including the user input, search results, and system message
|
|
1725
|
-
messages = [
|
|
1726
|
-
{"role": "user", "content": user_input + "\n" + "websearch results are:" + "\n".join(search_results)},
|
|
1727
|
-
]
|
|
1728
|
-
|
|
1729
|
-
# Use the chat method to get the response
|
|
1730
|
-
response = LLM.chat(messages)
|
|
1731
|
-
|
|
1732
|
-
return response
|
|
1733
|
-
|
|
1734
|
-
|
|
1735
|
-
if __name__ == "__main__":
|
|
1736
|
-
while True:
|
|
1737
|
-
# Get the user input
|
|
1738
|
-
user_input = input("User: ")
|
|
1739
|
-
|
|
1740
|
-
# Perform a web search based on the user input
|
|
1741
|
-
with WEBS() as webs:
|
|
1742
|
-
response = chat(user_input, webs)
|
|
1743
|
-
|
|
1744
|
-
# Print the response
|
|
1745
|
-
if response:
|
|
1746
|
-
print("AI:", response)
|
|
1747
|
-
else:
|
|
1748
|
-
print("No response")
|
|
1749
|
-
```
|
|
1750
1726
|
|
|
1751
1727
|
## `Webai` - terminal gpt and a open interpeter
|
|
1752
|
-
Code is in rawdog.py file
|
|
1753
1728
|
```
|
|
1754
1729
|
```shell
|
|
1755
1730
|
python -m webscout.webai webai --provider "phind" --rawdog
|