Skip to content

Commit a5aa64a

Browse files
feat(api): api update
1 parent 6df1fd6 commit a5aa64a

File tree

3 files changed

+30
-7
lines changed

3 files changed

+30
-7
lines changed

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 30
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/replicate%2Freplicate-client-2788217b7ad7d61d1a77800bc5ff12a6810f1692d4d770b72fa8f898c6a055ab.yml
3-
openapi_spec_hash: 4423bf747e228484547b441468a9f156
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/replicate%2Freplicate-client-0d7d82bff8a18b03e0cd1cbf8609c3026bb07db851bc6f9166032045a9925eea.yml
3+
openapi_spec_hash: 8ce211dfa6fece24b1413e91ba55210a
44
config_hash: 2e6a171ce57a4a6a8e8dcd3dd893d8cc

src/replicate/resources/predictions.py

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ def create(
7373
7474
```console
7575
curl -s -X POST -H 'Prefer: wait' \\
76-
-d '{"version": "5c7d5dc6dd8bf75c1acaa8565735e7986bc5b66206b55cca93cb72c9bf15ccaa", "input": {"text": "Alice"}}' \\
76+
-d '{"version": "replicate/hello-world:5c7d5dc6dd8bf75c1acaa8565735e7986bc5b66206b55cca93cb72c9bf15ccaa", "input": {"text": "Alice"}}' \\
7777
-H "Authorization: Bearer $REPLICATE_API_TOKEN" \\
7878
-H 'Content-Type: application/json' \\
7979
https://api.replicate.com/v1/predictions
@@ -110,7 +110,14 @@ def create(
110110
- you don't want to upload and host the file somewhere
111111
- you don't need to use the file again (Replicate will not store it)
112112
113-
version: The ID of the model version that you want to run.
113+
version: The ID of the model version that you want to run. This can be specified in two
114+
formats:
115+
116+
1. Just the 64-character version ID:
117+
`9dcd6d78e7c6560c340d916fe32e9f24aabfa331e5cce95fe31f77fb03121426`
118+
2. Full model identifier with version ID in the format `{owner}/{model}:{id}`.
119+
For example,
120+
`replicate/hello-world:9dcd6d78e7c6560c340d916fe32e9f24aabfa331e5cce95fe31f77fb03121426`
114121
115122
stream: **This field is deprecated.**
116123
@@ -484,7 +491,7 @@ async def create(
484491
485492
```console
486493
curl -s -X POST -H 'Prefer: wait' \\
487-
-d '{"version": "5c7d5dc6dd8bf75c1acaa8565735e7986bc5b66206b55cca93cb72c9bf15ccaa", "input": {"text": "Alice"}}' \\
494+
-d '{"version": "replicate/hello-world:5c7d5dc6dd8bf75c1acaa8565735e7986bc5b66206b55cca93cb72c9bf15ccaa", "input": {"text": "Alice"}}' \\
488495
-H "Authorization: Bearer $REPLICATE_API_TOKEN" \\
489496
-H 'Content-Type: application/json' \\
490497
https://api.replicate.com/v1/predictions
@@ -521,7 +528,14 @@ async def create(
521528
- you don't want to upload and host the file somewhere
522529
- you don't need to use the file again (Replicate will not store it)
523530
524-
version: The ID of the model version that you want to run.
531+
version: The ID of the model version that you want to run. This can be specified in two
532+
formats:
533+
534+
1. Just the 64-character version ID:
535+
`9dcd6d78e7c6560c340d916fe32e9f24aabfa331e5cce95fe31f77fb03121426`
536+
2. Full model identifier with version ID in the format `{owner}/{model}:{id}`.
537+
For example,
538+
`replicate/hello-world:9dcd6d78e7c6560c340d916fe32e9f24aabfa331e5cce95fe31f77fb03121426`
525539
526540
stream: **This field is deprecated.**
527541

src/replicate/types/prediction_create_params.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,16 @@ class PredictionCreateParams(TypedDict, total=False):
3737
"""
3838

3939
version: Required[str]
40-
"""The ID of the model version that you want to run."""
40+
"""The ID of the model version that you want to run.
41+
42+
This can be specified in two formats:
43+
44+
1. Just the 64-character version ID:
45+
`9dcd6d78e7c6560c340d916fe32e9f24aabfa331e5cce95fe31f77fb03121426`
46+
2. Full model identifier with version ID in the format `{owner}/{model}:{id}`.
47+
For example,
48+
`replicate/hello-world:9dcd6d78e7c6560c340d916fe32e9f24aabfa331e5cce95fe31f77fb03121426`
49+
"""
4150

4251
stream: bool
4352
"""**This field is deprecated.**

0 commit comments

Comments
 (0)