Skip to content

Commit

Permalink
chore(internal): codegen related update
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-bot committed Sep 16, 2024
1 parent af1190c commit d7fc06e
Showing 1 changed file with 6 additions and 11 deletions.
17 changes: 6 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,9 @@ const client = new RunwayML({
});

async function main() {
const imageToVideoCreateResponse = await client.imageToVideo.create({
model: 'REPLACE_ME',
promptImage: 'REPLACE_ME',
});
const imageToVideo = await client.imageToVideo.create({ model: 'REPLACE_ME', promptImage: 'REPLACE_ME' });

console.log(imageToVideoCreateResponse.id);
console.log(imageToVideo.id);
}

main();
Expand All @@ -55,9 +52,7 @@ const client = new RunwayML({

async function main() {
const params: RunwayML.ImageToVideoCreateParams = { model: 'REPLACE_ME', promptImage: 'REPLACE_ME' };
const imageToVideoCreateResponse: RunwayML.ImageToVideoCreateResponse = await client.imageToVideo.create(
params,
);
const imageToVideo: RunwayML.ImageToVideoCreateResponse = await client.imageToVideo.create(params);
}

main();
Expand All @@ -74,7 +69,7 @@ a subclass of `APIError` will be thrown:
<!-- prettier-ignore -->
```ts
async function main() {
const imageToVideoCreateResponse = await client.imageToVideo
const imageToVideo = await client.imageToVideo
.create({ model: 'REPLACE_ME', promptImage: 'REPLACE_ME' })
.catch(async (err) => {
if (err instanceof RunwayML.APIError) {
Expand Down Expand Up @@ -163,11 +158,11 @@ const response = await client.imageToVideo
console.log(response.headers.get('X-My-Header'));
console.log(response.statusText); // access the underlying Response object

const { data: imageToVideoCreateResponse, response: raw } = await client.imageToVideo
const { data: imageToVideo, response: raw } = await client.imageToVideo
.create({ model: 'REPLACE_ME', promptImage: 'REPLACE_ME' })
.withResponse();
console.log(raw.headers.get('X-My-Header'));
console.log(imageToVideoCreateResponse.id);
console.log(imageToVideo.id);
```

### Making custom/undocumented requests
Expand Down

0 comments on commit d7fc06e

Please sign in to comment.