acecalisto3 commited on
Commit
46e1045
·
verified ·
1 Parent(s): 91df01e

Update index.html

Browse files
Files changed (1) hide show
  1. index.html +254 -358
index.html CHANGED
@@ -1,374 +1,270 @@
1
- <!DOCTYPE html>
2
  <html>
3
- <head>
4
  <meta charset="utf-8" />
5
  <meta name="viewport" content="width=device-width" />
6
  <title>Smolagents and tools gallery</title>
7
  <meta name="description" content="Discover all smolagents and tools created by the community." />
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8
  <script src="https://cdnjs.cloudflare.com/ajax/libs/iframe-resizer/4.3.1/iframeResizer.contentWindow.min.js"></script>
9
  <script src="https://cdn.tailwindcss.com"></script>
10
  <style>
11
- body {
12
- font-family: sans-serif;
13
- padding: 20px;
14
- background-color: #f4f4f4;
15
- }
16
- #playground-container {
17
- max-width: 800px;
18
- margin: 0 auto;
19
- background-color: white;
20
- padding: 20px;
21
- border-radius: 8px;
22
- box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
23
- }
24
- #input-container, #output-container, #tool-select {
25
- margin-bottom: 20px;
26
- }
27
- textarea {
28
- width: 100%;
29
- padding: 10px;
30
- border: 1px solid #ccc;
31
- border-radius: 4px;
32
- resize: vertical;
33
- }
34
- button {
35
- padding: 10px 20px;
36
- background-color: #007bff;
37
- color: white;
38
- border: none;
39
- border-radius: 4px;
40
- cursor: pointer;
41
- }
42
- button:hover {
43
- background-color: #0056b3;
44
- }
45
- #output-container {
46
- border: 1px solid #ddd;
47
- padding: 15px;
48
- min-height: 150px;
49
- white-space: pre-wrap;
50
- background-color: #f9f9f9;
51
- border-radius: 4px;
52
- }
53
- #loading-indicator {
54
- display: none;
55
- text-align: center;
56
- margin-top: 10px;
57
- }
58
- #error-message {
59
- color: red;
60
- margin-top: 10px;
61
- }
62
- select {
63
- padding: 8px;
64
- border-radius: 4px;
65
- border: 1px solid #ccc;
66
- }
67
- iframe {
68
- display: block;
69
- border: none;
70
- width: 100%;
71
- height: 600px;
72
- pointer-events: none;
73
- margin-top: 48px; /* Match header height */
74
- }
75
- .grid-container {
76
- display: grid;
77
- grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
78
- grid-gap: 10px;
79
- margin-top: 3.5rem;
80
- }
81
- .grid-item {
82
- position: relative;
83
- overflow-y: hidden;
84
- border-radius: 10px;
85
- border: 1px solid rgb(55 65 81);
86
- }
87
- .grid-item:hover {
88
- filter: brightness(75%);
89
- }
90
- .grid-item a {
91
- position: absolute;
92
- top: 0;
93
- left: 0;
94
- width: 100%;
95
- height: 100%;
96
- display: block;
97
- z-index: 1;
98
- }
99
- .grid-item-header {
100
- position: absolute;
101
- top: 0;
102
- left: 0;
103
- right: 0;
104
- height: 48px;
105
- background: rgba(0,0,0,0.75);
106
- padding: 8px 16px;
107
- z-index: 10;
108
- display: flex;
109
- align-items: center;
110
- width: 100%;
111
- }
112
- .grid-item-header h2 {
113
- width: 100%;
114
- overflow-wrap: break-word;
115
- word-wrap: break-word;
116
- hyphens: auto;
117
- max-height: 32px;
118
- overflow: hidden;
119
- display: -webkit-box;
120
- -webkit-line-clamp: 2;
121
- -webkit-box-orient: vertical;
122
- line-height: 1.2;
123
- }
124
  </style>
125
  <script type="module">
