@gradio/client 0.15.1 → 0.17.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 +51 -0
- package/README.md +49 -43
- package/dist/client.d.ts +52 -70
- package/dist/client.d.ts.map +1 -1
- package/dist/constants.d.ts +17 -0
- package/dist/constants.d.ts.map +1 -0
- package/dist/helpers/api_info.d.ts +25 -0
- package/dist/helpers/api_info.d.ts.map +1 -0
- package/dist/helpers/data.d.ts +8 -0
- package/dist/helpers/data.d.ts.map +1 -0
- package/dist/{utils.d.ts → helpers/init_helpers.d.ts} +6 -17
- package/dist/helpers/init_helpers.d.ts.map +1 -0
- package/dist/helpers/spaces.d.ts +7 -0
- package/dist/helpers/spaces.d.ts.map +1 -0
- package/dist/index.d.ts +8 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1587 -1359
- package/dist/types.d.ts +152 -49
- package/dist/types.d.ts.map +1 -1
- package/dist/upload.d.ts +2 -2
- package/dist/upload.d.ts.map +1 -1
- package/dist/utils/duplicate.d.ts +4 -0
- package/dist/utils/duplicate.d.ts.map +1 -0
- package/dist/utils/handle_blob.d.ts +4 -0
- package/dist/utils/handle_blob.d.ts.map +1 -0
- package/dist/utils/post_data.d.ts +4 -0
- package/dist/utils/post_data.d.ts.map +1 -0
- package/dist/utils/predict.d.ts +4 -0
- package/dist/utils/predict.d.ts.map +1 -0
- package/dist/utils/stream.d.ts +8 -0
- package/dist/utils/stream.d.ts.map +1 -0
- package/dist/utils/submit.d.ts +4 -0
- package/dist/utils/submit.d.ts.map +1 -0
- package/dist/utils/upload_files.d.ts +4 -0
- package/dist/utils/upload_files.d.ts.map +1 -0
- package/dist/utils/view_api.d.ts +3 -0
- package/dist/utils/view_api.d.ts.map +1 -0
- package/dist/{wrapper-6f348d45.js → wrapper-CviSselG.js} +259 -17
- package/package.json +3 -2
- package/src/client.ts +290 -1652
- package/src/constants.ts +20 -0
- package/src/globals.d.ts +2 -21
- package/src/helpers/api_info.ts +300 -0
- package/src/helpers/data.ts +115 -0
- package/src/helpers/init_helpers.ts +134 -0
- package/src/helpers/spaces.ts +192 -0
- package/src/index.ts +16 -10
- package/src/types.ts +200 -59
- package/src/upload.ts +23 -15
- package/src/{client.node-test.ts → utils/client.node-test.ts} +11 -10
- package/src/utils/duplicate.ts +87 -0
- package/src/utils/handle_blob.ts +47 -0
- package/src/utils/post_data.ts +37 -0
- package/src/utils/predict.ts +56 -0
- package/src/utils/stream.ts +166 -0
- package/src/utils/submit.ts +689 -0
- package/src/utils/upload_files.ts +46 -0
- package/src/utils/view_api.ts +70 -0
- package/src/vite-env.d.ts +1 -0
- package/tsconfig.json +15 -2
- package/vite.config.js +4 -17
- package/dist/utils.d.ts.map +0 -1
- package/src/utils.ts +0 -300
package/CHANGELOG.md
CHANGED
@@ -1,5 +1,56 @@
|
|
1
1
|
# @gradio/client
|
2
2
|
|
3
|
+
## 0.17.0
|
4
|
+
|
5
|
+
### Highlights
|
6
|
+
|
7
|
+
#### Setting File Upload Limits ([#7909](https://github.com/gradio-app/gradio/pull/7909) [`2afca65`](https://github.com/gradio-app/gradio/commit/2afca6541912b37dc84f447c7ad4af21607d7c72))
|
8
|
+
|
9
|
+
We have added a `max_file_size` size parameter to `launch()` that limits to size of files uploaded to the server. This limit applies to each individual file. This parameter can be specified as a string or an integer (corresponding to the size in bytes).
|
10
|
+
|
11
|
+
The following code snippet sets a max file size of 5 megabytes.
|
12
|
+
|
13
|
+
```python
|
14
|
+
import gradio as gr
|
15
|
+
|
16
|
+
demo = gr.Interface(lambda x: x, "image", "image")
|
17
|
+
|
18
|
+
demo.launch(max_file_size="5mb")
|
19
|
+
# or
|
20
|
+
demo.launch(max_file_size=5 * gr.FileSize.MB)
|
21
|
+
```
|
22
|
+
|
23
|
+

|
24
|
+
|
25
|
+
|
26
|
+
#### Error states can now be cleared
|
27
|
+
|
28
|
+
When a component encounters an error, the error state shown in the UI can now be cleared by clicking on the `x` icon in the top right of the component. This applies to all types of errors, whether it's raised in the UI or the server.
|
29
|
+
|
30
|
+

