webscout 8.2.4__py3-none-any.whl → 8.2.6__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of webscout might be problematic. Click here for more details.

Files changed (110) hide show
  1. webscout/AIauto.py +112 -22
  2. webscout/AIutel.py +240 -344
  3. webscout/Extra/autocoder/autocoder.py +66 -5
  4. webscout/Extra/gguf.py +2 -0
  5. webscout/Provider/AISEARCH/scira_search.py +3 -5
  6. webscout/Provider/Aitopia.py +75 -51
  7. webscout/Provider/AllenAI.py +64 -67
  8. webscout/Provider/ChatGPTClone.py +33 -34
  9. webscout/Provider/ChatSandbox.py +342 -0
  10. webscout/Provider/Cloudflare.py +79 -32
  11. webscout/Provider/Deepinfra.py +69 -56
  12. webscout/Provider/ElectronHub.py +48 -39
  13. webscout/Provider/ExaChat.py +36 -20
  14. webscout/Provider/GPTWeb.py +24 -18
  15. webscout/Provider/GithubChat.py +52 -49
  16. webscout/Provider/GizAI.py +285 -0
  17. webscout/Provider/Glider.py +39 -28
  18. webscout/Provider/Groq.py +48 -20
  19. webscout/Provider/HeckAI.py +18 -36
  20. webscout/Provider/Jadve.py +30 -37
  21. webscout/Provider/LambdaChat.py +36 -59
  22. webscout/Provider/MCPCore.py +18 -21
  23. webscout/Provider/Marcus.py +23 -14
  24. webscout/Provider/Nemotron.py +218 -0
  25. webscout/Provider/Netwrck.py +35 -26
  26. webscout/Provider/OPENAI/__init__.py +1 -1
  27. webscout/Provider/OPENAI/exachat.py +4 -0
  28. webscout/Provider/OPENAI/scirachat.py +3 -4
  29. webscout/Provider/OPENAI/textpollinations.py +20 -22
  30. webscout/Provider/OPENAI/toolbaz.py +1 -0
  31. webscout/Provider/PI.py +22 -13
  32. webscout/Provider/StandardInput.py +42 -30
  33. webscout/Provider/TeachAnything.py +24 -12
  34. webscout/Provider/TextPollinationsAI.py +78 -76
  35. webscout/Provider/TwoAI.py +120 -88
  36. webscout/Provider/TypliAI.py +305 -0
  37. webscout/Provider/Venice.py +24 -22
  38. webscout/Provider/VercelAI.py +31 -12
  39. webscout/Provider/WiseCat.py +1 -1
  40. webscout/Provider/WrDoChat.py +370 -0
  41. webscout/Provider/__init__.py +11 -13
  42. webscout/Provider/ai4chat.py +5 -3
  43. webscout/Provider/akashgpt.py +59 -66
  44. webscout/Provider/asksteve.py +53 -44
  45. webscout/Provider/cerebras.py +77 -31
  46. webscout/Provider/chatglm.py +47 -37
  47. webscout/Provider/elmo.py +38 -32
  48. webscout/Provider/freeaichat.py +57 -43
  49. webscout/Provider/granite.py +24 -21
  50. webscout/Provider/hermes.py +27 -20
  51. webscout/Provider/learnfastai.py +25 -20
  52. webscout/Provider/llmchatco.py +48 -78
  53. webscout/Provider/multichat.py +13 -3
  54. webscout/Provider/scira_chat.py +50 -30
  55. webscout/Provider/scnet.py +27 -21
  56. webscout/Provider/searchchat.py +16 -24
  57. webscout/Provider/sonus.py +37 -39
  58. webscout/Provider/toolbaz.py +24 -46
  59. webscout/Provider/turboseek.py +37 -41
  60. webscout/Provider/typefully.py +30 -22
  61. webscout/Provider/typegpt.py +47 -51
  62. webscout/Provider/uncovr.py +46 -40
  63. webscout/__init__.py +0 -1
  64. webscout/cli.py +256 -0
  65. webscout/conversation.py +305 -448
  66. webscout/exceptions.py +3 -0
  67. webscout/swiftcli/__init__.py +80 -794
  68. webscout/swiftcli/core/__init__.py +7 -0
  69. webscout/swiftcli/core/cli.py +297 -0
  70. webscout/swiftcli/core/context.py +104 -0
  71. webscout/swiftcli/core/group.py +241 -0
  72. webscout/swiftcli/decorators/__init__.py +28 -0
  73. webscout/swiftcli/decorators/command.py +221 -0
  74. webscout/swiftcli/decorators/options.py +220 -0
  75. webscout/swiftcli/decorators/output.py +252 -0
  76. webscout/swiftcli/exceptions.py +21 -0
  77. webscout/swiftcli/plugins/__init__.py +9 -0
  78. webscout/swiftcli/plugins/base.py +135 -0
  79. webscout/swiftcli/plugins/manager.py +262 -0
  80. webscout/swiftcli/utils/__init__.py +59 -0
  81. webscout/swiftcli/utils/formatting.py +252 -0
  82. webscout/swiftcli/utils/parsing.py +267 -0
  83. webscout/version.py +1 -1
  84. {webscout-8.2.4.dist-info → webscout-8.2.6.dist-info}/METADATA +166 -45
  85. {webscout-8.2.4.dist-info → webscout-8.2.6.dist-info}/RECORD +89 -89
  86. {webscout-8.2.4.dist-info → webscout-8.2.6.dist-info}/WHEEL +1 -1
  87. webscout-8.2.6.dist-info/entry_points.txt +3 -0
  88. {webscout-8.2.4.dist-info → webscout-8.2.6.dist-info}/top_level.txt +0 -1
  89. inferno/__init__.py +0 -6
  90. inferno/__main__.py +0 -9
  91. inferno/cli.py +0 -6
  92. inferno/lol.py +0 -589
  93. webscout/LLM.py +0 -442
  94. webscout/Local/__init__.py +0 -12
  95. webscout/Local/__main__.py +0 -9
  96. webscout/Local/api.py +0 -576
  97. webscout/Local/cli.py +0 -516
  98. webscout/Local/config.py +0 -75
  99. webscout/Local/llm.py +0 -287
  100. webscout/Local/model_manager.py +0 -253
  101. webscout/Local/server.py +0 -721
  102. webscout/Local/utils.py +0 -93
  103. webscout/Provider/Chatify.py +0 -175
  104. webscout/Provider/PizzaGPT.py +0 -228
  105. webscout/Provider/askmyai.py +0 -158
  106. webscout/Provider/gaurish.py +0 -244
  107. webscout/Provider/promptrefine.py +0 -193
  108. webscout/Provider/tutorai.py +0 -270
  109. webscout-8.2.4.dist-info/entry_points.txt +0 -5
  110. {webscout-8.2.4.dist-info → webscout-8.2.6.dist-info}/licenses/LICENSE.md +0 -0
