@gradio/core 0.18.0 → 0.19.0
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.
- package/CHANGELOG.md +50 -0
- package/dist/src/Blocks.svelte +14 -13
- package/dist/src/api_docs/ApiDocs.svelte +20 -20
- package/package.json +48 -48
- package/src/Blocks.svelte +15 -15
- package/src/api_docs/ApiDocs.svelte +21 -20
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,55 @@
|
|
|
1
1
|
# @gradio/core
|
|
2
2
|
|
|
3
|
+
## 0.19.0
|
|
4
|
+
|
|
5
|
+
### Features
|
|
6
|
+
|
|
7
|
+
- [#11306](https://github.com/gradio-app/gradio/pull/11306) [`6cd608d`](https://github.com/gradio-app/gradio/commit/6cd608d8f9b1a142c58f0d2db861845ec267f705) - Improvements for plots and event listeners in re-renders. Thanks @aliabid94!
|
|
8
|
+
- [#11328](https://github.com/gradio-app/gradio/pull/11328) [`ff39d56`](https://github.com/gradio-app/gradio/commit/ff39d568dc9a8a44807126c7366ac8f7dc63df12) - Update mcp schema to include return type information from function. Thanks @abidlabs!
|
|
9
|
+
|
|
10
|
+
### Dependency updates
|
|
11
|
+
|
|
12
|
+
- @gradio/textbox@0.10.13
|
|
13
|
+
|
|
14
|
+
## 0.18.1
|
|
15
|
+
|
|
16
|
+
### Dependency updates
|
|
17
|
+
|
|
18
|
+
- @gradio/statustracker@0.10.12
|
|
19
|
+
- @gradio/gallery@0.15.21
|
|
20
|
+
- @gradio/plot@0.9.17
|
|
21
|
+
- @gradio/button@0.5.2
|
|
22
|
+
- @gradio/video@0.14.16
|
|
23
|
+
- @gradio/image@0.22.8
|
|
24
|
+
- @gradio/file@0.12.19
|
|
25
|
+
|
|
26
|
+
## 0.18.1
|
|
27
|
+
|
|
28
|
+
### Features
|
|
29
|
+
|
|
30
|
+
- [#11289](https://github.com/gradio-app/gradio/pull/11289) [`1b6bd1e`](https://github.com/gradio-app/gradio/commit/1b6bd1ee5a96541e88b5834784b9acd6bd344187) - Include default values in MCP docs. Thanks @abidlabs!
|
|
31
|
+
|
|
32
|
+
### Fixes
|
|
33
|
+
|
|
34
|
+
- [#11271](https://github.com/gradio-app/gradio/pull/11271) [`ab25fb9`](https://github.com/gradio-app/gradio/commit/ab25fb9adb4e0401a060cdd07c0985483075123c) - Ensure i18n setup is complete when rendering. Thanks @hannahblair!
|
|
35
|
+
|
|
36
|
+
### Dependency updates
|
|
37
|
+
|
|
38
|
+
- @gradio/statustracker@0.10.12
|
|
39
|
+
- @gradio/column@0.2.0
|
|
40
|
+
- @gradio/code@0.14.5
|
|
41
|
+
- @gradio/paramviewer@0.7.10
|
|
42
|
+
- @gradio/client@1.15.1
|
|
43
|
+
- @gradio/button@0.5.1
|
|
44
|
+
- @gradio/upload@0.16.6
|
|
45
|
+
- @gradio/image@0.22.7
|
|
46
|
+
- @gradio/gallery@0.15.20
|
|
47
|
+
- @gradio/plot@0.9.17
|
|
48
|
+
- @gradio/checkbox@0.4.22
|
|
49
|
+
- @gradio/file@0.12.19
|
|
50
|
+
- @gradio/video@0.14.15
|
|
51
|
+
- @gradio/textbox@0.10.12
|
|
52
|
+
|
|
3
53
|
## 0.18.0
|
|
4
54
|
|
|
5
55
|
### Features
|
package/dist/src/Blocks.svelte
CHANGED
|
@@ -36,7 +36,6 @@ export let api_prefix = "";
|
|
|
36
36
|
export let max_file_size = void 0;
|
|
37
37
|
export let initial_layout = void 0;
|
|
38
38
|
export let css = null;
|
|
39
|
-
setupi18n(app.config?.i18n_translations ?? void 0);
|
|
40
39
|
let {
|
|
41
40
|
layout: _layout,
|
|
42
41
|
targets,
|
|
@@ -226,17 +225,6 @@ async function trigger_api_call(dep_index, trigger_id = null, event_data = null)
|
|
|
226
225
|
if (current_status === "pending" || current_status === "generating") {
|
|
227
226
|
dep.pending_request = true;
|
|
228
227
|
}
|
|
229
|
-
let deps_to_remove = [];
|
|
230
|
-
if (dep.render_id != null) {
|
|
231
|
-
dependencies.forEach((other_dep, i) => {
|
|
232
|
-
if (other_dep.rendered_in === dep.render_id) {
|
|
233
|
-
deps_to_remove.push(i);
|
|
234
|
-
}
|
|
235
|
-
});
|
|
236
|
-
}
|
|
237
|
-
deps_to_remove.reverse().forEach((i) => {
|
|
238
|
-
dependencies.splice(i, 1);
|
|
239
|
-
});
|
|
240
228
|
let payload = {
|
|
241
229
|
fn_index: dep_index,
|
|
242
230
|
data: await Promise.all(
|
|
@@ -379,6 +367,15 @@ async function trigger_api_call(dep_index, trigger_id = null, event_data = null)
|
|
|
379
367
|
let render_layout = data.layout;
|
|
380
368
|
let _dependencies = data.dependencies;
|
|
381
369
|
let render_id = data.render_id;
|
|
370
|
+
let deps_to_remove = [];
|
|
371
|
+
dependencies.forEach((old_dep, i) => {
|
|
372
|
+
if (old_dep.rendered_in === dep.render_id) {
|
|
373
|
+
deps_to_remove.push(i);
|
|
374
|
+
}
|
|
375
|
+
});
|
|
376
|
+
deps_to_remove.reverse().forEach((i) => {
|
|
377
|
+
dependencies.splice(i, 1);
|
|
378
|
+
});
|
|
382
379
|
_dependencies.forEach((dep2) => {
|
|
383
380
|
dependencies.push(dep2);
|
|
384
381
|
});
|
|
@@ -661,6 +658,10 @@ function screen_recording() {
|
|
|
661
658
|
screen_recorder.startRecording();
|
|
662
659
|
}
|
|
663
660
|
}
|
|
661
|
+
let i18n_ready = false;
|
|
662
|
+
setupi18n(app.config?.i18n_translations ?? void 0).then(() => {
|
|
663
|
+
i18n_ready = true;
|
|
664
|
+
});
|
|
664
665
|
</script>
|
|
665
666
|
|
|
666
667
|
<svelte:head>
|
|
@@ -674,7 +675,7 @@ function screen_recording() {
|
|
|
674
675
|
|
|
675
676
|
<div class="wrap" style:min-height={app_mode ? "100%" : "auto"}>
|
|
676
677
|
<div class="contain" style:flex-grow={app_mode ? "1" : "auto"}>
|
|
677
|
-
{#if $_layout && app.config}
|
|
678
|
+
{#if $_layout && app.config && i18n_ready}
|
|
678
679
|
<MountComponents
|
|
679
680
|
rootNode={$_layout}
|
|
680
681
|
{root}
|
|
@@ -69,10 +69,10 @@ async function fetchMcpTools() {
|
|
|
69
69
|
try {
|
|
70
70
|
const response = await fetch(`${root}gradio_api/mcp/schema`);
|
|
71
71
|
const schema = await response.json();
|
|
72
|
-
tools =
|
|
73
|
-
name:
|
|
72
|
+
tools = schema.map((tool) => ({
|
|
73
|
+
name: tool.name,
|
|
74
74
|
description: tool.description || "",
|
|
75
|
-
parameters: tool.properties || {},
|
|
75
|
+
parameters: tool.inputSchema?.properties || {},
|
|
76
76
|
expanded: false
|
|
77
77
|
}));
|
|
78
78
|
} catch (error) {
|
|
@@ -213,24 +213,24 @@ onMount(() => {
|
|
|
213
213
|
<div class="tool-content">
|
|
214
214
|
{#if Object.keys(tool.parameters).length > 0}
|
|
215
215
|
<div class="tool-parameters">
|
|
216
|
-
{#
|
|
217
|
-
|
|
218
|
-
<
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
</
|
|
229
|
-
|
|
230
|
-
{
|
|
231
|
-
<p>No parameters</p>
|
|
232
|
-
{/if}
|
|
216
|
+
{#each Object.entries(tool.parameters) as [name, param]}
|
|
217
|
+
<div class="parameter">
|
|
218
|
+
<code>{name}</code>
|
|
219
|
+
<span class="parameter-type">
|
|
220
|
+
({param.type}{param.default !== undefined
|
|
221
|
+
? `, default: ${JSON.stringify(param.default)}`
|
|
222
|
+
: ""})
|
|
223
|
+
</span>
|
|
224
|
+
<p class="parameter-description">
|
|
225
|
+
{param.description
|
|
226
|
+
? param.description
|
|
227
|
+
: "⚠︎ No description for this parameter in function docstring"}
|
|
228
|
+
</p>
|
|
229
|
+
</div>
|
|
230
|
+
{/each}
|
|
233
231
|
</div>
|
|
232
|
+
{:else}
|
|
233
|
+
<p>Takes no input parameters</p>
|
|
234
234
|
{/if}
|
|
235
235
|
</div>
|
|
236
236
|
{/if}
|
package/package.json
CHANGED
|
@@ -1,67 +1,67 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gradio/core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.19.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"devDependencies": {
|
|
6
|
-
"@gradio/accordion": "^0.5.
|
|
7
|
-
"@gradio/annotatedimage": "^0.9.
|
|
8
|
-
"@gradio/box": "^0.2.19",
|
|
6
|
+
"@gradio/accordion": "^0.5.16",
|
|
7
|
+
"@gradio/annotatedimage": "^0.9.20",
|
|
9
8
|
"@gradio/atoms": "^0.16.1",
|
|
10
|
-
"@gradio/audio": "^0.17.
|
|
11
|
-
"@gradio/
|
|
12
|
-
"@gradio/
|
|
13
|
-
"@gradio/checkboxgroup": "^0.6.
|
|
14
|
-
"@gradio/chatbot": "^0.26.
|
|
15
|
-
"@gradio/
|
|
16
|
-
"@gradio/client": "^1.15.
|
|
17
|
-
"@gradio/
|
|
9
|
+
"@gradio/audio": "^0.17.16",
|
|
10
|
+
"@gradio/box": "^0.2.19",
|
|
11
|
+
"@gradio/button": "^0.5.2",
|
|
12
|
+
"@gradio/checkboxgroup": "^0.6.22",
|
|
13
|
+
"@gradio/chatbot": "^0.26.11",
|
|
14
|
+
"@gradio/checkbox": "^0.4.22",
|
|
15
|
+
"@gradio/client": "^1.15.1",
|
|
16
|
+
"@gradio/code": "^0.14.5",
|
|
17
|
+
"@gradio/colorpicker": "^0.4.22",
|
|
18
18
|
"@gradio/column": "^0.2.0",
|
|
19
|
-
"@gradio/dataframe": "^0.17.
|
|
20
|
-
"@gradio/
|
|
21
|
-
"@gradio/downloadbutton": "^0.4.
|
|
22
|
-
"@gradio/
|
|
23
|
-
"@gradio/dropdown": "^0.9.
|
|
24
|
-
"@gradio/fallback": "^0.4.
|
|
25
|
-
"@gradio/
|
|
26
|
-
"@gradio/
|
|
19
|
+
"@gradio/dataframe": "^0.17.14",
|
|
20
|
+
"@gradio/datetime": "^0.3.14",
|
|
21
|
+
"@gradio/downloadbutton": "^0.4.2",
|
|
22
|
+
"@gradio/dataset": "^0.4.21",
|
|
23
|
+
"@gradio/dropdown": "^0.9.22",
|
|
24
|
+
"@gradio/fallback": "^0.4.22",
|
|
25
|
+
"@gradio/fileexplorer": "^0.5.30",
|
|
26
|
+
"@gradio/gallery": "^0.15.21",
|
|
27
27
|
"@gradio/form": "^0.2.19",
|
|
28
|
-
"@gradio/
|
|
28
|
+
"@gradio/file": "^0.12.19",
|
|
29
29
|
"@gradio/group": "^0.2.0",
|
|
30
|
-
"@gradio/html": "^0.6.
|
|
31
|
-
"@gradio/highlightedtext": "^0.9.4",
|
|
30
|
+
"@gradio/html": "^0.6.14",
|
|
32
31
|
"@gradio/icons": "^0.12.0",
|
|
33
|
-
"@gradio/
|
|
34
|
-
"@gradio/
|
|
35
|
-
"@gradio/
|
|
36
|
-
"@gradio/
|
|
32
|
+
"@gradio/highlightedtext": "^0.9.5",
|
|
33
|
+
"@gradio/image": "^0.22.8",
|
|
34
|
+
"@gradio/imageeditor": "^0.15.2",
|
|
35
|
+
"@gradio/json": "^0.5.24",
|
|
36
|
+
"@gradio/imageslider": "^0.2.3",
|
|
37
37
|
"@gradio/browserstate": "^0.3.2",
|
|
38
|
-
"@gradio/
|
|
39
|
-
"@gradio/
|
|
40
|
-
"@gradio/
|
|
41
|
-
"@gradio/
|
|
42
|
-
"@gradio/number": "^0.5.
|
|
43
|
-
"@gradio/nativeplot": "^0.
|
|
44
|
-
"@gradio/plot": "^0.9.
|
|
45
|
-
"@gradio/paramviewer": "^0.7.
|
|
46
|
-
"@gradio/
|
|
47
|
-
"@gradio/sidebar": "^0.1.13",
|
|
38
|
+
"@gradio/markdown": "^0.13.14",
|
|
39
|
+
"@gradio/label": "^0.5.14",
|
|
40
|
+
"@gradio/model3d": "^0.14.15",
|
|
41
|
+
"@gradio/multimodaltextbox": "^0.10.8",
|
|
42
|
+
"@gradio/number": "^0.5.22",
|
|
43
|
+
"@gradio/nativeplot": "^0.6.0",
|
|
44
|
+
"@gradio/plot": "^0.9.17",
|
|
45
|
+
"@gradio/paramviewer": "^0.7.10",
|
|
46
|
+
"@gradio/sidebar": "^0.1.14",
|
|
48
47
|
"@gradio/row": "^0.2.1",
|
|
49
|
-
"@gradio/
|
|
50
|
-
"@gradio/
|
|
51
|
-
"@gradio/simpleimage": "^0.8.
|
|
52
|
-
"@gradio/
|
|
48
|
+
"@gradio/radio": "^0.7.5",
|
|
49
|
+
"@gradio/simpledropdown": "^0.3.22",
|
|
50
|
+
"@gradio/simpleimage": "^0.8.30",
|
|
51
|
+
"@gradio/sketchbox": "^0.6.9",
|
|
52
|
+
"@gradio/slider": "^0.6.11",
|
|
53
|
+
"@gradio/simpletextbox": "^0.3.22",
|
|
53
54
|
"@gradio/state": "^0.1.2",
|
|
54
|
-
"@gradio/sketchbox": "^0.6.8",
|
|
55
|
-
"@gradio/statustracker": "^0.10.11",
|
|
56
55
|
"@gradio/tabitem": "^0.4.4",
|
|
57
56
|
"@gradio/tabs": "^0.4.4",
|
|
58
|
-
"@gradio/
|
|
59
|
-
"@gradio/
|
|
57
|
+
"@gradio/statustracker": "^0.10.12",
|
|
58
|
+
"@gradio/textbox": "^0.10.13",
|
|
60
59
|
"@gradio/theme": "^0.4.0",
|
|
61
|
-
"@gradio/
|
|
62
|
-
"@gradio/
|
|
63
|
-
"@gradio/
|
|
60
|
+
"@gradio/timer": "^0.4.5",
|
|
61
|
+
"@gradio/upload": "^0.16.6",
|
|
62
|
+
"@gradio/uploadbutton": "^0.9.2",
|
|
64
63
|
"@gradio/utils": "^0.10.2",
|
|
64
|
+
"@gradio/video": "^0.14.16",
|
|
65
65
|
"@gradio/wasm": "^0.18.1"
|
|
66
66
|
},
|
|
67
67
|
"msw": {
|
package/src/Blocks.svelte
CHANGED
|
@@ -53,8 +53,6 @@
|
|
|
53
53
|
export let initial_layout: ComponentMeta | undefined = undefined;
|
|
54
54
|
export let css: string | null | undefined = null;
|
|
55
55
|
|
|
56
|
-
setupi18n(app.config?.i18n_translations ?? undefined);
|
|
57
|
-
|
|
58
56
|
let {
|
|
59
57
|
layout: _layout,
|
|
60
58
|
targets,
|
|
@@ -308,18 +306,6 @@
|
|
|
308
306
|
dep.pending_request = true;
|
|
309
307
|
}
|
|
310
308
|
|
|
311
|
-
let deps_to_remove: number[] = [];
|
|
312
|
-
if (dep.render_id != null) {
|
|
313
|
-
dependencies.forEach((other_dep, i) => {
|
|
314
|
-
if (other_dep.rendered_in === dep.render_id) {
|
|
315
|
-
deps_to_remove.push(i);
|
|
316
|
-
}
|
|
317
|
-
});
|
|
318
|
-
}
|
|
319
|
-
deps_to_remove.reverse().forEach((i) => {
|
|
320
|
-
dependencies.splice(i, 1);
|
|
321
|
-
});
|
|
322
|
-
|
|
323
309
|
let payload: Payload = {
|
|
324
310
|
fn_index: dep_index,
|
|
325
311
|
data: await Promise.all(
|
|
@@ -483,6 +469,15 @@
|
|
|
483
469
|
let _dependencies: Dependency[] = data.dependencies;
|
|
484
470
|
let render_id = data.render_id;
|
|
485
471
|
|
|
472
|
+
let deps_to_remove: number[] = [];
|
|
473
|
+
dependencies.forEach((old_dep, i) => {
|
|
474
|
+
if (old_dep.rendered_in === dep.render_id) {
|
|
475
|
+
deps_to_remove.push(i);
|
|
476
|
+
}
|
|
477
|
+
});
|
|
478
|
+
deps_to_remove.reverse().forEach((i) => {
|
|
479
|
+
dependencies.splice(i, 1);
|
|
480
|
+
});
|
|
486
481
|
_dependencies.forEach((dep) => {
|
|
487
482
|
dependencies.push(dep);
|
|
488
483
|
});
|
|
@@ -833,6 +828,11 @@
|
|
|
833
828
|
screen_recorder.startRecording();
|
|
834
829
|
}
|
|
835
830
|
}
|
|
831
|
+
|
|
832
|
+
let i18n_ready = false;
|
|
833
|
+
setupi18n(app.config?.i18n_translations ?? undefined).then(() => {
|
|
834
|
+
i18n_ready = true;
|
|
835
|
+
});
|
|
836
836
|
</script>
|
|
837
837
|
|
|
838
838
|
<svelte:head>
|
|
@@ -846,7 +846,7 @@
|
|
|
846
846
|
|
|
847
847
|
<div class="wrap" style:min-height={app_mode ? "100%" : "auto"}>
|
|
848
848
|
<div class="contain" style:flex-grow={app_mode ? "1" : "auto"}>
|
|
849
|
-
{#if $_layout && app.config}
|
|
849
|
+
{#if $_layout && app.config && i18n_ready}
|
|
850
850
|
<MountComponents
|
|
851
851
|
rootNode={$_layout}
|
|
852
852
|
{root}
|
|
@@ -101,6 +101,7 @@
|
|
|
101
101
|
type: string;
|
|
102
102
|
description: string;
|
|
103
103
|
format?: string;
|
|
104
|
+
default?: any;
|
|
104
105
|
}
|
|
105
106
|
|
|
106
107
|
interface Tool {
|
|
@@ -117,10 +118,10 @@
|
|
|
117
118
|
const response = await fetch(`${root}gradio_api/mcp/schema`);
|
|
118
119
|
const schema = await response.json();
|
|
119
120
|
|
|
120
|
-
tools =
|
|
121
|
-
name:
|
|
121
|
+
tools = schema.map((tool: any) => ({
|
|
122
|
+
name: tool.name,
|
|
122
123
|
description: tool.description || "",
|
|
123
|
-
parameters: tool.properties || {},
|
|
124
|
+
parameters: tool.inputSchema?.properties || {},
|
|
124
125
|
expanded: false
|
|
125
126
|
}));
|
|
126
127
|
} catch (error) {
|
|
@@ -267,24 +268,24 @@
|
|
|
267
268
|
<div class="tool-content">
|
|
268
269
|
{#if Object.keys(tool.parameters).length > 0}
|
|
269
270
|
<div class="tool-parameters">
|
|
270
|
-
{#
|
|
271
|
-
|
|
272
|
-
<
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
</
|
|
283
|
-
|
|
284
|
-
{
|
|
285
|
-
<p>No parameters</p>
|
|
286
|
-
{/if}
|
|
271
|
+
{#each Object.entries(tool.parameters) as [name, param]}
|
|
272
|
+
<div class="parameter">
|
|
273
|
+
<code>{name}</code>
|
|
274
|
+
<span class="parameter-type">
|
|
275
|
+
({param.type}{param.default !== undefined
|
|
276
|
+
? `, default: ${JSON.stringify(param.default)}`
|
|
277
|
+
: ""})
|
|
278
|
+
</span>
|
|
279
|
+
<p class="parameter-description">
|
|
280
|
+
{param.description
|
|
281
|
+
? param.description
|
|
282
|
+
: "⚠︎ No description for this parameter in function docstring"}
|
|
283
|
+
</p>
|
|
284
|
+
</div>
|
|
285
|
+
{/each}
|
|
287
286
|
</div>
|
|
287
|
+
{:else}
|
|
288
|
+
<p>Takes no input parameters</p>
|
|
288
289
|
{/if}
|
|
289
290
|
</div>
|
|
290
291
|
{/if}
|