126
- import Alpine from "https://cdn.skypack.dev/[email protected]";
127
- import Intersect from "https://cdn.skypack.dev/@alpinejs/intersect";
128
- Alpine.plugin(Intersect);
129
- Alpine.data("themesData", () => ({
130
- async init() {
131
- const data = await this.getThemes(this.page, this.sort, this.useTestData);
132
- this.themes = data.themes;
133
- this.totalPages = data.totalPages;
134
- },
135
- themes:,
136
- filter: "tool",
137
- sort: "likes",
138
- page: 1,
139
- totalPages: -1,
140
- useTestData: false,
141
- searchQuery: "",
142
- searchType: "keyword",
143
- hfToken: "",
144
- userSpaces:,
145
- buttonClass(attr, filter) {
146
- if (this[attr] === filter) {
147
- return "text-orange-600 bg-gradient-to-br from-orange-300 to-orange-100 px-2 md:px-3 py-1 rounded-full";
148
- }
149
- return "text-gray-800 hover:to-orange-300/100 hover:text-orange-600 dark:hover:bg-white";
150
- },
151
- async switchData() {
152
- this.page = 1;
153
- this.useTestData =!this.useTestData;
154
- const data = await this.getThemes(this.page, this.sort, this.useTestData);
155
- this.themes = data.themes;
156
- this.totalPages = data.totalPages;
157
- },
158
- async sortThemes(sort) {
159
- this.sort = sort;
160
- this.page = 1;
161
- const data = await this.getThemes(this.page, this.sort, this.useTestData);
162
- this.themes = data.themes;
163
- this.totalPages = data.totalPages;
164
- },
165
- async filterType(filter) {
166
- this.filter = filter;
167
- this.page = 1;
168
- if (this.searchQuery) {
169
- await this.searchThemes();
170
- } else {
171
- const data = await this.getThemes(this.page, this.sort, this.useTestData);
172
- this.themes = data.themes;
173
- this.totalPages = data.totalPages;
174
- }
175
- },
176
- async searchThemes() {
177
- this.page = 1;
178
- const data = await this.getThemes(this.page, this.sort, this.useTestData);
179
- this.themes = data.themes;
180
- this.totalPages = data.totalPages;
181
- },
182
- async switchSearchType(type) {
183
- this.searchType = type;
184
- if (this.searchQuery) {
185
- await this.searchThemes();
186
- }
187
- },
188
- async getUserSpaces() {
189
- if (!this.hfToken) return;
190
- const res = await fetch(`https://huggingface.co/api/spaces?token=${this.hfToken}`);
191
- const data = await res.json();
192
- this.userSpaces = data;
193
- },
194
- async getThemes(page, sort, useTestData) {
195
- let data;
196
- if (useTestData) {
197
- const res = await fetch(
198
- `https://huggingface.co/datasets/freddyaboulton/gradio-theme-subdomains/resolve/main/test_data.json`
199
- );
200
- data = await res.json();
201
- } else {
202
- const searchFilters = this.filter === 'tool'? 'tool': 'smolagents';
203
- let searchUrl;
204
- if (this.searchQuery) {
205
- if (this.searchType === 'semantic') {
206
- searchUrl = `https://huggingface.co/api/spaces/semantic-search?limit=100&filter=<span class="math-inline">\{searchFilters\}&q\=</span>{encodeURIComponent(this.searchQuery)}&expand=subdomain&expand=lastModified&expand=likes&expand=runtime`;
207
- } else {
208
- searchUrl = `https://huggingface.co/api/spaces?limit=100&filter=<span class="math-inline">\{searchFilters\}&search\=</span>{encodeURIComponent(this.searchQuery)}&expand=subdomain&expand=lastModified&expand=likes&expand=runtime`;
209
- }
210
- } else {
211
- searchUrl = `https://huggingface.co/api/spaces?limit=100&filter=${encodeURIComponent(searchFilters)}&expand=subdomain&expand=lastModified&expand=likes&expand=runtime`;
212
- }
213
- const res = await fetch(searchUrl);
214
- data = await res.json();
215
- data = data.filter(item => item.runtime?.stage === "RUNNING").map(item => ({
216
- id: item.id,
217
- subdomain: `https://${item.subdomain}.hf.space`,
218
- likes: item.likes,
219
- lastModified: item.lastModified
220
- }));
221
- }
222
- if (sort === 'likes') {
223
- data.sort((a, b) => (b.likes - a.likes));
224
- } else {
225
- data.sort((a, b) => (new Date(b.lastModified) - new Date(a.lastModified)));
226
- }
227
- const pageThemes = data.slice((page - 1) * 15, page * 15);
228
- return {
229
- themes: pageThemes,
230
- totalPages: Math.ceil(data.length / 15)
231
- };
232
- },
233
- async nextPage() {
234
- if (this.page < this.totalPages) {
235
- this.page += 1;
236
- const data = await this.getThemes(this.page, this.sort, this.useTestData);
237
- this.themes = this.themes.concat(data.themes);
238
- this.totalPages = data.totalPages;
239
- }
240
- },
241
- publishSelected() {
242
- const selectedSpaces = this.userSpaces.filter(space => space.selected);
243
- },
244
- }));
245
- Alpine.start();
 
 
 
 
 
 
 
 
246
  </script>
