Skip to content

Commit d3b27c8

Browse files
skeptrunedevcdxker
authored andcommitted
feat(ts-sdk): add editImage test case with image editing functionality
1 parent 4850110 commit d3b27c8

2 files changed

Lines changed: 28 additions & 3 deletions

File tree

clients/ts-sdk/src/__tests__/constants.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ export const TRIEVE = new TrieveSDK({
1010

1111
// export const TRIEVE = new TrieveSDK({
1212
// baseUrl: "http://localhost:8090",
13-
// organizationId: "310e51a2-4bb4-4317-9661-b5ef3ca85713",
14-
// datasetId: "e390d3b2-7c51-4695-a3ec-4487c32220b0",
13+
// organizationId: "ad2a06d2-c229-4322-a77c-ed45b2a39d94",
14+
// datasetId: "af0893e8-9e1c-4bfd-8ceb-ed9863fc96fb",
1515
// apiKey: "admin",
1616
// });
1717

clients/ts-sdk/src/functions/message/message.test.ts

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { beforeAll, describe, expect, expectTypeOf } from "vitest";
22
import { TrieveSDK } from "../../sdk";
3-
import { Message } from "../../types.gen";
3+
import { ImageEditResponse, Message } from "../../types.gen";
44
import { TRIEVE } from "../../__tests__/constants";
55
import { test } from "../../__tests__/utils";
66

@@ -169,4 +169,29 @@ describe("Message Tests", async () => {
169169
shirts: false,
170170
});
171171
});
172+
173+
test("editImage", async () => {
174+
const prompt = `Create a lovely room design where specifically the countertop is replaced with the Bahia Granite material`;
175+
const data = await trieve.editImage({
176+
input_images: [
177+
{
178+
image_src: {
179+
url: "https://trieve.b-cdn.net/sdk-tests/102024_KIT_80_PS_4.webp",
180+
},
181+
file_name: "room_photo",
182+
},
183+
{
184+
image_src: {
185+
url: "https://trieve.b-cdn.net/sdk-tests/black-granite-countertop.webp",
186+
},
187+
file_name: "picture_of_sample",
188+
},
189+
],
190+
prompt: prompt,
191+
quality: "medium",
192+
n: 1,
193+
});
194+
195+
expectTypeOf(data).toEqualTypeOf<ImageEditResponse>();
196+
});
172197
});

0 commit comments

Comments
 (0)