Skip to content

Commit 2b02d20

Browse files
authored
Add model field to Prediction type definition (#160)
1 parent 7dad954 commit 2b02d20

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

index.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ declare module 'replicate' {
4545
export interface Prediction {
4646
id: string;
4747
status: Status;
48+
model: string;
4849
version: string;
4950
input: object;
5051
output?: any;

index.test.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,7 @@ describe('Replicate client', () => {
161161
.post('/predictions')
162162
.reply(200, {
163163
id: 'ufawqhfynnddngldkgtslldrkq',
164+
model: 'replicate/hello-world',
164165
version:
165166
'5c7d5dc6dd8bf75c1acaa8565735e7986bc5b66206b55cca93cb72c9bf15ccaa',
166167
urls: {
@@ -290,6 +291,7 @@ describe('Replicate client', () => {
290291
.get('/predictions/rrr4z55ocneqzikepnug6xezpe')
291292
.reply(200, {
292293
id: 'rrr4z55ocneqzikepnug6xezpe',
294+
model: 'stability-ai/stable-diffusion',
293295
version:
294296
'be04660a5b93ef2aff61e3668dedb4cbeb14941e62a3fd5998364a32d613e35e',
295297
urls: {
@@ -361,6 +363,7 @@ describe('Replicate client', () => {
361363
.post('/predictions/ufawqhfynnddngldkgtslldrkq/cancel')
362364
.reply(200, {
363365
id: 'ufawqhfynnddngldkgtslldrkq',
366+
model: 'replicate/hello-world',
364367
version:
365368
'5c7d5dc6dd8bf75c1acaa8565735e7986bc5b66206b55cca93cb72c9bf15ccaa',
366369
urls: {
@@ -400,6 +403,7 @@ describe('Replicate client', () => {
400403
results: [
401404
{
402405
id: 'jpzd7hm5gfcapbfyt4mqytarku',
406+
model: 'stability-ai/stable-diffusion',
403407
version:
404408
'b21cbe271e65c1718f2999b038c18b45e21e4fba961181fbfae9342fc53b9e05',
405409
urls: {
@@ -457,7 +461,7 @@ describe('Replicate client', () => {
457461
)
458462
.reply(200, {
459463
id: 'zz4ibbonubfz7carwiefibzgga',
460-
version: '{version}',
464+
version: '632231d0d49d34d5c4633bd838aee3d81d936e59a886fbf28524702003b4c532',
461465
status: 'starting',
462466
input: {
463467
text: '...',
@@ -576,6 +580,7 @@ describe('Replicate client', () => {
576580
results: [
577581
{
578582
id: 'jpzd7hm5gfcapbfyt4mqytarku',
583+
model: 'stability-ai/sdxl',
579584
version:
580585
'b21cbe271e65c1718f2999b038c18b45e21e4fba961181fbfae9342fc53b9e05',
581586
urls: {
@@ -631,6 +636,7 @@ describe('Replicate client', () => {
631636
.post('/deployments/replicate/greeter/predictions')
632637
.reply(200, {
633638
id: 'mfrgcyzzme2wkmbwgzrgmntcg',
639+
model: 'replicate/hello-world',
634640
version:
635641
'5c7d5dc6dd8bf75c1acaa8565735e7986bc5b66206b55cca93cb72c9bf15ccaa',
636642
urls: {

0 commit comments

Comments
 (0)