247
- </head>
248
- <body class="pb-10 pt-5 bg-white relative">
249
  <section x-data="themesData">
250
- <section class="container px-6 grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-14 mx-auto relative">
251
- <div class="col-span-2 lg:col-span-1 flex flex-col gap-14 row-start">
252
- <div class="flex items-center gap-2">
253
- <img src="https://camo.githubusercontent.com/a8c1f1d12aa3114010c6e74b29d47fee91d8da10a915f065c38e6d0ea7f16568/68747470733a2f2f68756767696e67666163652e636f2f64617461736574732f68756767696e67666163652f646f63756d656e746174696f6e2d696d616765732f7265736f6c76652f6d61696e2f736d6f6c6167656e74732f6d6173636f742e706e67" alt="Smolagents mascot" class="w-14 h-14 flex-shrink-0">
254
- <h1 class="text-xl font-semibold text-gray-800 break-words">smolagents and tools gallery</h1>
255
- </div>
256
- <div class="flex items-center gap-2">
257
- <input
258
- type="text"
259
- x-model="hfToken"
260
- placeholder="Enter your Hugging Face Token"
261
- class="px-3 py-1 border rounded-lg"
262
- >
263
- <button @click="getUserSpaces()" class="px-3 py-1 bg-blue-500 text-white rounded-lg">Import Spaces</button>
264
- </div>
265
- </div>
266
- <div class="col-span-2 md:col-span-3 flex items-center gap-14 flex flex-wrap lg-auto lg:ml-auto text-sm">
267
- <div class="flex flex-col gap-2">
268
- <div class="flex items-center">
269
- <input
270
- type="text"
271
- x-model="searchQuery"
272
- @input="searchThemes()"
273
- placeholder="Search..."
274
- class="px-3 py-1 border rounded-lg"
275
- >
276
- </div>
277
- </div>
278
- <div class="flex gap-2">
279
- <span class="md:px-3 py-1 text-gray-800">type</span>
280
- <button:class="buttonClass('filter', 'tool')" @click="filterType('tool')">Tools</button>
281
- <button:class="buttonClass('filter', 'agent')" @click="filterType('agent')">Agents</button>
282
- </div>
283
- <div class="flex gap-2">
284
- <span class="md:px-3 py-1 text-gray-800">sort by</span>
285
- <button:class="buttonClass('sort', 'likes')" @click="sortThemes('likes')">Most Likes</button>
286
- <button:class="buttonClass('sort', 'recent')" @click="sortThemes('recent')">Recent</button>
287
- </div>
288
- </div>
289
- </section>
290
- <div class="container px-6 grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-2 mx-auto my-8 relative">
291
- <template x-for="theme in themes":key="theme.id">
292
- <div class="grid-item">
293
- <div class="grid-item-header">
294
- <h2 class="text-sm font-medium text-white" x-text="theme.id"></h2>
295
- </div>
296
- <iframe:src="`<span class="math-inline">\{theme\.subdomain\}?\_\=</span>{new Date().getTime()}`":alt="theme.id" scrolling="no" frameborder="0" loading="lazy"></iframe>
297
- <a:href="`https://huggingface.co/spaces/${theme.id}`" target="_blank"></a>
298
- </div>
299
- </template>
300
- <div class="grid-item">
301
- <div class="grid-item-header">
302
- <h2 class="text-sm font-medium text-white">smolagents Playground</h2>
303
- </div>
304
-
305
- <div id="playground-container">
306
- <div id="tool-select">
307
- <label for="tools">Select Tools:</label><br>
308
- <select id="tools" multiple>
309
- <option value="DuckDuckGoSearchTool">DuckDuckGoSearchTool</option>
310
- </select>
311
- </div>
312
-
313
- <div id="input-container">
314
- <label for="user-input">Enter your query:</label><br>
315
- <textarea id="user-input" rows="5"></textarea><br>
316
- <button id="run-button">Run Agent</button>
317
- <div id="loading-indicator">Running...</div>
318
- <div id="error-message"></div>
319
- </div>
320
-
321
- <div id="output-container">
322
- <p>Agent output:</p>
323
- <div id="output"></div>
324
- </div>
325
- </div>
326
-
327
- <a href="https://huggingface.co/spaces/your-username/your-space-name" target="_blank"></a>
328
  </div>
 
 
 
 
 
 
 
 
 
 
 