@@ -0,0 +1,267 @@
1
+ """Utility functions for parsing and validating command-line arguments."""
2
+
3
+ import os
4
+ import json
5
+ import yaml
6
+ from pathlib import Path
7
+ from typing import Any, Dict, List, Optional, Union, Type
8
+
9
+ from ..exceptions import BadParameter, UsageError
10
+
11
+ def parse_args(args: List[str]) -> Dict[str, Any]:
12
+ """
13
+ Parse command line arguments into a dictionary.
14
+
15
+ Args:
16
+ args: List of command line arguments
17
+
18
+ Returns:
19
+ Dictionary of parsed arguments
20
+
21
+ Example:
22
+ >>> parse_args(['--name', 'test', '--flag', '-n', '42'])
23
+ {'name': 'test', 'flag': True, 'n': '42'}
24
+ """
25
+ parsed = {}
26
+ i = 0
27
+ while i < len(args):
28
+ arg = args[i]
29
+
30
+ # Handle flags/options
31
+ if arg.startswith('-'):
32
+ key = arg.lstrip('-').replace('-', '_')
33
+
34
+ # Check if next arg is a value or another flag
35
+ if i + 1 >= len(args) or args[i + 1].startswith('-'):
36
+ parsed[key] = True # Flag without value
37
+ else:
38
+ parsed[key] = args[i + 1]
39
+ i += 1
40
+ else:
41
+ # Positional argument
42
+ parsed[f'arg{len([k for k in parsed.keys() if k.startswith("arg")])}'] = arg
43
+
44
+ i += 1
45
+
46
+ return parsed
47
+
48
+ def validate_required(
49
+ params: Dict[str, Any],
50
+ required: List[str]
51
+ ) -> None:
52
+ """
53
+ Validate required parameters are present.
54
+
55
+ Args:
56
+ params: Parameter dictionary
57
+ required: List of required parameter names
58
+
59
+ Raises:
60
+ UsageError: If required parameter is missing
61
+ """
62
+ missing = [p for p in required if p not in params]
63
+ if missing:
64
+ raise UsageError(f"Missing required parameters: {', '.join(missing)}")
65
+
66
+ def convert_type(
67
+ value: str,
68
+ type_: Type,
69
+ param_name: str
70
+ ) -> Any:
71
+ """
72
+ Convert string value to specified type.
73
+
74
+ Args:
75
+ value: String value to convert
76
+ type_: Target type
77
+ param_name: Parameter name for error messages
78
+
79
+ Returns:
80
+ Converted value
81
+
82
+ Raises:
83
+ BadParameter: If conversion fails
84
+ """
85
+ try:
86
+ if type_ == bool:
87
+ return value.lower() in ('true', 't', 'yes', 'y', '1')
88
+ return type_(value)
89
+ except (ValueError, TypeError):
90
+ raise BadParameter(
91
+ f"Invalid value for {param_name}: {value} (expected {type_.__name__})"
92
+ )
93
+
94
+ def validate_choice(
95
+ value: Any,
96
+ choices: List[Any],
97
+ param_name: str,
98
+ case_sensitive: bool = True
99
+ ) -> None:
100
+ """
101
+ Validate value is one of allowed choices.
102
+
103
+ Args:
104
+ value: Value to validate
105
+ choices: List of allowed choices
106
+ param_name: Parameter name for error messages
107
+ case_sensitive: Whether to do case-sensitive comparison
108
+
109
+ Raises:
110
+ BadParameter: If value not in choices
111
+ """
112
+ if not case_sensitive and isinstance(value, str):
113
+ if value.lower() not in [str(c).lower() for c in choices]:
114
+ raise BadParameter(
115
+ f"Invalid choice for {param_name}: {value} "
116
+ f"(choose from {', '.join(str(c) for c in choices)})"
117
+ )
118
+ elif value not in choices:
119
+ raise BadParameter(
120
+ f"Invalid choice for {param_name}: {value} "
121
+ f"(choose from {', '.join(str(c) for c in choices)})"
122
+ )
123
+
124
+ def load_config_file(
125
+ path: Union[str, Path],
126
+ format: str = 'auto',
127
+ required: bool = True
128
+ ) -> Dict[str, Any]:
129
+ """
130
+ Load configuration from file.
131
+
132
+ Args:
133
+ path: Path to config file
134
+ format: File format (json, yaml, or auto)
135
+ required: Whether file is required
136
+
137
+ Returns:
138
+ Configuration dictionary
139
+
140
+ Raises:
141
+ UsageError: If required file not found or invalid format
142
+ """
143
+ path = Path(os.path.expanduser(path))
144
+
145
+ if not path.exists():
146
+ if required:
147
+ raise UsageError(f"Config file not found: {path}")
148
+ return {}
149
+
150
+ # Auto-detect format from extension
151
+ if format == 'auto':
152
+ format = path.suffix.lstrip('.').lower()
153
+ if format not in ('json', 'yaml', 'yml'):
154
+ raise UsageError(f"Unsupported config format: {format}")
155
+
156
+ try:
157
+ with open(path) as f:
158
+ if format == 'json':
159
+ return json.load(f)
160
+ elif format in ('yaml', 'yml'):
161
+ return yaml.safe_load(f)
162
+ else:
163
+ raise UsageError(f"Unsupported config format: {format}")
164
+ except Exception as e:
165
+ raise UsageError(f"Error loading config file: {str(e)}")
166
+
167
+ def parse_key_value(
168
+ value: str,
169
+ separator: str = '='
170
+ ) -> tuple:
171
+ """
172
+ Parse key-value string.
173
+
174
+ Args:
175
+ value: String in format "key=value"
176
+ separator: Key-value separator
177
+
178
+ Returns:
179
+ Tuple of (key, value)
180
+
181
+ Raises:
182
+ BadParameter: If string not in key=value format
183
+ """
184
+ try:
185
+ key, value = value.split(separator, 1)
186
+ return key.strip(), value.strip()
187
+ except ValueError:
188
+ raise BadParameter(
189
+ f"Invalid key-value pair: {value} (expected format: key{separator}value)"
190
+ )
191
+
192
+ def parse_list(
193
+ value: str,
194
+ separator: str = ','
195
+ ) -> List[str]:
196
+ """
197
+ Parse comma-separated list.
198
+
199
+ Args:
200
+ value: Comma-separated string
201
+ separator: List item separator
202
+
203
+ Returns:
204
+ List of strings
205
+ """
206
+ return [x.strip() for x in value.split(separator) if x.strip()]
207
+
208
+ def parse_dict(
209
+ value: str,
210
+ item_separator: str = ',',
211
+ key_value_separator: str = '='
212
+ ) -> Dict[str, str]:
213
+ """
214
+ Parse dictionary string.
215
+
216
+ Args:
217
+ value: String in format "key1=value1,key2=value2"
218
+ item_separator: Separator between items
219
+ key_value_separator: Separator between keys and values
220
+
221
+ Returns:
222
+ Dictionary of key-value pairs
223
+
224
+ Example:
225
+ >>> parse_dict("name=test,count=42")
226
+ {'name': 'test', 'count': '42'}
227
+ """
228
+ result = {}
229
+ if not value:
230
+ return result
231
+
232
+ items = parse_list(value, item_separator)
233
+ for item in items:
234
+ key, value = parse_key_value(item, key_value_separator)
235
+ result[key] = value
236
+
237
+ return result
238
+
239
+ def get_env_var(
240
+ name: str,
241
+ type_: Type = str,
242
+ required: bool = False,
243
+ default: Any = None
244
+ ) -> Any:
245
+ """
246
+ Get and validate environment variable.
247
+
248
+ Args:
249
+ name: Environment variable name
250
+ type_: Expected type
251
+ required: Whether variable is required
252
+ default: Default value if not set
253
+
254
+ Returns:
255
+ Environment variable value
256
+
257
+ Raises:
258
+ UsageError: If required variable not set
259
+ """
260
+ value = os.environ.get(name)
261
+
262
+ if value is None:
263
+ if required:
264
+ raise UsageError(f"Required environment variable not set: {name}")
265
+ return default
266
+
267
+ return convert_type(value, type_, name)
webscout/version.py CHANGED
@@ -1,2 +1,2 @@
1
- __version__ = "8.2.4"
1
+ __version__ = "8.2.6"
2
2
  __prog__ = "webscout"