@gradio/core 0.27.0 → 0.27.2
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 +21 -0
- package/dist/src/Blocks.svelte +12 -21
- package/dist/src/Blocks.svelte.d.ts +11 -9
- package/dist/src/Embed.svelte.d.ts +4 -2
- package/dist/src/Login.svelte.d.ts +2 -0
- package/dist/src/MountComponents.svelte.d.ts +3 -1
- package/dist/src/Render.svelte +12 -13
- package/dist/src/Render.svelte.d.ts +3 -1
- package/dist/src/RenderComponent.svelte +3 -6
- package/dist/src/RenderComponent.svelte.d.ts +2 -0
- package/dist/src/api_docs/ApiBanner.svelte.d.ts +3 -1
- package/dist/src/api_docs/ApiDocs.svelte +28 -18
- package/dist/src/api_docs/ApiDocs.svelte.d.ts +3 -1
- package/dist/src/api_docs/ApiRecorder.svelte.d.ts +3 -1
- package/dist/src/api_docs/CodeSnippet.svelte +40 -40
- package/dist/src/api_docs/CodeSnippet.svelte.d.ts +4 -1
- package/dist/src/api_docs/CopyButton.svelte.d.ts +2 -0
- package/dist/src/api_docs/EndpointDetail.svelte +23 -1
- package/dist/src/api_docs/EndpointDetail.svelte.d.ts +5 -2
- package/dist/src/api_docs/InputPayload.svelte.d.ts +2 -0
- package/dist/src/api_docs/InstallSnippet.svelte.d.ts +2 -0
- package/dist/src/api_docs/MCPSnippet.svelte +89 -44
- package/dist/src/api_docs/MCPSnippet.svelte.d.ts +7 -2
- package/dist/src/api_docs/NoApi.svelte.d.ts +2 -0
- package/dist/src/api_docs/ParametersSnippet.svelte.d.ts +2 -0
- package/dist/src/api_docs/RecordingSnippet.svelte.d.ts +4 -2
- package/dist/src/api_docs/ResponseSnippet.svelte.d.ts +2 -0
- package/dist/src/api_docs/Settings.svelte.d.ts +4 -2
- package/dist/src/api_docs/SettingsBanner.svelte.d.ts +2 -0
- package/dist/src/api_docs/TryButton.svelte.d.ts +2 -0
- package/dist/src/api_docs/img/clear.svelte.d.ts +2 -0
- package/dist/src/api_docs/utils.d.ts +2 -0
- package/dist/src/api_docs/utils.js +14 -0
- package/dist/src/stories/I18nMultiLanguageTestComponent.svelte.d.ts +3 -3
- package/dist/src/stories/I18nTestSetup.svelte +1 -2
- package/dist/src/stories/I18nTestSetup.svelte.d.ts +3 -1
- package/package.json +31 -31
- package/src/api_docs/ApiDocs.svelte +24 -3
- package/src/api_docs/CodeSnippet.svelte +38 -36
- package/src/api_docs/EndpointDetail.svelte +24 -1
- package/src/api_docs/MCPSnippet.svelte +68 -17
- package/src/api_docs/utils.ts +14 -0
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
import { SvelteComponent } from "svelte";
|
|
2
2
|
declare const __propDef: {
|
|
3
3
|
props: {
|
|
4
|
-
api_name?:
|
|
5
|
-
description?:
|
|
4
|
+
api_name?: string | null;
|
|
5
|
+
description?: string | null;
|
|
6
|
+
analytics: Record<string, any>;
|
|
6
7
|
};
|
|
7
8
|
events: {
|
|
8
9
|
[evt: string]: CustomEvent<any>;
|
|
9
10
|
};
|
|
10
11
|
slots: {};
|
|
12
|
+
exports?: {} | undefined;
|
|
13
|
+
bindings?: string | undefined;
|
|
11
14
|
};
|
|
12
15
|
export type EndpointDetailProps = typeof __propDef.props;
|
|
13
16
|
export type EndpointDetailEvents = typeof __propDef.events;
|
|
@@ -15,6 +15,8 @@ declare const __propDef: {
|
|
|
15
15
|
[evt: string]: CustomEvent<any>;
|
|
16
16
|
};
|
|
17
17
|
slots: {};
|
|
18
|
+
exports?: {} | undefined;
|
|
19
|
+
bindings?: string | undefined;
|
|
18
20
|
};
|
|
19
21
|
export type InputPayloadProps = typeof __propDef.props;
|
|
20
22
|
export type InputPayloadEvents = typeof __propDef.events;
|
|
@@ -7,6 +7,8 @@ declare const __propDef: {
|
|
|
7
7
|
[evt: string]: CustomEvent<any>;
|
|
8
8
|
};
|
|
9
9
|
slots: {};
|
|
10
|
+
exports?: {} | undefined;
|
|
11
|
+
bindings?: string | undefined;
|
|
10
12
|
};
|
|
11
13
|
export type InstallSnippetProps = typeof __propDef.props;
|
|
12
14
|
export type InstallSnippetEvents = typeof __propDef.events;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
<script>import { Block } from "@gradio/atoms";
|
|
2
2
|
import CopyButton from "./CopyButton.svelte";
|
|
3
|
+
import { Tool, Prompt, Resource } from "@gradio/icons";
|
|
4
|
+
import { format_latency, get_color_from_success_rate } from "./utils";
|
|
3
5
|
export let mcp_server_active;
|
|
4
6
|
export let mcp_server_url;
|
|
5
7
|
export let mcp_server_url_streamable;
|
|
@@ -10,6 +12,7 @@ export let mcp_json_sse;
|
|
|
10
12
|
export let mcp_json_stdio;
|
|
11
13
|
export let file_data_present;
|
|
12
14
|
export let mcp_docs;
|
|
15
|
+
export let analytics;
|
|
13
16
|
let current_transport = "streamable_http";
|
|
14
17
|
let include_file_upload = true;
|
|
15
18
|
const transports = [
|
|
@@ -17,16 +20,14 @@ const transports = [
|
|
|
17
20
|
["sse", "SSE"],
|
|
18
21
|
["stdio", "STDIO"]
|
|
19
22
|
];
|
|
20
|
-
const
|
|
21
|
-
tool:
|
|
22
|
-
resource:
|
|
23
|
-
prompt:
|
|
23
|
+
const tool_type_icons = {
|
|
24
|
+
tool: Tool,
|
|
25
|
+
resource: Resource,
|
|
26
|
+
prompt: Prompt
|
|
24
27
|
};
|
|
25
|
-
$:
|
|
26
|
-
display_url = current_transport === "sse" ? mcp_server_url : mcp_server_url_streamable;
|
|
28
|
+
$: display_url = current_transport === "sse" ? mcp_server_url : mcp_server_url_streamable;
|
|
27
29
|
function update_config_with_file_upload(base_config, include_upload) {
|
|
28
|
-
if (!base_config)
|
|
29
|
-
return null;
|
|
30
|
+
if (!base_config) return null;
|
|
30
31
|
const config = JSON.parse(JSON.stringify(base_config));
|
|
31
32
|
if (include_upload && file_data_present) {
|
|
32
33
|
const upload_file_mcp_server = {
|
|
@@ -46,30 +47,27 @@ function update_config_with_file_upload(base_config, include_upload) {
|
|
|
46
47
|
}
|
|
47
48
|
return config;
|
|
48
49
|
}
|
|
49
|
-
$:
|
|
50
|
-
|
|
51
|
-
mcp_json_sse
|
|
52
|
-
|
|
53
|
-
mcpServers
|
|
54
|
-
|
|
55
|
-
gradio
|
|
56
|
-
|
|
57
|
-
url: mcp_server_url_streamable
|
|
58
|
-
}
|
|
50
|
+
$: mcp_json_streamable_http = update_config_with_file_upload(
|
|
51
|
+
mcp_json_sse ? {
|
|
52
|
+
...mcp_json_sse,
|
|
53
|
+
mcpServers: {
|
|
54
|
+
...mcp_json_sse.mcpServers,
|
|
55
|
+
gradio: {
|
|
56
|
+
...mcp_json_sse.mcpServers.gradio,
|
|
57
|
+
url: mcp_server_url_streamable
|
|
59
58
|
}
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
$:
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
);
|
|
59
|
+
}
|
|
60
|
+
} : null,
|
|
61
|
+
include_file_upload
|
|
62
|
+
);
|
|
63
|
+
$: mcp_json_sse_updated = update_config_with_file_upload(
|
|
64
|
+
mcp_json_sse,
|
|
65
|
+
include_file_upload
|
|
66
|
+
);
|
|
67
|
+
$: mcp_json_stdio_updated = update_config_with_file_upload(
|
|
68
|
+
mcp_json_stdio,
|
|
69
|
+
include_file_upload
|
|
70
|
+
);
|
|
73
71
|
</script>
|
|
74
72
|
|
|
75
73
|
{#if mcp_server_active}
|
|
@@ -109,11 +107,15 @@ $:
|
|
|
109
107
|
{/if}
|
|
110
108
|
|
|
111
109
|
<div class="tool-selection">
|
|
112
|
-
<strong
|
|
113
|
-
|
|
114
|
-
(
|
|
115
|
-
|
|
116
|
-
|
|
110
|
+
<strong>
|
|
111
|
+
{all_tools.length > 0 ? all_tools.length : tools.length} Available MCP Tools
|
|
112
|
+
(<span style="display: inline-block; vertical-align: sub;"><Tool /></span
|
|
113
|
+
>), Resources (<span style="display: inline-block; vertical-align: sub;"
|
|
114
|
+
><Resource /></span
|
|
115
|
+
>), and Prompts (<span style="display: inline-block; vertical-align: sub;"
|
|
116
|
+
><Prompt /></span
|
|
117
|
+
>)
|
|
118
|
+
</strong>
|
|
117
119
|
{#if all_tools.length > 0}
|
|
118
120
|
<div class="tool-selection-controls">
|
|
119
121
|
<button
|
|
@@ -137,6 +139,9 @@ $:
|
|
|
137
139
|
</div>
|
|
138
140
|
<div class="mcp-tools">
|
|
139
141
|
{#each all_tools.length > 0 ? all_tools : tools as tool}
|
|
142
|
+
{@const success_rate =
|
|
143
|
+
analytics[tool.meta.endpoint_name]?.success_rate || 0}
|
|
144
|
+
{@const color = get_color_from_success_rate(success_rate)}
|
|
140
145
|
<div class="tool-item">
|
|
141
146
|
<div class="tool-header-wrapper">
|
|
142
147
|
{#if all_tools.length > 0}
|
|
@@ -163,17 +168,53 @@ $:
|
|
|
163
168
|
class="tool-header"
|
|
164
169
|
on:click={() => (tool.expanded = !tool.expanded)}
|
|
165
170
|
>
|
|
166
|
-
<span
|
|
167
|
-
|
|
168
|
-
|
|
171
|
+
<span style="display: inline-block">
|
|
172
|
+
<span
|
|
173
|
+
style="display: inline-block; padding-right: 6px; vertical-align: sub"
|
|
169
174
|
>
|
|
175
|
+
{#if tool_type_icons[tool.meta.mcp_type]}
|
|
176
|
+
{@const Icon = tool_type_icons[tool.meta.mcp_type]}
|
|
177
|
+
<Icon />
|
|
178
|
+
{/if}
|
|
179
|
+
</span>
|
|
180
|
+
<span class="tool-name">{tool.name}</span>
|
|
170
181
|
|
|
171
|
-
<span class="tool-description"
|
|
172
|
-
|
|
182
|
+
<span class="tool-description">
|
|
183
|
+
{tool.description
|
|
173
184
|
? tool.description
|
|
174
|
-
: "⚠︎ No description provided in function docstring"}
|
|
175
|
-
|
|
176
|
-
|
|
185
|
+
: "⚠︎ No description provided in function docstring"}
|
|
186
|
+
</span>
|
|
187
|
+
{#if analytics[tool.meta.endpoint_name]}
|
|
188
|
+
<span
|
|
189
|
+
class="tool-analytics"
|
|
190
|
+
style="color: var(--body-text-color-subdued); margin-left: 1em;"
|
|
191
|
+
>
|
|
192
|
+
Total requests: {analytics[tool.meta.endpoint_name]
|
|
193
|
+
.total_requests}
|
|
194
|
+
<span style={color}
|
|
195
|
+
>({Math.round(success_rate * 100)}% successful)</span
|
|
196
|
+
>
|
|
197
|
+
| p50/p90/p99:
|
|
198
|
+
{format_latency(
|
|
199
|
+
analytics[tool.meta.endpoint_name].process_time_percentiles[
|
|
200
|
+
"50th"
|
|
201
|
+
]
|
|
202
|
+
)}
|
|
203
|
+
/
|
|
204
|
+
{format_latency(
|
|
205
|
+
analytics[tool.meta.endpoint_name].process_time_percentiles[
|
|
206
|
+
"90th"
|
|
207
|
+
]
|
|
208
|
+
)}
|
|
209
|
+
/
|
|
210
|
+
{format_latency(
|
|
211
|
+
analytics[tool.meta.endpoint_name].process_time_percentiles[
|
|
212
|
+
"99th"
|
|
213
|
+
]
|
|
214
|
+
)}
|
|
215
|
+
</span>
|
|
216
|
+
{/if}
|
|
217
|
+
</span>
|
|
177
218
|
<span class="tool-arrow">{tool.expanded ? "▼" : "▶"}</span>
|
|
178
219
|
</button>
|
|
179
220
|
</div>
|
|
@@ -297,6 +338,10 @@ $:
|
|
|
297
338
|
{/if}
|
|
298
339
|
|
|
299
340
|
<style>
|
|
341
|
+
.tool-analytics {
|
|
342
|
+
font-size: 0.95em;
|
|
343
|
+
color: var(--body-text-color-subdued);
|
|
344
|
+
}
|
|
300
345
|
.transport-selection {
|
|
301
346
|
margin-bottom: var(--size-4);
|
|
302
347
|
}
|
|
@@ -18,6 +18,7 @@ declare const __propDef: {
|
|
|
18
18
|
meta: {
|
|
19
19
|
mcp_type: "tool" | "resource" | "prompt";
|
|
20
20
|
file_data_present: boolean;
|
|
21
|
+
endpoint_name: string;
|
|
21
22
|
};
|
|
22
23
|
}[];
|
|
23
24
|
all_tools?: {
|
|
@@ -34,18 +35,22 @@ declare const __propDef: {
|
|
|
34
35
|
meta: {
|
|
35
36
|
mcp_type: "tool" | "resource" | "prompt";
|
|
36
37
|
file_data_present: boolean;
|
|
38
|
+
endpoint_name: string;
|
|
37
39
|
};
|
|
38
|
-
}[]
|
|
39
|
-
selected_tools?: Set<string
|
|
40
|
+
}[];
|
|
41
|
+
selected_tools?: Set<string>;
|
|
40
42
|
mcp_json_sse: any;
|
|
41
43
|
mcp_json_stdio: any;
|
|
42
44
|
file_data_present: boolean;
|
|
43
45
|
mcp_docs: string;
|
|
46
|
+
analytics: Record<string, any>;
|
|
44
47
|
};
|
|
45
48
|
events: {
|
|
46
49
|
[evt: string]: CustomEvent<any>;
|
|
47
50
|
};
|
|
48
51
|
slots: {};
|
|
52
|
+
exports?: {} | undefined;
|
|
53
|
+
bindings?: string | undefined;
|
|
49
54
|
};
|
|
50
55
|
export type McpSnippetProps = typeof __propDef.props;
|
|
51
56
|
export type McpSnippetEvents = typeof __propDef.events;
|
|
@@ -10,6 +10,8 @@ declare const __propDef: {
|
|
|
10
10
|
[evt: string]: CustomEvent<any>;
|
|
11
11
|
};
|
|
12
12
|
slots: {};
|
|
13
|
+
exports?: {} | undefined;
|
|
14
|
+
bindings?: string | undefined;
|
|
13
15
|
};
|
|
14
16
|
export type ParametersSnippetProps = typeof __propDef.props;
|
|
15
17
|
export type ParametersSnippetEvents = typeof __propDef.events;
|
|
@@ -5,15 +5,17 @@ declare const __propDef: {
|
|
|
5
5
|
dependencies: Dependency[];
|
|
6
6
|
short_root: string;
|
|
7
7
|
root: string;
|
|
8
|
-
api_prefix?: string
|
|
8
|
+
api_prefix?: string;
|
|
9
9
|
current_language: "python" | "javascript" | "bash" | "mcp";
|
|
10
10
|
username: string | null;
|
|
11
|
-
api_calls?: Payload[]
|
|
11
|
+
api_calls?: Payload[];
|
|
12
12
|
};
|
|
13
13
|
events: {
|
|
14
14
|
[evt: string]: CustomEvent<any>;
|
|
15
15
|
};
|
|
16
16
|
slots: {};
|
|
17
|
+
exports?: {} | undefined;
|
|
18
|
+
bindings?: string | undefined;
|
|
17
19
|
};
|
|
18
20
|
export type RecordingSnippetProps = typeof __propDef.props;
|
|
19
21
|
export type RecordingSnippetEvents = typeof __propDef.events;
|
|
@@ -10,6 +10,8 @@ declare const __propDef: {
|
|
|
10
10
|
[evt: string]: CustomEvent<any>;
|
|
11
11
|
};
|
|
12
12
|
slots: {};
|
|
13
|
+
exports?: {} | undefined;
|
|
14
|
+
bindings?: string | undefined;
|
|
13
15
|
};
|
|
14
16
|
export type ResponseSnippetProps = typeof __propDef.props;
|
|
15
17
|
export type ResponseSnippetEvents = typeof __propDef.events;
|
|
@@ -4,8 +4,8 @@ declare const __propDef: {
|
|
|
4
4
|
root: string;
|
|
5
5
|
space_id: string | null;
|
|
6
6
|
pwa_enabled: boolean | undefined;
|
|
7
|
-
allow_zoom?: boolean
|
|
8
|
-
allow_video_trim?: boolean
|
|
7
|
+
allow_zoom?: boolean;
|
|
8
|
+
allow_video_trim?: boolean;
|
|
9
9
|
};
|
|
10
10
|
events: {
|
|
11
11
|
close: CustomEvent<any>;
|
|
@@ -14,6 +14,8 @@ declare const __propDef: {
|
|
|
14
14
|
[evt: string]: CustomEvent<any>;
|
|
15
15
|
};
|
|
16
16
|
slots: {};
|
|
17
|
+
exports?: {} | undefined;
|
|
18
|
+
bindings?: string | undefined;
|
|
17
19
|
};
|
|
18
20
|
export type SettingsProps = typeof __propDef.props;
|
|
19
21
|
export type SettingsEvents = typeof __propDef.events;
|
|
@@ -9,6 +9,8 @@ declare const __propDef: {
|
|
|
9
9
|
[evt: string]: CustomEvent<any>;
|
|
10
10
|
};
|
|
11
11
|
slots: {};
|
|
12
|
+
exports?: {} | undefined;
|
|
13
|
+
bindings?: string | undefined;
|
|
12
14
|
};
|
|
13
15
|
export type SettingsBannerProps = typeof __propDef.props;
|
|
14
16
|
export type SettingsBannerEvents = typeof __propDef.events;
|
|
@@ -1,2 +1,4 @@
|
|
|
1
1
|
export declare function represent_value(value: string, type: string | undefined, lang?: "js" | "py" | "bash" | null): string | null | number | boolean | Record<string, unknown>;
|
|
2
2
|
export declare function is_potentially_nested_file_data(obj: any): boolean;
|
|
3
|
+
export declare function format_latency(val: number): string;
|
|
4
|
+
export declare function get_color_from_success_rate(success_rate: number): string;
|
|
@@ -133,3 +133,17 @@ function stringify_except_file_function(obj) {
|
|
|
133
133
|
const regexNone = /"UNQUOTEDNone"/g;
|
|
134
134
|
return jsonString.replace(regexNone, "None");
|
|
135
135
|
}
|
|
136
|
+
export function format_latency(val) {
|
|
137
|
+
if (val < 1)
|
|
138
|
+
return `${Math.round(val * 1000)} ms`;
|
|
139
|
+
return `${val.toFixed(2)} s`;
|
|
140
|
+
}
|
|
141
|
+
export function get_color_from_success_rate(success_rate) {
|
|
142
|
+
if (success_rate > 0.9) {
|
|
143
|
+
return "color: green;";
|
|
144
|
+
}
|
|
145
|
+
else if (success_rate > 0.1) {
|
|
146
|
+
return "color: orange;";
|
|
147
|
+
}
|
|
148
|
+
return "color: red;";
|
|
149
|
+
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { SvelteComponent } from "svelte";
|
|
2
2
|
declare const __propDef: {
|
|
3
|
-
props:
|
|
4
|
-
[x: string]: never;
|
|
5
|
-
};
|
|
3
|
+
props: Record<string, never>;
|
|
6
4
|
events: {
|
|
7
5
|
[evt: string]: CustomEvent<any>;
|
|
8
6
|
};
|
|
9
7
|
slots: {};
|
|
8
|
+
exports?: {} | undefined;
|
|
9
|
+
bindings?: string | undefined;
|
|
10
10
|
};
|
|
11
11
|
export type I18nMultiLanguageTestComponentProps = typeof __propDef.props;
|
|
12
12
|
export type I18nMultiLanguageTestComponentEvents = typeof __propDef.events;
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import { SvelteComponent } from "svelte";
|
|
2
2
|
declare const __propDef: {
|
|
3
3
|
props: {
|
|
4
|
-
active?: boolean
|
|
4
|
+
active?: boolean;
|
|
5
5
|
};
|
|
6
6
|
events: {
|
|
7
7
|
[evt: string]: CustomEvent<any>;
|
|
8
8
|
};
|
|
9
9
|
slots: {};
|
|
10
|
+
exports?: {} | undefined;
|
|
11
|
+
bindings?: string | undefined;
|
|
10
12
|
};
|
|
11
13
|
export type I18nTestSetupProps = typeof __propDef.props;
|
|
12
14
|
export type I18nTestSetupEvents = typeof __propDef.events;
|
package/package.json
CHANGED
|
@@ -1,69 +1,69 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gradio/core",
|
|
3
|
-
"version": "0.27.
|
|
3
|
+
"version": "0.27.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"devDependencies": {
|
|
6
|
-
"@gradio/annotatedimage": "^0.9.29",
|
|
7
6
|
"@gradio/accordion": "^0.5.22",
|
|
8
|
-
"@gradio/
|
|
9
|
-
"@gradio/
|
|
10
|
-
"@gradio/browserstate": "^0.3.2",
|
|
11
|
-
"@gradio/chatbot": "^0.26.22",
|
|
12
|
-
"@gradio/checkbox": "^0.4.28",
|
|
7
|
+
"@gradio/annotatedimage": "^0.9.29",
|
|
8
|
+
"@gradio/audio": "^0.17.26",
|
|
13
9
|
"@gradio/box": "^0.2.23",
|
|
10
|
+
"@gradio/browserstate": "^0.3.2",
|
|
11
|
+
"@gradio/atoms": "^0.16.5",
|
|
14
12
|
"@gradio/button": "^0.5.11",
|
|
13
|
+
"@gradio/checkbox": "^0.4.28",
|
|
14
|
+
"@gradio/chatbot": "^0.26.23",
|
|
15
15
|
"@gradio/checkboxgroup": "^0.6.27",
|
|
16
|
-
"@gradio/client": "^1.17.1",
|
|
17
16
|
"@gradio/code": "^0.14.15",
|
|
17
|
+
"@gradio/client": "^1.17.1",
|
|
18
18
|
"@gradio/colorpicker": "^0.4.27",
|
|
19
19
|
"@gradio/column": "^0.2.1",
|
|
20
|
-
"@gradio/dataframe": "^0.
|
|
21
|
-
"@gradio/dropdown": "^0.10.2",
|
|
20
|
+
"@gradio/dataframe": "^0.19.1",
|
|
22
21
|
"@gradio/dataset": "^0.4.32",
|
|
22
|
+
"@gradio/dropdown": "^0.10.2",
|
|
23
|
+
"@gradio/fallback": "^0.4.27",
|
|
23
24
|
"@gradio/datetime": "^0.3.20",
|
|
24
25
|
"@gradio/downloadbutton": "^0.4.11",
|
|
25
|
-
"@gradio/fallback": "^0.4.27",
|
|
26
|
-
"@gradio/file": "^0.12.28",
|
|
27
26
|
"@gradio/fileexplorer": "^0.5.39",
|
|
27
|
+
"@gradio/file": "^0.12.28",
|
|
28
28
|
"@gradio/form": "^0.2.23",
|
|
29
29
|
"@gradio/group": "^0.2.0",
|
|
30
|
-
"@gradio/
|
|
30
|
+
"@gradio/html": "^0.7.0",
|
|
31
|
+
"@gradio/icons": "^0.13.1",
|
|
31
32
|
"@gradio/highlightedtext": "^0.9.10",
|
|
32
|
-
"@gradio/
|
|
33
|
-
"@gradio/icons": "^0.13.0",
|
|
34
|
-
"@gradio/image": "^0.22.17",
|
|
33
|
+
"@gradio/gallery": "^0.15.31",
|
|
35
34
|
"@gradio/imageeditor": "^0.16.5",
|
|
36
|
-
"@gradio/
|
|
35
|
+
"@gradio/image": "^0.22.17",
|
|
37
36
|
"@gradio/imageslider": "^0.2.13",
|
|
37
|
+
"@gradio/json": "^0.5.29",
|
|
38
38
|
"@gradio/label": "^0.5.19",
|
|
39
|
-
"@gradio/markdown": "^0.13.20",
|
|
40
39
|
"@gradio/model3d": "^0.14.25",
|
|
41
|
-
"@gradio/
|
|
40
|
+
"@gradio/markdown": "^0.13.20",
|
|
42
41
|
"@gradio/number": "^0.6.4",
|
|
43
|
-
"@gradio/
|
|
42
|
+
"@gradio/multimodaltextbox": "^0.10.17",
|
|
44
43
|
"@gradio/paramviewer": "^0.7.15",
|
|
44
|
+
"@gradio/nativeplot": "^0.7.4",
|
|
45
45
|
"@gradio/plot": "^0.9.22",
|
|
46
|
-
"@gradio/radio": "^0.7.10",
|
|
47
46
|
"@gradio/row": "^0.2.1",
|
|
48
47
|
"@gradio/sidebar": "^0.1.20",
|
|
49
|
-
"@gradio/
|
|
50
|
-
"@gradio/simpletextbox": "^0.3.28",
|
|
48
|
+
"@gradio/radio": "^0.7.10",
|
|
51
49
|
"@gradio/simpledropdown": "^0.3.27",
|
|
52
|
-
"@gradio/
|
|
53
|
-
"@gradio/slider": "^0.6.16",
|
|
50
|
+
"@gradio/simpletextbox": "^0.3.28",
|
|
54
51
|
"@gradio/state": "^0.1.2",
|
|
52
|
+
"@gradio/sketchbox": "^0.6.15",
|
|
53
|
+
"@gradio/simpleimage": "^0.8.39",
|
|
54
|
+
"@gradio/statustracker": "^0.10.18",
|
|
55
55
|
"@gradio/tabitem": "^0.5.0",
|
|
56
|
-
"@gradio/
|
|
56
|
+
"@gradio/slider": "^0.6.16",
|
|
57
57
|
"@gradio/textbox": "^0.10.20",
|
|
58
|
+
"@gradio/tabs": "^0.4.5",
|
|
58
59
|
"@gradio/theme": "^0.4.0",
|
|
59
|
-
"@gradio/timer": "^0.4.5",
|
|
60
|
-
"@gradio/statustracker": "^0.10.17",
|
|
61
|
-
"@gradio/upload": "^0.16.15",
|
|
62
60
|
"@gradio/uploadbutton": "^0.9.11",
|
|
61
|
+
"@gradio/upload": "^0.16.16",
|
|
62
|
+
"@gradio/timer": "^0.4.5",
|
|
63
63
|
"@gradio/utils": "^0.10.2",
|
|
64
|
-
"@gradio/video": "^0.15.0",
|
|
65
64
|
"@gradio/vibeeditor": "^0.2.2",
|
|
66
|
-
"@gradio/wasm": "^0.18.1"
|
|
65
|
+
"@gradio/wasm": "^0.18.1",
|
|
66
|
+
"@gradio/video": "^0.15.0"
|
|
67
67
|
},
|
|
68
68
|
"msw": {
|
|
69
69
|
"workerDirectory": "public"
|
|
@@ -99,6 +99,7 @@
|
|
|
99
99
|
};
|
|
100
100
|
|
|
101
101
|
let js_info: Record<string, any>;
|
|
102
|
+
let analytics: Record<string, any>;
|
|
102
103
|
|
|
103
104
|
get_info().then((data) => {
|
|
104
105
|
info = data;
|
|
@@ -108,6 +109,18 @@
|
|
|
108
109
|
js_info = js_api_info;
|
|
109
110
|
});
|
|
110
111
|
|
|
112
|
+
async function get_summary(): Promise<{
|
|
113
|
+
functions: any;
|
|
114
|
+
}> {
|
|
115
|
+
let response = await fetch(root.replace(/\/$/, "") + "/monitoring/summary");
|
|
116
|
+
let data = await response.json();
|
|
117
|
+
return data;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
get_summary().then((summary) => {
|
|
121
|
+
analytics = summary.functions;
|
|
122
|
+
});
|
|
123
|
+
|
|
111
124
|
const dispatch = createEventDispatcher();
|
|
112
125
|
|
|
113
126
|
$: selected_tools_array = Array.from(selected_tools);
|
|
@@ -148,6 +161,7 @@
|
|
|
148
161
|
meta: {
|
|
149
162
|
mcp_type: "tool" | "resource" | "prompt";
|
|
150
163
|
file_data_present: boolean;
|
|
164
|
+
endpoint_name: string;
|
|
151
165
|
};
|
|
152
166
|
}
|
|
153
167
|
|
|
@@ -192,7 +206,8 @@
|
|
|
192
206
|
description: tool.description || "",
|
|
193
207
|
parameters: tool.inputSchema?.properties || {},
|
|
194
208
|
meta: tool.meta,
|
|
195
|
-
expanded: false
|
|
209
|
+
expanded: false,
|
|
210
|
+
endpoint_name: tool.endpoint_name
|
|
196
211
|
}));
|
|
197
212
|
selected_tools = new Set(tools.map((tool) => tool.name));
|
|
198
213
|
headers = schema.map((tool: any) => tool.meta?.headers || []).flat();
|
|
@@ -260,6 +275,9 @@
|
|
|
260
275
|
}
|
|
261
276
|
|
|
262
277
|
onMount(() => {
|
|
278
|
+
const controller = new AbortController();
|
|
279
|
+
const signal = controller.signal;
|
|
280
|
+
|
|
263
281
|
document.body.style.overflow = "hidden";
|
|
264
282
|
if ("parentIFrame" in window) {
|
|
265
283
|
window.parentIFrame?.scrollTo(0, 0);
|
|
@@ -271,7 +289,7 @@
|
|
|
271
289
|
}
|
|
272
290
|
|
|
273
291
|
// Check MCP server status and fetch tools if active
|
|
274
|
-
fetch(mcp_server_url)
|
|
292
|
+
fetch(mcp_server_url, { signal: signal })
|
|
275
293
|
.then((response) => {
|
|
276
294
|
mcp_server_active = response.ok;
|
|
277
295
|
if (mcp_server_active) {
|
|
@@ -284,6 +302,7 @@
|
|
|
284
302
|
current_language = "python";
|
|
285
303
|
}
|
|
286
304
|
}
|
|
305
|
+
controller.abort();
|
|
287
306
|
})
|
|
288
307
|
.catch(() => {
|
|
289
308
|
mcp_server_active = false;
|
|
@@ -295,7 +314,7 @@
|
|
|
295
314
|
});
|
|
296
315
|
</script>
|
|
297
316
|
|
|
298
|
-
{#if info}
|
|
317
|
+
{#if info && analytics}
|
|
299
318
|
{#if api_count}
|
|
300
319
|
<div class="banner-wrap">
|
|
301
320
|
<ApiBanner
|
|
@@ -385,6 +404,7 @@
|
|
|
385
404
|
{mcp_json_stdio}
|
|
386
405
|
{file_data_present}
|
|
387
406
|
{mcp_docs}
|
|
407
|
+
{analytics}
|
|
388
408
|
/>
|
|
389
409
|
{:else}
|
|
390
410
|
1. Confirm that you have cURL installed on your system.
|
|
@@ -461,6 +481,7 @@
|
|
|
461
481
|
api_description={info.named_endpoints[
|
|
462
482
|
"/" + dependency.api_name
|
|
463
483
|
].description}
|
|
484
|
+
{analytics}
|
|
464
485
|
/>
|
|
465
486
|
|
|
466
487
|
<ParametersSnippet
|