329
  </div>
330
-
331
- <div class="h-12 relative" x-intersect="nextPage" data-iframe-height></div>
332
- <button @click="publishSelected()" class="px-4 py-2 bg-green-500 text-white rounded-lg">Publish Selected Spaces</button>
 
 
 
 
 
 
 
 
 
 
333
  </section>
334
-
335
- <script>
336
- document.getElementById('run-button').addEventListener('click', async () => {
337
- const userInput = document.getElementById('user-input').value;
338
- const outputDiv = document.getElementById('output');
339
- const loadingIndicator = document.getElementById('loading-indicator');
340
- const errorMessage = document.getElementById('error-message');
341
-
342
- outputDiv.textContent = "";
343
- errorMessage.textContent = "";
344
- loadingIndicator.style.display = 'block';
345
-
346
- const selectedTools = Array.from(document.getElementById('tools').selectedOptions).map(option => option.value);
347
-
348
- try {const response = await fetch('/run_agent', {
349
- method: 'POST',
350
- headers: {
351
- 'Content-Type': 'application/json'
352
- },
353
- body: JSON.stringify({
354
- query: userInput,
355
- tools: selectedTools
356
- })
357
- });
358
-
359
- loadingIndicator.style.display = 'none';
360
-
361
- if (response.ok) {
362
- const data = await response.json();
363
- outputDiv.textContent = data.result;
364
- } else {
365
- errorMessage.textContent = `Error: ${response.statusText}`;
366
- }
367
- } catch (error) {
368
- loadingIndicator.style.display = 'none';
369
- errorMessage.textContent = `Error: ${error.message}`;
370
- }
371
- });
372
- </script>
373
- </body>
374
  </html>
 
1
+ <!DOCTYPE html>
2
  <html>
3
+ <head>
4
  <meta charset="utf-8" />
5
  <meta name="viewport" content="width=device-width" />
6
  <title>Smolagents and tools gallery</title>
7
  <meta name="description" content="Discover all smolagents and tools created by the community." />
