webscout 8.3__py3-none-any.whl → 8.3.2__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/AIauto.py +4 -4
- webscout/AIbase.py +61 -1
- webscout/AIutel.py +46 -53
- webscout/Bing_search.py +418 -0
- webscout/Extra/YTToolkit/ytapi/patterns.py +45 -45
- webscout/Extra/YTToolkit/ytapi/stream.py +1 -1
- webscout/Extra/YTToolkit/ytapi/video.py +10 -10
- webscout/Extra/autocoder/autocoder_utiles.py +1 -1
- webscout/Extra/gguf.py +706 -177
- webscout/Litlogger/formats.py +9 -0
- webscout/Litlogger/handlers.py +18 -0
- webscout/Litlogger/logger.py +43 -1
- webscout/Provider/AISEARCH/genspark_search.py +7 -7
- webscout/Provider/AISEARCH/scira_search.py +3 -2
- webscout/Provider/GeminiProxy.py +140 -0
- webscout/Provider/LambdaChat.py +7 -1
- webscout/Provider/MCPCore.py +78 -75
- webscout/Provider/OPENAI/BLACKBOXAI.py +1046 -1017
- webscout/Provider/OPENAI/GeminiProxy.py +328 -0
- webscout/Provider/OPENAI/Qwen3.py +303 -303
- webscout/Provider/OPENAI/README.md +5 -0
- webscout/Provider/OPENAI/README_AUTOPROXY.md +238 -0
- webscout/Provider/OPENAI/TogetherAI.py +355 -0
- webscout/Provider/OPENAI/__init__.py +16 -1
- webscout/Provider/OPENAI/autoproxy.py +332 -0
- webscout/Provider/OPENAI/base.py +101 -14
- webscout/Provider/OPENAI/chatgpt.py +15 -2
- webscout/Provider/OPENAI/chatgptclone.py +14 -3
- webscout/Provider/OPENAI/deepinfra.py +339 -328
- webscout/Provider/OPENAI/e2b.py +295 -74
- webscout/Provider/OPENAI/mcpcore.py +109 -70
- webscout/Provider/OPENAI/opkfc.py +18 -6
- webscout/Provider/OPENAI/scirachat.py +59 -50
- webscout/Provider/OPENAI/toolbaz.py +2 -10
- webscout/Provider/OPENAI/writecream.py +166 -166
- webscout/Provider/OPENAI/x0gpt.py +367 -367
- webscout/Provider/OPENAI/xenai.py +514 -0
- webscout/Provider/OPENAI/yep.py +389 -383
- webscout/Provider/STT/__init__.py +3 -0
- webscout/Provider/STT/base.py +281 -0
- webscout/Provider/STT/elevenlabs.py +265 -0
- webscout/Provider/TTI/__init__.py +4 -1
- webscout/Provider/TTI/aiarta.py +399 -365
- webscout/Provider/TTI/base.py +74 -2
- webscout/Provider/TTI/bing.py +231 -0
- webscout/Provider/TTI/fastflux.py +63 -30
- webscout/Provider/TTI/gpt1image.py +149 -0
- webscout/Provider/TTI/imagen.py +196 -0
- webscout/Provider/TTI/magicstudio.py +60 -29
- webscout/Provider/TTI/piclumen.py +43 -32
- webscout/Provider/TTI/pixelmuse.py +232 -225
- webscout/Provider/TTI/pollinations.py +43 -32
- webscout/Provider/TTI/together.py +287 -0
- webscout/Provider/TTI/utils.py +2 -1
- webscout/Provider/TTS/README.md +1 -0
- webscout/Provider/TTS/__init__.py +2 -1
- webscout/Provider/TTS/freetts.py +140 -0
- webscout/Provider/TTS/speechma.py +45 -39
- webscout/Provider/TogetherAI.py +366 -0
- webscout/Provider/UNFINISHED/ChutesAI.py +314 -0
- webscout/Provider/UNFINISHED/fetch_together_models.py +95 -0
- webscout/Provider/XenAI.py +324 -0
- webscout/Provider/__init__.py +8 -0
- webscout/Provider/deepseek_assistant.py +378 -0
- webscout/Provider/scira_chat.py +3 -2
- webscout/Provider/toolbaz.py +0 -1
- webscout/auth/__init__.py +44 -0
- webscout/auth/api_key_manager.py +189 -0
- webscout/auth/auth_system.py +100 -0
- webscout/auth/config.py +76 -0
- webscout/auth/database.py +400 -0
- webscout/auth/exceptions.py +67 -0
- webscout/auth/middleware.py +248 -0
- webscout/auth/models.py +130 -0
- webscout/auth/providers.py +257 -0
- webscout/auth/rate_limiter.py +254 -0
- webscout/auth/request_models.py +127 -0
- webscout/auth/request_processing.py +226 -0
- webscout/auth/routes.py +526 -0
- webscout/auth/schemas.py +103 -0
- webscout/auth/server.py +312 -0
- webscout/auth/static/favicon.svg +11 -0
- webscout/auth/swagger_ui.py +203 -0
- webscout/auth/templates/components/authentication.html +237 -0
- webscout/auth/templates/components/base.html +103 -0
- webscout/auth/templates/components/endpoints.html +750 -0
- webscout/auth/templates/components/examples.html +491 -0
- webscout/auth/templates/components/footer.html +75 -0
- webscout/auth/templates/components/header.html +27 -0
- webscout/auth/templates/components/models.html +286 -0
- webscout/auth/templates/components/navigation.html +70 -0
- webscout/auth/templates/static/api.js +455 -0
- webscout/auth/templates/static/icons.js +168 -0
- webscout/auth/templates/static/main.js +784 -0
- webscout/auth/templates/static/particles.js +201 -0
- webscout/auth/templates/static/styles.css +3353 -0
- webscout/auth/templates/static/ui.js +374 -0
- webscout/auth/templates/swagger_ui.html +170 -0
- webscout/client.py +49 -3
- webscout/litagent/Readme.md +12 -3
- webscout/litagent/agent.py +99 -62
- webscout/scout/core/scout.py +104 -26
- webscout/scout/element.py +139 -18
- webscout/swiftcli/core/cli.py +14 -3
- webscout/swiftcli/decorators/output.py +59 -9
- webscout/update_checker.py +31 -49
- webscout/version.py +1 -1
- webscout/webscout_search.py +4 -12
- webscout/webscout_search_async.py +3 -10
- webscout/yep_search.py +2 -11
- {webscout-8.3.dist-info → webscout-8.3.2.dist-info}/METADATA +41 -11
- {webscout-8.3.dist-info → webscout-8.3.2.dist-info}/RECORD +116 -68
- {webscout-8.3.dist-info → webscout-8.3.2.dist-info}/entry_points.txt +1 -1
- webscout/Provider/HF_space/__init__.py +0 -0
- webscout/Provider/HF_space/qwen_qwen2.py +0 -206
- webscout/Provider/OPENAI/api.py +0 -1035
- webscout/Provider/TTI/artbit.py +0 -0
- {webscout-8.3.dist-info → webscout-8.3.2.dist-info}/WHEEL +0 -0
- {webscout-8.3.dist-info → webscout-8.3.2.dist-info}/licenses/LICENSE.md +0 -0
- {webscout-8.3.dist-info → webscout-8.3.2.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,491 @@
|
|
|
1
|
+
<div id="examples-panel" class="tab-content" role="tabpanel" aria-labelledby="examples-tab">
|
|
2
|
+
<div class="endpoint-section">
|
|
3
|
+
<h2 class="section-title">Code Examples</h2>
|
|
4
|
+
<p class="section-description">
|
|
5
|
+
Get started quickly with these comprehensive code examples in multiple programming languages. Each example includes error handling, best practices, and real-world usage patterns.
|
|
6
|
+
</p>
|
|
7
|
+
|
|
8
|
+
<div class="examples-nav">
|
|
9
|
+
<button class="example-tab active" data-language="python">
|
|
10
|
+
<span class="tab-icon">🐍</span>
|
|
11
|
+
Python
|
|
12
|
+
</button>
|
|
13
|
+
<button class="example-tab" data-language="javascript">
|
|
14
|
+
<span class="tab-icon">🟨</span>
|
|
15
|
+
JavaScript
|
|
16
|
+
</button>
|
|
17
|
+
<button class="example-tab" data-language="curl">
|
|
18
|
+
<span class="tab-icon">🌐</span>
|
|
19
|
+
cURL
|
|
20
|
+
</button>
|
|
21
|
+
<button class="example-tab" data-language="php">
|
|
22
|
+
<span class="tab-icon">🐘</span>
|
|
23
|
+
PHP
|
|
24
|
+
</button>
|
|
25
|
+
<button class="example-tab" data-language="go">
|
|
26
|
+
<span class="tab-icon">🔷</span>
|
|
27
|
+
Go
|
|
28
|
+
</button>
|
|
29
|
+
</div>
|
|
30
|
+
|
|
31
|
+
<div class="example-content">
|
|
32
|
+
<!-- Python Examples -->
|
|
33
|
+
<div id="python-examples" class="language-examples active">
|
|
34
|
+
<div class="example-card">
|
|
35
|
+
<div class="example-header">
|
|
36
|
+
<h3>🐍 Python - Chat Completion</h3>
|
|
37
|
+
<button class="copy-code-btn" onclick="copyCode('python-chat-code')">
|
|
38
|
+
📋 Copy
|
|
39
|
+
</button>
|
|
40
|
+
</div>
|
|
41
|
+
<div class="code-block">
|
|
42
|
+
<pre id="python-chat-code"><code class="language-python">import requests
|
|
43
|
+
import json
|
|
44
|
+
|
|
45
|
+
# Configuration
|
|
46
|
+
API_KEY = "your-api-key-here"
|
|
47
|
+
BASE_URL = "{{ base_url }}"
|
|
48
|
+
|
|
49
|
+
def chat_completion(messages, model="gpt-3.5-turbo", stream=False):
|
|
50
|
+
"""
|
|
51
|
+
Send a chat completion request to the WebScout API
|
|
52
|
+
"""
|
|
53
|
+
url = f"{BASE_URL}/v1/chat/completions"
|
|
54
|
+
|
|
55
|
+
headers = {
|
|
56
|
+
"Authorization": f"Bearer {API_KEY}",
|
|
57
|
+
"Content-Type": "application/json"
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
payload = {
|
|
61
|
+
"model": model,
|
|
62
|
+
"messages": messages,
|
|
63
|
+
"stream": stream,
|
|
64
|
+
"temperature": 0.7,
|
|
65
|
+
"max_tokens": 150
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
try:
|
|
69
|
+
response = requests.post(url, headers=headers, json=payload)
|
|
70
|
+
response.raise_for_status()
|
|
71
|
+
|
|
72
|
+
if stream:
|
|
73
|
+
# Handle streaming response
|
|
74
|
+
for line in response.iter_lines():
|
|
75
|
+
if line:
|
|
76
|
+
line = line.decode('utf-8')
|
|
77
|
+
if line.startswith('data: '):
|
|
78
|
+
data = line[6:]
|
|
79
|
+
if data != '[DONE]':
|
|
80
|
+
chunk = json.loads(data)
|
|
81
|
+
if 'choices' in chunk and chunk['choices']:
|
|
82
|
+
delta = chunk['choices'][0].get('delta', {})
|
|
83
|
+
if 'content' in delta:
|
|
84
|
+
print(delta['content'], end='', flush=True)
|
|
85
|
+
else:
|
|
86
|
+
# Handle regular response
|
|
87
|
+
result = response.json()
|
|
88
|
+
return result['choices'][0]['message']['content']
|
|
89
|
+
|
|
90
|
+
except requests.exceptions.RequestException as e:
|
|
91
|
+
print(f"Error making request: {e}")
|
|
92
|
+
return None
|
|
93
|
+
except json.JSONDecodeError as e:
|
|
94
|
+
print(f"Error parsing JSON: {e}")
|
|
95
|
+
return None
|
|
96
|
+
|
|
97
|
+
# Example usage
|
|
98
|
+
if __name__ == "__main__":
|
|
99
|
+
messages = [
|
|
100
|
+
{"role": "user", "content": "Hello, how are you today?"}
|
|
101
|
+
]
|
|
102
|
+
|
|
103
|
+
# Non-streaming example
|
|
104
|
+
response = chat_completion(messages)
|
|
105
|
+
if response:
|
|
106
|
+
print("Response:", response)
|
|
107
|
+
|
|
108
|
+
# Streaming example
|
|
109
|
+
print("\nStreaming response:")
|
|
110
|
+
chat_completion(messages, stream=True)</code></pre>
|
|
111
|
+
</div>
|
|
112
|
+
</div>
|
|
113
|
+
|
|
114
|
+
<div class="example-card">
|
|
115
|
+
<div class="example-header">
|
|
116
|
+
<h3>🎨 Python - Image Generation</h3>
|
|
117
|
+
<button class="copy-code-btn" onclick="copyCode('python-image-code')">
|
|
118
|
+
📋 Copy
|
|
119
|
+
</button>
|
|
120
|
+
</div>
|
|
121
|
+
<div class="code-block">
|
|
122
|
+
<pre id="python-image-code"><code class="language-python">import requests
|
|
123
|
+
import json
|
|
124
|
+
from pathlib import Path
|
|
125
|
+
|
|
126
|
+
def generate_image(prompt, model="dall-e-2", size="512x512", n=1):
|
|
127
|
+
"""
|
|
128
|
+
Generate images using the WebScout API
|
|
129
|
+
"""
|
|
130
|
+
url = f"{BASE_URL}/v1/images/generations"
|
|
131
|
+
|
|
132
|
+
headers = {
|
|
133
|
+
"Authorization": f"Bearer {API_KEY}",
|
|
134
|
+
"Content-Type": "application/json"
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
payload = {
|
|
138
|
+
"prompt": prompt,
|
|
139
|
+
"model": model,
|
|
140
|
+
"size": size,
|
|
141
|
+
"n": n
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
try:
|
|
145
|
+
response = requests.post(url, headers=headers, json=payload)
|
|
146
|
+
response.raise_for_status()
|
|
147
|
+
|
|
148
|
+
result = response.json()
|
|
149
|
+
return result['data']
|
|
150
|
+
|
|
151
|
+
except requests.exceptions.RequestException as e:
|
|
152
|
+
print(f"Error generating image: {e}")
|
|
153
|
+
return None
|
|
154
|
+
|
|
155
|
+
def download_image(image_url, filename):
|
|
156
|
+
"""
|
|
157
|
+
Download an image from URL
|
|
158
|
+
"""
|
|
159
|
+
try:
|
|
160
|
+
response = requests.get(image_url)
|
|
161
|
+
response.raise_for_status()
|
|
162
|
+
|
|
163
|
+
with open(filename, 'wb') as f:
|
|
164
|
+
f.write(response.content)
|
|
165
|
+
|
|
166
|
+
print(f"Image saved as {filename}")
|
|
167
|
+
return True
|
|
168
|
+
|
|
169
|
+
except Exception as e:
|
|
170
|
+
print(f"Error downloading image: {e}")
|
|
171
|
+
return False
|
|
172
|
+
|
|
173
|
+
# Example usage
|
|
174
|
+
if __name__ == "__main__":
|
|
175
|
+
prompt = "A beautiful sunset over a mountain landscape"
|
|
176
|
+
|
|
177
|
+
images = generate_image(prompt)
|
|
178
|
+
if images:
|
|
179
|
+
for i, image in enumerate(images):
|
|
180
|
+
filename = f"generated_image_{i+1}.png"
|
|
181
|
+
download_image(image['url'], filename)</code></pre>
|
|
182
|
+
</div>
|
|
183
|
+
</div>
|
|
184
|
+
</div>
|
|
185
|
+
|
|
186
|
+
<!-- JavaScript Examples -->
|
|
187
|
+
<div id="javascript-examples" class="language-examples">
|
|
188
|
+
<div class="example-card">
|
|
189
|
+
<div class="example-header">
|
|
190
|
+
<h3>🟨 JavaScript - Chat Completion</h3>
|
|
191
|
+
<button class="copy-code-btn" onclick="copyCode('js-chat-code')">
|
|
192
|
+
📋 Copy
|
|
193
|
+
</button>
|
|
194
|
+
</div>
|
|
195
|
+
<div class="code-block">
|
|
196
|
+
<pre id="js-chat-code"><code class="language-javascript">// Configuration
|
|
197
|
+
const API_KEY = 'your-api-key-here';
|
|
198
|
+
const BASE_URL = '{{ base_url }}';
|
|
199
|
+
|
|
200
|
+
class WebScoutAPI {
|
|
201
|
+
constructor(apiKey, baseUrl) {
|
|
202
|
+
this.apiKey = apiKey;
|
|
203
|
+
this.baseUrl = baseUrl;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
async chatCompletion(messages, options = {}) {
|
|
207
|
+
const {
|
|
208
|
+
model = 'gpt-3.5-turbo',
|
|
209
|
+
stream = false,
|
|
210
|
+
temperature = 0.7,
|
|
211
|
+
maxTokens = 150
|
|
212
|
+
} = options;
|
|
213
|
+
|
|
214
|
+
const url = `${this.baseUrl}/v1/chat/completions`;
|
|
215
|
+
|
|
216
|
+
const payload = {
|
|
217
|
+
model,
|
|
218
|
+
messages,
|
|
219
|
+
stream,
|
|
220
|
+
temperature,
|
|
221
|
+
max_tokens: maxTokens
|
|
222
|
+
};
|
|
223
|
+
|
|
224
|
+
try {
|
|
225
|
+
const response = await fetch(url, {
|
|
226
|
+
method: 'POST',
|
|
227
|
+
headers: {
|
|
228
|
+
'Authorization': `Bearer ${this.apiKey}`,
|
|
229
|
+
'Content-Type': 'application/json'
|
|
230
|
+
},
|
|
231
|
+
body: JSON.stringify(payload)
|
|
232
|
+
});
|
|
233
|
+
|
|
234
|
+
if (!response.ok) {
|
|
235
|
+
throw new Error(`HTTP error! status: ${response.status}`);
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
if (stream) {
|
|
239
|
+
return this.handleStreamingResponse(response);
|
|
240
|
+
} else {
|
|
241
|
+
const result = await response.json();
|
|
242
|
+
return result.choices[0].message.content;
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
} catch (error) {
|
|
246
|
+
console.error('Error making chat completion request:', error);
|
|
247
|
+
throw error;
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
async *handleStreamingResponse(response) {
|
|
252
|
+
const reader = response.body.getReader();
|
|
253
|
+
const decoder = new TextDecoder();
|
|
254
|
+
|
|
255
|
+
try {
|
|
256
|
+
while (true) {
|
|
257
|
+
const { done, value } = await reader.read();
|
|
258
|
+
|
|
259
|
+
if (done) break;
|
|
260
|
+
|
|
261
|
+
const chunk = decoder.decode(value);
|
|
262
|
+
const lines = chunk.split('\n');
|
|
263
|
+
|
|
264
|
+
for (const line of lines) {
|
|
265
|
+
if (line.startsWith('data: ')) {
|
|
266
|
+
const data = line.slice(6);
|
|
267
|
+
if (data === '[DONE]') return;
|
|
268
|
+
|
|
269
|
+
try {
|
|
270
|
+
const parsed = JSON.parse(data);
|
|
271
|
+
if (parsed.choices && parsed.choices[0].delta.content) {
|
|
272
|
+
yield parsed.choices[0].delta.content;
|
|
273
|
+
}
|
|
274
|
+
} catch (e) {
|
|
275
|
+
// Skip invalid JSON
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
} finally {
|
|
281
|
+
reader.releaseLock();
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
async generateImage(prompt, options = {}) {
|
|
286
|
+
const {
|
|
287
|
+
model = 'dall-e-2',
|
|
288
|
+
size = '512x512',
|
|
289
|
+
n = 1
|
|
290
|
+
} = options;
|
|
291
|
+
|
|
292
|
+
const url = `${this.baseUrl}/v1/images/generations`;
|
|
293
|
+
|
|
294
|
+
const payload = {
|
|
295
|
+
prompt,
|
|
296
|
+
model,
|
|
297
|
+
size,
|
|
298
|
+
n
|
|
299
|
+
};
|
|
300
|
+
|
|
301
|
+
try {
|
|
302
|
+
const response = await fetch(url, {
|
|
303
|
+
method: 'POST',
|
|
304
|
+
headers: {
|
|
305
|
+
'Authorization': `Bearer ${this.apiKey}`,
|
|
306
|
+
'Content-Type': 'application/json'
|
|
307
|
+
},
|
|
308
|
+
body: JSON.stringify(payload)
|
|
309
|
+
});
|
|
310
|
+
|
|
311
|
+
if (!response.ok) {
|
|
312
|
+
throw new Error(`HTTP error! status: ${response.status}`);
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
const result = await response.json();
|
|
316
|
+
return result.data;
|
|
317
|
+
|
|
318
|
+
} catch (error) {
|
|
319
|
+
console.error('Error generating image:', error);
|
|
320
|
+
throw error;
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
// Example usage
|
|
326
|
+
async function main() {
|
|
327
|
+
const api = new WebScoutAPI(API_KEY, BASE_URL);
|
|
328
|
+
|
|
329
|
+
// Chat completion example
|
|
330
|
+
const messages = [
|
|
331
|
+
{ role: 'user', content: 'Hello, how are you today?' }
|
|
332
|
+
];
|
|
333
|
+
|
|
334
|
+
try {
|
|
335
|
+
// Non-streaming
|
|
336
|
+
const response = await api.chatCompletion(messages);
|
|
337
|
+
console.log('Response:', response);
|
|
338
|
+
|
|
339
|
+
// Streaming
|
|
340
|
+
console.log('Streaming response:');
|
|
341
|
+
for await (const chunk of api.chatCompletion(messages, { stream: true })) {
|
|
342
|
+
process.stdout.write(chunk);
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
// Image generation
|
|
346
|
+
const images = await api.generateImage('A beautiful sunset over mountains');
|
|
347
|
+
console.log('Generated images:', images);
|
|
348
|
+
|
|
349
|
+
} catch (error) {
|
|
350
|
+
console.error('Error:', error);
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
// Run the example
|
|
355
|
+
main();</code></pre>
|
|
356
|
+
</div>
|
|
357
|
+
</div>
|
|
358
|
+
</div>
|
|
359
|
+
|
|
360
|
+
<!-- cURL Examples -->
|
|
361
|
+
<div id="curl-examples" class="language-examples">
|
|
362
|
+
<div class="example-card">
|
|
363
|
+
<div class="example-header">
|
|
364
|
+
<h3>🌐 cURL - Chat Completion</h3>
|
|
365
|
+
<button class="copy-code-btn" onclick="copyCode('curl-chat-code')">
|
|
366
|
+
📋 Copy
|
|
367
|
+
</button>
|
|
368
|
+
</div>
|
|
369
|
+
<div class="code-block">
|
|
370
|
+
<pre id="curl-chat-code"><code class="language-bash"># Chat Completion Request
|
|
371
|
+
curl -X POST "{{ base_url }}/v1/chat/completions" \
|
|
372
|
+
-H "Authorization: Bearer YOUR_API_KEY" \
|
|
373
|
+
-H "Content-Type: application/json" \
|
|
374
|
+
-d '{
|
|
375
|
+
"model": "gpt-3.5-turbo",
|
|
376
|
+
"messages": [
|
|
377
|
+
{
|
|
378
|
+
"role": "user",
|
|
379
|
+
"content": "Hello, how are you today?"
|
|
380
|
+
}
|
|
381
|
+
],
|
|
382
|
+
"temperature": 0.7,
|
|
383
|
+
"max_tokens": 150
|
|
384
|
+
}'
|
|
385
|
+
|
|
386
|
+
# Streaming Chat Completion
|
|
387
|
+
curl -X POST "{{ base_url }}/v1/chat/completions" \
|
|
388
|
+
-H "Authorization: Bearer YOUR_API_KEY" \
|
|
389
|
+
-H "Content-Type: application/json" \
|
|
390
|
+
-d '{
|
|
391
|
+
"model": "gpt-3.5-turbo",
|
|
392
|
+
"messages": [
|
|
393
|
+
{
|
|
394
|
+
"role": "user",
|
|
395
|
+
"content": "Tell me a story"
|
|
396
|
+
}
|
|
397
|
+
],
|
|
398
|
+
"stream": true,
|
|
399
|
+
"temperature": 0.8
|
|
400
|
+
}' \
|
|
401
|
+
--no-buffer</code></pre>
|
|
402
|
+
</div>
|
|
403
|
+
</div>
|
|
404
|
+
|
|
405
|
+
<div class="example-card">
|
|
406
|
+
<div class="example-header">
|
|
407
|
+
<h3>🎨 cURL - Image Generation</h3>
|
|
408
|
+
<button class="copy-code-btn" onclick="copyCode('curl-image-code')">
|
|
409
|
+
📋 Copy
|
|
410
|
+
</button>
|
|
411
|
+
</div>
|
|
412
|
+
<div class="code-block">
|
|
413
|
+
<pre id="curl-image-code"><code class="language-bash"># Image Generation Request
|
|
414
|
+
curl -X POST "{{ base_url }}/v1/images/generations" \
|
|
415
|
+
-H "Authorization: Bearer YOUR_API_KEY" \
|
|
416
|
+
-H "Content-Type: application/json" \
|
|
417
|
+
-d '{
|
|
418
|
+
"prompt": "A beautiful sunset over a mountain landscape",
|
|
419
|
+
"model": "dall-e-2",
|
|
420
|
+
"size": "512x512",
|
|
421
|
+
"n": 1
|
|
422
|
+
}'
|
|
423
|
+
|
|
424
|
+
# List Available Models
|
|
425
|
+
curl -X GET "{{ base_url }}/v1/models" \
|
|
426
|
+
-H "Authorization: Bearer YOUR_API_KEY"
|
|
427
|
+
|
|
428
|
+
# Generate API Key
|
|
429
|
+
curl -X POST "{{ base_url }}/v1/auth/generate-key" \
|
|
430
|
+
-H "Content-Type: application/json" \
|
|
431
|
+
-d '{
|
|
432
|
+
"username": "your-username",
|
|
433
|
+
"name": "My API Key",
|
|
434
|
+
"rate_limit": 60
|
|
435
|
+
}'</code></pre>
|
|
436
|
+
</div>
|
|
437
|
+
</div>
|
|
438
|
+
</div>
|
|
439
|
+
</div>
|
|
440
|
+
|
|
441
|
+
<div class="integration-guides">
|
|
442
|
+
<h2 class="section-title">Integration Guides</h2>
|
|
443
|
+
|
|
444
|
+
<div class="guides-grid">
|
|
445
|
+
<div class="guide-card">
|
|
446
|
+
<div class="guide-icon">⚡</div>
|
|
447
|
+
<h3>Quick Start</h3>
|
|
448
|
+
<p>Get up and running with the WebScout API in under 5 minutes.</p>
|
|
449
|
+
<ul>
|
|
450
|
+
<li>Generate your API key</li>
|
|
451
|
+
<li>Make your first request</li>
|
|
452
|
+
<li>Handle responses</li>
|
|
453
|
+
</ul>
|
|
454
|
+
</div>
|
|
455
|
+
|
|
456
|
+
<div class="guide-card">
|
|
457
|
+
<div class="guide-icon">🔄</div>
|
|
458
|
+
<h3>Streaming</h3>
|
|
459
|
+
<p>Learn how to implement real-time streaming responses.</p>
|
|
460
|
+
<ul>
|
|
461
|
+
<li>Server-sent events</li>
|
|
462
|
+
<li>Chunk processing</li>
|
|
463
|
+
<li>Error handling</li>
|
|
464
|
+
</ul>
|
|
465
|
+
</div>
|
|
466
|
+
|
|
467
|
+
<div class="guide-card">
|
|
468
|
+
<div class="guide-icon">⚠️</div>
|
|
469
|
+
<h3>Error Handling</h3>
|
|
470
|
+
<p>Best practices for handling API errors and edge cases.</p>
|
|
471
|
+
<ul>
|
|
472
|
+
<li>HTTP status codes</li>
|
|
473
|
+
<li>Rate limiting</li>
|
|
474
|
+
<li>Retry strategies</li>
|
|
475
|
+
</ul>
|
|
476
|
+
</div>
|
|
477
|
+
|
|
478
|
+
<div class="guide-card">
|
|
479
|
+
<div class="guide-icon">🔧</div>
|
|
480
|
+
<h3>Advanced Usage</h3>
|
|
481
|
+
<p>Advanced techniques for power users and enterprise applications.</p>
|
|
482
|
+
<ul>
|
|
483
|
+
<li>Batch processing</li>
|
|
484
|
+
<li>Custom models</li>
|
|
485
|
+
<li>Performance optimization</li>
|
|
486
|
+
</ul>
|
|
487
|
+
</div>
|
|
488
|
+
</div>
|
|
489
|
+
</div>
|
|
490
|
+
</div>
|
|
491
|
+
</div>
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
<footer class="footer premium-footer">
|
|
2
|
+
<div class="container">
|
|
3
|
+
<div class="footer-content">
|
|
4
|
+
<div class="footer-section">
|
|
5
|
+
<h3 class="footer-title">WebScout API</h3>
|
|
6
|
+
<p class="footer-description">
|
|
7
|
+
A powerful, modern, and intuitive API interface for accessing multiple AI models and services. Built with performance, reliability, and developer experience in mind.
|
|
8
|
+
</p>
|
|
9
|
+
</div>
|
|
10
|
+
|
|
11
|
+
<div class="footer-section">
|
|
12
|
+
<h4 class="footer-subtitle">API Resources</h4>
|
|
13
|
+
<ul class="footer-links">
|
|
14
|
+
<li><a href="#endpoints" onclick="showTab('endpoints')">📡 API Endpoints</a></li>
|
|
15
|
+
<li><a href="#authentication" onclick="showTab('authentication')">🔐 Authentication</a></li>
|
|
16
|
+
<li><a href="#models" onclick="showTab('models')">🤖 Available Models</a></li>
|
|
17
|
+
<li><a href="#examples" onclick="showTab('examples')">💡 Code Examples</a></li>
|
|
18
|
+
</ul>
|
|
19
|
+
</div>
|
|
20
|
+
|
|
21
|
+
<div class="footer-section">
|
|
22
|
+
<h4 class="footer-subtitle">Developer Tools</h4>
|
|
23
|
+
<ul class="footer-links">
|
|
24
|
+
<li><a href="{{ base_url }}/openapi.json" target="_blank">📄 OpenAPI Spec</a></li>
|
|
25
|
+
<li><a href="{{ base_url }}/health" target="_blank">💚 Health Check</a></li>
|
|
26
|
+
<li><a href="{{ base_url }}/metrics" target="_blank">📊 Metrics</a></li>
|
|
27
|
+
<li><a href="#" onclick="downloadPostmanCollection()">📮 Postman Collection</a></li>
|
|
28
|
+
</ul>
|
|
29
|
+
</div>
|
|
30
|
+
|
|
31
|
+
<div class="footer-section">
|
|
32
|
+
<h4 class="footer-subtitle">Support & Community</h4>
|
|
33
|
+
<ul class="footer-links">
|
|
34
|
+
<li><a href="https://github.com/webscout-ai" target="_blank">🐙 GitHub</a></li>
|
|
35
|
+
<li><a href="https://discord.gg/webscout" target="_blank">💬 Discord</a></li>
|
|
36
|
+
<li><a href="mailto:support@webscout.ai">📧 Support</a></li>
|
|
37
|
+
<li><a href="https://docs.webscout.ai" target="_blank">📚 Documentation</a></li>
|
|
38
|
+
</ul>
|
|
39
|
+
</div>
|
|
40
|
+
</div>
|
|
41
|
+
|
|
42
|
+
<div class="footer-bottom">
|
|
43
|
+
<div class="footer-bottom-content">
|
|
44
|
+
<div class="footer-copyright">
|
|
45
|
+
<p>© 2024 WebScout. All rights reserved.</p>
|
|
46
|
+
<p class="footer-version">API Version {{ version }}</p>
|
|
47
|
+
</div>
|
|
48
|
+
|
|
49
|
+
<div class="footer-social">
|
|
50
|
+
<a href="https://twitter.com/webscout_ai" target="_blank" class="social-link" title="Twitter">
|
|
51
|
+
<span>🐦</span>
|
|
52
|
+
</a>
|
|
53
|
+
<a href="https://linkedin.com/company/webscout-ai" target="_blank" class="social-link" title="LinkedIn">
|
|
54
|
+
<span>💼</span>
|
|
55
|
+
</a>
|
|
56
|
+
<a href="https://youtube.com/@webscout-ai" target="_blank" class="social-link" title="YouTube">
|
|
57
|
+
<span>📺</span>
|
|
58
|
+
</a>
|
|
59
|
+
<a href="https://medium.com/@webscout-ai" target="_blank" class="social-link" title="Medium">
|
|
60
|
+
<span>📝</span>
|
|
61
|
+
</a>
|
|
62
|
+
</div>
|
|
63
|
+
</div>
|
|
64
|
+
</div>
|
|
65
|
+
|
|
66
|
+
<div class="footer-legal">
|
|
67
|
+
<div class="legal-links">
|
|
68
|
+
<a href="/privacy" target="_blank">Privacy Policy</a>
|
|
69
|
+
<a href="/terms" target="_blank">Terms of Service</a>
|
|
70
|
+
<a href="/cookies" target="_blank">Cookie Policy</a>
|
|
71
|
+
<a href="/security" target="_blank">Security</a>
|
|
72
|
+
</div>
|
|
73
|
+
</div>
|
|
74
|
+
</div>
|
|
75
|
+
</footer>
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
<header class="header">
|
|
2
|
+
<div class="container">
|
|
3
|
+
<div class="header-content animate-fadeIn">
|
|
4
|
+
<h1 class="header-title gradient-text text-glow">
|
|
5
|
+
<span class="header-icon">
|
|
6
|
+
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
|
7
|
+
<path d="M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09z"/>
|
|
8
|
+
<path d="m12 15-3-3a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.35 22.35 0 0 1-4 2z"/>
|
|
9
|
+
<path d="M9 12H4s.55-3.03 2-4c1.62-1.08 5 0 5 0"/>
|
|
10
|
+
<path d="M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5"/>
|
|
11
|
+
</svg>
|
|
12
|
+
</span>
|
|
13
|
+
{{ title }}
|
|
14
|
+
</h1>
|
|
15
|
+
|
|
16
|
+
<p class="header-description animate-slideInFromLeft">
|
|
17
|
+
{{ description }} - A modern, powerful, and intuitive API interface
|
|
18
|
+
</p>
|
|
19
|
+
|
|
20
|
+
<div class="header-status glass-effect hover-lift">
|
|
21
|
+
<span id="status-indicator" class="status-indicator"></span>
|
|
22
|
+
<span>API Status: Online</span>
|
|
23
|
+
<span class="status-version">v{{ version }}</span>
|
|
24
|
+
</div>
|
|
25
|
+
</div>
|
|
26
|
+
</div>
|
|
27
|
+
</header>
|