webscout 3.7__py3-none-any.whl → 3.9__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of webscout might be problematic. Click here for more details.
- webscout/AIutel.py +5 -1
- webscout/Extra/autollama.py +158 -7
- webscout/Extra/gguf.py +164 -4
- webscout/Local/_version.py +1 -1
- webscout/Provider/Geminiflash.py +152 -0
- webscout/Provider/Geminipro.py +152 -0
- webscout/Provider/Youchat.py +5 -1
- webscout/Provider/__init__.py +6 -0
- webscout/__init__.py +5 -1
- webscout/version.py +1 -1
- webscout/webai.py +48 -0
- {webscout-3.7.dist-info → webscout-3.9.dist-info}/METADATA +6 -331
- {webscout-3.7.dist-info → webscout-3.9.dist-info}/RECORD +17 -15
- {webscout-3.7.dist-info → webscout-3.9.dist-info}/LICENSE.md +0 -0
- {webscout-3.7.dist-info → webscout-3.9.dist-info}/WHEEL +0 -0
- {webscout-3.7.dist-info → webscout-3.9.dist-info}/entry_points.txt +0 -0
- {webscout-3.7.dist-info → webscout-3.9.dist-info}/top_level.txt +0 -0
webscout/AIutel.py
CHANGED
|
@@ -19,7 +19,7 @@ from playsound import playsound
|
|
|
19
19
|
from time import sleep as wait
|
|
20
20
|
import pathlib
|
|
21
21
|
import urllib.parse
|
|
22
|
-
appdir = appdirs.AppDirs("AIWEBS", "
|
|
22
|
+
appdir = appdirs.AppDirs("AIWEBS", "webscout")
|
|
23
23
|
|
|
24
24
|
default_path = appdir.user_cache_dir
|
|
25
25
|
|
|
@@ -49,7 +49,11 @@ webai = [
|
|
|
49
49
|
"basedgpt",
|
|
50
50
|
"deepseek",
|
|
51
51
|
"deepinfra",
|
|
52
|
+
"vtlchat",
|
|
53
|
+
"geminiflash",
|
|
54
|
+
"geminipro",
|
|
52
55
|
]
|
|
56
|
+
|
|
53
57
|
gpt4free_providers = [
|
|
54
58
|
provider.__name__ for provider in g4f.Provider.__providers__ # if provider.working
|
|
55
59
|
]
|
webscout/Extra/autollama.py
CHANGED
|
@@ -10,11 +10,161 @@ def autollama(model_path, gguf_file):
|
|
|
10
10
|
gguf_file (str): The name of the GGUF file.
|
|
11
11
|
"""
|
|
12
12
|
|
|
13
|
-
#
|
|
14
|
-
|
|
13
|
+
# Check if autollama.sh exists in the current working directory
|
|
14
|
+
script_path = os.path.join(os.getcwd(), "autollama.sh")
|
|
15
|
+
if not os.path.exists(script_path):
|
|
16
|
+
# Create autollama.sh with the content provided
|
|
17
|
+
with open(script_path, "w") as f:
|
|
18
|
+
f.write("""
|
|
19
|
+
function show_art() {
|
|
20
|
+
cat << "EOF"
|
|
21
|
+
Made with love in India
|
|
22
|
+
EOF
|
|
23
|
+
}
|
|
15
24
|
|
|
16
|
-
|
|
17
|
-
|
|
25
|
+
show_art
|
|
26
|
+
|
|
27
|
+
# Initialize default values
|
|
28
|
+
MODEL_PATH=""
|
|
29
|
+
GGUF_FILE=""
|
|
30
|
+
|
|
31
|
+
# Display help/usage information
|
|
32
|
+
usage() {
|
|
33
|
+
echo "Usage: $0 -m <model_path> -g <gguf_file>"
|
|
34
|
+
echo
|
|
35
|
+
echo "Options:"
|
|
36
|
+
echo " -m <model_path> Set the path to the model"
|
|
37
|
+
echo " -g <gguf_file> Set the GGUF file name"
|
|
38
|
+
echo " -h Display this help and exit"
|
|
39
|
+
echo
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
# Parse command-line options
|
|
43
|
+
while getopts ":m:g:h" opt; do
|
|
44
|
+
case ${opt} in
|
|
45
|
+
m )
|
|
46
|
+
MODEL_PATH=$OPTARG
|
|
47
|
+
;;
|
|
48
|
+
g )
|
|
49
|
+
GGUF_FILE=$OPTARG
|
|
50
|
+
;;
|
|
51
|
+
h )
|
|
52
|
+
usage
|
|
53
|
+
exit 0
|
|
54
|
+
;;
|
|
55
|
+
\? )
|
|
56
|
+
echo "Invalid Option: -$OPTARG" 1>&2
|
|
57
|
+
usage
|
|
58
|
+
exit 1
|
|
59
|
+
;;
|
|
60
|
+
: )
|
|
61
|
+
echo "Invalid Option: -$OPTARG requires an argument" 1>&2
|
|
62
|
+
usage
|
|
63
|
+
exit 1
|
|
64
|
+
;;
|
|
65
|
+
esac
|
|
66
|
+
done
|
|
67
|
+
|
|
68
|
+
# Check required parameters
|
|
69
|
+
if [ -z "$MODEL_PATH" ] || [ -z "$GGUF_FILE" ]; then
|
|
70
|
+
echo "Error: -m (model_path) and -g (gguf_file) are required."
|
|
71
|
+
usage
|
|
72
|
+
exit 1
|
|
73
|
+
fi
|
|
74
|
+
|
|
75
|
+
# Derive MODEL_NAME
|
|
76
|
+
MODEL_NAME=$(echo $GGUF_FILE | sed 's/\(.*\)\.Q4.*/\\1/')
|
|
77
|
+
|
|
78
|
+
# Log file where downloaded models are recorded
|
|
79
|
+
DOWNLOAD_LOG="downloaded_models.log"
|
|
80
|
+
|
|
81
|
+
# Composite logging name
|
|
82
|
+
LOGGING_NAME="${MODEL_PATH}_${MODEL_NAME}"
|
|
83
|
+
|
|
84
|
+
# Check if the model has been downloaded
|
|
85
|
+
function is_model_downloaded {
|
|
86
|
+
grep -qxF "$LOGGING_NAME" "$DOWNLOAD_LOG" && return 0 || return 1
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
# Log the downloaded model
|
|
90
|
+
function log_downloaded_model {
|
|
91
|
+
echo "$LOGGING_NAME" >> "$DOWNLOAD_LOG"
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
# Function to check if the model has already been created
|
|
95
|
+
function is_model_created {
|
|
96
|
+
# 'ollama list' lists all models
|
|
97
|
+
ollama list | grep -q "$MODEL_NAME" && return 0 || return 1
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
# Check if huggingface-hub is installed, and install it if not
|
|
101
|
+
if ! pip show huggingface-hub > /dev/null; then
|
|
102
|
+
echo "Installing huggingface-hub..."
|
|
103
|
+
pip install -U "huggingface_hub[cli]"
|
|
104
|
+
else
|
|
105
|
+
echo "huggingface-hub is already installed."
|
|
106
|
+
fi
|
|
107
|
+
|
|
108
|
+
# Check if the model has already been downloaded
|
|
109
|
+
if is_model_downloaded; then
|
|
110
|
+
echo "Model $LOGGING_NAME has already been downloaded. Skipping download."
|
|
111
|
+
else
|
|
112
|
+
echo "Downloading model $LOGGING_NAME..."
|
|
113
|
+
# Download the model
|
|
114
|
+
huggingface-cli download $MODEL_PATH $GGUF_FILE --local-dir downloads --local-dir-use-symlinks False
|
|
115
|
+
|
|
116
|
+
# Log the downloaded model
|
|
117
|
+
log_downloaded_model
|
|
118
|
+
echo "Model $LOGGING_NAME downloaded and logged."
|
|
119
|
+
fi
|
|
120
|
+
|
|
121
|
+
# Check if Ollama is installed, and install it if not
|
|
122
|
+
if ! command -v ollama &> /dev/null; then
|
|
123
|
+
echo "Installing Ollama..."
|
|
124
|
+
curl -fsSL https://ollama.com/install.sh | sh
|
|
125
|
+
else
|
|
126
|
+
echo "Ollama is already installed."
|
|
127
|
+
fi
|
|
128
|
+
|
|
129
|
+
# Check if Ollama is already running
|
|
130
|
+
if pgrep -f 'ollama serve' > /dev/null; then
|
|
131
|
+
echo "Ollama is already running. Skipping the start."
|
|
132
|
+
else
|
|
133
|
+
echo "Starting Ollama..."
|
|
134
|
+
# Start Ollama in the background
|
|
135
|
+
ollama serve &
|
|
136
|
+
|
|
137
|
+
# Wait for Ollama to start
|
|
138
|
+
while true; do
|
|
139
|
+
if pgrep -f 'ollama serve' > /dev/null; then
|
|
140
|
+
echo "Ollama has started."
|
|
141
|
+
sleep 60
|
|
142
|
+
break
|
|
143
|
+
else
|
|
144
|
+
echo "Waiting for Ollama to start..."
|
|
145
|
+
sleep 1 # Wait for 1 second before checking again
|
|
146
|
+
fi
|
|
147
|
+
done
|
|
148
|
+
fi
|
|
149
|
+
|
|
150
|
+
# Check if the model has already been created
|
|
151
|
+
if is_model_created; then
|
|
152
|
+
echo "Model $MODEL_NAME is already created. Skipping creation."
|
|
153
|
+
else
|
|
154
|
+
echo "Creating model $MODEL_NAME..."
|
|
155
|
+
# Create the model in Ollama
|
|
156
|
+
# Prepare Modelfile with the downloaded path
|
|
157
|
+
echo "FROM ./downloads/$GGUF_FILE" > Modelfile
|
|
158
|
+
ollama create $MODEL_NAME -f Modelfile
|
|
159
|
+
echo "Model $MODEL_NAME created."
|
|
160
|
+
fi
|
|
161
|
+
|
|
162
|
+
|
|
163
|
+
echo "model name is > $MODEL_NAME"
|
|
164
|
+
echo "Use Ollama run $MODEL_NAME"
|
|
165
|
+
""")
|
|
166
|
+
# Make autollama.sh executable (using chmod)
|
|
167
|
+
os.chmod(script_path, 0o755)
|
|
18
168
|
|
|
19
169
|
# Initialize command list
|
|
20
170
|
command = ["bash", script_path, "-m", model_path, "-g", gguf_file]
|
|
@@ -32,8 +182,8 @@ def autollama(model_path, gguf_file):
|
|
|
32
182
|
process.wait()
|
|
33
183
|
|
|
34
184
|
def main():
|
|
35
|
-
parser = argparse.ArgumentParser(description='
|
|
36
|
-
parser.add_argument('-m', '--model_path', required=True, help='Set the
|
|
185
|
+
parser = argparse.ArgumentParser(description='Automatically create and run an Ollama model in Ollama')
|
|
186
|
+
parser.add_argument('-m', '--model_path', required=True, help='Set the hunggingface model id to the Hugging Face model')
|
|
37
187
|
parser.add_argument('-g', '--gguf_file', required=True, help='Set the GGUF file name')
|
|
38
188
|
args = parser.parse_args()
|
|
39
189
|
|
|
@@ -44,4 +194,5 @@ def main():
|
|
|
44
194
|
exit(1)
|
|
45
195
|
|
|
46
196
|
if __name__ == "__main__":
|
|
47
|
-
main()
|
|
197
|
+
main()
|
|
198
|
+
|
webscout/Extra/gguf.py
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
# webscout/Extra/gguf.py
|
|
1
2
|
import subprocess
|
|
2
3
|
import argparse
|
|
3
4
|
import os
|
|
@@ -30,11 +31,169 @@ def convert(model_id, username=None, token=None, quantization_methods="q4_k_m,q5
|
|
|
30
31
|
if method not in valid_methods:
|
|
31
32
|
raise ValueError(f"Invalid method: {method}. Please select from the available methods: {', '.join(valid_methods)}")
|
|
32
33
|
|
|
33
|
-
|
|
34
|
-
|
|
34
|
+
# Construct the absolute path to the shell script
|
|
35
|
+
script_path = os.path.join(os.getcwd(), "gguf.sh")
|
|
36
|
+
if not os.path.exists(script_path):
|
|
37
|
+
# Create autollama.sh with the content provided
|
|
38
|
+
with open(script_path, "w") as f:
|
|
39
|
+
f.write("""
|
|
40
|
+
cat << "EOF"
|
|
41
|
+
Made with love in India
|
|
42
|
+
EOF
|
|
35
43
|
|
|
36
|
-
|
|
37
|
-
|
|
44
|
+
# Default values
|
|
45
|
+
MODEL_ID=""
|
|
46
|
+
USERNAME=""
|
|
47
|
+
TOKEN=""
|
|
48
|
+
QUANTIZATION_METHODS="q4_k_m,q5_k_m" # Default to "q4_k_m,q5_k_m" if not provided
|
|
49
|
+
|
|
50
|
+
# Display help/usage information
|
|
51
|
+
usage() {
|
|
52
|
+
echo "Usage: $0 -m MODEL_ID [-u USERNAME] [-t TOKEN] [-q QUANTIZATION_METHODS]"
|
|
53
|
+
echo
|
|
54
|
+
echo "Options:"
|
|
55
|
+
echo " -m MODEL_ID Required: Set the HF model ID"
|
|
56
|
+
echo " -u USERNAME Optional: Set the username"
|
|
57
|
+
echo " -t TOKEN Optional: Set the token"
|
|
58
|
+
echo " -q QUANTIZATION_METHODS Optional: Set the quantization methods (default: q4_k_m,q5_k_m)"
|
|
59
|
+
echo " -h Display this help and exit"
|
|
60
|
+
echo
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
# Parse command-line options
|
|
64
|
+
while getopts ":m:u:t:q:h" opt; do
|
|
65
|
+
case ${opt} in
|
|
66
|
+
m )
|
|
67
|
+
MODEL_ID=$OPTARG
|
|
68
|
+
;;
|
|
69
|
+
u )
|
|
70
|
+
USERNAME=$OPTARG
|
|
71
|
+
;;
|
|
72
|
+
t )
|
|
73
|
+
TOKEN=$OPTARG
|
|
74
|
+
;;
|
|
75
|
+
q )
|
|
76
|
+
QUANTIZATION_METHODS=$OPTARG
|
|
77
|
+
;;
|
|
78
|
+
h )
|
|
79
|
+
usage
|
|
80
|
+
exit 0
|
|
81
|
+
;;
|
|
82
|
+
\? )
|
|
83
|
+
echo "Invalid Option: -$OPTARG" 1>&2
|
|
84
|
+
usage
|
|
85
|
+
exit 1
|
|
86
|
+
;;
|
|
87
|
+
: )
|
|
88
|
+
echo "Invalid Option: -$OPTARG requires an argument" 1>&2
|
|
89
|
+
usage
|
|
90
|
+
exit 1
|
|
91
|
+
;;
|
|
92
|
+
esac
|
|
93
|
+
done
|
|
94
|
+
shift $((OPTIND -1))
|
|
95
|
+
|
|
96
|
+
# Ensure MODEL_ID is provided
|
|
97
|
+
if [ -z "$MODEL_ID" ]; then
|
|
98
|
+
echo "Error: MODEL_ID is required."
|
|
99
|
+
usage
|
|
100
|
+
exit 1
|
|
101
|
+
fi
|
|
102
|
+
|
|
103
|
+
# # Echoing the arguments for checking
|
|
104
|
+
# echo "MODEL_ID: $MODEL_ID"
|
|
105
|
+
# echo "USERNAME: ${USERNAME:-'Not provided'}"
|
|
106
|
+
# echo "TOKEN: ${TOKEN:-'Not provided'}"
|
|
107
|
+
# echo "QUANTIZATION_METHODS: $QUANTIZATION_METHODS"
|
|
108
|
+
|
|
109
|
+
# Splitting string into an array for quantization methods, if provided
|
|
110
|
+
IFS=',' read -r -a QUANTIZATION_METHOD_ARRAY <<< "$QUANTIZATION_METHODS"
|
|
111
|
+
echo "Quantization Methods: ${QUANTIZATION_METHOD_ARRAY[@]}"
|
|
112
|
+
|
|
113
|
+
MODEL_NAME=$(echo "$MODEL_ID" | awk -F'/' '{print $NF}')
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
# ----------- llama.cpp setup block-----------
|
|
117
|
+
# Check if llama.cpp is already installed and skip the build step if it is
|
|
118
|
+
if [ ! -d "llama.cpp" ]; then
|
|
119
|
+
echo "llama.cpp not found. Cloning and setting up..."
|
|
120
|
+
git clone https://github.com/ggerganov/llama.cpp
|
|
121
|
+
cd llama.cpp && git pull
|
|
122
|
+
# Install required packages
|
|
123
|
+
pip3 install -r requirements.txt
|
|
124
|
+
# Build llama.cpp as it's freshly cloned
|
|
125
|
+
if ! command -v nvcc &> /dev/null
|
|
126
|
+
then
|
|
127
|
+
echo "nvcc could not be found, building llama without LLAMA_CUBLAS"
|
|
128
|
+
make clean && make
|
|
129
|
+
else
|
|
130
|
+
make clean && LLAMA_CUBLAS=1 make
|
|
131
|
+
fi
|
|
132
|
+
cd ..
|
|
133
|
+
else
|
|
134
|
+
echo "llama.cpp found. Assuming it's already built and up to date."
|
|
135
|
+
# Optionally, still update dependencies
|
|
136
|
+
# cd llama.cpp && pip3 install -r requirements.txt && cd ..
|
|
137
|
+
fi
|
|
138
|
+
# ----------- llama.cpp setup block-----------
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
|
|
142
|
+
|
|
143
|
+
# Download model
|
|
144
|
+
#todo : shall we put condition to check if model has been already downloaded? similar to autogguf?
|
|
145
|
+
echo "Downloading the model..."
|
|
146
|
+
huggingface-cli download "$MODEL_ID" --local-dir "./${MODEL_NAME}" --local-dir-use-symlinks False --revision main
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
# Convert to fp16
|
|
150
|
+
FP16="${MODEL_NAME}/${MODEL_NAME,,}.fp16.bin"
|
|
151
|
+
echo "Converting the model to fp16..."
|
|
152
|
+
python3 llama.cpp/convert-hf-to-gguf.py "$MODEL_NAME" --outtype f16 --outfile "$FP16"
|
|
153
|
+
|
|
154
|
+
# Quantize the model
|
|
155
|
+
echo "Quantizing the model..."
|
|
156
|
+
for METHOD in "${QUANTIZATION_METHOD_ARRAY[@]}"; do
|
|
157
|
+
QTYPE="${MODEL_NAME}/${MODEL_NAME,,}.${METHOD^^}.gguf"
|
|
158
|
+
./llama.cpp/llama-quantize "$FP16" "$QTYPE" "$METHOD"
|
|
159
|
+
done
|
|
160
|
+
|
|
161
|
+
|
|
162
|
+
# Check if USERNAME and TOKEN are provided
|
|
163
|
+
if [[ -n "$USERNAME" && -n "$TOKEN" ]]; then
|
|
164
|
+
|
|
165
|
+
# Login to Hugging Face
|
|
166
|
+
echo "Logging in to Hugging Face..."
|
|
167
|
+
huggingface-cli login --token "$TOKEN"
|
|
168
|
+
|
|
169
|
+
|
|
170
|
+
# Uploading .gguf, .md files, and config.json
|
|
171
|
+
echo "Uploading .gguf, .md files, and config.json..."
|
|
172
|
+
|
|
173
|
+
|
|
174
|
+
# Define a temporary directory
|
|
175
|
+
TEMP_DIR="./temp_upload_dir"
|
|
176
|
+
|
|
177
|
+
# Create the temporary directory
|
|
178
|
+
mkdir -p "${TEMP_DIR}"
|
|
179
|
+
|
|
180
|
+
# Copy the specific files to the temporary directory
|
|
181
|
+
find "./${MODEL_NAME}" -type f \( -name "*.gguf" -o -name "*.md" -o -name "config.json" \) -exec cp {} "${TEMP_DIR}/" \;
|
|
182
|
+
|
|
183
|
+
# Upload the temporary directory to Hugging Face
|
|
184
|
+
huggingface-cli upload "${USERNAME}/${MODEL_NAME}-GGUF" "${TEMP_DIR}" --private
|
|
185
|
+
|
|
186
|
+
# Remove the temporary directory after upload
|
|
187
|
+
rm -rf "${TEMP_DIR}"
|
|
188
|
+
echo "Upload completed."
|
|
189
|
+
else
|
|
190
|
+
echo "USERNAME and TOKEN must be provided for upload."
|
|
191
|
+
fi
|
|
192
|
+
|
|
193
|
+
echo "Script completed."
|
|
194
|
+
""")
|
|
195
|
+
# Make autollama.sh executable (using chmod)
|
|
196
|
+
os.chmod(script_path, 0o755)
|
|
38
197
|
|
|
39
198
|
# Construct the command
|
|
40
199
|
command = ["bash", script_path, "-m", model_id]
|
|
@@ -60,6 +219,7 @@ def convert(model_id, username=None, token=None, quantization_methods="q4_k_m,q5
|
|
|
60
219
|
|
|
61
220
|
process.wait()
|
|
62
221
|
|
|
222
|
+
|
|
63
223
|
def main():
|
|
64
224
|
parser = argparse.ArgumentParser(description='Convert and quantize model using gguf.sh')
|
|
65
225
|
parser.add_argument('-m', '--model_id', required=True, help='Set the HF model ID (e.g., "google/flan-t5-xl")')
|
webscout/Local/_version.py
CHANGED
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
import requests
|
|
2
|
+
from ..AIbase import Provider
|
|
3
|
+
from ..AIutel import Conversation
|
|
4
|
+
from ..AIutel import Optimizers
|
|
5
|
+
from ..AIutel import AwesomePrompts
|
|
6
|
+
from webscout import exceptions
|
|
7
|
+
|
|
8
|
+
class GEMINIFLASH(Provider):
|
|
9
|
+
def __init__(
|
|
10
|
+
self,
|
|
11
|
+
is_conversation: bool = True,
|
|
12
|
+
max_tokens: int = 600,
|
|
13
|
+
timeout: int = 30,
|
|
14
|
+
intro: str = None,
|
|
15
|
+
filepath: str = None,
|
|
16
|
+
update_file: bool = True,
|
|
17
|
+
proxies: dict = {},
|
|
18
|
+
history_offset: int = 10250,
|
|
19
|
+
act: str = None,
|
|
20
|
+
):
|
|
21
|
+
"""Initializes GEMINI
|
|
22
|
+
|
|
23
|
+
Args:
|
|
24
|
+
is_conversation (bool, optional): Flag for chatting conversationally. Defaults to True.
|
|
25
|
+
max_tokens (int, optional): Maximum number of tokens to be generated upon completion. Defaults to 600.
|
|
26
|
+
timeout (int, optional): Http request timeout. Defaults to 30.
|
|
27
|
+
intro (str, optional): Conversation introductory prompt. Defaults to None.
|
|
28
|
+
filepath (str, optional): Path to file containing conversation history. Defaults to None.
|
|
29
|
+
update_file (bool, optional): Add new prompts and responses to the file. Defaults to True.
|
|
30
|
+
proxies (dict, optional): Http request proxies. Defaults to {}.
|
|
31
|
+
history_offset (int, optional): Limit conversation history to this number of last texts. Defaults to 10250.
|
|
32
|
+
act (str|int, optional): Awesome prompt key or index. (Used as intro). Defaults to None.
|
|
33
|
+
"""
|
|
34
|
+
self.session = requests.Session()
|
|
35
|
+
self.is_conversation = is_conversation
|
|
36
|
+
self.max_tokens_to_sample = max_tokens
|
|
37
|
+
self.chat_endpoint = "https://gemini-flash.developer-house.workers.dev"
|
|
38
|
+
self.timeout = timeout
|
|
39
|
+
self.last_response = {}
|
|
40
|
+
self.__available_optimizers = (
|
|
41
|
+
method
|
|
42
|
+
for method in dir(Optimizers)
|
|
43
|
+
if callable(getattr(Optimizers, method)) and not method.startswith("__")
|
|
44
|
+
)
|
|
45
|
+
Conversation.intro = (
|
|
46
|
+
AwesomePrompts().get_act(
|
|
47
|
+
act, raise_not_found=True, default=None, case_insensitive=True
|
|
48
|
+
)
|
|
49
|
+
if act
|
|
50
|
+
else intro or Conversation.intro
|
|
51
|
+
)
|
|
52
|
+
self.conversation = Conversation(
|
|
53
|
+
is_conversation, self.max_tokens_to_sample, filepath, update_file
|
|
54
|
+
)
|
|
55
|
+
self.conversation.history_offset = history_offset
|
|
56
|
+
self.session.proxies = proxies
|
|
57
|
+
|
|
58
|
+
def ask(
|
|
59
|
+
self,
|
|
60
|
+
prompt: str,
|
|
61
|
+
stream: bool = False,
|
|
62
|
+
raw: bool = False,
|
|
63
|
+
optimizer: str = None,
|
|
64
|
+
conversationally: bool = False,
|
|
65
|
+
) -> dict:
|
|
66
|
+
"""Chat with AI
|
|
67
|
+
|
|
68
|
+
Args:
|
|
69
|
+
prompt (str): Prompt to be send.
|
|
70
|
+
stream (bool, optional): Flag for streaming response. Defaults to False.
|
|
71
|
+
raw (bool, optional): Stream back raw response as received. Defaults to False.
|
|
72
|
+
optimizer (str, optional): Prompt optimizer name - `[code, shell_command]`. Defaults to None.
|
|
73
|
+
conversationally (bool, optional): Chat conversationally when using optimizer. Defaults to False.
|
|
74
|
+
Returns:
|
|
75
|
+
dict : {}
|
|
76
|
+
```json
|
|
77
|
+
{
|
|
78
|
+
"text" : "How may I assist you today?"
|
|
79
|
+
}
|
|
80
|
+
```
|
|
81
|
+
"""
|
|
82
|
+
conversation_prompt = self.conversation.gen_complete_prompt(prompt)
|
|
83
|
+
if optimizer:
|
|
84
|
+
if optimizer in self.__available_optimizers:
|
|
85
|
+
conversation_prompt = getattr(Optimizers, optimizer)(
|
|
86
|
+
conversation_prompt if conversationally else prompt
|
|
87
|
+
)
|
|
88
|
+
else:
|
|
89
|
+
raise Exception(
|
|
90
|
+
f"Optimizer is not one of {self.__available_optimizers}"
|
|
91
|
+
)
|
|
92
|
+
self.session.headers.update(
|
|
93
|
+
{
|
|
94
|
+
"Content-Type": "application/json",
|
|
95
|
+
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36",
|
|
96
|
+
}
|
|
97
|
+
)
|
|
98
|
+
payload = {"question": conversation_prompt}
|
|
99
|
+
|
|
100
|
+
response = self.session.get(
|
|
101
|
+
self.chat_endpoint, params=payload, stream=True, timeout=self.timeout
|
|
102
|
+
)
|
|
103
|
+
if not response.ok:
|
|
104
|
+
raise exceptions.FailedToGenerateResponseError(
|
|
105
|
+
f"Failed to generate response - ({response.status_code}, {response.reason}) - {response.text}"
|
|
106
|
+
)
|
|
107
|
+
|
|
108
|
+
resp = response.json()
|
|
109
|
+
self.last_response.update(resp)
|
|
110
|
+
self.conversation.update_chat_history(
|
|
111
|
+
prompt, self.get_message(self.last_response)
|
|
112
|
+
)
|
|
113
|
+
return resp
|
|
114
|
+
|
|
115
|
+
def chat(
|
|
116
|
+
self,
|
|
117
|
+
prompt: str,
|
|
118
|
+
stream: bool = False,
|
|
119
|
+
optimizer: str = None,
|
|
120
|
+
conversationally: bool = False,
|
|
121
|
+
) -> str:
|
|
122
|
+
"""Generate response `str`
|
|
123
|
+
Args:
|
|
124
|
+
prompt (str): Prompt to be send.
|
|
125
|
+
stream (bool, optional): Flag for streaming response. Defaults to False.
|
|
126
|
+
optimizer (str, optional): Prompt optimizer name - `[code, shell_command]`. Defaults to None.
|
|
127
|
+
conversationally (bool, optional): Chat conversationally when using optimizer. Defaults to False.
|
|
128
|
+
Returns:
|
|
129
|
+
str: Response generated
|
|
130
|
+
"""
|
|
131
|
+
return self.get_message(
|
|
132
|
+
self.ask(
|
|
133
|
+
prompt,
|
|
134
|
+
optimizer=optimizer,
|
|
135
|
+
conversationally=conversationally,
|
|
136
|
+
)
|
|
137
|
+
)
|
|
138
|
+
|
|
139
|
+
def get_message(self, response: dict) -> str:
|
|
140
|
+
"""Retrieves message only from response
|
|
141
|
+
|
|
142
|
+
Args:
|
|
143
|
+
response (dict): Response generated by `self.ask`
|
|
144
|
+
|
|
145
|
+
Returns:
|
|
146
|
+
str: Message extracted
|
|
147
|
+
"""
|
|
148
|
+
assert isinstance(response, dict), "Response should be of dict data-type only"
|
|
149
|
+
try:
|
|
150
|
+
return response["content"]
|
|
151
|
+
except KeyError:
|
|
152
|
+
return ""
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
import requests
|
|
2
|
+
from ..AIbase import Provider
|
|
3
|
+
from ..AIutel import Conversation
|
|
4
|
+
from ..AIutel import Optimizers
|
|
5
|
+
from ..AIutel import AwesomePrompts
|
|
6
|
+
from webscout import exceptions
|
|
7
|
+
|
|
8
|
+
class GEMINIPRO(Provider):
|
|
9
|
+
def __init__(
|
|
10
|
+
self,
|
|
11
|
+
is_conversation: bool = True,
|
|
12
|
+
max_tokens: int = 600,
|
|
13
|
+
timeout: int = 30,
|
|
14
|
+
intro: str = None,
|
|
15
|
+
filepath: str = None,
|
|
16
|
+
update_file: bool = True,
|
|
17
|
+
proxies: dict = {},
|
|
18
|
+
history_offset: int = 10250,
|
|
19
|
+
act: str = None,
|
|
20
|
+
):
|
|
21
|
+
"""Initializes GEMINI
|
|
22
|
+
|
|
23
|
+
Args:
|
|
24
|
+
is_conversation (bool, optional): Flag for chatting conversationally. Defaults to True.
|
|
25
|
+
max_tokens (int, optional): Maximum number of tokens to be generated upon completion. Defaults to 600.
|
|
26
|
+
timeout (int, optional): Http request timeout. Defaults to 30.
|
|
27
|
+
intro (str, optional): Conversation introductory prompt. Defaults to None.
|
|
28
|
+
filepath (str, optional): Path to file containing conversation history. Defaults to None.
|
|
29
|
+
update_file (bool, optional): Add new prompts and responses to the file. Defaults to True.
|
|
30
|
+
proxies (dict, optional): Http request proxies. Defaults to {}.
|
|
31
|
+
history_offset (int, optional): Limit conversation history to this number of last texts. Defaults to 10250.
|
|
32
|
+
act (str|int, optional): Awesome prompt key or index. (Used as intro). Defaults to None.
|
|
33
|
+
"""
|
|
34
|
+
self.session = requests.Session()
|
|
35
|
+
self.is_conversation = is_conversation
|
|
36
|
+
self.max_tokens_to_sample = max_tokens
|
|
37
|
+
self.chat_endpoint = "https://gemini-pro.developer-house.workers.dev/"
|
|
38
|
+
self.timeout = timeout
|
|
39
|
+
self.last_response = {}
|
|
40
|
+
self.__available_optimizers = (
|
|
41
|
+
method
|
|
42
|
+
for method in dir(Optimizers)
|
|
43
|
+
if callable(getattr(Optimizers, method)) and not method.startswith("__")
|
|
44
|
+
)
|
|
45
|
+
Conversation.intro = (
|
|
46
|
+
AwesomePrompts().get_act(
|
|
47
|
+
act, raise_not_found=True, default=None, case_insensitive=True
|
|
48
|
+
)
|
|
49
|
+
if act
|
|
50
|
+
else intro or Conversation.intro
|
|
51
|
+
)
|
|
52
|
+
self.conversation = Conversation(
|
|
53
|
+
is_conversation, self.max_tokens_to_sample, filepath, update_file
|
|
54
|
+
)
|
|
55
|
+
self.conversation.history_offset = history_offset
|
|
56
|
+
self.session.proxies = proxies
|
|
57
|
+
|
|
58
|
+
def ask(
|
|
59
|
+
self,
|
|
60
|
+
prompt: str,
|
|
61
|
+
stream: bool = False,
|
|
62
|
+
raw: bool = False,
|
|
63
|
+
optimizer: str = None,
|
|
64
|
+
conversationally: bool = False,
|
|
65
|
+
) -> dict:
|
|
66
|
+
"""Chat with AI
|
|
67
|
+
|
|
68
|
+
Args:
|
|
69
|
+
prompt (str): Prompt to be send.
|
|
70
|
+
stream (bool, optional): Flag for streaming response. Defaults to False.
|
|
71
|
+
raw (bool, optional): Stream back raw response as received. Defaults to False.
|
|
72
|
+
optimizer (str, optional): Prompt optimizer name - `[code, shell_command]`. Defaults to None.
|
|
73
|
+
conversationally (bool, optional): Chat conversationally when using optimizer. Defaults to False.
|
|
74
|
+
Returns:
|
|
75
|
+
dict : {}
|
|
76
|
+
```json
|
|
77
|
+
{
|
|
78
|
+
"text" : "How may I assist you today?"
|
|
79
|
+
}
|
|
80
|
+
```
|
|
81
|
+
"""
|
|
82
|
+
conversation_prompt = self.conversation.gen_complete_prompt(prompt)
|
|
83
|
+
if optimizer:
|
|
84
|
+
if optimizer in self.__available_optimizers:
|
|
85
|
+
conversation_prompt = getattr(Optimizers, optimizer)(
|
|
86
|
+
conversation_prompt if conversationally else prompt
|
|
87
|
+
)
|
|
88
|
+
else:
|
|
89
|
+
raise Exception(
|
|
90
|
+
f"Optimizer is not one of {self.__available_optimizers}"
|
|
91
|
+
)
|
|
92
|
+
self.session.headers.update(
|
|
93
|
+
{
|
|
94
|
+
"Content-Type": "application/json",
|
|
95
|
+
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36",
|
|
96
|
+
}
|
|
97
|
+
)
|
|
98
|
+
payload = {"question": conversation_prompt}
|
|
99
|
+
|
|
100
|
+
response = self.session.get(
|
|
101
|
+
self.chat_endpoint, params=payload, stream=True, timeout=self.timeout
|
|
102
|
+
)
|
|
103
|
+
if not response.ok:
|
|
104
|
+
raise exceptions.FailedToGenerateResponseError(
|
|
105
|
+
f"Failed to generate response - ({response.status_code}, {response.reason}) - {response.text}"
|
|
106
|
+
)
|
|
107
|
+
|
|
108
|
+
resp = response.json()
|
|
109
|
+
self.last_response.update(resp)
|
|
110
|
+
self.conversation.update_chat_history(
|
|
111
|
+
prompt, self.get_message(self.last_response)
|
|
112
|
+
)
|
|
113
|
+
return resp
|
|
114
|
+
|
|
115
|
+
def chat(
|
|
116
|
+
self,
|
|
117
|
+
prompt: str,
|
|
118
|
+
stream: bool = False,
|
|
119
|
+
optimizer: str = None,
|
|
120
|
+
conversationally: bool = False,
|
|
121
|
+
) -> str:
|
|
122
|
+
"""Generate response `str`
|
|
123
|
+
Args:
|
|
124
|
+
prompt (str): Prompt to be send.
|
|
125
|
+
stream (bool, optional): Flag for streaming response. Defaults to False.
|
|
126
|
+
optimizer (str, optional): Prompt optimizer name - `[code, shell_command]`. Defaults to None.
|
|
127
|
+
conversationally (bool, optional): Chat conversationally when using optimizer. Defaults to False.
|
|
128
|
+
Returns:
|
|
129
|
+
str: Response generated
|
|
130
|
+
"""
|
|
131
|
+
return self.get_message(
|
|
132
|
+
self.ask(
|
|
133
|
+
prompt,
|
|
134
|
+
optimizer=optimizer,
|
|
135
|
+
conversationally=conversationally,
|
|
136
|
+
)
|
|
137
|
+
)
|
|
138
|
+
|
|
139
|
+
def get_message(self, response: dict) -> str:
|
|
140
|
+
"""Retrieves message only from response
|
|
141
|
+
|
|
142
|
+
Args:
|
|
143
|
+
response (dict): Response generated by `self.ask`
|
|
144
|
+
|
|
145
|
+
Returns:
|
|
146
|
+
str: Message extracted
|
|
147
|
+
"""
|
|
148
|
+
assert isinstance(response, dict), "Response should be of dict data-type only"
|
|
149
|
+
try:
|
|
150
|
+
return response["content"]
|
|
151
|
+
except KeyError:
|
|
152
|
+
return ""
|
webscout/Provider/Youchat.py
CHANGED
|
@@ -218,4 +218,8 @@ class YouChat(Provider):
|
|
|
218
218
|
str: Message extracted
|
|
219
219
|
"""
|
|
220
220
|
assert isinstance(response, dict), "Response should be of dict data-type only"
|
|
221
|
-
return response["text"]
|
|
221
|
+
return response["text"]
|
|
222
|
+
|
|
223
|
+
if __name__ == "__main__":
|
|
224
|
+
YouChat = YouChat()
|
|
225
|
+
print(YouChat.chat("hello"))
|
webscout/Provider/__init__.py
CHANGED
|
@@ -35,6 +35,9 @@ from .BasedGPT import BasedGPT
|
|
|
35
35
|
from .Deepseek import DeepSeek
|
|
36
36
|
from .Deepinfra import DeepInfra, VLM, AsyncDeepInfra
|
|
37
37
|
from .VTLchat import VTLchat
|
|
38
|
+
from .Geminipro import GEMINIPRO
|
|
39
|
+
from .Geminiflash import GEMINIFLASH
|
|
40
|
+
|
|
38
41
|
__all__ = [
|
|
39
42
|
'ThinkAnyAI',
|
|
40
43
|
'Xjai',
|
|
@@ -73,5 +76,8 @@ __all__ = [
|
|
|
73
76
|
'AsyncPhindv2',
|
|
74
77
|
'Phindv2',
|
|
75
78
|
'OPENGPTv2',
|
|
79
|
+
'GEMINIPRO',
|
|
80
|
+
'GEMINIFLASH',
|
|
81
|
+
|
|
76
82
|
|
|
77
83
|
]
|
webscout/__init__.py
CHANGED
|
@@ -11,7 +11,8 @@ from .LLM import LLM
|
|
|
11
11
|
import g4f
|
|
12
12
|
# Import provider classes for direct access
|
|
13
13
|
from .Provider import *
|
|
14
|
-
from .Extra import
|
|
14
|
+
from .Extra import gguf
|
|
15
|
+
from .Extra import autollama
|
|
15
16
|
__repo__ = "https://github.com/OE-LUCIFER/Webscout"
|
|
16
17
|
|
|
17
18
|
webai = [
|
|
@@ -38,6 +39,9 @@ webai = [
|
|
|
38
39
|
"basedgpt",
|
|
39
40
|
"deepseek",
|
|
40
41
|
"deepinfra",
|
|
42
|
+
"vtlchat",
|
|
43
|
+
"geminiflash",
|
|
44
|
+
"geminipro",
|
|
41
45
|
]
|
|
42
46
|
|
|
43
47
|
gpt4free_providers = [
|
webscout/version.py
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
__version__ = "3.
|
|
1
|
+
__version__ = "3.9"
|
|
2
2
|
|
webscout/webai.py
CHANGED
|
@@ -689,7 +689,55 @@ class Main(cmd.Cmd):
|
|
|
689
689
|
history_offset=history_offset,
|
|
690
690
|
act=awesome_prompt,
|
|
691
691
|
)
|
|
692
|
+
elif provider == "geminiflash":
|
|
693
|
+
from webscout import GEMINIFLASH
|
|
692
694
|
|
|
695
|
+
self.bot = GEMINIFLASH(
|
|
696
|
+
is_conversation=disable_conversation,
|
|
697
|
+
max_tokens=max_tokens,
|
|
698
|
+
temperature=temperature,
|
|
699
|
+
top_p=top_p,
|
|
700
|
+
timeout=timeout,
|
|
701
|
+
intro=intro,
|
|
702
|
+
filepath=filepath,
|
|
703
|
+
update_file=update_file,
|
|
704
|
+
proxies=proxies,
|
|
705
|
+
history_offset=history_offset,
|
|
706
|
+
act=awesome_prompt,
|
|
707
|
+
)
|
|
708
|
+
elif provider == "geminipro":
|
|
709
|
+
from webscout import GEMINIPRO
|
|
710
|
+
|
|
711
|
+
self.bot = GEMINIPRO(
|
|
712
|
+
is_conversation=disable_conversation,
|
|
713
|
+
max_tokens=max_tokens,
|
|
714
|
+
temperature=temperature,
|
|
715
|
+
top_p=top_p,
|
|
716
|
+
timeout=timeout,
|
|
717
|
+
intro=intro,
|
|
718
|
+
filepath=filepath,
|
|
719
|
+
update_file=update_file,
|
|
720
|
+
proxies=proxies,
|
|
721
|
+
history_offset=history_offset,
|
|
722
|
+
act=awesome_prompt,
|
|
723
|
+
)
|
|
724
|
+
|
|
725
|
+
elif provider == "vtlchat":
|
|
726
|
+
from webscout import VTLchat
|
|
727
|
+
|
|
728
|
+
self.bot = VTLchat(
|
|
729
|
+
is_conversation=disable_conversation,
|
|
730
|
+
max_tokens=max_tokens,
|
|
731
|
+
temperature=temperature,
|
|
732
|
+
top_p=top_p,
|
|
733
|
+
timeout=timeout,
|
|
734
|
+
intro=intro,
|
|
735
|
+
filepath=filepath,
|
|
736
|
+
update_file=update_file,
|
|
737
|
+
proxies=proxies,
|
|
738
|
+
history_offset=history_offset,
|
|
739
|
+
act=awesome_prompt,
|
|
740
|
+
)
|
|
693
741
|
elif provider == "gemini":
|
|
694
742
|
from webscout import GEMINI
|
|
695
743
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: webscout
|
|
3
|
-
Version: 3.
|
|
3
|
+
Version: 3.9
|
|
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
|
|
@@ -1421,6 +1421,9 @@ provider = VTLchat()
|
|
|
1421
1421
|
response = provider.chat("Hello, how are you?")
|
|
1422
1422
|
print(response)
|
|
1423
1423
|
```
|
|
1424
|
+
|
|
1425
|
+
### 21. GeminiFlash and geminipro
|
|
1426
|
+
**Usage similar to other providers**
|
|
1424
1427
|
### `LLM`
|
|
1425
1428
|
```python
|
|
1426
1429
|
from webscout.LLM import LLM
|
|
@@ -1599,7 +1602,7 @@ Webscout's `autollama` utility download model from huggingface and then automati
|
|
|
1599
1602
|
```python
|
|
1600
1603
|
from webscout import autollama
|
|
1601
1604
|
|
|
1602
|
-
autollama
|
|
1605
|
+
autollama(
|
|
1603
1606
|
model_path="OEvortex/HelpingAI-Lite-1.5T", # Hugging Face model ID
|
|
1604
1607
|
gguf_file="HelpingAI-Lite-1.5T.q4_k_m.gguf" # GGUF file ID
|
|
1605
1608
|
)
|
|
@@ -1698,335 +1701,7 @@ if __name__ == "__main__":
|
|
|
1698
1701
|
```
|
|
1699
1702
|
|
|
1700
1703
|
## `Webai` - terminal gpt and a open interpeter
|
|
1701
|
-
|
|
1702
|
-
```python
|
|
1703
|
-
import time
|
|
1704
|
-
import uuid
|
|
1705
|
-
from typing import Dict, Any, Optional, AsyncGenerator
|
|
1706
|
-
from rich.console import Console
|
|
1707
|
-
from rich.markdown import Markdown
|
|
1708
|
-
from rich.panel import Panel
|
|
1709
|
-
from rich.style import Style
|
|
1710
|
-
import webscout
|
|
1711
|
-
import webscout.AIutel
|
|
1712
|
-
import g4f
|
|
1713
|
-
from webscout.g4f import *
|
|
1714
|
-
from webscout.async_providers import mapper as async_provider_map
|
|
1715
|
-
|
|
1716
|
-
class TaskExecutor:
|
|
1717
|
-
"""
|
|
1718
|
-
Manages an interactive chat session, handling user input, AI responses,
|
|
1719
|
-
and optional features like web search, code execution, and text-to-speech.
|
|
1720
|
-
"""
|
|
1721
|
-
|
|
1722
|
-
def __init__(self) -> None:
|
|
1723
|
-
"""Initializes the conversational assistant with default settings."""
|
|
1724
|
-
self._console: Console = Console()
|
|
1725
|
-
|
|
1726
|
-
# Session configuration
|
|
1727
|
-
self._selected_provider: str = "phind"
|
|
1728
|
-
self._selected_model: str = "Phind Model"
|
|
1729
|
-
self._conversation_enabled: bool = True
|
|
1730
|
-
self._max_tokens: int = 600
|
|
1731
|
-
self._temperature: float = 0.2
|
|
1732
|
-
self._top_k: int = -1
|
|
1733
|
-
self._top_p: float = 0.999
|
|
1734
|
-
self._timeout: int = 30
|
|
1735
|
-
self._auth_token: str = None # API key, if required
|
|
1736
|
-
self._chat_completion_enabled: bool = True # g4fauto
|
|
1737
|
-
self._ignore_working: bool = False # Ignore working status of providers
|
|
1738
|
-
self._proxy_path: str = None # Path to proxy configuration
|
|
1739
|
-
|
|
1740
|
-
# History Management
|
|
1741
|
-
self._history_filepath: str = "history.txt"
|
|
1742
|
-
self._update_history_file: bool = True
|
|
1743
|
-
self._history_offset: int = 10250
|
|
1744
|
-
|
|
1745
|
-
# Prompt Engineering
|
|
1746
|
-
self._initial_prompt: str = None
|
|
1747
|
-
self._awesome_prompt_content: str = None
|
|
1748
|
-
|
|
1749
|
-
# Optional Features
|
|
1750
|
-
self._web_search_enabled: bool = False # Enable web search
|
|
1751
|
-
self._rawdog_enabled: bool = True
|
|
1752
|
-
self._internal_script_execution_enabled: bool = True
|
|
1753
|
-
self._script_confirmation_required: bool = False
|
|
1754
|
-
self._selected_interpreter: str = "python"
|
|
1755
|
-
self._selected_optimizer: str = "code"
|
|
1756
|
-
self._suppress_output: bool = False # Suppress verbose output
|
|
1757
|
-
|
|
1758
|
-
# AI provider mapping
|
|
1759
|
-
self._ai_provider_mapping: Dict[str, Any] = {
|
|
1760
|
-
"phind": webscout.PhindSearch,
|
|
1761
|
-
"opengpt": webscout.OPENGPT,
|
|
1762
|
-
"koboldai": webscout.KOBOLDAI,
|
|
1763
|
-
"blackboxai": webscout.BLACKBOXAI,
|
|
1764
|
-
"llama2": webscout.LLAMA2,
|
|
1765
|
-
"yepchat": webscout.YEPCHAT,
|
|
1766
|
-
"leo": webscout.LEO,
|
|
1767
|
-
"groq": webscout.GROQ,
|
|
1768
|
-
"openai": webscout.OPENAI,
|
|
1769
|
-
"perplexity": webscout.PERPLEXITY,
|
|
1770
|
-
"you": webscout.YouChat,
|
|
1771
|
-
"xjai": webscout.Xjai,
|
|
1772
|
-
"cohere": webscout.Cohere,
|
|
1773
|
-
"reka": webscout.REKA,
|
|
1774
|
-
"thinkany": webscout.ThinkAnyAI,
|
|
1775
|
-
"gemini": webscout.GEMINI,
|
|
1776
|
-
"berlin4h": webscout.Berlin4h,
|
|
1777
|
-
"chatgptuk": webscout.ChatGPTUK,
|
|
1778
|
-
"poe": webscout.POE,
|
|
1779
|
-
"basedgpt": webscout.BasedGPT,
|
|
1780
|
-
"deepseek": webscout.DeepSeek,
|
|
1781
|
-
"deepinfra": webscout.DeepInfra,
|
|
1782
|
-
"opengenptv2": webscout.OPENGPTv2
|
|
1783
|
-
}
|
|
1784
|
-
|
|
1785
|
-
# Initialize Rawdog if enabled
|
|
1786
|
-
if self._rawdog_enabled:
|
|
1787
|
-
self._rawdog_instance: webscout.AIutel.RawDog = webscout.AIutel.RawDog(
|
|
1788
|
-
quiet=self._suppress_output,
|
|
1789
|
-
internal_exec=self._internal_script_execution_enabled,
|
|
1790
|
-
confirm_script=self._script_confirmation_required,
|
|
1791
|
-
interpreter=self._selected_interpreter,
|
|
1792
|
-
)
|
|
1793
|
-
|
|
1794
|
-
self._initial_prompt = self._rawdog_instance.intro_prompt
|
|
1795
|
-
|
|
1796
|
-
# Initialize the selected AI model
|
|
1797
|
-
self._ai_model = self._get_ai_model()
|
|
1798
|
-
|
|
1799
|
-
def _get_ai_model(self):
|
|
1800
|
-
"""
|
|
1801
|
-
Determines the appropriate AI model based on the selected provider,
|
|
1802
|
-
including automatic provider selection and g4fauto support.
|
|
1803
|
-
"""
|
|
1804
|
-
if self._selected_provider == "g4fauto":
|
|
1805
|
-
# Automatically select the best provider from g4f
|
|
1806
|
-
test = TestProviders(quiet=self._suppress_output, timeout=self._timeout)
|
|
1807
|
-
g4fauto = test.best if not self._ignore_working else test.auto
|
|
1808
|
-
if isinstance(g4fauto, str):
|
|
1809
|
-
self._selected_provider = "g4fauto+" + g4fauto
|
|
1810
|
-
self._ai_model = self._create_g4f_model(g4fauto)
|
|
1811
|
-
else:
|
|
1812
|
-
raise Exception(
|
|
1813
|
-
"No working g4f provider found. "
|
|
1814
|
-
"Consider running 'webscout.webai gpt4free test -y' first"
|
|
1815
|
-
)
|
|
1816
|
-
else:
|
|
1817
|
-
# Use the specified provider
|
|
1818
|
-
self._ai_model = self._ai_provider_mapping[self._selected_provider](
|
|
1819
|
-
is_conversation=self._conversation_enabled,
|
|
1820
|
-
max_tokens=self._max_tokens,
|
|
1821
|
-
timeout=self._timeout,
|
|
1822
|
-
intro=self._initial_prompt,
|
|
1823
|
-
filepath=self._history_filepath,
|
|
1824
|
-
update_file=self._update_history_file,
|
|
1825
|
-
proxies={}, # Load proxies from config if needed
|
|
1826
|
-
history_offset=self._history_offset,
|
|
1827
|
-
act=self._awesome_prompt_content,
|
|
1828
|
-
model=self._selected_model,
|
|
1829
|
-
quiet=self._suppress_output,
|
|
1830
|
-
# auth=self._auth_token, # Pass API key if required
|
|
1831
|
-
)
|
|
1832
|
-
return self._ai_model
|
|
1833
|
-
|
|
1834
|
-
def _create_g4f_model(self, provider: str):
|
|
1835
|
-
"""
|
|
1836
|
-
Creates a g4f model instance using the provided provider and webscout.WEBS for web search.
|
|
1837
|
-
"""
|
|
1838
|
-
return webscout.g4f.GPT4FREE(
|
|
1839
|
-
provider=provider,
|
|
1840
|
-
auth=self._auth_token,
|
|
1841
|
-
max_tokens=self._max_tokens,
|
|
1842
|
-
chat_completion=self._chat_completion_enabled,
|
|
1843
|
-
ignore_working=self._ignore_working,
|
|
1844
|
-
timeout=self._timeout,
|
|
1845
|
-
intro=self._initial_prompt,
|
|
1846
|
-
filepath=self._history_filepath,
|
|
1847
|
-
update_file=self._update_history_file,
|
|
1848
|
-
proxies={}, # Load proxies from config if needed
|
|
1849
|
-
history_offset=self._history_offset,
|
|
1850
|
-
act=self._awesome_prompt_content,
|
|
1851
|
-
)
|
|
1852
|
-
|
|
1853
|
-
def process_query(self, query: str) -> None:
|
|
1854
|
-
"""
|
|
1855
|
-
Processes a user query, potentially enhancing it with web search results,
|
|
1856
|
-
passing it to the AI model, and handling the response.
|
|
1857
|
-
|
|
1858
|
-
Args:
|
|
1859
|
-
query: The user's text input.
|
|
1860
|
-
|
|
1861
|
-
Returns:
|
|
1862
|
-
None
|
|
1863
|
-
"""
|
|
1864
|
-
if self._web_search_enabled:
|
|
1865
|
-
query = self._augment_query_with_web_search(query)
|
|
1866
|
-
|
|
1867
|
-
# Apply code optimization if configured
|
|
1868
|
-
if self._selected_optimizer == "code":
|
|
1869
|
-
query = webscout.AIutel.Optimizers.code(query)
|
|
1870
|
-
|
|
1871
|
-
try:
|
|
1872
|
-
response: str = self._ai_model.chat(query)
|
|
1873
|
-
except webscout.exceptions.FailedToGenerateResponseError as e:
|
|
1874
|
-
self._console.print(Markdown(f"LLM: [red]{e}[/red]"))
|
|
1875
|
-
return
|
|
1876
|
-
|
|
1877
|
-
# Handle Rawdog responses if enabled
|
|
1878
|
-
if self._rawdog_enabled:
|
|
1879
|
-
self._handle_rawdog_response(response)
|
|
1880
|
-
else:
|
|
1881
|
-
self._console.print(Markdown(f"LLM: {response}"))
|
|
1882
|
-
|
|
1883
|
-
def _augment_query_with_web_search(self, query: str) -> str:
|
|
1884
|
-
"""Performs a web search and appends the results to the query.
|
|
1885
|
-
|
|
1886
|
-
Args:
|
|
1887
|
-
query: The user's text input.
|
|
1888
|
-
|
|
1889
|
-
Returns:
|
|
1890
|
-
str: The augmented query with web search results.
|
|
1891
|
-
"""
|
|
1892
|
-
web_search_results = webscout.WEBS().text(query, max_results=3)
|
|
1893
|
-
if web_search_results:
|
|
1894
|
-
formatted_results = "\n".join(
|
|
1895
|
-
f"{i+1}. {result['title']} - {result['href']}\n\nBody: {result['body']}"
|
|
1896
|
-
for i, result in enumerate(web_search_results)
|
|
1897
|
-
)
|
|
1898
|
-
query += f"\n\n## Web Search Results are:\n\n{formatted_results}"
|
|
1899
|
-
return query
|
|
1900
|
-
|
|
1901
|
-
def _handle_rawdog_response(self, response: str) -> None:
|
|
1902
|
-
"""Handles AI responses, potentially executing them as code with Rawdog.
|
|
1903
|
-
|
|
1904
|
-
Args:
|
|
1905
|
-
response: The AI model's response.
|
|
1906
|
-
|
|
1907
|
-
Returns:
|
|
1908
|
-
None
|
|
1909
|
-
"""
|
|
1910
|
-
try:
|
|
1911
|
-
is_feedback = self._rawdog_instance.main(response)
|
|
1912
|
-
if is_feedback and "PREVIOUS SCRIPT EXCEPTION" in is_feedback:
|
|
1913
|
-
self._console.print(Markdown(f"LLM: {is_feedback}"))
|
|
1914
|
-
error_message = is_feedback.split("PREVIOUS SCRIPT EXCEPTION:\n")[1].strip()
|
|
1915
|
-
# Generate a solution for the error and execute it
|
|
1916
|
-
error_solution_query = (
|
|
1917
|
-
f"The following code was executed and resulted in an error:\n\n"
|
|
1918
|
-
f"{response}\n\n"
|
|
1919
|
-
f"Error: {error_message}\n\n"
|
|
1920
|
-
f"Please provide a solution to fix this error in the code and execute it."
|
|
1921
|
-
)
|
|
1922
|
-
try:
|
|
1923
|
-
new_response = self._ai_model.chat(error_solution_query)
|
|
1924
|
-
self._handle_rawdog_response(new_response)
|
|
1925
|
-
except webscout.exceptions.FailedToGenerateResponseError as e:
|
|
1926
|
-
self._console.print(Markdown(f"LLM: [red]Error while generating solution: {e}[/red]"))
|
|
1927
|
-
else:
|
|
1928
|
-
self._console.print(Markdown("LLM: (Script executed successfully)"))
|
|
1929
|
-
except Exception as e:
|
|
1930
|
-
self._console.print(Markdown(f"LLM: [red]Error: {e}[/red]"))
|
|
1931
|
-
|
|
1932
|
-
|
|
1933
|
-
async def process_async_query(self, query: str) -> None:
|
|
1934
|
-
"""
|
|
1935
|
-
Asynchronously processes a user query, potentially enhancing it with web search results,
|
|
1936
|
-
passing it to the AI model, and handling the response.
|
|
1937
|
-
|
|
1938
|
-
Args:
|
|
1939
|
-
query: The user's text input.
|
|
1940
|
-
|
|
1941
|
-
Returns:
|
|
1942
|
-
None
|
|
1943
|
-
"""
|
|
1944
|
-
if self._web_search_enabled:
|
|
1945
|
-
query = self._augment_query_with_web_search(query)
|
|
1946
|
-
|
|
1947
|
-
# Apply code optimization if configured
|
|
1948
|
-
if self._selected_optimizer == "code":
|
|
1949
|
-
query = webscout.AIutel.Optimizers.code(query)
|
|
1950
|
-
|
|
1951
|
-
async_model = self._get_async_ai_model()
|
|
1952
|
-
|
|
1953
|
-
try:
|
|
1954
|
-
async for response in async_model.chat(query, stream=True):
|
|
1955
|
-
self._console.print(Markdown(f"LLM: {response}"), end="")
|
|
1956
|
-
except webscout.exceptions.FailedToGenerateResponseError as e:
|
|
1957
|
-
self._console.print(Markdown(f"LLM: [red]{e}[/red]"))
|
|
1958
|
-
return
|
|
1959
|
-
|
|
1960
|
-
# Handle Rawdog responses if enabled
|
|
1961
|
-
if self._rawdog_enabled:
|
|
1962
|
-
self._handle_rawdog_response(response)
|
|
1963
|
-
else:
|
|
1964
|
-
self._console.print(Markdown(f"LLM: {response}"))
|
|
1965
|
-
|
|
1966
|
-
def _get_async_ai_model(self):
|
|
1967
|
-
"""
|
|
1968
|
-
Determines the appropriate asynchronous AI model based on the selected provider.
|
|
1969
|
-
"""
|
|
1970
|
-
if self._selected_provider == "g4fauto":
|
|
1971
|
-
# Automatically select the best provider from g4f
|
|
1972
|
-
test = TestProviders(quiet=self._suppress_output, timeout=self._timeout)
|
|
1973
|
-
g4fauto = test.best if not self._ignore_working else test.auto
|
|
1974
|
-
if isinstance(g4fauto, str):
|
|
1975
|
-
self._selected_provider = "g4fauto+" + g4fauto
|
|
1976
|
-
self._ai_model = self._create_async_g4f_model(g4fauto)
|
|
1977
|
-
else:
|
|
1978
|
-
raise Exception(
|
|
1979
|
-
"No working g4f provider found. "
|
|
1980
|
-
"Consider running 'webscout gpt4free test -y' first"
|
|
1981
|
-
)
|
|
1982
|
-
else:
|
|
1983
|
-
# Use the specified provider
|
|
1984
|
-
if self._selected_provider in async_provider_map:
|
|
1985
|
-
self._ai_model = async_provider_map[self._selected_provider](
|
|
1986
|
-
is_conversation=self._conversation_enabled,
|
|
1987
|
-
max_tokens=self._max_tokens,
|
|
1988
|
-
timeout=self._timeout,
|
|
1989
|
-
intro=self._initial_prompt,
|
|
1990
|
-
filepath=self._history_filepath,
|
|
1991
|
-
update_file=self._update_history_file,
|
|
1992
|
-
proxies={}, # Load proxies from config if needed
|
|
1993
|
-
history_offset=self._history_offset,
|
|
1994
|
-
act=self._awesome_prompt_content,
|
|
1995
|
-
model=self._selected_model,
|
|
1996
|
-
quiet=self._suppress_output,
|
|
1997
|
-
auth=self._auth_token, # Pass API key if required
|
|
1998
|
-
)
|
|
1999
|
-
else:
|
|
2000
|
-
raise Exception(
|
|
2001
|
-
f"Asynchronous provider '{self._selected_provider}' is not yet supported"
|
|
2002
|
-
)
|
|
2003
|
-
return self._ai_model
|
|
2004
|
-
|
|
2005
|
-
def _create_async_g4f_model(self, provider: str):
|
|
2006
|
-
"""
|
|
2007
|
-
Creates an asynchronous g4f model instance using the provided provider and webscout.WEBS for web search.
|
|
2008
|
-
"""
|
|
2009
|
-
return webscout.g4f.AsyncGPT4FREE(
|
|
2010
|
-
provider=provider,
|
|
2011
|
-
auth=self._auth_token,
|
|
2012
|
-
max_tokens=self._max_tokens,
|
|
2013
|
-
chat_completion=self._chat_completion_enabled,
|
|
2014
|
-
ignore_working=self._ignore_working,
|
|
2015
|
-
timeout=self._timeout,
|
|
2016
|
-
intro=self._initial_prompt,
|
|
2017
|
-
filepath=self._history_filepath,
|
|
2018
|
-
update_file=self._update_history_file,
|
|
2019
|
-
proxies={}, # Load proxies from config if needed
|
|
2020
|
-
history_offset=self._history_offset,
|
|
2021
|
-
act=self._awesome_prompt_content,
|
|
2022
|
-
)
|
|
2023
|
-
|
|
2024
|
-
if __name__ == "__main__":
|
|
2025
|
-
assistant = TaskExecutor()
|
|
2026
|
-
while True:
|
|
2027
|
-
input_query = input("Enter your query: ")
|
|
2028
|
-
assistant.process_query(input_query)
|
|
2029
|
-
|
|
1704
|
+
Code is in rawdog.py file
|
|
2030
1705
|
```
|
|
2031
1706
|
```shell
|
|
2032
1707
|
python -m webscout.webai webai --provider "phind" --rawdog
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
webscout/AIauto.py,sha256=xPGr_Z0h27XXNh4Wiufjn9TksDOqxqlaGcLUYKNP55w,18246
|
|
2
2
|
webscout/AIbase.py,sha256=GoHbN8r0gq2saYRZv6LA-Fr9Jlcjv80STKFXUq2ZeGU,4710
|
|
3
|
-
webscout/AIutel.py,sha256=
|
|
3
|
+
webscout/AIutel.py,sha256=akfyVlJnIdo8jf8c1vzKDITtNdwAJHFqC5bEVGh7554,33597
|
|
4
4
|
webscout/DWEBS.py,sha256=QLuT1IKu0lnwdl7W6c-ctBAO7Jj0Zk3PYm6-13BC7rU,25740
|
|
5
5
|
webscout/LLM.py,sha256=LbGCZdJf8A5dwfoGS4tyy39tAh5BDdhMZP0ScKaaQfU,4184
|
|
6
|
-
webscout/__init__.py,sha256=
|
|
6
|
+
webscout/__init__.py,sha256=znxNHlt9EDBgWP1uD71EN9eKO4-WFpmN8_bPPmJaNLw,2142
|
|
7
7
|
webscout/__main__.py,sha256=ZtTRgsRjUi2JOvYFLF1ZCh55Sdoz94I-BS-TlJC7WDU,126
|
|
8
8
|
webscout/async_providers.py,sha256=holBv5SxanxVXc_92CBBaXHlB2IakB_fHnhyZaFjYF8,684
|
|
9
9
|
webscout/cli.py,sha256=enw_dPTCG3sNC1TXt96XccnpRmF4Etr99nh-RbGYags,18784
|
|
@@ -13,17 +13,17 @@ webscout/models.py,sha256=5iQIdtedT18YuTZ3npoG7kLMwcrKwhQ7928dl_7qZW0,692
|
|
|
13
13
|
webscout/tempid.py,sha256=5oc3UbXhPGKxrMRTfRABT-V-dNzH_hOKWtLYM6iCWd4,5896
|
|
14
14
|
webscout/transcriber.py,sha256=EddvTSq7dPJ42V3pQVnGuEiYQ7WjJ9uyeR9kMSxN7uY,20622
|
|
15
15
|
webscout/utils.py,sha256=CxeXvp0rWIulUrEaPZMaNfg_tSuQLRSV8uuHA2chyKE,2603
|
|
16
|
-
webscout/version.py,sha256
|
|
16
|
+
webscout/version.py,sha256=-NWv4nLXKlNPAmvsqgPMnu9sdeUQAtJ95GCckHBql6M,23
|
|
17
17
|
webscout/voice.py,sha256=0QjXTHAQmCK07IDZXRc7JXem47cnPJH7u3X0sVP1-UQ,967
|
|
18
|
-
webscout/webai.py,sha256=
|
|
18
|
+
webscout/webai.py,sha256=Bs6HtPAxupTsUmuCGlylYQ325EDuYjFTJgmnbe5Gj5w,88471
|
|
19
19
|
webscout/webscout_search.py,sha256=lFAot1-Qil_YfXieeLakDVDEX8Ckcima4ueXdOYwiMc,42804
|
|
20
20
|
webscout/webscout_search_async.py,sha256=dooKGwLm0cwTml55Vy6NHPPY-nymEqX2h8laX94Zg5A,14537
|
|
21
21
|
webscout/websx_search.py,sha256=n-qVwiHozJEF-GFRPcAfh4k1d_tscTmDe1dNL-1ngcU,12094
|
|
22
22
|
webscout/Extra/__init__.py,sha256=vlW4RoSl5v3d7j_Yq1XEMydrG9JM-On_afgK-HtRZsk,45
|
|
23
|
-
webscout/Extra/autollama.py,sha256=
|
|
24
|
-
webscout/Extra/gguf.py,sha256=
|
|
23
|
+
webscout/Extra/autollama.py,sha256=DDdnb1tKEZWJaADVn9GXTZkMSwLKCcUGIjMKNlOBtK8,5419
|
|
24
|
+
webscout/Extra/gguf.py,sha256=5zTNE5HxM_VQ5ONoocL8GG5fRXrgyLdEEjNzndG0oUw,7811
|
|
25
25
|
webscout/Local/__init__.py,sha256=RN6klpbabPGNX2YzPm_hdeUcQvieUwvJt22uAO2RKSM,238
|
|
26
|
-
webscout/Local/_version.py,sha256=
|
|
26
|
+
webscout/Local/_version.py,sha256=J-XfaHI4CMBbIor8FPDPPUHW5Q1Y8wrhkVocEjQJ0qg,83
|
|
27
27
|
webscout/Local/formats.py,sha256=BiZZSoN3e8S6-S-ykBL9ogSUs0vK11GaZ3ghc9U8GRk,18994
|
|
28
28
|
webscout/Local/model.py,sha256=T_bzNNrxEyOyLyhp6fKwiuVBBkXC2a37LzJVCxFIxOU,30710
|
|
29
29
|
webscout/Local/rawdog.py,sha256=ojY_O8Vb1KvR34OwWdfLgllgaAK_7HMf64ElMATvCXs,36689
|
|
@@ -38,6 +38,8 @@ webscout/Provider/Cohere.py,sha256=IXnRosYOaMAA65nvsKmN6ZkJGSdZFYQYBidzuNaCqX8,8
|
|
|
38
38
|
webscout/Provider/Deepinfra.py,sha256=kVnWARJdEtIeIsZwGw3POq8B2dO87bDcJso3uOeCeOA,18750
|
|
39
39
|
webscout/Provider/Deepseek.py,sha256=pnOB44ObuOfAsoi_bUGUvha3tfwd0rTJ9rnX-14QkL4,10550
|
|
40
40
|
webscout/Provider/Gemini.py,sha256=_4DHWvlWuNAmVHPwHB1RjmryjTZZCthLa6lvPEHLvkQ,8451
|
|
41
|
+
webscout/Provider/Geminiflash.py,sha256=1kMPA-ypi1gmJoms606Z7j_51znpdofM2aAyo4Hl7wU,5951
|
|
42
|
+
webscout/Provider/Geminipro.py,sha256=nOifT5CRmnUg28iifSbOHkNLoKucLRr5zCj607mVrhw,5948
|
|
41
43
|
webscout/Provider/Groq.py,sha256=QfgP3hKUcqq5vUA4Pzuu3HAgpJkKwLWNjjsnxtkCYd8,21094
|
|
42
44
|
webscout/Provider/Koboldai.py,sha256=KwWx2yPlvT9BGx37iNvSbgzWkJ9I8kSOmeg7sL1hb0M,15806
|
|
43
45
|
webscout/Provider/Leo.py,sha256=wbuDR-vFjLptfRC6yDlk74tINqNvCOzpISsK92lIgGg,19987
|
|
@@ -52,11 +54,11 @@ webscout/Provider/ThinkAnyAI.py,sha256=_qFjj0djxxrranyEY33w14oizyRjzlVwMv_hzvVtw
|
|
|
52
54
|
webscout/Provider/VTLchat.py,sha256=_sErGr-wOi16ZAfiGOo0bPsAEMkjzzwreEsIqjIZMIU,10041
|
|
53
55
|
webscout/Provider/Xjai.py,sha256=BIlk2ouz9Kh_0Gg9hPvTqhI7XtcmWdg5vHSX_4uGrIs,9039
|
|
54
56
|
webscout/Provider/Yepchat.py,sha256=2Eit-A7w1ph1GQKNQuur_yaDzI64r0yBGxCIjDefJxQ,19875
|
|
55
|
-
webscout/Provider/Youchat.py,sha256=
|
|
56
|
-
webscout/Provider/__init__.py,sha256=
|
|
57
|
-
webscout-3.
|
|
58
|
-
webscout-3.
|
|
59
|
-
webscout-3.
|
|
60
|
-
webscout-3.
|
|
61
|
-
webscout-3.
|
|
62
|
-
webscout-3.
|
|
57
|
+
webscout/Provider/Youchat.py,sha256=fhMpt94pIPE_XDbC4z9xyfgA7NbkNE2wlRFJabsjv90,8069
|
|
58
|
+
webscout/Provider/__init__.py,sha256=nFRM7vno2a7y2lG-7mDXvzytI8irb_loC0BPGZtrh7w,1923
|
|
59
|
+
webscout-3.9.dist-info/LICENSE.md,sha256=9P0imsudI7MEvZe2pOcg8rKBn6E5FGHQ-riYozZI-Bk,2942
|
|
60
|
+
webscout-3.9.dist-info/METADATA,sha256=BGlQ0WLKmc-jx8j7dQhYR_tM8IZGORpTSWqEzSKYlSk,55625
|
|
61
|
+
webscout-3.9.dist-info/WHEEL,sha256=cpQTJ5IWu9CdaPViMhC9YzF8gZuS5-vlfoFihTBC86A,91
|
|
62
|
+
webscout-3.9.dist-info/entry_points.txt,sha256=Hh4YIIjvkqB9SVxZ2ri4DZUkgEu_WF_5_r_nZDIvfG8,73
|
|
63
|
+
webscout-3.9.dist-info/top_level.txt,sha256=nYIw7OKBQDr_Z33IzZUKidRD3zQEo8jOJYkMVMeN334,9
|
|
64
|
+
webscout-3.9.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|