8
+ <meta property="og:url" content="https://smolagents-tools-gallery.hf.space/" />
9
+ <meta property="og:type" content="website" />
10
+ <meta property="og:title" content="smolagents and tools gallery" />
11
+ <meta property="og:description" content="Discover all smolagents and tools created by the community." />
12
+ <meta property="og:image" content="https://huggingface-projects-diffusers-gallery.hf.space/Fo6vR6JX0AEjbw1.jpeg" />
13
+ <meta name="twitter:card" content="player" />
14
+ <meta property="twitter:url" content="https://davidberenstein1957-smolagents-and-tools.static.hf.space" />
15
+ <meta name="twitter:description" content="Discover all smolagents and tools created by the community." />
16
+ <meta name="twitter:site" content="@huggingface" />
17
+ <meta name="twitter:title" content="smolagents and tools gallery" />
18
+ <meta name="twitter:image" content="https://huggingface-projects-diffusers-gallery.hf.space/Fo6vR6JX0AEjbw1.jpeg" />
19
+ <meta name="twitter:player" content="https://davidberenstein1957-smolagents-and-tools.static.hf.space" />
20
+ <meta name="twitter:player:width" content="100%" />
21
+ <meta name="twitter:player:height" content="600" />
22
  <script src="https://cdnjs.cloudflare.com/ajax/libs/iframe-resizer/4.3.1/iframeResizer.contentWindow.min.js"></script>
23
  <script src="https://cdn.tailwindcss.com"></script>
24
  <style>
