Spaces:
Sleeping
Sleeping
gefiwek187
commited on
Commit
β’
11a10b3
1
Parent(s):
d66f398
Create templates/index.html
Browse files- templates/index.html +105 -0
templates/index.html
ADDED
@@ -0,0 +1,105 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<!DOCTYPE html>
|
2 |
+
<html lang="en">
|
3 |
+
<head>
|
4 |
+
<meta charset="UTF-8">
|
5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
6 |
+
<title>DuckDuckGo Chat API</title>
|
7 |
+
<style>
|
8 |
+
body {
|
9 |
+
font-family: Arial, sans-serif;
|
10 |
+
line-height: 1.6;
|
11 |
+
max-width: 800px;
|
12 |
+
margin: 0 auto;
|
13 |
+
padding: 20px;
|
14 |
+
background-color: #f4f4f4;
|
15 |
+
}
|
16 |
+
h1, h2 {
|
17 |
+
color: #333;
|
18 |
+
}
|
19 |
+
code {
|
20 |
+
background-color: #e4e4e4;
|
21 |
+
padding: 2px 4px;
|
22 |
+
border-radius: 4px;
|
23 |
+
}
|
24 |
+
pre {
|
25 |
+
background-color: #e4e4e4;
|
26 |
+
padding: 10px;
|
27 |
+
border-radius: 4px;
|
28 |
+
overflow-x: auto;
|
29 |
+
}
|
30 |
+
.endpoint {
|
31 |
+
background-color: #fff;
|
32 |
+
border: 1px solid #ddd;
|
33 |
+
padding: 15px;
|
34 |
+
margin-bottom: 20px;
|
35 |
+
border-radius: 5px;
|
36 |
+
}
|
37 |
+
</style>
|
38 |
+
</head>
|
39 |
+
<body>
|
40 |
+
<h1>π¦ DuckDuckGo Chat API</h1>
|
41 |
+
|
42 |
+
<p>An OpenAI-compatible API for DuckDuckGo's AI chat functionality. Seamlessly integrate multiple AI models into your applications.</p>
|
43 |
+
|
44 |
+
<h2>π Available Endpoints</h2>
|
45 |
+
|
46 |
+
<div class="endpoint">
|
47 |
+
<h3>POST /v1/chat/completions</h3>
|
48 |
+
<p>Generate chat completions using various AI models.</p>
|
49 |
+
|
50 |
+
<h4>Request Body Example:</h4>
|
51 |
+
<pre><code>{
|
52 |
+
"model": "gpt-4o-mini",
|
53 |
+
"messages": [
|
54 |
+
{"role": "user", "content": "Hello, how are you?"}
|
55 |
+
],
|
56 |
+
"stream": false
|
57 |
+
}</code></pre>
|
58 |
+
|
59 |
+
<h4>Supported Models:</h4>
|
60 |
+
<ul>
|
61 |
+
<li>gpt-4o-mini</li>
|
62 |
+
<li>claude-3-haiku</li>
|
63 |
+
<li>llama-3.1-70b</li>
|
64 |
+
<li>mixtral-8x7b</li>
|
65 |
+
</ul>
|
66 |
+
</div>
|
67 |
+
|
68 |
+
<div class="endpoint">
|
69 |
+
<h3>GET /v1/models</h3>
|
70 |
+
<p>Retrieve a list of available AI models.</p>
|
71 |
+
</div>
|
72 |
+
|
73 |
+
<h2>π οΈ Features</h2>
|
74 |
+
<ul>
|
75 |
+
<li>OpenAI-compatible API</li>
|
76 |
+
<li>Multiple AI model support</li>
|
77 |
+
<li>Streaming and non-streaming responses</li>
|
78 |
+
<li>Easy integration</li>
|
79 |
+
</ul>
|
80 |
+
|
81 |
+
<h2>π Usage Example (Python)</h2>
|
82 |
+
<pre><code>import requests
|
83 |
+
|
84 |
+
response = requests.post(
|
85 |
+
'https://your-api-url.com/v1/chat/completions',
|
86 |
+
json={
|
87 |
+
"model": "gpt-4o-mini",
|
88 |
+
"messages": [{"role": "user", "content": "Tell me a joke"}]
|
89 |
+
}
|
90 |
+
)
|
91 |
+
print(response.json())</code></pre>
|
92 |
+
|
93 |
+
<h2>π Credits</h2>
|
94 |
+
<p>
|
95 |
+
Created by: Your Name<br>
|
96 |
+
Powered by:
|
97 |
+
<a href="https://duckduckgo.com">DuckDuckGo</a> |
|
98 |
+
<a href="https://github.com/deedy5/duckduckgo_search">duckduckgo_search</a>
|
99 |
+
</p>
|
100 |
+
|
101 |
+
<footer>
|
102 |
+
<p><small>Β© 2024 DuckDuckGo Chat API. All rights reserved.</small></p>
|
103 |
+
</footer>
|
104 |
+
</body>
|
105 |
+
</html>
|