Home
About
Blog
Products
Forum
Support
Contact
Sunbelt Computer Software
PL/B Language Development and Support
Home
About
Blog
Products
Forum
Support
Contact
replicate-javascript/index.d.ts at main · Radovenchyk/replicate-javascript · GitHub
Skip to content
Navigation Menu
Sign in
Products
Platform
GitHub
Repository hosting, code review, and collaboration
Copilot
AI coding agent for tasks, projects and automated work
Build & Ship
Actions
CI/CD and automation
Code Quality
Quality analysis, fixes, and enforcement
Codespaces
Cloud development environments
Secure
Code Security
Vulnerability detection and remediation
Secret Protection
Secret scanning and leak prevention
All Features
Developers
Learn
Documentation
Training
Certifications
Build
Build with Copilot
Customize Copilot
Integrations
Explore
Trending repos
GitHub Sponsors
Events
Changelog
Changelog
Your source for the latest features, improvements, and fixes across GitHub products, all in one place.
Businesses
By Stage
Enterprises
Team
Startups
Nonprofits
By Industry
Healthcare
Financial services
Manufacturing
Government
See all industries
Evaluate GitHub
Why GitHub
Customer Stories
Business insights
Trust Center
Add-ons
GitHub Advanced Security
Enterprise-grade code security
Copilot for business
Enterprise-grade AI features
Premium Support
Enterprise-grade 24/7 support
Resources
Learn & Connect
Documentation
Resource center
Blog
Events & webinars
Community Forum
Customer Stories
Integrations
Support
Customer support
Training
GitHub Status
Company
About
Partners
Changelog
GitHub Universe
GitHub Universe
The event for developers, by developers — talks, workshops, and what’s next for GitHub.
Pricing
Search
/
Sign in
Sign up
Appearance settings
You signed in with another tab or window.
Reload
to refresh your session.
You signed out in another tab or window.
Reload
to refresh your session.
You switched accounts on another tab or window.
Reload
to refresh your session.
Dismiss alert
{{ message }}
Radovenchyk
replicate-javascript
Repository navigation
Code
Pull requests
Actions
Projects
Security and quality
Insights
More
items
Files
Expand file tree
main
Breadcrumbs
replicate-javascript
/
index.d.ts
Copy path
Blame
More file actions
Blame
More file actions
Latest commit
History
History
History
347 lines (315 loc) · 8.06 KB
main
Breadcrumbs
replicate-javascript
/
index.d.ts
Copy path
Top
File metadata and controls
Code
Blame
347 lines (315 loc) · 8.06 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
declare
module
"replicate"
{
type
Status
=
"starting"
|
"processing"
|
"succeeded"
|
"failed"
|
"canceled"
;
type
Visibility
=
"public"
|
"private"
;
type
WebhookEventType
=
"start"
|
"output"
|
"logs"
|
"completed"
;
export
interface
ApiError
extends
Error
{
request
:
Request
;
response
:
Response
;
}
export
interface
Account
{
type
:
"user"
|
"organization"
;
username
:
string
;
name
:
string
;
github_url
?:
string
;
}
export
interface
Collection
{
name
:
string
;
slug
:
string
;
description
:
string
;
models
?:
Model
[
]
;
}
export
interface
Deployment
{
owner
:
string
;
name
:
string
;
current_release
:
{
number
:
number
;
model
:
string
;
version
:
string
;
created_at
:
string
;
created_by
:
Account
;
configuration
:
{
hardware
:
string
;
min_instances
:
number
;
max_instances
:
number
;
}
;
}
;
}
export
interface
FileObject
{
id
:
string
;
name
:
string
;
content_type
:
string
;
size
:
number
;
etag
:
string
;
checksum
:
string
;
metadata
:
Record
<
string
,
unknown
>
;
created_at
:
string
;
expires_at
:
string
|
null
;
urls
:
{
get
:
string
;
}
;
}
export
interface
Hardware
{
sku
:
string
;
name
:
string
;
}
export
interface
Model
{
url
:
string
;
owner
:
string
;
name
:
string
;
description
?:
string
;
visibility
:
"public"
|
"private"
;
github_url
?:
string
;
paper_url
?:
string
;
license_url
?:
string
;
run_count
:
number
;
cover_image_url
?:
string
;
default_example
?:
Prediction
;
latest_version
?:
ModelVersion
;
}
export
interface
ModelVersion
{
id
:
string
;
created_at
:
string
;
cog_version
:
string
;
openapi_schema
:
object
;
}
export
interface
Prediction
{
id
:
string
;
status
:
Status
;
model
:
string
;
version
:
string
;
input
:
object
;
output
?:
any
;
source
:
"api"
|
"web"
;
error
?:
any
;
logs
?:
string
;
metrics
?:
{
predict_time
?:
number
;
}
;
webhook
?:
string
;
webhook_events_filter
?:
WebhookEventType
[
]
;
created_at
:
string
;
started_at
?:
string
;
completed_at
?:
string
;
urls
:
{
get
:
string
;
cancel
:
string
;
stream
?:
string
;
}
;
}
export
type
Training
=
Prediction
;
export
type
FileEncodingStrategy
=
"default"
|
"upload"
|
"data-uri"
;
export
interface
Page
<
T
>
{
previous
?:
string
;
next
?:
string
;
results
:
T
[
]
;
}
export
interface
ServerSentEvent
{
event
:
string
;
data
:
string
;
id
?:
string
;
retry
?:
number
;
}
export
interface
WebhookSecret
{
key
:
string
;
}
export
default
class
Replicate
{
constructor
(
options
?:
{
auth
?:
string
;
userAgent
?:
string
;
baseUrl
?:
string
;
fetch
?:
(
input
:
Request
|
string
,
init
?:
RequestInit
)
=>
Promise
<
Response
>
;
fileEncodingStrategy
?:
FileEncodingStrategy
;
}
)
;
auth
:
string
;
userAgent
?:
string
;
baseUrl
?:
string
;
fetch
:
(
input
:
Request
|
string
,
init
?:
RequestInit
)
=>
Promise
<
Response
>
;
fileEncodingStrategy
:
FileEncodingStrategy
;
run
(
identifier
: `${
string
}
/${
string
}
`
|
`${
string
}
/${
string
}
:${
string
}
`
,
options
:
{
input
:
object
;
wait
?:
{
interval
?:
number
}
;
webhook
?:
string
;
webhook_events_filter
?:
WebhookEventType
[
]
;
signal
?:
AbortSignal
;
}
,
progress
?:
(
prediction
:
Prediction
)
=>
void
)
:
Promise
<
object
>
;
stream
(
identifier
: `${
string
}
/${
string
}
`
|
`${
string
}
/${
string
}
:${
string
}
`
,
options
:
{
input
:
object
;
webhook
?:
string
;
webhook_events_filter
?:
WebhookEventType
[
]
;
signal
?:
AbortSignal
;
}
)
:
AsyncGenerator
<
ServerSentEvent
>
;
request
(
route
:
string
|
URL
,
options
:
{
method
?:
string
;
headers
?:
object
|
Headers
;
params
?:
object
;
data
?:
object
;
}
)
:
Promise
<
Response
>
;
paginate
<
T
>
(
endpoint
:
(
)
=>
Promise
<
Page
<
T
>
>
)
:
AsyncGenerator
<
[
T
]
>
;
wait
(
prediction
:
Prediction
,
options
?:
{
interval
?:
number
;
}
,
stop
?:
(
prediction
:
Prediction
)
=>
Promise
<
boolean
>
)
:
Promise
<
Prediction
>
;
accounts
:
{
current
(
)
:
Promise
<
Account
>
;
}
;
collections
:
{
list
(
)
:
Promise
<
Page
<
Collection
>
>
;
get
(
collection_slug
:
string
)
:
Promise
<
Collection
>
;
}
;
deployments
:
{
predictions
:
{
create
(
deployment_owner
:
string
,
deployment_name
:
string
,
options
:
{
input
:
object
;
stream
?:
boolean
;
webhook
?:
string
;
webhook_events_filter
?:
WebhookEventType
[
]
;
}
)
:
Promise
<
Prediction
>
;
}
;
get
(
deployment_owner
:
string
,
deployment_name
:
string
)
:
Promise
<
Deployment
>
;
create
(
deployment_config
:
{
name
:
string
;
model
:
string
;
version
:
string
;
hardware
:
string
;
min_instances
:
number
;
max_instances
:
number
;
}
)
:
Promise
<
Deployment
>
;
update
(
deployment_owner
:
string
,
deployment_name
:
string
,
deployment_config
:
{
version
?:
string
;
hardware
?:
string
;
min_instances
?:
number
;
max_instances
?:
number
;
}
&
(
|
{
version
:
string
}
|
{
hardware
:
string
}
|
{
min_instances
:
number
}
|
{
max_instances
:
number
}
)
)
:
Promise
<
Deployment
>
;
delete
(
deployment_owner
:
string
,
deployment_name
:
string
)
:
Promise
<
boolean
>
;
list
(
)
:
Promise
<
Page
<
Deployment
>
>
;
}
;
files
:
{
create
(
file
:
Blob
|
Buffer
,
metadata
?:
Record
<
string
,
unknown
>
)
:
Promise
<
FileObject
>
;
list
(
)
:
Promise
<
Page
<
FileObject
>
>
;
get
(
file_id
:
string
)
:
Promise
<
FileObject
>
;
delete
(
file_id
:
string
)
:
Promise
<
boolean
>
;
}
;
hardware
:
{
list
(
)
:
Promise
<
Hardware
[
]
>
;
}
;
models
:
{
get
(
model_owner
:
string
,
model_name
:
string
)
:
Promise
<
Model
>
;
list
(
)
:
Promise
<
Page
<
Model
>
>
;
create
(
model_owner
:
string
,
model_name
:
string
,
options
:
{
visibility
:
Visibility
;
hardware
:
string
;
description
?:
string
;
github_url
?:
string
;
paper_url
?:
string
;
license_url
?:
string
;
cover_image_url
?:
string
;
}
)
:
Promise
<
Model
>
;
versions
:
{
list
(
model_owner
:
string
,
model_name
:
string
)
:
Promise
<
ModelVersion
[
]
>
;
get
(
model_owner
:
string
,
model_name
:
string
,
version_id
:
string
)
:
Promise
<
ModelVersion
>
;
}
;
search
(
query
:
string
)
:
Promise
<
Page
<
Model
>
>
;
}
;
predictions
:
{
create
(
options
:
{
model
?:
string
;
version
?:
string
;
input
:
object
;
stream
?:
boolean
;
webhook
?:
string
;
webhook_events_filter
?:
WebhookEventType
[
]
;
}
&
(
{
version
:
string
}
|
{
model
:
string
}
)
)
:
Promise
<
Prediction
>
;
get
(
prediction_id
:
string
)
:
Promise
<
Prediction
>
;
cancel
(
prediction_id
:
string
)
:
Promise
<
Prediction
>
;
list
(
)
:
Promise
<
Page
<
Prediction
>
>
;
}
;
trainings
:
{
create
(
model_owner
:
string
,
model_name
:
string
,
version_id
:
string
,
options
:
{
destination
: `${
string
}
/${
string
}
`
;
input
:
object
;
webhook
?:
string
;
webhook_events_filter
?:
WebhookEventType
[
]
;
}
)
:
Promise
<
Training
>
;
get
(
training_id
:
string
)
:
Promise
<
Training
>
;
cancel
(
training_id
:
string
)
:
Promise
<
Training
>
;
list
(
)
:
Promise
<
Page
<
Training
>
>
;
}
;
webhooks
:
{
default
:
{
secret
:
{
get
(
)
:
Promise
<
WebhookSecret
>
;
}
;
}
;
}
;
}
export
function
validateWebhook
(
requestData
:
|
Request
|
{
id
?:
string
;
timestamp
?:
string
;
body
:
string
;
secret
?:
string
;
signature
?:
string
;
}
,
secret
:
string
)
:
Promise
<
boolean
>
;
export
function
parseProgressFromLogs
(
logs
:
Prediction
|
string
)
:
{
percentage
:
number
;
current
:
number
;
total
:
number
;
}
|
null
;
}
You can’t perform that action at this time.