25
+ iframe {
26
+ display: block;
27
+ border: none;
28
+ width: 100%;
29
+ height: 600px;
30
+ pointer-events: none;
31
+ margin-top: 48px; /* Match header height */
32
+ }
33
+ .grid-container {
34
+ display: grid;
35
+ grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
36
+ grid-gap: 10px;
37
+ margin-top: 3.5rem;
38
+ }
39
+ .grid-item {
40
+ position: relative;
41
+ overflow-y: hidden;
42
+ border-radius: 10px;
43
+ border: 1px solid rgb(55 65 81);
44
+ }
45
+ .grid-item:hover {
46
+ filter: brightness(75%);
47
+ }
48
+ .grid-item a {
49
+ position: absolute;
50
+ top: 0;
51
+ left: 0;
52
+ width: 100%;
53
+ height: 100%;
54
+ display: block;
55
+ z-index: 1;
56
+ }
57
+ .grid-item-header {
58
+ position: absolute;
59
+ top: 0;
60
+ left: 0;
61
+ right: 0;
62
+ height: 48px;
63
+ background: rgba(0,0,0,0.75);
64
+ padding: 8px 16px;
65
+ z-index: 10;
66
+ display: flex;
67
+ align-items: center;
68
+ width: 100%;
69
+ }
70
+ .grid-item-header h2 {
71
+ width: 100%;
72
+ overflow-wrap: break-word;
73
+ word-wrap: break-word;
74
+ hyphens: auto;
75
+ max-height: 32px;
76
+ overflow: hidden;
77
+ display: -webkit-box;
78
+ -webkit-line-clamp: 2;
79
+ -webkit-box-orient: vertical;
80
+ line-height: 1.2;
81
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
82
  </style>
83
  <script type="module">
84
+ import Alpine from "https://cdn.skypack.dev/[email protected]";
85
+ import Intersect from "https://cdn.skypack.dev/@alpinejs/intersect";
86
+ Alpine.plugin(Intersect);
87
+ Alpine.data("themesData", () => ({
88
+ async init() {
89
+ const data = await this.getThemes(this.page, this.sort, this.useTestData);
90
+ this.themes = data.themes;
91
+ this.totalPages = data.totalPages;
92
+ },
93
+ themes:,
94
+ filter: "tool",
95
+ sort: "likes",
96
+ page: 1,
97
+ totalPages: -1,
98
+ useTestData: false,
99
+ searchQuery: "",
100
+ searchType: "keyword",
101
+ hfToken: "", // New property for Hugging Face token
102
+ userSpaces:, // New property to store user spaces
103
+ buttonClass(attr, filter) {
104
+ if (this[attr] === filter) {
105
+ return "text-orange-600 bg-gradient-to-br from-orange-300 to-orange-100 px-2 md:px-3 py-1 rounded-full";
106
+ }
107
+ return "text-gray-800 hover:to-orange-300/100 hover:text-orange-600 dark:hover:bg-white";
108
+ },
109
+ async switchData() {
110
+ this.page = 1;
111
+ this.useTestData =!this.useTestData;
112
+ const data = await this.getThemes(this.page, this.sort, this.useTestData);
113
+ this.themes = data.themes;
114
+ this.totalPages = data.totalPages;
115
+ },
116
+ async sortThemes(sort) {
117
+ this.sort = sort;
118
+ this.page = 1;
119
+ const data = await this.getThemes(this.page, this.sort, this.useTestData);
120
+ this.themes = data.themes;
121
+ this.totalPages = data.totalPages;
122
+ },
123
+ async filterType(filter) {
124
+ this.filter = filter;
125
+ this.page = 1;
126
+ if (this.searchQuery) {
127
+ await this.searchThemes();
128
+ } else {
129
+ const data = await this.getThemes(this.page, this.sort, this.useTestData);
130
+ this.themes = data.themes;
131
+ this.totalPages = data.totalPages;
132
+ }
133
+ },
134
+ async searchThemes() {
135
+ this.page = 1;
136
+ const data = await this.getThemes(this.page, this.sort, this.useTestData);
137
+ this.themes = data.themes;
138
+ this.totalPages = data.totalPages;
139
+ },
140
+ async switchSearchType(type) {
141
+ this.searchType = type;
142
+ if (this.searchQuery) {
143
+ await this.searchThemes();
144
+ }
145
+ },
146
+ async getUserSpaces() {
147
+ if (!this.hfToken) {
148
+ alert("Please enter your Hugging Face token.");
149
+ return;
150
+ }
151
+ try {
152
+ const res = await fetch(`https://huggingface.co/api/spaces?token=${this.hfToken}`);
153
+ if (!res.ok) {
154
+ throw new Error(`Failed to fetch spaces: ${res.status} ${res.statusText}`);
155
+ }
156
+ const data = await res.json();
157
+ this.userSpaces = data;
158
+ } catch (error) {
159
+ alert(`Error fetching spaces: ${error.message}`);
160
+ }
161
+ },
162
+ async getThemes(page, sort, useTestData) {
163
+ let data;
164
+ if (useTestData) {
165
+ const res = await fetch(
166
+ `https://huggingface.co/datasets/freddyaboulton/gradio-theme-subdomains/resolve/main/test_data.json`
167
+ );
168
+ data = await res.json();
169
+ } else {
170
+ const searchFilters = this.filter === 'tool'? 'tool': 'smolagents';
171
+ let searchUrl;
172
+ if (this.searchQuery) {
173
+ if (this.searchType === 'semantic') {
174
+ searchUrl = `https://huggingface.co/api/spaces/semantic-search?limit=100&filter=${searchFilters}&q=${encodeURIComponent(this.searchQuery)}&expand=subdomain&expand=lastModified&expand=likes&expand=runtime`;
175
+ } else {
176
+ searchUrl = `https://huggingface.co/api/spaces?limit=100&filter=${searchFilters}&search=${encodeURIComponent(this.searchQuery)}&expand=subdomain&expand=lastModified&expand=likes&expand=runtime`;
177
+ }
178
+ } else {
179
+ searchUrl = `https://huggingface.co/api/spaces?limit=100&filter=${encodeURIComponent(searchFilters)}&expand=subdomain&expand=lastModified&expand=likes&expand=runtime`;
180
+ }
181
+ const res = await fetch(searchUrl);
182
+ data = await res.json();
183
+ // Transform the API response to match the expected format
184
+ data = data.filter(item => item.runtime?.stage === "RUNNING").map(item => ({
185
+ id: item.id,
186
+ subdomain: `https://${item.subdomain}.hf.space`,
187
+ likes: item.likes,
188
+ lastModified: item.lastModified
189
+ }));
190
+ }
191
+ if (sort === 'likes') {
192
+ data.sort((a, b) => (b.likes - a.likes));
193
+ } else {
194
+ data.sort((a, b) => (new Date(b.lastModified) - new Date(a.lastModified)));
195
+ }
196
+ const pageThemes = data.slice((page - 1) * 15, page * 15);
197
+ return {
198
+ themes: pageThemes,
199
+ totalPages: Math.ceil(data.length / 15)
200
+ };
201
+ },
202
+ async nextPage() {
203
+ if (this.page < this.totalPages) {
204
+ this.page += 1;
205
+ const data = await this.getThemes(this.page, this.sort, this.useTestData);
206
+ this.themes = this.themes.concat(data.themes);
207
+ this.totalPages = data.totalPages;
208
+ }
209
+ },
210
+ }));
211
+ Alpine.start();
212
  </script>
213
+ </head>
214
+ <body class="pb-10 pt-5 bg-white relative">
215
  <section x-data="themesData">
216
+ <section class="container px-6 grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-14 mx-auto relative">
217
+ <div class="col-span-2 lg:col-span-1 flex flex-col gap-14 row-start">
218
+ <div class="flex items-center gap-2">
219
+ <img src="https://camo.githubusercontent.com/a8c1f1d12aa3114010c6e74b29d47fee91d8da10a915f065c38e6d0ea7f16568/68747470733a2f2f68756767696e67666163652e636f2f64617461736574732f68756767696e67666163652f646f63756d656e746174696f6e2d696d616765732f7265736f6c76652f6d61696e2f736d6f6c6167656e74732f6d6173636f742e706e67" alt="Smolagents mascot" class="w-14 h-14 flex-shrink-0">
220
+ <h1 class="text-xl font-semibold text-gray-800 break-words">smolagents and tools gallery</h1>
221
+ </div>
222
+ <div class="flex items-center gap-2">
223
+ <input
224
+ type="text"
225
+ x-model="hfToken"
226
+ placeholder="Enter your Hugging Face Token"
227
+ class="px-3 py-1 border rounded-lg"
228
+ >
229
+ <button @click="getUserSpaces()" class="px-3 py-1 bg-blue-500 text-white rounded-lg">Import Spaces</button>
230
+ </div>
231
+ </div>
232
+ <div class="col-span-2 md:col-span-3 flex items-center gap-14 flex flex-wrap lg-auto lg:ml-auto text-sm">
233
+ <div class="flex flex-col gap-2">
234
+ <div class="flex items-center">
235
+ <input
236
+ type="text"
237
+ x-model="searchQuery"
238
+ @input="searchThemes()"
239
+ placeholder="Search..."
240
+ class="px-3 py-1 border rounded-lg"
241
+ >
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
242
  </div>
243
+ </div>
244
+ <div class="flex gap-2">
245
+ <span class="md:px-3 py-1 text-gray-800">type</span>
246
+ <button:class="buttonClass('filter', 'tool')" @click="filterType('tool')">Tools</button>
247
+ <button:class="buttonClass('filter', 'agent')" @click="filterType('agent')">Agents</button>
248
+ </div>
249
+ <div class="flex gap-2">
250
+ <span class="md:px-3 py-1 text-gray-800">sort by</span>
251
+ <button:class="buttonClass('sort', 'likes')" @click="sortThemes('likes')">Most Likes</button>
252
+ <button:class="buttonClass('sort', 'recent')" @click="sortThemes('recent')">Recent</button>
253
+ </div>
254
  </div>
255
+ </section>
256
+ <div class="container px-6 grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-2 mx-auto my-8 relative">
257
+ <template x-for="theme in themes":key="theme.id">
258
+ <div class="grid-item">
259
+ <div class="grid-item-header">
260
+ <h2 class="text-sm font-medium text-white" x-text="theme.id"></h2>
261
+ </div>
262
+ <iframe:src="`${theme.subdomain}?_=${new Date().getTime()}`":alt="theme.id" scrolling="no" frameborder="0" loading="lazy"></iframe>
263
+ <a:href="`https://huggingface.co/spaces/${theme.id}`" target="_blank"></a>
264
+ </div>
265
+ </template>
266
+ </div>
267
+ <div class="h-12 relative" x-intersect="nextPage" data-iframe-height></div>
268
  </section>
269
+ </body>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
270
  </html>