webscout 6.5__py3-none-any.whl → 6.7__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of webscout might be problematic. Click here for more details.
- webscout/Extra/autocoder/autocoder_utiles.py +119 -101
- webscout/Extra/weather.py +5 -5
- webscout/Provider/AISEARCH/__init__.py +2 -0
- webscout/Provider/AISEARCH/ooai.py +155 -0
- webscout/Provider/Amigo.py +70 -85
- webscout/Provider/{prefind.py → Jadve.py} +72 -70
- webscout/Provider/Netwrck.py +239 -0
- webscout/Provider/Openai.py +4 -3
- webscout/Provider/PI.py +2 -2
- webscout/Provider/PizzaGPT.py +3 -3
- webscout/Provider/TeachAnything.py +15 -2
- webscout/Provider/Youchat.py +42 -8
- webscout/Provider/__init__.py +134 -147
- webscout/Provider/meta.py +1 -1
- webscout/Provider/multichat.py +230 -0
- webscout/Provider/promptrefine.py +2 -2
- webscout/Provider/talkai.py +10 -13
- webscout/Provider/turboseek.py +5 -4
- webscout/Provider/tutorai.py +8 -112
- webscout/Provider/typegpt.py +4 -5
- webscout/Provider/x0gpt.py +81 -9
- webscout/Provider/yep.py +123 -361
- webscout/__init__.py +10 -1
- webscout/cli.py +31 -39
- webscout/conversation.py +24 -9
- webscout/exceptions.py +188 -20
- webscout/litprinter/__init__.py +19 -123
- webscout/litprinter/colors.py +54 -0
- webscout/optimizers.py +335 -185
- webscout/scout/__init__.py +2 -5
- webscout/scout/core/__init__.py +7 -0
- webscout/scout/core/crawler.py +140 -0
- webscout/scout/core/scout.py +571 -0
- webscout/scout/core/search_result.py +96 -0
- webscout/scout/core/text_analyzer.py +63 -0
- webscout/scout/core/text_utils.py +277 -0
- webscout/scout/core/web_analyzer.py +52 -0
- webscout/scout/element.py +6 -5
- webscout/update_checker.py +117 -58
- webscout/version.py +1 -1
- webscout/webscout_search.py +1 -1
- webscout/zeroart/base.py +15 -16
- webscout/zeroart/effects.py +1 -1
- webscout/zeroart/fonts.py +1 -1
- {webscout-6.5.dist-info → webscout-6.7.dist-info}/METADATA +9 -172
- {webscout-6.5.dist-info → webscout-6.7.dist-info}/RECORD +63 -45
- {webscout-6.5.dist-info → webscout-6.7.dist-info}/entry_points.txt +1 -1
- webscout-6.7.dist-info/top_level.txt +2 -0
- webstoken/__init__.py +30 -0
- webstoken/classifier.py +189 -0
- webstoken/keywords.py +216 -0
- webstoken/language.py +128 -0
- webstoken/ner.py +164 -0
- webstoken/normalizer.py +35 -0
- webstoken/processor.py +77 -0
- webstoken/sentiment.py +206 -0
- webstoken/stemmer.py +73 -0
- webstoken/t.py +75 -0
- webstoken/tagger.py +60 -0
- webstoken/tokenizer.py +158 -0
- webscout/Provider/Perplexity.py +0 -591
- webscout/Provider/RoboCoders.py +0 -206
- webscout/Provider/genspark.py +0 -225
- webscout/Provider/perplexitylabs.py +0 -265
- webscout/Provider/twitterclone.py +0 -251
- webscout/Provider/upstage.py +0 -230
- webscout-6.5.dist-info/top_level.txt +0 -1
- /webscout/Provider/{felo_search.py → AISEARCH/felo_search.py} +0 -0
- {webscout-6.5.dist-info → webscout-6.7.dist-info}/LICENSE.md +0 -0
- {webscout-6.5.dist-info → webscout-6.7.dist-info}/WHEEL +0 -0
webscout/optimizers.py
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
"""Prompt optimization utilities."""
|
|
2
|
+
|
|
3
|
+
import os
|
|
2
4
|
import platform
|
|
3
5
|
import subprocess
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
+
from typing import Literal, Optional, Tuple, Callable, Dict, Any
|
|
6
7
|
class Optimizers:
|
|
7
8
|
"""
|
|
8
9
|
>>> Optimizers.code("write a hello world")
|
|
@@ -17,254 +18,403 @@ class Optimizers:
|
|
|
17
18
|
>>> Optimizers.math("solve quadratic equation")
|
|
18
19
|
Returns optimized prompt for math problems
|
|
19
20
|
"""
|
|
20
|
-
|
|
21
21
|
@staticmethod
|
|
22
|
-
def code(prompt):
|
|
22
|
+
def code(prompt: str) -> str:
|
|
23
23
|
"""Deprecated: Use coder() instead"""
|
|
24
24
|
return Optimizers.coder(prompt)
|
|
25
25
|
|
|
26
26
|
@staticmethod
|
|
27
|
-
def shell_command(prompt):
|
|
28
|
-
|
|
29
|
-
|
|
27
|
+
def shell_command(prompt: str) -> str:
|
|
28
|
+
"""Deprecated: Use coder() instead"""
|
|
29
|
+
return Optimizers.coder(f"!{prompt}")
|
|
30
30
|
|
|
31
31
|
@staticmethod
|
|
32
|
-
def coder(prompt):
|
|
32
|
+
def coder(prompt: str) -> str:
|
|
33
33
|
"""Unified optimizer for both code and shell commands."""
|
|
34
34
|
# Get system info for shell commands
|
|
35
|
-
operating_system = ""
|
|
35
|
+
operating_system: str = ""
|
|
36
36
|
if platform.system() == "Windows":
|
|
37
37
|
operating_system = "Windows"
|
|
38
38
|
elif platform.system() == "Darwin":
|
|
39
39
|
operating_system = "MacOS"
|
|
40
40
|
elif platform.system() == "Linux":
|
|
41
41
|
try:
|
|
42
|
-
result = subprocess.check_output(["lsb_release", "-si"]).decode().strip()
|
|
42
|
+
result: str = subprocess.check_output(["lsb_release", "-si"]).decode().strip()
|
|
43
43
|
operating_system = f"Linux/{result}" if result else "Linux"
|
|
44
|
-
except:
|
|
44
|
+
except Exception:
|
|
45
45
|
operating_system = "Linux"
|
|
46
46
|
else:
|
|
47
47
|
operating_system = platform.system()
|
|
48
48
|
|
|
49
49
|
# Get shell info
|
|
50
|
-
shell_name = "/bin/sh"
|
|
50
|
+
shell_name: str = "/bin/sh"
|
|
51
51
|
if platform.system() == "Windows":
|
|
52
52
|
shell_name = "powershell.exe" if os.getenv("PSModulePath") else "cmd.exe"
|
|
53
53
|
else:
|
|
54
|
-
shell_env = os.getenv("SHELL")
|
|
54
|
+
shell_env: Optional[str] = os.getenv("SHELL")
|
|
55
55
|
if shell_env:
|
|
56
56
|
shell_name = shell_env
|
|
57
57
|
|
|
58
58
|
return (
|
|
59
|
-
"
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
59
|
+
f"""<system_context>
|
|
60
|
+
<role>
|
|
61
|
+
Your Role: You are a code generation expert. Analyze the request and provide appropriate output.
|
|
62
|
+
If the request starts with '!' or involves system/shell operations, provide a shell command.
|
|
63
|
+
Otherwise, provide Python code.
|
|
64
|
+
</role>
|
|
65
|
+
<rules>
|
|
66
|
+
RULES:
|
|
67
|
+
- Provide ONLY code/command output without any description or markdown
|
|
68
|
+
- For shell commands:
|
|
69
|
+
- Target OS: {operating_system}
|
|
70
|
+
- Shell: {shell_name}
|
|
71
|
+
- Combine multiple steps when possible
|
|
72
|
+
- For Python code:
|
|
73
|
+
- Include necessary imports
|
|
74
|
+
- Handle errors appropriately
|
|
75
|
+
- Follow PEP 8 style
|
|
76
|
+
- If details are missing, use most logical implementation
|
|
77
|
+
- No warnings, descriptions, or explanations
|
|
78
|
+
</rules>
|
|
79
|
+
<request>
|
|
80
|
+
Request: {prompt}
|
|
81
|
+
</request>
|
|
82
|
+
<output>
|
|
83
|
+
Output:
|
|
84
|
+
</output>
|
|
85
|
+
</system_context>"""
|
|
76
86
|
)
|
|
77
87
|
|
|
78
88
|
@staticmethod
|
|
79
|
-
def search(prompt):
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
+
def search(prompt: str) -> str:
|
|
90
|
+
"""Optimize prompt for web search queries."""
|
|
91
|
+
return f"""
|
|
92
|
+
<system_context>
|
|
93
|
+
<role>
|
|
94
|
+
Your role: Generate a precise and focused web search query.
|
|
95
|
+
</role>
|
|
96
|
+
<instructions>
|
|
97
|
+
IMPORTANT: Return only the search query without any explanation.
|
|
98
|
+
Format: Plain text, no markdown.
|
|
99
|
+
If details are missing, focus on the most relevant aspects.
|
|
100
|
+
</instructions>
|
|
101
|
+
<request>
|
|
102
|
+
Request: {prompt}
|
|
103
|
+
</request>
|
|
104
|
+
<output>
|
|
105
|
+
Search Query:
|
|
106
|
+
</output>
|
|
107
|
+
</system_context>
|
|
108
|
+
"""
|
|
89
109
|
|
|
90
110
|
@staticmethod
|
|
91
|
-
def math(prompt):
|
|
111
|
+
def math(prompt: str) -> str:
|
|
92
112
|
"""Optimize prompt for mathematical problem solving."""
|
|
93
|
-
return
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
113
|
+
return f"""
|
|
114
|
+
<system_context>
|
|
115
|
+
<role>
|
|
116
|
+
Your role: Solve mathematical problems step by step.
|
|
117
|
+
</role>
|
|
118
|
+
<instructions>
|
|
119
|
+
Format: Plain text, show calculations clearly.
|
|
120
|
+
Show all steps and intermediate results.
|
|
121
|
+
Include units where applicable.
|
|
122
|
+
Provide final answer in a clear format.
|
|
123
|
+
</instructions>
|
|
124
|
+
<request>
|
|
125
|
+
Problem: {prompt}
|
|
126
|
+
</request>
|
|
127
|
+
<output>
|
|
128
|
+
Solution:
|
|
129
|
+
</output>
|
|
130
|
+
</system_context>
|
|
131
|
+
"""
|
|
102
132
|
|
|
103
133
|
@staticmethod
|
|
104
|
-
def explain(prompt):
|
|
134
|
+
def explain(prompt: str) -> str:
|
|
105
135
|
"""Optimize prompt for clear explanations."""
|
|
106
|
-
return
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
136
|
+
return f"""
|
|
137
|
+
<system_context>
|
|
138
|
+
<role>
|
|
139
|
+
Your role: Explain concepts clearly and concisely.
|
|
140
|
+
</role>
|
|
141
|
+
<instructions>
|
|
142
|
+
Format: Break down complex ideas into simple terms.
|
|
143
|
+
Use analogies where helpful.
|
|
144
|
+
Focus on key points and practical understanding.
|
|
145
|
+
</instructions>
|
|
146
|
+
<topic>
|
|
147
|
+
Topic: {prompt}
|
|
148
|
+
</topic>
|
|
149
|
+
<output>
|
|
150
|
+
Explanation:
|
|
151
|
+
</output>
|
|
152
|
+
</system_context>
|
|
153
|
+
"""
|
|
114
154
|
|
|
115
155
|
@staticmethod
|
|
116
|
-
def debug(prompt):
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
156
|
+
def debug(prompt: str) -> str:
|
|
157
|
+
"""Optimize prompt for debugging code."""
|
|
158
|
+
return f"""
|
|
159
|
+
<system_context>
|
|
160
|
+
<role>
|
|
161
|
+
Your role: Debug code and identify issues.
|
|
162
|
+
</role>
|
|
163
|
+
<instructions>
|
|
164
|
+
Steps:
|
|
165
|
+
- Identify syntax errors
|
|
166
|
+
- Check logic issues
|
|
167
|
+
- Look for common pitfalls
|
|
168
|
+
- Suggest fixes
|
|
169
|
+
</instructions>
|
|
170
|
+
<input>
|
|
171
|
+
Code to debug: {prompt}
|
|
172
|
+
</input>
|
|
173
|
+
<output>
|
|
174
|
+
Analysis:
|
|
175
|
+
</output>
|
|
176
|
+
</system_context>
|
|
177
|
+
"""
|
|
128
178
|
|
|
129
179
|
@staticmethod
|
|
130
|
-
def api(prompt):
|
|
180
|
+
def api(prompt: str) -> str:
|
|
131
181
|
"""Optimize prompt for API endpoint design."""
|
|
132
|
-
return
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
182
|
+
return f"""
|
|
183
|
+
<system_context>
|
|
184
|
+
<role>
|
|
185
|
+
Your role: Design RESTful API endpoints.
|
|
186
|
+
</role>
|
|
187
|
+
<instructions>
|
|
188
|
+
Include:
|
|
189
|
+
- HTTP methods
|
|
190
|
+
- URL structure
|
|
191
|
+
- Request/Response format
|
|
192
|
+
- Status codes
|
|
193
|
+
</instructions>
|
|
194
|
+
<input>
|
|
195
|
+
API requirement: {prompt}
|
|
196
|
+
</input>
|
|
197
|
+
<output>
|
|
198
|
+
Design:
|
|
199
|
+
</output>
|
|
200
|
+
</system_context>
|
|
201
|
+
"""
|
|
142
202
|
|
|
143
203
|
@staticmethod
|
|
144
|
-
def sql(prompt):
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
204
|
+
def sql(prompt: str) -> str:
|
|
205
|
+
"""Optimize prompt for SQL query generation."""
|
|
206
|
+
return f"""
|
|
207
|
+
<system_context>
|
|
208
|
+
<role>
|
|
209
|
+
Your role: Generate optimized SQL queries.
|
|
210
|
+
</role>
|
|
211
|
+
<instructions>
|
|
212
|
+
Requirements:
|
|
213
|
+
- Standard SQL syntax
|
|
214
|
+
- Efficient query structure
|
|
215
|
+
- Proper joins and indexing
|
|
216
|
+
- Consider performance
|
|
217
|
+
</instructions>
|
|
218
|
+
<input>
|
|
219
|
+
Query need: {prompt}
|
|
220
|
+
</input>
|
|
221
|
+
<output>
|
|
222
|
+
SQL:
|
|
223
|
+
</output>
|
|
224
|
+
</system_context>
|
|
225
|
+
"""
|
|
156
226
|
|
|
157
227
|
@staticmethod
|
|
158
|
-
def regex(prompt):
|
|
228
|
+
def regex(prompt: str) -> str:
|
|
159
229
|
"""Optimize prompt for regex pattern generation."""
|
|
160
|
-
return
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
230
|
+
return f"""
|
|
231
|
+
<system_context>
|
|
232
|
+
<role>
|
|
233
|
+
Your role: Generate precise regex patterns.
|
|
234
|
+
</role>
|
|
235
|
+
<instructions>
|
|
236
|
+
Requirements:
|
|
237
|
+
- Standard regex syntax
|
|
238
|
+
- Pattern explanation
|
|
239
|
+
- Test cases
|
|
240
|
+
- Consider edge cases
|
|
241
|
+
</instructions>
|
|
242
|
+
<input>
|
|
243
|
+
Pattern need: {prompt}
|
|
244
|
+
</input>
|
|
245
|
+
<output>
|
|
246
|
+
Regex:
|
|
247
|
+
</output>
|
|
248
|
+
</system_context>
|
|
249
|
+
"""
|
|
170
250
|
|
|
171
251
|
@staticmethod
|
|
172
|
-
def test(prompt):
|
|
252
|
+
def test(prompt: str) -> str:
|
|
173
253
|
"""Optimize prompt for test case generation."""
|
|
174
|
-
return
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
254
|
+
return f"""
|
|
255
|
+
<system_context>
|
|
256
|
+
<role>
|
|
257
|
+
Your role: Generate comprehensive test cases.
|
|
258
|
+
</role>
|
|
259
|
+
<instructions>
|
|
260
|
+
Include:
|
|
261
|
+
- Edge cases
|
|
262
|
+
- Corner cases
|
|
263
|
+
- Error scenarios
|
|
264
|
+
- Happy path
|
|
265
|
+
Format: Test name and expected result
|
|
266
|
+
</instructions>
|
|
267
|
+
<input>
|
|
268
|
+
Test requirement: {prompt}
|
|
269
|
+
</input>
|
|
270
|
+
<output>
|
|
271
|
+
Test Cases:
|
|
272
|
+
</output>
|
|
273
|
+
</system_context>
|
|
274
|
+
"""
|
|
185
275
|
|
|
186
276
|
@staticmethod
|
|
187
|
-
def docker(prompt):
|
|
277
|
+
def docker(prompt: str) -> str:
|
|
188
278
|
"""Optimize prompt for Dockerfile creation."""
|
|
189
|
-
return
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
279
|
+
return f"""
|
|
280
|
+
<system_context>
|
|
281
|
+
<role>
|
|
282
|
+
Your role: Create efficient Dockerfile.
|
|
283
|
+
</role>
|
|
284
|
+
<instructions>
|
|
285
|
+
Consider:
|
|
286
|
+
- Base image selection
|
|
287
|
+
- Layer optimization
|
|
288
|
+
- Security best practices
|
|
289
|
+
- Multi-stage builds if needed
|
|
290
|
+
</instructions>
|
|
291
|
+
<input>
|
|
292
|
+
Container requirement: {prompt}
|
|
293
|
+
</input>
|
|
294
|
+
<output>
|
|
295
|
+
Dockerfile:
|
|
296
|
+
</output>
|
|
297
|
+
</system_context>
|
|
298
|
+
"""
|
|
199
299
|
|
|
200
300
|
@staticmethod
|
|
201
|
-
def git(prompt):
|
|
301
|
+
def git(prompt: str) -> str:
|
|
202
302
|
"""Optimize prompt for git commands."""
|
|
203
|
-
return
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
303
|
+
return f"""
|
|
304
|
+
<system_context>
|
|
305
|
+
<role>
|
|
306
|
+
Your role: Generate git commands.
|
|
307
|
+
</role>
|
|
308
|
+
<instructions>
|
|
309
|
+
Requirements:
|
|
310
|
+
- Clear and safe commands
|
|
311
|
+
- Consider current state
|
|
312
|
+
- Include safety checks
|
|
313
|
+
- Best practices
|
|
314
|
+
</instructions>
|
|
315
|
+
<input>
|
|
316
|
+
Git task: {prompt}
|
|
317
|
+
</input>
|
|
318
|
+
<output>
|
|
319
|
+
Command:
|
|
320
|
+
</output>
|
|
321
|
+
</system_context>
|
|
322
|
+
"""
|
|
213
323
|
|
|
214
324
|
@staticmethod
|
|
215
|
-
def yaml(prompt):
|
|
325
|
+
def yaml(prompt: str) -> str:
|
|
216
326
|
"""Optimize prompt for YAML configuration."""
|
|
217
|
-
return
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
327
|
+
return f"""
|
|
328
|
+
<system_context>
|
|
329
|
+
<role>
|
|
330
|
+
Your role: Generate YAML configuration.
|
|
331
|
+
</role>
|
|
332
|
+
<instructions>
|
|
333
|
+
Requirements:
|
|
334
|
+
- Valid YAML syntax
|
|
335
|
+
- Clear structure
|
|
336
|
+
- Comments for complex parts
|
|
337
|
+
- Best practices
|
|
338
|
+
</instructions>
|
|
339
|
+
<input>
|
|
340
|
+
Config need: {prompt}
|
|
341
|
+
</input>
|
|
342
|
+
<output>
|
|
343
|
+
YAML:
|
|
344
|
+
</output>
|
|
345
|
+
</system_context>
|
|
346
|
+
"""
|
|
227
347
|
|
|
228
348
|
@staticmethod
|
|
229
|
-
def cli(prompt):
|
|
349
|
+
def cli(prompt: str) -> str:
|
|
230
350
|
"""Optimize prompt for CLI command design."""
|
|
231
|
-
return
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
351
|
+
return f"""
|
|
352
|
+
<system_context>
|
|
353
|
+
<role>
|
|
354
|
+
Your role: Design CLI commands.
|
|
355
|
+
</role>
|
|
356
|
+
<instructions>
|
|
357
|
+
Include:
|
|
358
|
+
- Command structure
|
|
359
|
+
- Arguments/options
|
|
360
|
+
- Help messages
|
|
361
|
+
- Examples
|
|
362
|
+
</instructions>
|
|
363
|
+
<input>
|
|
364
|
+
CLI requirement: {prompt}
|
|
365
|
+
</input>
|
|
366
|
+
<output>
|
|
367
|
+
Design:
|
|
368
|
+
</output>
|
|
369
|
+
</system_context>
|
|
370
|
+
"""
|
|
241
371
|
|
|
242
372
|
@staticmethod
|
|
243
|
-
def refactor(prompt):
|
|
373
|
+
def refactor(prompt: str) -> str:
|
|
244
374
|
"""Optimize prompt for code refactoring suggestions."""
|
|
245
|
-
return
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
375
|
+
return f"""
|
|
376
|
+
<system_context>
|
|
377
|
+
<role>
|
|
378
|
+
Your role: Suggest code improvements.
|
|
379
|
+
</role>
|
|
380
|
+
<instructions>
|
|
381
|
+
Focus on:
|
|
382
|
+
- Code quality
|
|
383
|
+
- Performance
|
|
384
|
+
- Readability
|
|
385
|
+
- Best practices
|
|
386
|
+
- Design patterns
|
|
387
|
+
</instructions>
|
|
388
|
+
<input>
|
|
389
|
+
Code to refactor: {prompt}
|
|
390
|
+
</input>
|
|
391
|
+
<output>
|
|
392
|
+
Suggestions:
|
|
393
|
+
</output>
|
|
394
|
+
</system_context>
|
|
395
|
+
"""
|
|
256
396
|
|
|
257
397
|
@staticmethod
|
|
258
|
-
def security(prompt):
|
|
398
|
+
def security(prompt: str) -> str:
|
|
259
399
|
"""Optimize prompt for security analysis."""
|
|
260
|
-
return
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
400
|
+
return f"""
|
|
401
|
+
<system_context>
|
|
402
|
+
<role>
|
|
403
|
+
Your role: Security analysis and fixes.
|
|
404
|
+
</role>
|
|
405
|
+
<instructions>
|
|
406
|
+
Check for:
|
|
407
|
+
- Common vulnerabilities
|
|
408
|
+
- Security best practices
|
|
409
|
+
- Input validation
|
|
410
|
+
- Authentication/Authorization
|
|
411
|
+
- Data protection
|
|
412
|
+
</instructions>
|
|
413
|
+
<input>
|
|
414
|
+
Code to analyze: {prompt}
|
|
415
|
+
</input>
|
|
416
|
+
<output>
|
|
417
|
+
Analysis:
|
|
418
|
+
</output>
|
|
419
|
+
</system_context>
|
|
420
|
+
"""
|
webscout/scout/__init__.py
CHANGED
|
@@ -2,10 +2,7 @@
|
|
|
2
2
|
Scout: A powerful, zero-dependency web scraping library
|
|
3
3
|
"""
|
|
4
4
|
|
|
5
|
-
from .core import Scout
|
|
5
|
+
from .core import Scout, ScoutCrawler, ScoutTextAnalyzer, ScoutWebAnalyzer, ScoutSearchResult
|
|
6
6
|
from .element import Tag, NavigableString
|
|
7
7
|
|
|
8
|
-
__all__ = ['Scout', 'Tag', 'NavigableString']
|
|
9
|
-
|
|
10
|
-
# Alias for BeautifulSoup compatibility
|
|
11
|
-
BeautifulSoup = Scout
|
|
8
|
+
__all__ = ['Scout', 'ScoutCrawler', 'Tag', 'NavigableString','ScoutTextAnalyzer', 'ScoutWebAnalyzer', 'ScoutSearchResult']
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
from .text_analyzer import ScoutTextAnalyzer
|
|
2
|
+
from .web_analyzer import ScoutWebAnalyzer
|
|
3
|
+
from .search_result import ScoutSearchResult
|
|
4
|
+
from .crawler import ScoutCrawler
|
|
5
|
+
from .scout import Scout
|
|
6
|
+
|
|
7
|
+
__all__ = ['ScoutTextAnalyzer', 'ScoutWebAnalyzer', 'ScoutSearchResult', 'ScoutCrawler', 'Scout']
|