|
31
|
+
|
32
|
+
Thanks @freddyaboulton!
|
33
|
+
|
34
|
+
### Features
|
35
|
+
|
36
|
+
- [#8056](https://github.com/gradio-app/gradio/pull/8056) [`2e469a5`](https://github.com/gradio-app/gradio/commit/2e469a5f99e52a5011a010f46e47dde7bb0c7140) - Using keys to preserve values between reloads. Thanks @aliabid94!
|
37
|
+
- [#7646](https://github.com/gradio-app/gradio/pull/7646) [`450b8cc`](https://github.com/gradio-app/gradio/commit/450b8cc898f130f15caa3742f65c17b9f7a8f398) - Refactor JS Client. Thanks @hannahblair!
|
38
|
+
- [#8061](https://github.com/gradio-app/gradio/pull/8061) [`17e83c9`](https://github.com/gradio-app/gradio/commit/17e83c958ebb35b3e122ca486067d1bd5ce33a22) - Docs Reorg and Intro Page. Thanks @aliabd!
|
39
|
+
|
40
|
+
### Fixes
|
41
|
+
|
42
|
+
- [#8066](https://github.com/gradio-app/gradio/pull/8066) [`624f9b9`](https://github.com/gradio-app/gradio/commit/624f9b9477f74a581a6c14119234f9efdfcda398) - make gradio dev tools a local dependency rather than bundling. Thanks @pngwn!
|
43
|
+
|
44
|
+
## 0.16.0
|
45
|
+
|
46
|
+
### Features
|
47
|
+
|
48
|
+
- [#7845](https://github.com/gradio-app/gradio/pull/7845) [`dbb7373`](https://github.com/gradio-app/gradio/commit/dbb7373dde69d4ed2741942b5a1898f8620cec24) - ensure `ImageEditor` events work as expected. Thanks @pngwn!
|
49
|
+
|
50
|
+
### Fixes
|
51
|
+
|
52
|
+
- [#7974](https://github.com/gradio-app/gradio/pull/7974) [`79e0aa8`](https://github.com/gradio-app/gradio/commit/79e0aa81c94e755faa6e85d76ac5d5a666313e6a) - Fix heartbeat in the js client to be Lite compatible. Thanks @whitphx!
|
53
|
+
|
3
54
|
## 0.15.1
|
4
55
|
|
5
56
|
### Fixes
|
package/README.md
CHANGED
@@ -1,29 +1,29 @@
|
|
1
1
|
## JavaScript Client Library
|
2
2
|
|
3
|
-
A
|
3
|
+
A JavaScript (and TypeScript) Client to call Gradio APIs.
|
4
4
|
|
5
5
|
## Installation
|
6
6
|
|
7
|
-
The Gradio JavaScript
|
7
|
+
The Gradio JavaScript Client is available on npm as `@gradio/client`. You can install it as below:
|
8
8
|
|
9
|
-
```
|
9
|
+
```shell
|
10
10
|
npm i @gradio/client
|
11
11
|
```
|
12
12
|
|
13
13
|
## Usage
|
14
14
|
|
15
|
-
The JavaScript Gradio Client exposes
|
15
|
+
The JavaScript Gradio Client exposes the Client class, `Client`, along with various other utility functions. `Client` is used to initialise and establish a connection to, or duplicate, a Gradio app.
|
16
16
|
|
17
|
-
### `
|
17
|
+
### `Client`
|
18
18
|
|
19
|
-
The
|
19
|
+
The Client function connects to the API of a hosted Gradio space and returns an object that allows you to make calls to that API.
|
20
20
|
|
21
21
|
The simplest example looks like this:
|
22
22
|
|
23
23
|
```ts
|
24
|
-
import {
|
24
|
+
import { Client } from "@gradio/client";
|
25
25
|
|
26
|
-
const app = await
|
26
|
+
const app = await Client.connect("user/space-name");
|
27
27
|
const result = await app.predict("/predict");
|
28
28
|
```
|
29
29
|
|
@@ -34,7 +34,7 @@ This function accepts two arguments: `source` and `options`:
|
|
34
34
|
This is the url or name of the gradio app whose API you wish to connect to. This parameter is required and should always be a string. For example:
|
35
35
|
|
36
36
|
```ts
|
37
|
-
|
37
|
+
Client.connect("user/space-name");
|
38
38
|
```
|
39
39
|
|
40
40
|
#### `options`
|
@@ -48,23 +48,23 @@ This should be a Hugging Face personal access token and is required if you wish
|
|
48
48
|
Example:
|
49
49
|
|
50
50
|
```ts
|
51
|
-
import {
|
51
|
+
import { Client } from "@gradio/client";
|
52
52
|
|
53
|
-
const app = await
|
53
|
+
const app = await Client.connect("user/space-name", { hf_token: "hf_..." });
|
54
54
|
```
|
55
55
|
|
56
56
|
##### `status_callback`
|
57
57
|
|
58
|
-
This should be a function which will notify
|
58
|
+
This should be a function which will notify you of the status of a space if it is not running. If the gradio API you are connecting to is not awake and running or is not hosted on Hugging Face space then this function will do nothing.
|
59
59
|
|
60
60
|
**Additional context**
|
61
61
|
|
62
62
|
Applications hosted on Hugging Face spaces can be in a number of different states. As spaces are a GitOps tool and will rebuild when new changes are pushed to the repository, they have various building, running and error states. If a space is not 'running' then the function passed as the `status_callback` will notify you of the current state of the space and the status of the space as it changes. Spaces that are building or sleeping can take longer than usual to respond, so you can use this information to give users feedback about the progress of their action.
|
63
63
|
|
64
64
|
```ts
|
65
|
-
import {
|
65
|
+
import { Client, type SpaceStatus } from "@gradio/client";
|
66
66
|
|
67
|
-
const app = await
|
67
|
+
const app = await Client.connect("user/space-name", {
|
68
68
|
// The space_status parameter does not need to be manually annotated, this is just for illustration.
|
69
69
|
space_status: (space_status: SpaceStatus) => console.log(space_status)
|
70
70
|
});
|
@@ -100,9 +100,9 @@ The gradio client returns an object with a number of methods and properties:
|
|
100
100
|
The `predict` method allows you to call an api endpoint and get a prediction result:
|
101
101
|
|
102
102
|
```ts
|
103
|
-
import {
|
103
|
+
import { Client } from "@gradio/client";
|
104
104
|
|
105
|
-
const app = await
|
105
|
+
const app = await Client.connect("user/space-name");
|
106
106
|
const result = await app.predict("/predict");
|
107
107
|
```
|
108
108
|
|
@@ -113,20 +113,20 @@ const result = await app.predict("/predict");
|
|
113
113
|
This is the endpoint for an api request and is required. The default endpoint for a `gradio.Interface` is `"/predict"`. Explicitly named endpoints have a custom name. The endpoint names can be found on the "View API" page of a space.
|
114
114
|
|
115
115
|
```ts
|
116
|
-
import {
|
116
|
+
import { Client } from "@gradio/client";
|
117
117
|
|
118
|
-
const app = await
|
118
|
+
const app = await Client.connect("user/space-name");
|
119
119
|
const result = await app.predict("/predict");
|
120
120
|
```
|
121
121
|
|
122
122
|
##### `payload`
|
123
123
|
|
124
|
-
The `payload` argument is generally
|
124
|
+
The `payload` argument is generally required but this depends on the API itself. If the API endpoint depends on values being passed in then the argument is required for the API request to succeed. The data that should be passed in is detailed on the "View API" page of a space, or accessible via the `view_api()` method of the client.
|
125
125
|
|
126
126
|
```ts
|
127
|
-
import {
|
127
|
+
import { Client } from "@gradio/client";
|
128
128
|
|
129
|
-
const app = await
|
129
|
+
const app = await Client.connect("user/space-name");
|
130
130
|
const result = await app.predict("/predict", [1, "Hello", "friends"]);
|
131
131
|
```
|
132
132
|
|
@@ -135,9 +135,9 @@ const result = await app.predict("/predict", [1, "Hello", "friends"]);
|
|
135
135
|
The `submit` method provides a more flexible way to call an API endpoint, providing you with status updates about the current progress of the prediction as well as supporting more complex endpoint types.
|
136
136
|
|
137
137
|
```ts
|
138
|
-
import {
|
138
|
+
import { Client } from "@gradio/client";
|
139
139
|
|
140
|
-
const app = await
|
140
|
+
const app = await Client.connect("user/space-name");
|
141
141
|
const submission = app.submit("/predict", payload);
|
142
142
|
```
|
143
143
|
|
@@ -179,9 +179,9 @@ interface Status {
|
|
179
179
|
Usage of these subscribe callback looks like this:
|
180
180
|
|
181
181
|
```ts
|
182
|
-
import {
|
182
|
+
import { Client } from "@gradio/client";
|
183
183
|
|
184
|
-
const app = await
|
184
|
+
const app = await Client.connect("user/space-name");
|
185
185
|
const submission = app
|
186
186
|
.submit("/predict", payload)
|
187
187
|
.on("data", (data) => console.log(data))
|
@@ -193,9 +193,9 @@ const submission = app
|
|
193
193
|
The `off` method unsubscribes from a specific event of the submitted job and works similarly to `document.removeEventListener`; both the event name and the original callback must be passed in to successfully unsubscribe:
|
194
194
|
|
195
195
|
```ts
|
196
|
-
import {
|
196
|
+
import { Client } from "@gradio/client";
|
197
197
|
|
198
|
-
const app = await
|
198
|
+
const app = await Client.connect("user/space-name");
|
199
199
|
const handle_data = (data) => console.log(data);
|
200
200
|
|
201
201
|
const submission = app.submit("/predict", payload).on("data", handle_data);
|
@@ -209,9 +209,9 @@ submission.off("/predict", handle_data);
|
|
209
209
|
The `destroy` method will remove all subscriptions to a job, regardless of whether or not they are `"data"` or `"status"` events. This is a convenience method for when you do not want to unsubscribe use the `off` method.
|
210
210
|
|
211
211
|
```js
|
212
|
-
import {
|
212
|
+
import { Client } from "@gradio/client";
|
213
213
|
|
214
|
-
const app = await
|
214
|
+
const app = await Client.connect("user/space-name");
|
215
215
|
const handle_data = (data) => console.log(data);
|
216
216
|
|
217
217
|
const submission = app.submit("/predict", payload).on("data", handle_data);
|
@@ -225,9 +225,9 @@ submission.destroy();
|
|
225
225
|
Certain types of gradio function can run repeatedly and in some cases indefinitely. the `cancel` method will stop such an endpoints and prevent the API from issuing additional updates.
|
226
226
|
|
227
227
|
```ts
|
228
|
-
import {
|
228
|
+
import { Client } from "@gradio/client";
|
229
229
|
|
230
|
-
const app = await
|
230
|
+
const app = await Client.connect("user/space-name");
|
231
231
|
const submission = app
|
232
232
|
.submit("/predict", payload)
|
233
233
|
.on("data", (data) => console.log(data));
|
@@ -242,9 +242,9 @@ submission.cancel();
|
|
242
242
|
The `view_api` method provides details about the API you are connected to. It returns a JavaScript object of all named endpoints, unnamed endpoints and what values they accept and return. This method does not accept arguments.
|
243
243
|
|
244
244
|
```ts
|
245
|
-
import {
|
245
|
+
import { Client } from "@gradio/client";
|
246
246
|
|
247
|
-
const app = await
|
247
|
+
const app = await Client.connect("user/space-name");
|
248
248
|
const api_info = await app.view_api();
|
249
249
|
|
250
250
|
console.log(api_info);
|
@@ -255,9 +255,9 @@ console.log(api_info);
|
|
255
255
|
The `config` property contains the configuration for the gradio application you are connected to. This object may contain useful meta information about the application.
|
256
256
|
|
257
257
|
```ts
|
258
|
-
import {
|
258
|
+
import { Client } from "@gradio/client";
|
259
259
|
|
260
|
-
const app = await
|
260
|
+
const app = await Client.connect("user/space-name");
|
261
261
|
console.log(app.config);
|
262
262
|
```
|
263
263
|
|
@@ -268,9 +268,9 @@ The duplicate function will attempt to duplicate the space that is referenced an
|
|
268
268
|
`duplicate` accepts the same arguments as `client` with the addition of a `private` options property dictating whether the duplicated space should be private or public. A huggingface token is required for duplication to work.
|
269
269
|
|
270
270
|
```ts
|
271
|
-
import {
|
271
|
+
import { Client } from "@gradio/client";
|
272
272
|
|
273
|
-
const app = await duplicate("user/space-name", {
|
273
|
+
const app = await Client.duplicate("user/space-name", {
|
274
274
|
hf_token: "hf_..."
|
275
275
|
});
|
276
276
|
```
|
@@ -292,9 +292,9 @@ Accepts all options that `client` accepts, except `hf_token` is required. [See `
|
|
292
292
|
This is an optional property specific to `duplicate`'s options object and will determine whether the space should be public or private. Spaces duplicated via the `duplicate` method are public by default.
|
293
293
|
|
294
294
|
```ts
|
295
|
-
import {
|
295
|
+
import { Client } from "@gradio/client";
|
296
296
|
|
297
|
-
const app = await duplicate("user/space-name", {
|
297
|
+
const app = await Client.duplicate("user/space-name", {
|
298
298
|
hf_token: "hf_...",
|
299
299
|
private: true
|
300
300
|
});
|
@@ -305,9 +305,9 @@ const app = await duplicate("user/space-name", {
|
|
305
305
|
This is an optional property specific to `duplicate`'s options object and will set the timeout in minutes before the duplicated space will go to sleep.
|
306
306
|
|
307
307
|
```ts
|
308
|
-
import {
|
308
|
+
import { Client } from "@gradio/client";
|
309
309
|
|
310
|
-
const app = await duplicate("user/space-name", {
|
310
|
+
const app = await Client.duplicate("user/space-name", {
|
311
311
|
hf_token: "hf_...",
|
312
312
|
private: true,
|
313
313
|
timeout: 5
|
@@ -322,16 +322,22 @@ Possible hardware options are:
|
|
322
322
|
|
323
323
|
- `"cpu-basic"`
|
324
324
|
- `"cpu-upgrade"`
|
325
|
+
- `"cpu-xl"`
|
325
326
|
- `"t4-small"`
|
326
327
|
- `"t4-medium"`
|
327
328
|
- `"a10g-small"`
|
328
329
|
- `"a10g-large"`
|
330
|
+
- `"a10g-largex2"`
|
331
|
+
- `"a10g-largex4"`
|
329
332
|
- `"a100-large"`
|
333
|
+
- `"zero-a10g"`
|
334
|
+
- `"h100"`
|
335
|
+
- `"h100x8"`
|
330
336
|
|
331
337
|
```ts
|
332
|
-
import {
|
338
|
+
import { Client } from "@gradio/client";
|
333
339
|
|
334
|
-
const app = await duplicate("user/space-name", {
|
340
|
+
const app = await Client.duplicate("user/space-name", {
|
335
341
|
hf_token: "hf_...",
|
336
342
|
private: true,
|
337
343
|
hardware: "a10g-small"
|
package/dist/client.d.ts
CHANGED
@@ -1,74 +1,56 @@
|
|
1
|
-
import {
|
2
|
-
|
3
|
-
|
4
|
-
type event = <K extends EventType>(eventType: K, listener: EventListener<K>) => SubmitReturn;
|
5
|
-
type predict = (endpoint: string | number, data?: unknown[], event_data?: unknown) => Promise<unknown>;
|
6
|
-
export type client_return = {
|
7
|
-
predict: predict;
|
8
|
-
config: Config;
|
9
|
-
submit: (endpoint: string | number, data?: unknown[], event_data?: unknown, trigger_id?: number | null) => SubmitReturn;
|
10
|
-
component_server: (component_id: number, fn_name: string, data: unknown[]) => any;
|
11
|
-
view_api: (c?: Config) => Promise<ApiInfo<JsApiData>>;
|
12
|
-
};
|
13
|
-
type SubmitReturn = {
|
14
|
-
on: event;
|
15
|
-
off: event;
|
16
|
-
cancel: () => Promise<void>;
|
17
|
-
destroy: () => void;
|
18
|
-
};
|
19
|
-
export declare let NodeBlob: any;
|
20
|
-
export declare function duplicate(app_reference: string, options: {
|
21
|
-
hf_token: `hf_${string}`;
|
22
|
-
private?: boolean;
|
23
|
-
status_callback: SpaceStatusCallback;
|
24
|
-
hardware?: (typeof hardware_types)[number];
|
25
|
-
timeout?: number;
|
26
|
-
}): Promise<client_return>;
|
27
|
-
interface Client {
|
28
|
-
post_data: (url: string, body: unknown, token?: `hf_${string}`) => Promise<[PostResponse, number]>;
|
29
|
-
upload_files: (root: string, files: File[], token?: `hf_${string}`, upload_id?: string) => Promise<UploadResponse>;
|
30
|
-
client: (app_reference: string, options: {
|
31
|
-
hf_token?: `hf_${string}`;
|
32
|
-
status_callback?: SpaceStatusCallback;
|
33
|
-
}) => Promise<client_return>;
|
34
|
-
handle_blob: (endpoint: string, data: unknown[], api_info: ApiInfo<JsApiData>, token?: `hf_${string}`) => Promise<unknown[]>;
|
1
|
+
import type { ApiData, ApiInfo, ClientOptions, Config, DuplicateOptions, EndpointInfo, JsApiData, SpaceStatus, Status, SubmitReturn, UploadResponse } from "./types";
|
2
|
+
export declare class NodeBlob extends Blob {
|
3
|
+
constructor(blobParts?: BlobPart[], options?: BlobPropertyBag);
|
35
4
|
}
|
36
|
-
export declare
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
5
|
+
export declare class Client {
|
6
|
+
app_reference: string;
|
7
|
+
options: ClientOptions;
|
8
|
+
config: Config | undefined;
|
9
|
+
api_info: ApiInfo<JsApiData> | undefined;
|
10
|
+
api_map: Record<string, number>;
|
11
|
+
session_hash: string;
|
12
|
+
jwt: string | false;
|
13
|
+
last_status: Record<string, Status["stage"]>;
|
14
|
+
stream_status: {
|
15
|
+
open: boolean;
|
46
16
|
};
|
47
|
-
|
48
|
-
|
17
|
+
pending_stream_messages: Record<string, any[][]>;
|
18
|
+
pending_diff_streams: Record<string, any[][]>;
|
19
|
+
event_callbacks: Record<string, () => Promise<void>>;
|
20
|
+
unclosed_events: Set<string>;
|
21
|
+
heartbeat_event: EventSource | null;
|
22
|
+
fetch_implementation(input: RequestInfo | URL, init?: RequestInit): Promise<Response>;
|
23
|
+
eventSource_factory(url: URL): EventSource | null;
|
24
|
+
view_api: () => Promise<ApiInfo<JsApiData>>;
|
25
|
+
upload_files: (root_url: string, files: (Blob | File)[], upload_id?: string) => Promise<UploadResponse>;
|
26
|
+
handle_blob: (endpoint: string, data: unknown[], endpoint_info: EndpointInfo<ApiData | JsApiData>) => Promise<unknown[]>;
|
27
|
+
post_data: (url: string, body: unknown, additional_headers?: any) => Promise<unknown[]>;
|
28
|
+
submit: (endpoint: string | number, data: unknown[], event_data?: unknown, trigger_id?: number | null) => SubmitReturn;
|
29
|
+
predict: (endpoint: string | number, data?: unknown[], event_data?: unknown) => Promise<unknown>;
|
30
|
+
open_stream: () => void;
|
31
|
+
resolve_config: (endpoint: string) => Promise<Config | undefined>;
|
32
|
+
constructor(app_reference: string, options?: ClientOptions);
|
33
|
+
private init;
|
34
|
+
static connect(app_reference: string, options?: ClientOptions): Promise<Client>;
|
35
|
+
close(): void;
|
36
|
+
static duplicate(app_reference: string, options?: DuplicateOptions): Promise<Client>;
|
37
|
+
private _resolve_config;
|
38
|
+
private config_success;
|
39
|
+
handle_space_success(status: SpaceStatus): Promise<Config | void>;
|
40
|
+
component_server(component_id: number, fn_name: string, data: unknown[] | {
|
41
|
+
binary: boolean;
|
42
|
+
data: Record<string, any>;
|
43
|
+
}): Promise<unknown>;
|
44
|
+
private prepare_return_obj;
|
49
45
|
}
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
}
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
interface ApiInfo<T extends ApiData | JsApiData> {
|
61
|
-
named_endpoints: {
|
62
|
-
[key: string]: EndpointInfo<T>;
|
63
|
-
};
|
64
|
-
unnamed_endpoints: {
|
65
|
-
[key: string]: EndpointInfo<T>;
|
66
|
-
};
|
67
|
-
}
|
68
|
-
export declare function walk_and_store_blobs(param: any, type?: any, path?: any[], root?: boolean, api_info?: any): Promise<{
|
69
|
-
path: string[];
|
70
|
-
type: string;
|
71
|
-
blob: Blob | false;
|
72
|
-
}[]>;
|
73
|
-
export {};
|
46
|
+
/**
|
47
|
+
* @deprecated This method will be removed in v1.0. Use `Client.connect()` instead.
|
48
|
+
* Creates a client instance for interacting with Gradio apps.
|
49
|
+
*
|
50
|
+
* @param {string} app_reference - The reference or URL to a Gradio space or app.
|
51
|
+
* @param {ClientOptions} options - Configuration options for the client.
|
52
|
+
* @returns {Promise<Client>} A promise that resolves to a `Client` instance.
|
53
|
+
*/
|
54
|
+
export declare function client(app_reference: string, options?: ClientOptions): Promise<Client>;
|
55
|
+
export type ClientInstance = Client;
|
74
56
|
//# sourceMappingURL=client.d.ts.map
|
package/dist/client.d.ts.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"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"}
|
@@ -0,0 +1,17 @@
|
|
1
|
+
export declare const HOST_URL = "host";
|
2
|
+
export declare const API_URL = "api/predict/";
|
3
|
+
export declare const SSE_URL_V0 = "queue/join";
|
4
|
+
export declare const SSE_DATA_URL_V0 = "queue/data";
|
5
|
+
export declare const SSE_URL = "queue/data";
|
6
|
+
export declare const SSE_DATA_URL = "queue/join";
|
7
|
+
export declare const UPLOAD_URL = "upload";
|
8
|
+
export declare const LOGIN_URL = "login";
|
9
|
+
export declare const CONFIG_URL = "config";
|
10
|
+
export declare const API_INFO_URL = "info";
|
11
|
+
export declare const RAW_API_INFO_URL = "info?serialize=False";
|
12
|
+
export declare const SPACE_FETCHER_URL = "https://gradio-space-api-fetcher-v2.hf.space/api";
|
13
|
+
export declare const RESET_URL = "reset";
|
14
|
+
export declare const SPACE_URL = "https://hf.space/{}";
|
15
|
+
export declare const QUEUE_FULL_MSG = "This application is too busy. Keep trying!";
|
16
|
+
export declare const BROKEN_CONNECTION_MSG = "Connection errored out.";
|
17
|
+
//# sourceMappingURL=constants.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,QAAQ,SAAS,CAAC;AAC/B,eAAO,MAAM,OAAO,iBAAiB,CAAC;AACtC,eAAO,MAAM,UAAU,eAAe,CAAC;AACvC,eAAO,MAAM,eAAe,eAAe,CAAC;AAC5C,eAAO,MAAM,OAAO,eAAe,CAAC;AACpC,eAAO,MAAM,YAAY,eAAe,CAAC;AACzC,eAAO,MAAM,UAAU,WAAW,CAAC;AACnC,eAAO,MAAM,SAAS,UAAU,CAAC;AACjC,eAAO,MAAM,UAAU,WAAW,CAAC;AACnC,eAAO,MAAM,YAAY,SAAS,CAAC;AACnC,eAAO,MAAM,gBAAgB,yBAAyB,CAAC;AACvD,eAAO,MAAM,iBAAiB,qDACqB,CAAC;AACpD,eAAO,MAAM,SAAS,UAAU,CAAC;AACjC,eAAO,MAAM,SAAS,wBAAwB,CAAC;AAG/C,eAAO,MAAM,cAAc,+CAA+C,CAAC;AAC3E,eAAO,MAAM,qBAAqB,4BAA4B,CAAC"}
|
@@ -0,0 +1,25 @@
|
|
1
|
+
import type { Status } from "../types";
|
2
|
+
import type { ApiData, ApiInfo, Config, JsApiData } from "../types";
|
3
|
+
export declare const RE_SPACE_NAME: RegExp;
|
4
|
+
export declare const RE_SPACE_DOMAIN: RegExp;
|
5
|
+
export declare function process_endpoint(app_reference: string, hf_token?: `hf_${string}`): Promise<{
|
6
|
+
space_id: string | false;
|
7
|
+
host: string;
|
8
|
+
ws_protocol: "ws" | "wss";
|
9
|
+
http_protocol: "http:" | "https:";
|
10
|
+
}>;
|
11
|
+
export declare function transform_api_info(api_info: ApiInfo<ApiData>, config: Config, api_map: Record<string, number>): ApiInfo<JsApiData>;
|
12
|
+
export declare function get_type(type: {
|
13
|
+
type: any;
|
14
|
+
description: string;
|
15
|
+
}, component: string, serializer: string, signature_type: "return" | "parameter"): string | undefined;
|
16
|
+
export declare function get_description(type: {
|
17
|
+
type: any;
|
18
|
+
description: string;
|
19
|
+
}, serializer: string): string;
|
20
|
+
export declare function handle_message(data: any, last_status: Status["stage"]): {
|
21
|
+
type: "hash" | "data" | "update" | "complete" | "generating" | "log" | "none" | "heartbeat" | "unexpected_error";
|
22
|
+
data?: any;
|
23
|
+
status?: Status;
|
24
|
+
};
|
25
|
+
//# sourceMappingURL=api_info.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"api_info.d.ts","sourceRoot":"","sources":["../../src/helpers/api_info.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAEvC,OAAO,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAGpE,eAAO,MAAM,aAAa,QAAqB,CAAC;AAChD,eAAO,MAAM,eAAe,QAAwB,CAAC;AAErD,wBAAsB,gBAAgB,CACrC,aAAa,EAAE,MAAM,EACrB,QAAQ,CAAC,EAAE,MAAM,MAAM,EAAE,GACvB,OAAO,CAAC;IACV,QAAQ,EAAE,MAAM,GAAG,KAAK,CAAC;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,IAAI,GAAG,KAAK,CAAC;IAC1B,aAAa,EAAE,OAAO,GAAG,QAAQ,CAAC;CAClC,CAAC,CA4CD;AAED,wBAAgB,kBAAkB,CACjC,QAAQ,EAAE,OAAO,CAAC,OAAO,CAAC,EAC1B,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAC7B,OAAO,CAAC,SAAS,CAAC,CAiDpB;AAED,wBAAgB,QAAQ,CACvB,IAAI,EAAE;IAAE,IAAI,EAAE,GAAG,CAAC;IAAC,WAAW,EAAE,MAAM,CAAA;CAAE,EACxC,SAAS,EAAE,MAAM,EACjB,UAAU,EAAE,MAAM,EAClB,cAAc,EAAE,QAAQ,GAAG,WAAW,GACpC,MAAM,GAAG,SAAS,CAiCpB;AAED,wBAAgB,eAAe,CAC9B,IAAI,EAAE;IAAE,IAAI,EAAE,GAAG,CAAC;IAAC,WAAW,EAAE,MAAM,CAAA;CAAE,EACxC,UAAU,EAAE,MAAM,GAChB,MAAM,CASR;AAED,wBAAgB,cAAc,CAC7B,IAAI,EAAE,GAAG,EACT,WAAW,EAAE,MAAM,CAAC,OAAO,CAAC,GAC1B;IACF,IAAI,EACD,MAAM,GACN,MAAM,GACN,QAAQ,GACR,UAAU,GACV,YAAY,GACZ,KAAK,GACL,MAAM,GACN,WAAW,GACX,kBAAkB,CAAC;IACtB,IAAI,CAAC,EAAE,GAAG,CAAC;IACX,MAAM,CAAC,EAAE,MAAM,CAAC;CAChB,CAgHA"}
|
@@ -0,0 +1,8 @@
|
|
1
|
+
import type { ApiData, BlobRef, Config, EndpointInfo, JsApiData, ParamType } from "../types";
|
2
|
+
export declare function update_object(object: {
|
3
|
+
[x: string]: any;
|
4
|
+
}, newValue: any, stack: (string | number)[]): void;
|
5
|
+
export declare function walk_and_store_blobs(param: ParamType, type?: string | undefined, path?: string[], root?: boolean, endpoint_info?: EndpointInfo<ApiData | JsApiData> | undefined): Promise<BlobRef[]>;
|
6
|
+
export declare function skip_queue(id: number, config: Config): boolean;
|
7
|
+
export declare function post_message<Res = any>(message: any, origin: string): Promise<Res>;
|
8
|
+
//# sourceMappingURL=data.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"data.d.ts","sourceRoot":"","sources":["../../src/helpers/data.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACX,OAAO,EACP,OAAO,EACP,MAAM,EACN,YAAY,EACZ,SAAS,EACT,SAAS,EACT,MAAM,UAAU,CAAC;AAElB,wBAAgB,aAAa,CAC5B,MAAM,EAAE;IAAE,CAAC,CAAC,EAAE,MAAM,GAAG,GAAG,CAAA;CAAE,EAC5B,QAAQ,EAAE,GAAG,EACb,KAAK,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,GACxB,IAAI,CAgBN;AAED,wBAAsB,oBAAoB,CACzC,KAAK,EAAE,SAAS,EAChB,IAAI,GAAE,MAAM,GAAG,SAAqB,EACpC,IAAI,GAAE,MAAM,EAAO,EACnB,IAAI,UAAQ,EACZ,aAAa,GAAE,YAAY,CAAC,OAAO,GAAG,SAAS,CAAC,GAAG,SAAqB,GACtE,OAAO,CAAC,OAAO,EAAE,CAAC,CAoDpB;AAED,wBAAgB,UAAU,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAM9D;AAID,wBAAgB,YAAY,CAAC,GAAG,GAAG,GAAG,EACrC,OAAO,EAAE,GAAG,EACZ,MAAM,EAAE,MAAM,GACZ,OAAO,CAAC,GAAG,CAAC,CASd"}
|
@@ -1,4 +1,5 @@
|
|
1
|
-
import type { Config } from "
|
1
|
+
import type { Config } from "../types";
|
2
|
+
import { Client } from "..";
|
2
3
|
/**
|
3
4
|
* This function is used to resolve the URL for making requests when the app has a root path.
|
4
5
|
* The root path could be a path suffix like "/app" which is appended to the end of the base URL. Or
|
@@ -10,24 +11,12 @@ import type { Config } from "./types.js";
|
|
10
11
|
* @returns {string} the resolved URL
|
11
12
|
*/
|
12
13
|
export declare function resolve_root(base_url: string, root_path: string, prioritize_base: boolean): string;
|
14
|
+
export declare function get_jwt(space: string, token: `hf_${string}`): Promise<string | false>;
|
15
|
+
export declare function map_names_to_ids(fns: Config["dependencies"]): Record<string, number>;
|
16
|
+
export declare function resolve_config(this: Client, endpoint: string): Promise<Config | undefined>;
|
13
17
|
export declare function determine_protocol(endpoint: string): {
|
14
18
|
ws_protocol: "ws" | "wss";
|
15
19
|
http_protocol: "http:" | "https:";
|
16
20
|
host: string;
|
17
21
|
};
|
18
|
-
|
19
|
-
export declare const RE_SPACE_DOMAIN: RegExp;
|
20
|
-
export declare function process_endpoint(app_reference: string, token?: `hf_${string}`): Promise<{
|
21
|
-
space_id: string | false;
|
22
|
-
host: string;
|
23
|
-
ws_protocol: "ws" | "wss";
|
24
|
-
http_protocol: "http:" | "https:";
|
25
|
-
}>;
|
26
|
-
export declare function map_names_to_ids(fns: Config["dependencies"]): Record<string, number>;
|
27
|
-
export declare function discussions_enabled(space_id: string): Promise<boolean>;
|
28
|
-
export declare function get_space_hardware(space_id: string, token: `hf_${string}`): Promise<(typeof hardware_types)[number]>;
|
29
|
-
export declare function set_space_hardware(space_id: string, new_hardware: (typeof hardware_types)[number], token: `hf_${string}`): Promise<(typeof hardware_types)[number]>;
|
30
|
-
export declare function set_space_timeout(space_id: string, timeout: number, token: `hf_${string}`): Promise<number>;
|
31
|
-
export declare const hardware_types: readonly ["cpu-basic", "cpu-upgrade", "t4-small", "t4-medium", "a10g-small", "a10g-large", "a100-large"];
|
32
|
-
export declare function apply_diff(obj: any, diff: [string, (number | string)[], any][]): any;
|
33
|
-
//# sourceMappingURL=utils.d.ts.map
|
22
|
+
//# sourceMappingURL=init_helpers.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"init_helpers.d.ts","sourceRoot":"","sources":["../../src/helpers/init_helpers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAEvC,OAAO,EAAE,MAAM,EAAE,MAAM,IAAI,CAAC;AAE5B;;;;;;;;;GASG;AACH,wBAAgB,YAAY,CAC3B,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,MAAM,EACjB,eAAe,EAAE,OAAO,GACtB,MAAM,CAKR;AAED,wBAAsB,OAAO,CAC5B,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,MAAM,MAAM,EAAE,GACnB,OAAO,CAAC,MAAM,GAAG,KAAK,CAAC,CAezB;AAED,wBAAgB,gBAAgB,CAC/B,GAAG,EAAE,MAAM,CAAC,cAAc,CAAC,GACzB,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAOxB;AAED,wBAAsB,cAAc,CACnC,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,MAAM,GACd,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAoC7B;AAED,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,GAAG;IACrD,WAAW,EAAE,IAAI,GAAG,KAAK,CAAC;IAC1B,aAAa,EAAE,OAAO,GAAG,QAAQ,CAAC;IAClC,IAAI,EAAE,MAAM,CAAC;CACb,CAgCA"}
|
@@ -0,0 +1,7 @@
|
|
1
|
+
import type { SpaceStatusCallback } from "../types";
|
2
|
+
export declare function check_space_status(id: string, type: "subdomain" | "space_name", status_callback: SpaceStatusCallback): Promise<void>;
|
3
|
+
export declare function discussions_enabled(space_id: string): Promise<boolean>;
|
4
|
+
export declare function get_space_hardware(space_id: string, hf_token?: `hf_${string}` | undefined): Promise<(typeof hardware_types)[number]>;
|
5
|
+
export declare function set_space_timeout(space_id: string, timeout: number, hf_token?: `hf_${string}`): Promise<any>;
|
6
|
+
export declare const hardware_types: readonly ["cpu-basic", "cpu-upgrade", "cpu-xl", "t4-small", "t4-medium", "a10g-small", "a10g-large", "a10g-largex2", "a10g-largex4", "a100-large", "zero-a10g", "h100", "h100x8"];
|
7
|
+
//# sourceMappingURL=spaces.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"spaces.d.ts","sourceRoot":"","sources":["../../src/helpers/spaces.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAEpD,wBAAsB,kBAAkB,CACvC,EAAE,EAAE,MAAM,EACV,IAAI,EAAE,WAAW,GAAG,YAAY,EAChC,eAAe,EAAE,mBAAmB,GAClC,OAAO,CAAC,IAAI,CAAC,CAqFf;AAID,wBAAsB,mBAAmB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAe5E;AAED,wBAAsB,kBAAkB,CACvC,QAAQ,EAAE,MAAM,EAChB,QAAQ,CAAC,EAAE,MAAM,MAAM,EAAE,GAAG,SAAS,GACnC,OAAO,CAAC,CAAC,OAAO,cAAc,CAAC,CAAC,MAAM,CAAC,CAAC,CAqB1C;AAED,wBAAsB,iBAAiB,CACtC,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,MAAM,EACf,QAAQ,CAAC,EAAE,MAAM,MAAM,EAAE,GACvB,OAAO,CAAC,GAAG,CAAC,CAiCd;AAED,eAAO,MAAM,cAAc,mLAcjB,CAAC"}
|
package/dist/index.d.ts
CHANGED
@@ -1,5 +1,9 @@
|
|
1
|
-
export {
|
2
|
-
export
|
3
|
-
export
|
4
|
-
export {
|
1
|
+
export { Client } from "./client";
|
2
|
+
export { predict } from "./utils/predict";
|
3
|
+
export { submit } from "./utils/submit";
|
4
|
+
export { upload_files } from "./utils/upload_files";
|
5
|
+
export { FileData, upload, prepare_files } from "./upload";
|
6
|
+
export type { SpaceStatus, Status, client_return, UploadResponse } from "./types";
|
7
|
+
export { client } from "./client";
|
8
|
+
export { duplicate } from "./utils/duplicate";
|
5
9
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAC1C,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AACxC,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAE3D,YAAY,EACX,WAAW,EACX,MAAM,EACN,aAAa,EACb,cAAc,EACd,MAAM,SAAS,CAAC;AAGjB,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC"}
|