From 6c7f44a1893a7ace9e45102d7008ff90c3a53c3f Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 13 Sep 2024 21:31:50 -0300 Subject: [PATCH] ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.396.9 (#10) Co-authored-by: speakeasybot --- .speakeasy/gen.lock | 140 +++-- .speakeasy/gen.yaml | 2 +- FUNCTIONS.md | 4 +- README.md | 51 +- RELEASES.md | 12 +- USAGE.md | 2 +- codeSamples.yaml | 24 +- ...diototextpost.md => bodygenaudiototext.md} | 4 +- ...etoimagepost.md => bodygenimagetoimage.md} | 4 +- ...etovideopost.md => bodygenimagetovideo.md} | 28 +- ...stimage.md => bodygenimagetovideoimage.md} | 4 +- ...ing2post.md => bodygensegmentanything2.md} | 26 +- ...age.md => bodygensegmentanything2image.md} | 4 +- ...pscaleupscalepost.md => bodygenupscale.md} | 20 +- ...ng2postimage.md => bodygenupscaleimage.md} | 4 +- ...tresponse.md => genaudiototextresponse.md} | 6 +- ...response.md => genimagetoimageresponse.md} | 6 +- ...response.md => genimagetovideoresponse.md} | 6 +- ...onse.md => gensegmentanything2response.md} | 6 +- ...eresponse.md => gentexttoimageresponse.md} | 6 +- ...scaleresponse.md => genupscaleresponse.md} | 6 +- docs/sdks/generate/README.md | 500 ++++++++++++++++++ docs/sdks/livepeerai/README.md | 498 +---------------- jsr.json | 10 +- package-lock.json | 26 +- package.json | 9 +- ...{audioToText.ts => generateAudioToText.ts} | 15 +- ...mageToImage.ts => generateImageToImage.ts} | 15 +- ...mageToVideo.ts => generateImageToVideo.ts} | 15 +- ...ything2.ts => generateSegmentAnything2.ts} | 17 +- ...{textToImage.ts => generateTextToImage.ts} | 10 +- src/funcs/{upscale.ts => generateUpscale.ts} | 14 +- src/lib/config.ts | 8 +- ...diototextpost.ts => bodygenaudiototext.ts} | 34 +- ...etoimagepost.ts => bodygenimagetoimage.ts} | 34 +- ...etovideopost.ts => bodygenimagetovideo.ts} | 72 ++- ...ing2post.ts => bodygensegmentanything2.ts} | 120 ++--- ...pscaleupscalepost.ts => bodygenupscale.ts} | 72 ++- src/models/components/index.ts | 10 +- .../{audiototext.ts => genaudiototext.ts} | 28 +- .../{texttoimage.ts => genimagetoimage.ts} | 28 +- .../{imagetovideo.ts => genimagetovideo.ts} | 28 +- ...entanything2.ts => gensegmentanything2.ts} | 28 +- .../{imagetoimage.ts => gentexttoimage.ts} | 28 +- .../operations/{upscale.ts => genupscale.ts} | 28 +- src/models/operations/index.ts | 12 +- src/sdk/generate.ts | 118 +++++ src/sdk/sdk.ts | 115 +--- 48 files changed, 1152 insertions(+), 1105 deletions(-) rename docs/models/components/{bodyaudiototextaudiototextpost.md => bodygenaudiototext.md} (96%) rename docs/models/components/{bodyimagetoimageimagetoimagepost.md => bodygenimagetoimage.md} (98%) rename docs/models/components/{bodyimagetovideoimagetovideopost.md => bodygenimagetovideo.md} (51%) rename docs/models/components/{bodyupscaleupscalepostimage.md => bodygenimagetovideoimage.md} (84%) rename docs/models/components/{bodysegmentanything2segmentanything2post.md => bodygensegmentanything2.md} (57%) rename docs/models/components/{bodyimagetovideoimagetovideopostimage.md => bodygensegmentanything2image.md} (82%) rename docs/models/components/{bodyupscaleupscalepost.md => bodygenupscale.md} (61%) rename docs/models/components/{bodysegmentanything2segmentanything2postimage.md => bodygenupscaleimage.md} (80%) rename docs/models/operations/{audiototextresponse.md => genaudiototextresponse.md} (93%) rename docs/models/operations/{imagetoimageresponse.md => genimagetoimageresponse.md} (93%) rename docs/models/operations/{imagetovideoresponse.md => genimagetovideoresponse.md} (93%) rename docs/models/operations/{segmentanything2response.md => gensegmentanything2response.md} (92%) rename docs/models/operations/{texttoimageresponse.md => gentexttoimageresponse.md} (93%) rename docs/models/operations/{upscaleresponse.md => genupscaleresponse.md} (94%) create mode 100644 docs/sdks/generate/README.md rename src/funcs/{audioToText.ts => generateAudioToText.ts} (92%) rename src/funcs/{imageToImage.ts => generateImageToImage.ts} (93%) rename src/funcs/{imageToVideo.ts => generateImageToVideo.ts} (93%) rename src/funcs/{segmentAnything2.ts => generateSegmentAnything2.ts} (92%) rename src/funcs/{textToImage.ts => generateTextToImage.ts} (94%) rename src/funcs/{upscale.ts => generateUpscale.ts} (93%) rename src/models/components/{bodyaudiototextaudiototextpost.ts => bodygenaudiototext.ts} (67%) rename src/models/components/{bodyimagetoimageimagetoimagepost.ts => bodygenimagetoimage.ts} (81%) rename src/models/components/{bodyimagetovideoimagetovideopost.ts => bodygenimagetovideo.ts} (62%) rename src/models/components/{bodysegmentanything2segmentanything2post.ts => bodygensegmentanything2.ts} (53%) rename src/models/components/{bodyupscaleupscalepost.ts => bodygenupscale.ts} (56%) rename src/models/operations/{audiototext.ts => genaudiototext.ts} (70%) rename src/models/operations/{texttoimage.ts => genimagetoimage.ts} (69%) rename src/models/operations/{imagetovideo.ts => genimagetovideo.ts} (69%) rename src/models/operations/{segmentanything2.ts => gensegmentanything2.ts} (68%) rename src/models/operations/{imagetoimage.ts => gentexttoimage.ts} (70%) rename src/models/operations/{upscale.ts => genupscale.ts} (71%) create mode 100644 src/sdk/generate.ts diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index c9cb6c3..7b0d4d5 100644 --- a/.speakeasy/gen.lock +++ b/.speakeasy/gen.lock @@ -1,19 +1,20 @@ lockVersion: 2.0.0 id: 8766970f-4397-4dff-8082-81333329536d management: - docChecksum: 57e99cb8e6e8b32242245c05aacb18c7 - docVersion: v0.2.0 - speakeasyVersion: 1.396.6 - generationVersion: 2.415.6 - releaseVersion: 0.2.0 - configChecksum: 070fffd68711f91890b67094a60e2aaa + docChecksum: 5649b2692e9b9f3c1065851a47fbba06 + docVersion: v0.5.0 + speakeasyVersion: 1.396.9 + generationVersion: 2.415.7 + releaseVersion: 0.3.0 + configChecksum: c8aa17308629ebd7735417f6e6f6e9ed repoURL: https://github.com/livepeer/livepeer-ai-js.git installationURL: https://github.com/livepeer/livepeer-ai-js + published: true features: typescript: additionalDependencies: 0.1.0 constsAndDefaults: 0.1.11 - core: 3.17.2 + core: 3.17.3 defaultEnabledRetries: 0.1.0 devContainers: 2.90.0 envVarSecurityUsage: 0.1.1 @@ -21,6 +22,7 @@ features: globalSecurityCallbacks: 0.1.0 globalSecurityFlattening: 0.1.0 globalServerURLs: 2.82.4 + nameOverrides: 2.81.2 responseFormat: 0.2.3 retries: 2.83.0 sdkHooks: 0.1.0 @@ -40,14 +42,14 @@ generatedFiles: - docs/lib/utils/retryconfig.md - docs/models/components/apierror.md - docs/models/components/audio.md - - docs/models/components/bodyaudiototextaudiototextpost.md - - docs/models/components/bodyimagetoimageimagetoimagepost.md - - docs/models/components/bodyimagetovideoimagetovideopost.md - - docs/models/components/bodyimagetovideoimagetovideopostimage.md - - docs/models/components/bodysegmentanything2segmentanything2post.md - - docs/models/components/bodysegmentanything2segmentanything2postimage.md - - docs/models/components/bodyupscaleupscalepost.md - - docs/models/components/bodyupscaleupscalepostimage.md + - docs/models/components/bodygenaudiototext.md + - docs/models/components/bodygenimagetoimage.md + - docs/models/components/bodygenimagetovideo.md + - docs/models/components/bodygenimagetovideoimage.md + - docs/models/components/bodygensegmentanything2.md + - docs/models/components/bodygensegmentanything2image.md + - docs/models/components/bodygenupscale.md + - docs/models/components/bodygenupscaleimage.md - docs/models/components/chunk.md - docs/models/components/image.md - docs/models/components/imageresponse.md @@ -61,22 +63,23 @@ generatedFiles: - docs/models/components/videoresponse.md - docs/models/errors/httperror.md - docs/models/errors/httpvalidationerror.md - - docs/models/operations/audiototextresponse.md - - docs/models/operations/imagetoimageresponse.md - - docs/models/operations/imagetovideoresponse.md - - docs/models/operations/segmentanything2response.md - - docs/models/operations/texttoimageresponse.md - - docs/models/operations/upscaleresponse.md + - docs/models/operations/genaudiototextresponse.md + - docs/models/operations/genimagetoimageresponse.md + - docs/models/operations/genimagetovideoresponse.md + - docs/models/operations/gensegmentanything2response.md + - docs/models/operations/gentexttoimageresponse.md + - docs/models/operations/genupscaleresponse.md + - docs/sdks/generate/README.md - docs/sdks/livepeerai/README.md - jsr.json - package.json - src/core.ts - - src/funcs/audioToText.ts - - src/funcs/imageToImage.ts - - src/funcs/imageToVideo.ts - - src/funcs/segmentAnything2.ts - - src/funcs/textToImage.ts - - src/funcs/upscale.ts + - src/funcs/generateAudioToText.ts + - src/funcs/generateImageToImage.ts + - src/funcs/generateImageToVideo.ts + - src/funcs/generateSegmentAnything2.ts + - src/funcs/generateTextToImage.ts + - src/funcs/generateUpscale.ts - src/hooks/hooks.ts - src/hooks/index.ts - src/hooks/types.ts @@ -97,11 +100,11 @@ generatedFiles: - src/lib/security.ts - src/lib/url.ts - src/models/components/apierror.ts - - src/models/components/bodyaudiototextaudiototextpost.ts - - src/models/components/bodyimagetoimageimagetoimagepost.ts - - src/models/components/bodyimagetovideoimagetovideopost.ts - - src/models/components/bodysegmentanything2segmentanything2post.ts - - src/models/components/bodyupscaleupscalepost.ts + - src/models/components/bodygenaudiototext.ts + - src/models/components/bodygenimagetoimage.ts + - src/models/components/bodygenimagetovideo.ts + - src/models/components/bodygensegmentanything2.ts + - src/models/components/bodygenupscale.ts - src/models/components/chunk.ts - src/models/components/imageresponse.ts - src/models/components/index.ts @@ -118,13 +121,14 @@ generatedFiles: - src/models/errors/index.ts - src/models/errors/sdkerror.ts - src/models/errors/sdkvalidationerror.ts - - src/models/operations/audiototext.ts - - src/models/operations/imagetoimage.ts - - src/models/operations/imagetovideo.ts + - src/models/operations/genaudiototext.ts + - src/models/operations/genimagetoimage.ts + - src/models/operations/genimagetovideo.ts + - src/models/operations/gensegmentanything2.ts + - src/models/operations/gentexttoimage.ts + - src/models/operations/genupscale.ts - src/models/operations/index.ts - - src/models/operations/segmentanything2.ts - - src/models/operations/texttoimage.ts - - src/models/operations/upscale.ts + - src/sdk/generate.ts - src/sdk/index.ts - src/sdk/sdk.ts - src/types/blobs.ts @@ -197,3 +201,63 @@ examples: "400": application/json: {"detail": {"msg": ""}} "422": {} + genTextToImage: + speakeasy-default-gen-text-to-image: + requestBody: + application/json: {"prompt": ""} + responses: + "200": + application/json: {"images": []} + "400": + application/json: {"detail": {"msg": ""}} + "422": {} + genImageToImage: + speakeasy-default-gen-image-to-image: + requestBody: + multipart/form-data: {"prompt": "", "image": {}} + responses: + "200": + application/json: {"images": []} + "400": + application/json: {"detail": {"msg": ""}} + "422": {} + genImageToVideo: + speakeasy-default-gen-image-to-video: + requestBody: + multipart/form-data: {"image": {}} + responses: + "200": + application/json: {"images": []} + "400": + application/json: {"detail": {"msg": ""}} + "422": {} + genUpscale: + speakeasy-default-gen-upscale: + requestBody: + multipart/form-data: {"prompt": "", "image": {}} + responses: + "200": + application/json: {"images": []} + "400": + application/json: {"detail": {"msg": ""}} + "422": {} + genAudioToText: + speakeasy-default-gen-audio-to-text: + requestBody: + multipart/form-data: {"audio": {}} + responses: + "200": + application/json: {"text": "", "chunks": []} + "400": + application/json: {"detail": {"msg": ""}} + "422": {} + genSegmentAnything2: + speakeasy-default-gen-segment-anything2: + requestBody: + multipart/form-data: {"image": {}} + responses: + "200": + application/json: {"masks": "", "scores": "", "logits": ""} + "400": + application/json: {"detail": {"msg": ""}} + "422": {} diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index 1dc68f9..53e6469 100644 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -15,7 +15,7 @@ generation: auth: oAuth2ClientCredentialsEnabled: false typescript: - version: 0.2.0 + version: 0.3.0 additionalDependencies: dependencies: {} devDependencies: {} diff --git a/FUNCTIONS.md b/FUNCTIONS.md index b462137..c889802 100644 --- a/FUNCTIONS.md +++ b/FUNCTIONS.md @@ -20,7 +20,7 @@ specific category of applications. ```typescript import { LivepeerAICore } from "livepeer-ai/core.js"; -import { textToImage } from "livepeer-ai/funcs/textToImage.js"; +import { generateTextToImage } from "livepeer-ai/funcs/generateTextToImage.js"; import { SDKValidationError } from "livepeer-ai/models/errors/sdkvalidationerror.js"; // Use `LivepeerAICore` for best tree-shaking performance. @@ -30,7 +30,7 @@ const livepeerAI = new LivepeerAICore({ }); async function run() { - const res = await textToImage(livepeerAI, { + const res = await generateTextToImage(livepeerAI, { prompt: "", }); diff --git a/README.md b/README.md index 951546c..7439a81 100644 --- a/README.md +++ b/README.md @@ -17,25 +17,25 @@ The SDK can be installed with either [npm](https://www.npmjs.com/), [pnpm](https ### NPM ```bash -npm add https://github.com/livepeer/livepeer-ai-js +npm add livepeer-ai ``` ### PNPM ```bash -pnpm add https://github.com/livepeer/livepeer-ai-js +pnpm add livepeer-ai ``` ### Bun ```bash -bun add https://github.com/livepeer/livepeer-ai-js +bun add livepeer-ai ``` ### Yarn ```bash -yarn add https://github.com/livepeer/livepeer-ai-js zod +yarn add livepeer-ai zod # Note that Yarn does not install peer dependencies automatically. You will need # to install zod as shown above. @@ -61,7 +61,7 @@ const livepeerAI = new LivepeerAI({ }); async function run() { - const result = await livepeerAI.textToImage({ + const result = await livepeerAI.generate.textToImage({ prompt: "", }); @@ -80,14 +80,15 @@ run();
Available methods -### [LivepeerAI SDK](docs/sdks/livepeerai/README.md) +### [generate](docs/sdks/generate/README.md) + +* [textToImage](docs/sdks/generate/README.md#texttoimage) - Text To Image +* [imageToImage](docs/sdks/generate/README.md#imagetoimage) - Image To Image +* [imageToVideo](docs/sdks/generate/README.md#imagetovideo) - Image To Video +* [upscale](docs/sdks/generate/README.md#upscale) - Upscale +* [audioToText](docs/sdks/generate/README.md#audiototext) - Audio To Text +* [segmentAnything2](docs/sdks/generate/README.md#segmentanything2) - Segment Anything 2 -* [textToImage](docs/sdks/livepeerai/README.md#texttoimage) - Text To Image -* [imageToImage](docs/sdks/livepeerai/README.md#imagetoimage) - Image To Image -* [imageToVideo](docs/sdks/livepeerai/README.md#imagetovideo) - Image To Video -* [upscale](docs/sdks/livepeerai/README.md#upscale) - Upscale -* [audioToText](docs/sdks/livepeerai/README.md#audiototext) - Audio To Text -* [segmentAnything2](docs/sdks/livepeerai/README.md#segmentanything2) - Segment Anything 2
@@ -107,12 +108,12 @@ To read more about standalone functions, check [FUNCTIONS.md](./FUNCTIONS.md). Available standalone functions -- [audioToText](docs/sdks/livepeerai/README.md#audiototext) -- [imageToImage](docs/sdks/livepeerai/README.md#imagetoimage) -- [imageToVideo](docs/sdks/livepeerai/README.md#imagetovideo) -- [segmentAnything2](docs/sdks/livepeerai/README.md#segmentanything2) -- [textToImage](docs/sdks/livepeerai/README.md#texttoimage) -- [upscale](docs/sdks/livepeerai/README.md#upscale) +- [generateAudioToText](docs/sdks/generate/README.md#audiototext) +- [generateImageToImage](docs/sdks/generate/README.md#imagetoimage) +- [generateImageToVideo](docs/sdks/generate/README.md#imagetovideo) +- [generateSegmentAnything2](docs/sdks/generate/README.md#segmentanything2) +- [generateTextToImage](docs/sdks/generate/README.md#texttoimage) +- [generateUpscale](docs/sdks/generate/README.md#upscale) @@ -141,7 +142,7 @@ const livepeerAI = new LivepeerAI({ }); async function run() { - const result = await livepeerAI.imageToImage({ + const result = await livepeerAI.generate.imageToImage({ image: await openAsBlob("example.file"), prompt: "", }); @@ -169,7 +170,7 @@ const livepeerAI = new LivepeerAI({ }); async function run() { - const result = await livepeerAI.textToImage({ + const result = await livepeerAI.generate.textToImage({ prompt: "", }, { retries: { @@ -211,7 +212,7 @@ const livepeerAI = new LivepeerAI({ }); async function run() { - const result = await livepeerAI.textToImage({ + const result = await livepeerAI.generate.textToImage({ prompt: "", }); @@ -253,7 +254,7 @@ const livepeerAI = new LivepeerAI({ async function run() { let result; try { - result = await livepeerAI.textToImage({ + result = await livepeerAI.generate.textToImage({ prompt: "", }); @@ -311,7 +312,7 @@ const livepeerAI = new LivepeerAI({ }); async function run() { - const result = await livepeerAI.textToImage({ + const result = await livepeerAI.generate.textToImage({ prompt: "", }); @@ -337,7 +338,7 @@ const livepeerAI = new LivepeerAI({ }); async function run() { - const result = await livepeerAI.textToImage({ + const result = await livepeerAI.generate.textToImage({ prompt: "", }); @@ -419,7 +420,7 @@ const livepeerAI = new LivepeerAI({ }); async function run() { - const result = await livepeerAI.textToImage({ + const result = await livepeerAI.generate.textToImage({ prompt: "", }); diff --git a/RELEASES.md b/RELEASES.md index 17014cb..f291ee5 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -30,4 +30,14 @@ Based on: - OpenAPI Doc - Speakeasy CLI 1.396.6 (2.415.6) https://github.com/speakeasy-api/speakeasy ### Generated -- [typescript v0.2.0] . \ No newline at end of file +- [typescript v0.2.0] . + +## 2024-09-14 00:29:13 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.396.9 (2.415.7) https://github.com/speakeasy-api/speakeasy +### Generated +- [typescript v0.3.0] . +### Releases +- [NPM v0.3.0] https://www.npmjs.com/package/livepeer-ai/v/0.3.0 - . \ No newline at end of file diff --git a/USAGE.md b/USAGE.md index cf3ceb1..565b9bb 100644 --- a/USAGE.md +++ b/USAGE.md @@ -7,7 +7,7 @@ const livepeerAI = new LivepeerAI({ }); async function run() { - const result = await livepeerAI.textToImage({ + const result = await livepeerAI.generate.textToImage({ prompt: "", }); diff --git a/codeSamples.yaml b/codeSamples.yaml index 9e86e99..11631ff 100644 --- a/codeSamples.yaml +++ b/codeSamples.yaml @@ -7,35 +7,35 @@ actions: update: x-codeSamples: - lang: typescript - label: audio_to_text - source: "import { LivepeerAI } from \"livepeer-ai\";\nimport { openAsBlob } from \"node:fs\";\n\nconst livepeerAI = new LivepeerAI({\n httpBearer: \"\",\n});\n\nasync function run() {\n const result = await livepeerAI.audioToText({\n audio: await openAsBlob(\"example.file\"),\n });\n \n // Handle the result\n console.log(result)\n}\n\nrun();" + label: genAudioToText + source: "import { LivepeerAI } from \"livepeer-ai\";\nimport { openAsBlob } from \"node:fs\";\n\nconst livepeerAI = new LivepeerAI({\n httpBearer: \"\",\n});\n\nasync function run() {\n const result = await livepeerAI.generate.audioToText({\n audio: await openAsBlob(\"example.file\"),\n });\n \n // Handle the result\n console.log(result)\n}\n\nrun();" - target: $["paths"]["/image-to-image"]["post"] update: x-codeSamples: - lang: typescript - label: image_to_image - source: "import { LivepeerAI } from \"livepeer-ai\";\nimport { openAsBlob } from \"node:fs\";\n\nconst livepeerAI = new LivepeerAI({\n httpBearer: \"\",\n});\n\nasync function run() {\n const result = await livepeerAI.imageToImage({\n prompt: \"\",\n image: await openAsBlob(\"example.file\"),\n });\n \n // Handle the result\n console.log(result)\n}\n\nrun();" + label: genImageToImage + source: "import { LivepeerAI } from \"livepeer-ai\";\nimport { openAsBlob } from \"node:fs\";\n\nconst livepeerAI = new LivepeerAI({\n httpBearer: \"\",\n});\n\nasync function run() {\n const result = await livepeerAI.generate.imageToImage({\n prompt: \"\",\n image: await openAsBlob(\"example.file\"),\n });\n \n // Handle the result\n console.log(result)\n}\n\nrun();" - target: $["paths"]["/image-to-video"]["post"] update: x-codeSamples: - lang: typescript - label: image_to_video - source: "import { LivepeerAI } from \"livepeer-ai\";\nimport { openAsBlob } from \"node:fs\";\n\nconst livepeerAI = new LivepeerAI({\n httpBearer: \"\",\n});\n\nasync function run() {\n const result = await livepeerAI.imageToVideo({\n image: await openAsBlob(\"example.file\"),\n });\n \n // Handle the result\n console.log(result)\n}\n\nrun();" + label: genImageToVideo + source: "import { LivepeerAI } from \"livepeer-ai\";\nimport { openAsBlob } from \"node:fs\";\n\nconst livepeerAI = new LivepeerAI({\n httpBearer: \"\",\n});\n\nasync function run() {\n const result = await livepeerAI.generate.imageToVideo({\n image: await openAsBlob(\"example.file\"),\n });\n \n // Handle the result\n console.log(result)\n}\n\nrun();" - target: $["paths"]["/segment-anything-2"]["post"] update: x-codeSamples: - lang: typescript - label: segment_anything_2 - source: "import { LivepeerAI } from \"livepeer-ai\";\nimport { openAsBlob } from \"node:fs\";\n\nconst livepeerAI = new LivepeerAI({\n httpBearer: \"\",\n});\n\nasync function run() {\n const result = await livepeerAI.segmentAnything2({\n image: await openAsBlob(\"example.file\"),\n });\n \n // Handle the result\n console.log(result)\n}\n\nrun();" + label: genSegmentAnything2 + source: "import { LivepeerAI } from \"livepeer-ai\";\nimport { openAsBlob } from \"node:fs\";\n\nconst livepeerAI = new LivepeerAI({\n httpBearer: \"\",\n});\n\nasync function run() {\n const result = await livepeerAI.generate.segmentAnything2({\n image: await openAsBlob(\"example.file\"),\n });\n \n // Handle the result\n console.log(result)\n}\n\nrun();" - target: $["paths"]["/text-to-image"]["post"] update: x-codeSamples: - lang: typescript - label: text_to_image - source: "import { LivepeerAI } from \"livepeer-ai\";\n\nconst livepeerAI = new LivepeerAI({\n httpBearer: \"\",\n});\n\nasync function run() {\n const result = await livepeerAI.textToImage({\n prompt: \"\",\n });\n \n // Handle the result\n console.log(result)\n}\n\nrun();" + label: genTextToImage + source: "import { LivepeerAI } from \"livepeer-ai\";\n\nconst livepeerAI = new LivepeerAI({\n httpBearer: \"\",\n});\n\nasync function run() {\n const result = await livepeerAI.generate.textToImage({\n prompt: \"\",\n });\n \n // Handle the result\n console.log(result)\n}\n\nrun();" - target: $["paths"]["/upscale"]["post"] update: x-codeSamples: - lang: typescript - label: upscale - source: "import { LivepeerAI } from \"livepeer-ai\";\nimport { openAsBlob } from \"node:fs\";\n\nconst livepeerAI = new LivepeerAI({\n httpBearer: \"\",\n});\n\nasync function run() {\n const result = await livepeerAI.upscale({\n prompt: \"\",\n image: await openAsBlob(\"example.file\"),\n });\n \n // Handle the result\n console.log(result)\n}\n\nrun();" + label: genUpscale + source: "import { LivepeerAI } from \"livepeer-ai\";\nimport { openAsBlob } from \"node:fs\";\n\nconst livepeerAI = new LivepeerAI({\n httpBearer: \"\",\n});\n\nasync function run() {\n const result = await livepeerAI.generate.upscale({\n prompt: \"\",\n image: await openAsBlob(\"example.file\"),\n });\n \n // Handle the result\n console.log(result)\n}\n\nrun();" diff --git a/docs/models/components/bodyaudiototextaudiototextpost.md b/docs/models/components/bodygenaudiototext.md similarity index 96% rename from docs/models/components/bodyaudiototextaudiototextpost.md rename to docs/models/components/bodygenaudiototext.md index a81a3fd..9f6f957 100644 --- a/docs/models/components/bodyaudiototextaudiototextpost.md +++ b/docs/models/components/bodygenaudiototext.md @@ -1,9 +1,9 @@ -# BodyAudioToTextAudioToTextPost +# BodyGenAudioToText ## Example Usage ```typescript -import { BodyAudioToTextAudioToTextPost } from "livepeer-ai/models/components"; +import { BodyGenAudioToText } from "livepeer-ai/models/components"; // No examples available for this model ``` diff --git a/docs/models/components/bodyimagetoimageimagetoimagepost.md b/docs/models/components/bodygenimagetoimage.md similarity index 98% rename from docs/models/components/bodyimagetoimageimagetoimagepost.md rename to docs/models/components/bodygenimagetoimage.md index 5a14bc8..89a95eb 100644 --- a/docs/models/components/bodyimagetoimageimagetoimagepost.md +++ b/docs/models/components/bodygenimagetoimage.md @@ -1,9 +1,9 @@ -# BodyImageToImageImageToImagePost +# BodyGenImageToImage ## Example Usage ```typescript -import { BodyImageToImageImageToImagePost } from "livepeer-ai/models/components"; +import { BodyGenImageToImage } from "livepeer-ai/models/components"; // No examples available for this model ``` diff --git a/docs/models/components/bodyimagetovideoimagetovideopost.md b/docs/models/components/bodygenimagetovideo.md similarity index 51% rename from docs/models/components/bodyimagetovideoimagetovideopost.md rename to docs/models/components/bodygenimagetovideo.md index cb781e4..a1bbe9a 100644 --- a/docs/models/components/bodyimagetovideoimagetovideopost.md +++ b/docs/models/components/bodygenimagetovideo.md @@ -1,24 +1,24 @@ -# BodyImageToVideoImageToVideoPost +# BodyGenImageToVideo ## Example Usage ```typescript -import { BodyImageToVideoImageToVideoPost } from "livepeer-ai/models/components"; +import { BodyGenImageToVideo } from "livepeer-ai/models/components"; // No examples available for this model ``` ## Fields -| Field | Type | Required | Description | -| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `image` | [File](https://developer.mozilla.org/en-US/docs/Web/API/File) \| [Blob](https://developer.mozilla.org/en-US/docs/Web/API/Blob) \| [components.BodyImageToVideoImageToVideoPostImage](../../models/components/bodyimagetovideoimagetovideopostimage.md) | :heavy_check_mark: | Uploaded image to generate a video from. | -| `fps` | *number* | :heavy_minus_sign: | The frames per second of the generated video. | -| `height` | *number* | :heavy_minus_sign: | The height in pixels of the generated video. | -| `modelId` | *string* | :heavy_minus_sign: | Hugging Face model ID used for video generation. | -| `motionBucketId` | *number* | :heavy_minus_sign: | Used for conditioning the amount of motion for the generation. The higher the number the more motion will be in the video. | -| `noiseAugStrength` | *number* | :heavy_minus_sign: | Amount of noise added to the conditioning image. Higher values reduce resemblance to the conditioning image and increase motion. | -| `numInferenceSteps` | *number* | :heavy_minus_sign: | Number of denoising steps. More steps usually lead to higher quality images but slower inference. Modulated by strength. | -| `safetyCheck` | *boolean* | :heavy_minus_sign: | Perform a safety check to estimate if generated images could be offensive or harmful. | -| `seed` | *number* | :heavy_minus_sign: | Seed for random number generation. | -| `width` | *number* | :heavy_minus_sign: | The width in pixels of the generated video. | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `image` | [File](https://developer.mozilla.org/en-US/docs/Web/API/File) \| [Blob](https://developer.mozilla.org/en-US/docs/Web/API/Blob) \| [components.BodyGenImageToVideoImage](../../models/components/bodygenimagetovideoimage.md) | :heavy_check_mark: | Uploaded image to generate a video from. | +| `fps` | *number* | :heavy_minus_sign: | The frames per second of the generated video. | +| `height` | *number* | :heavy_minus_sign: | The height in pixels of the generated video. | +| `modelId` | *string* | :heavy_minus_sign: | Hugging Face model ID used for video generation. | +| `motionBucketId` | *number* | :heavy_minus_sign: | Used for conditioning the amount of motion for the generation. The higher the number the more motion will be in the video. | +| `noiseAugStrength` | *number* | :heavy_minus_sign: | Amount of noise added to the conditioning image. Higher values reduce resemblance to the conditioning image and increase motion. | +| `numInferenceSteps` | *number* | :heavy_minus_sign: | Number of denoising steps. More steps usually lead to higher quality images but slower inference. Modulated by strength. | +| `safetyCheck` | *boolean* | :heavy_minus_sign: | Perform a safety check to estimate if generated images could be offensive or harmful. | +| `seed` | *number* | :heavy_minus_sign: | Seed for random number generation. | +| `width` | *number* | :heavy_minus_sign: | The width in pixels of the generated video. | \ No newline at end of file diff --git a/docs/models/components/bodyupscaleupscalepostimage.md b/docs/models/components/bodygenimagetovideoimage.md similarity index 84% rename from docs/models/components/bodyupscaleupscalepostimage.md rename to docs/models/components/bodygenimagetovideoimage.md index bbebea5..8c71872 100644 --- a/docs/models/components/bodyupscaleupscalepostimage.md +++ b/docs/models/components/bodygenimagetovideoimage.md @@ -1,9 +1,9 @@ -# BodyUpscaleUpscalePostImage +# BodyGenImageToVideoImage ## Example Usage ```typescript -import { BodyUpscaleUpscalePostImage } from "livepeer-ai/models/components"; +import { BodyGenImageToVideoImage } from "livepeer-ai/models/components"; // No examples available for this model ``` diff --git a/docs/models/components/bodysegmentanything2segmentanything2post.md b/docs/models/components/bodygensegmentanything2.md similarity index 57% rename from docs/models/components/bodysegmentanything2segmentanything2post.md rename to docs/models/components/bodygensegmentanything2.md index c3f58ba..fffaddd 100644 --- a/docs/models/components/bodysegmentanything2segmentanything2post.md +++ b/docs/models/components/bodygensegmentanything2.md @@ -1,23 +1,23 @@ -# BodySegmentAnything2SegmentAnything2Post +# BodyGenSegmentAnything2 ## Example Usage ```typescript -import { BodySegmentAnything2SegmentAnything2Post } from "livepeer-ai/models/components"; +import { BodyGenSegmentAnything2 } from "livepeer-ai/models/components"; // No examples available for this model ``` ## Fields -| Field | Type | Required | Description | -| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `image` | [File](https://developer.mozilla.org/en-US/docs/Web/API/File) \| [Blob](https://developer.mozilla.org/en-US/docs/Web/API/Blob) \| [components.BodySegmentAnything2SegmentAnything2PostImage](../../models/components/bodysegmentanything2segmentanything2postimage.md) | :heavy_check_mark: | Image to segment. | -| `box` | *string* | :heavy_minus_sign: | A length 4 array given as a box prompt to the model, in XYXY format. | -| `maskInput` | *string* | :heavy_minus_sign: | A low-resolution mask input to the model, typically from a previous prediction iteration, with the form 1xHxW (H=W=256 for SAM). | -| `modelId` | *string* | :heavy_minus_sign: | Hugging Face model ID used for image generation. | -| `multimaskOutput` | *boolean* | :heavy_minus_sign: | If true, the model will return three masks for ambiguous input prompts, often producing better masks than a single prediction. | -| `normalizeCoords` | *boolean* | :heavy_minus_sign: | If true, the point coordinates will be normalized to the range [0,1], with point_coords expected to be with respect to image dimensions. | -| `pointCoords` | *string* | :heavy_minus_sign: | Nx2 array of point prompts to the model, where each point is in (X,Y) in pixels. | -| `pointLabels` | *string* | :heavy_minus_sign: | Labels for the point prompts, where 1 indicates a foreground point and 0 indicates a background point. | -| `returnLogits` | *boolean* | :heavy_minus_sign: | If true, returns un-thresholded mask logits instead of a binary mask. | \ No newline at end of file +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `image` | [File](https://developer.mozilla.org/en-US/docs/Web/API/File) \| [Blob](https://developer.mozilla.org/en-US/docs/Web/API/Blob) \| [components.BodyGenSegmentAnything2Image](../../models/components/bodygensegmentanything2image.md) | :heavy_check_mark: | Image to segment. | +| `box` | *string* | :heavy_minus_sign: | A length 4 array given as a box prompt to the model, in XYXY format. | +| `maskInput` | *string* | :heavy_minus_sign: | A low-resolution mask input to the model, typically from a previous prediction iteration, with the form 1xHxW (H=W=256 for SAM). | +| `modelId` | *string* | :heavy_minus_sign: | Hugging Face model ID used for image generation. | +| `multimaskOutput` | *boolean* | :heavy_minus_sign: | If true, the model will return three masks for ambiguous input prompts, often producing better masks than a single prediction. | +| `normalizeCoords` | *boolean* | :heavy_minus_sign: | If true, the point coordinates will be normalized to the range [0,1], with point_coords expected to be with respect to image dimensions. | +| `pointCoords` | *string* | :heavy_minus_sign: | Nx2 array of point prompts to the model, where each point is in (X,Y) in pixels. | +| `pointLabels` | *string* | :heavy_minus_sign: | Labels for the point prompts, where 1 indicates a foreground point and 0 indicates a background point. | +| `returnLogits` | *boolean* | :heavy_minus_sign: | If true, returns un-thresholded mask logits instead of a binary mask. | \ No newline at end of file diff --git a/docs/models/components/bodyimagetovideoimagetovideopostimage.md b/docs/models/components/bodygensegmentanything2image.md similarity index 82% rename from docs/models/components/bodyimagetovideoimagetovideopostimage.md rename to docs/models/components/bodygensegmentanything2image.md index 5639b0a..33166c0 100644 --- a/docs/models/components/bodyimagetovideoimagetovideopostimage.md +++ b/docs/models/components/bodygensegmentanything2image.md @@ -1,9 +1,9 @@ -# BodyImageToVideoImageToVideoPostImage +# BodyGenSegmentAnything2Image ## Example Usage ```typescript -import { BodyImageToVideoImageToVideoPostImage } from "livepeer-ai/models/components"; +import { BodyGenSegmentAnything2Image } from "livepeer-ai/models/components"; // No examples available for this model ``` diff --git a/docs/models/components/bodyupscaleupscalepost.md b/docs/models/components/bodygenupscale.md similarity index 61% rename from docs/models/components/bodyupscaleupscalepost.md rename to docs/models/components/bodygenupscale.md index 5d15452..4e79d96 100644 --- a/docs/models/components/bodyupscaleupscalepost.md +++ b/docs/models/components/bodygenupscale.md @@ -1,20 +1,20 @@ -# BodyUpscaleUpscalePost +# BodyGenUpscale ## Example Usage ```typescript -import { BodyUpscaleUpscalePost } from "livepeer-ai/models/components"; +import { BodyGenUpscale } from "livepeer-ai/models/components"; // No examples available for this model ``` ## Fields -| Field | Type | Required | Description | -| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `image` | [File](https://developer.mozilla.org/en-US/docs/Web/API/File) \| [Blob](https://developer.mozilla.org/en-US/docs/Web/API/Blob) \| [components.BodyUpscaleUpscalePostImage](../../models/components/bodyupscaleupscalepostimage.md) | :heavy_check_mark: | Uploaded image to modify with the pipeline. | -| `prompt` | *string* | :heavy_check_mark: | Text prompt(s) to guide upscaled image generation. | -| `modelId` | *string* | :heavy_minus_sign: | Hugging Face model ID used for upscaled image generation. | -| `numInferenceSteps` | *number* | :heavy_minus_sign: | Number of denoising steps. More steps usually lead to higher quality images but slower inference. Modulated by strength. | -| `safetyCheck` | *boolean* | :heavy_minus_sign: | Perform a safety check to estimate if generated images could be offensive or harmful. | -| `seed` | *number* | :heavy_minus_sign: | Seed for random number generation. | \ No newline at end of file +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `image` | [File](https://developer.mozilla.org/en-US/docs/Web/API/File) \| [Blob](https://developer.mozilla.org/en-US/docs/Web/API/Blob) \| [components.BodyGenUpscaleImage](../../models/components/bodygenupscaleimage.md) | :heavy_check_mark: | Uploaded image to modify with the pipeline. | +| `prompt` | *string* | :heavy_check_mark: | Text prompt(s) to guide upscaled image generation. | +| `modelId` | *string* | :heavy_minus_sign: | Hugging Face model ID used for upscaled image generation. | +| `numInferenceSteps` | *number* | :heavy_minus_sign: | Number of denoising steps. More steps usually lead to higher quality images but slower inference. Modulated by strength. | +| `safetyCheck` | *boolean* | :heavy_minus_sign: | Perform a safety check to estimate if generated images could be offensive or harmful. | +| `seed` | *number* | :heavy_minus_sign: | Seed for random number generation. | \ No newline at end of file diff --git a/docs/models/components/bodysegmentanything2segmentanything2postimage.md b/docs/models/components/bodygenupscaleimage.md similarity index 80% rename from docs/models/components/bodysegmentanything2segmentanything2postimage.md rename to docs/models/components/bodygenupscaleimage.md index d1b1aa4..fdbf7e0 100644 --- a/docs/models/components/bodysegmentanything2segmentanything2postimage.md +++ b/docs/models/components/bodygenupscaleimage.md @@ -1,9 +1,9 @@ -# BodySegmentAnything2SegmentAnything2PostImage +# BodyGenUpscaleImage ## Example Usage ```typescript -import { BodySegmentAnything2SegmentAnything2PostImage } from "livepeer-ai/models/components"; +import { BodyGenUpscaleImage } from "livepeer-ai/models/components"; // No examples available for this model ``` diff --git a/docs/models/operations/audiototextresponse.md b/docs/models/operations/genaudiototextresponse.md similarity index 93% rename from docs/models/operations/audiototextresponse.md rename to docs/models/operations/genaudiototextresponse.md index 4d38713..e597562 100644 --- a/docs/models/operations/audiototextresponse.md +++ b/docs/models/operations/genaudiototextresponse.md @@ -1,11 +1,11 @@ -# AudioToTextResponse +# GenAudioToTextResponse ## Example Usage ```typescript -import { AudioToTextResponse } from "livepeer-ai/models/operations"; +import { GenAudioToTextResponse } from "livepeer-ai/models/operations"; -let value: AudioToTextResponse = { +let value: GenAudioToTextResponse = { contentType: "", statusCode: 602763, rawResponse: new Response("{\"message\": \"hello world\"}", { diff --git a/docs/models/operations/imagetoimageresponse.md b/docs/models/operations/genimagetoimageresponse.md similarity index 93% rename from docs/models/operations/imagetoimageresponse.md rename to docs/models/operations/genimagetoimageresponse.md index d8cddbb..6518ba3 100644 --- a/docs/models/operations/imagetoimageresponse.md +++ b/docs/models/operations/genimagetoimageresponse.md @@ -1,11 +1,11 @@ -# ImageToImageResponse +# GenImageToImageResponse ## Example Usage ```typescript -import { ImageToImageResponse } from "livepeer-ai/models/operations"; +import { GenImageToImageResponse } from "livepeer-ai/models/operations"; -let value: ImageToImageResponse = { +let value: GenImageToImageResponse = { contentType: "", statusCode: 592845, rawResponse: new Response("{\"message\": \"hello world\"}", { diff --git a/docs/models/operations/imagetovideoresponse.md b/docs/models/operations/genimagetovideoresponse.md similarity index 93% rename from docs/models/operations/imagetovideoresponse.md rename to docs/models/operations/genimagetovideoresponse.md index 88a4698..2228977 100644 --- a/docs/models/operations/imagetovideoresponse.md +++ b/docs/models/operations/genimagetovideoresponse.md @@ -1,11 +1,11 @@ -# ImageToVideoResponse +# GenImageToVideoResponse ## Example Usage ```typescript -import { ImageToVideoResponse } from "livepeer-ai/models/operations"; +import { GenImageToVideoResponse } from "livepeer-ai/models/operations"; -let value: ImageToVideoResponse = { +let value: GenImageToVideoResponse = { contentType: "", statusCode: 715190, rawResponse: new Response("{\"message\": \"hello world\"}", { diff --git a/docs/models/operations/segmentanything2response.md b/docs/models/operations/gensegmentanything2response.md similarity index 92% rename from docs/models/operations/segmentanything2response.md rename to docs/models/operations/gensegmentanything2response.md index 76ec8fb..08bd6a8 100644 --- a/docs/models/operations/segmentanything2response.md +++ b/docs/models/operations/gensegmentanything2response.md @@ -1,11 +1,11 @@ -# SegmentAnything2Response +# GenSegmentAnything2Response ## Example Usage ```typescript -import { SegmentAnything2Response } from "livepeer-ai/models/operations"; +import { GenSegmentAnything2Response } from "livepeer-ai/models/operations"; -let value: SegmentAnything2Response = { +let value: GenSegmentAnything2Response = { contentType: "", statusCode: 857946, rawResponse: new Response("{\"message\": \"hello world\"}", { diff --git a/docs/models/operations/texttoimageresponse.md b/docs/models/operations/gentexttoimageresponse.md similarity index 93% rename from docs/models/operations/texttoimageresponse.md rename to docs/models/operations/gentexttoimageresponse.md index 858916e..f68ae3c 100644 --- a/docs/models/operations/texttoimageresponse.md +++ b/docs/models/operations/gentexttoimageresponse.md @@ -1,11 +1,11 @@ -# TextToImageResponse +# GenTextToImageResponse ## Example Usage ```typescript -import { TextToImageResponse } from "livepeer-ai/models/operations"; +import { GenTextToImageResponse } from "livepeer-ai/models/operations"; -let value: TextToImageResponse = { +let value: GenTextToImageResponse = { contentType: "", statusCode: 548814, rawResponse: new Response("{\"message\": \"hello world\"}", { diff --git a/docs/models/operations/upscaleresponse.md b/docs/models/operations/genupscaleresponse.md similarity index 94% rename from docs/models/operations/upscaleresponse.md rename to docs/models/operations/genupscaleresponse.md index 5754588..3c9d0d8 100644 --- a/docs/models/operations/upscaleresponse.md +++ b/docs/models/operations/genupscaleresponse.md @@ -1,11 +1,11 @@ -# UpscaleResponse +# GenUpscaleResponse ## Example Usage ```typescript -import { UpscaleResponse } from "livepeer-ai/models/operations"; +import { GenUpscaleResponse } from "livepeer-ai/models/operations"; -let value: UpscaleResponse = { +let value: GenUpscaleResponse = { contentType: "", statusCode: 844266, rawResponse: new Response("{\"message\": \"hello world\"}", { diff --git a/docs/sdks/generate/README.md b/docs/sdks/generate/README.md new file mode 100644 index 0000000..ee24999 --- /dev/null +++ b/docs/sdks/generate/README.md @@ -0,0 +1,500 @@ +# Generate +(*generate*) + +## Overview + +### Available Operations + +* [textToImage](#texttoimage) - Text To Image +* [imageToImage](#imagetoimage) - Image To Image +* [imageToVideo](#imagetovideo) - Image To Video +* [upscale](#upscale) - Upscale +* [audioToText](#audiototext) - Audio To Text +* [segmentAnything2](#segmentanything2) - Segment Anything 2 + +## textToImage + +Generate images from text prompts. + +### Example Usage + +```typescript +import { LivepeerAI } from "livepeer-ai"; + +const livepeerAI = new LivepeerAI({ + httpBearer: "", +}); + +async function run() { + const result = await livepeerAI.generate.textToImage({ + prompt: "", + }); + + // Handle the result + console.log(result) +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { LivepeerAICore } from "livepeer-ai/core.js"; +import { generateTextToImage } from "livepeer-ai/funcs/generateTextToImage.js"; + +// Use `LivepeerAICore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const livepeerAI = new LivepeerAICore({ + httpBearer: "", +}); + +async function run() { + const res = await generateTextToImage(livepeerAI, { + prompt: "", + }); + + if (!res.ok) { + throw res.error; + } + + const { value: result } = res; + + // Handle the result + console.log(result) +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [components.TextToImageParams](../../models/components/texttoimageparams.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[operations.GenTextToImageResponse](../../models/operations/gentexttoimageresponse.md)\>** + +### Errors + +| Error Object | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| errors.HTTPError | 400,401,500 | application/json | +| errors.HTTPValidationError | 422 | application/json | +| errors.SDKError | 4xx-5xx | */* | + + +## imageToImage + +Apply image transformations to a provided image. + +### Example Usage + +```typescript +import { LivepeerAI } from "livepeer-ai"; +import { openAsBlob } from "node:fs"; + +const livepeerAI = new LivepeerAI({ + httpBearer: "", +}); + +async function run() { + const result = await livepeerAI.generate.imageToImage({ + image: await openAsBlob("example.file"), + prompt: "", + }); + + // Handle the result + console.log(result) +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { LivepeerAICore } from "livepeer-ai/core.js"; +import { generateImageToImage } from "livepeer-ai/funcs/generateImageToImage.js"; +import { openAsBlob } from "node:fs"; + +// Use `LivepeerAICore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const livepeerAI = new LivepeerAICore({ + httpBearer: "", +}); + +async function run() { + const res = await generateImageToImage(livepeerAI, { + image: await openAsBlob("example.file"), + prompt: "", + }); + + if (!res.ok) { + throw res.error; + } + + const { value: result } = res; + + // Handle the result + console.log(result) +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [components.BodyGenImageToImage](../../models/components/bodygenimagetoimage.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[operations.GenImageToImageResponse](../../models/operations/genimagetoimageresponse.md)\>** + +### Errors + +| Error Object | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| errors.HTTPError | 400,401,500 | application/json | +| errors.HTTPValidationError | 422 | application/json | +| errors.SDKError | 4xx-5xx | */* | + + +## imageToVideo + +Generate a video from a provided image. + +### Example Usage + +```typescript +import { LivepeerAI } from "livepeer-ai"; +import { openAsBlob } from "node:fs"; + +const livepeerAI = new LivepeerAI({ + httpBearer: "", +}); + +async function run() { + const result = await livepeerAI.generate.imageToVideo({ + image: await openAsBlob("example.file"), + }); + + // Handle the result + console.log(result) +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { LivepeerAICore } from "livepeer-ai/core.js"; +import { generateImageToVideo } from "livepeer-ai/funcs/generateImageToVideo.js"; +import { openAsBlob } from "node:fs"; + +// Use `LivepeerAICore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const livepeerAI = new LivepeerAICore({ + httpBearer: "", +}); + +async function run() { + const res = await generateImageToVideo(livepeerAI, { + image: await openAsBlob("example.file"), + }); + + if (!res.ok) { + throw res.error; + } + + const { value: result } = res; + + // Handle the result + console.log(result) +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [components.BodyGenImageToVideo](../../models/components/bodygenimagetovideo.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[operations.GenImageToVideoResponse](../../models/operations/genimagetovideoresponse.md)\>** + +### Errors + +| Error Object | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| errors.HTTPError | 400,401,500 | application/json | +| errors.HTTPValidationError | 422 | application/json | +| errors.SDKError | 4xx-5xx | */* | + + +## upscale + +Upscale an image by increasing its resolution. + +### Example Usage + +```typescript +import { LivepeerAI } from "livepeer-ai"; +import { openAsBlob } from "node:fs"; + +const livepeerAI = new LivepeerAI({ + httpBearer: "", +}); + +async function run() { + const result = await livepeerAI.generate.upscale({ + image: await openAsBlob("example.file"), + prompt: "", + }); + + // Handle the result + console.log(result) +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { LivepeerAICore } from "livepeer-ai/core.js"; +import { generateUpscale } from "livepeer-ai/funcs/generateUpscale.js"; +import { openAsBlob } from "node:fs"; + +// Use `LivepeerAICore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const livepeerAI = new LivepeerAICore({ + httpBearer: "", +}); + +async function run() { + const res = await generateUpscale(livepeerAI, { + image: await openAsBlob("example.file"), + prompt: "", + }); + + if (!res.ok) { + throw res.error; + } + + const { value: result } = res; + + // Handle the result + console.log(result) +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [components.BodyGenUpscale](../../models/components/bodygenupscale.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[operations.GenUpscaleResponse](../../models/operations/genupscaleresponse.md)\>** + +### Errors + +| Error Object | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| errors.HTTPError | 400,401,500 | application/json | +| errors.HTTPValidationError | 422 | application/json | +| errors.SDKError | 4xx-5xx | */* | + + +## audioToText + +Transcribe audio files to text. + +### Example Usage + +```typescript +import { LivepeerAI } from "livepeer-ai"; +import { openAsBlob } from "node:fs"; + +const livepeerAI = new LivepeerAI({ + httpBearer: "", +}); + +async function run() { + const result = await livepeerAI.generate.audioToText({ + audio: await openAsBlob("example.file"), + }); + + // Handle the result + console.log(result) +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { LivepeerAICore } from "livepeer-ai/core.js"; +import { generateAudioToText } from "livepeer-ai/funcs/generateAudioToText.js"; +import { openAsBlob } from "node:fs"; + +// Use `LivepeerAICore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const livepeerAI = new LivepeerAICore({ + httpBearer: "", +}); + +async function run() { + const res = await generateAudioToText(livepeerAI, { + audio: await openAsBlob("example.file"), + }); + + if (!res.ok) { + throw res.error; + } + + const { value: result } = res; + + // Handle the result + console.log(result) +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [components.BodyGenAudioToText](../../models/components/bodygenaudiototext.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[operations.GenAudioToTextResponse](../../models/operations/genaudiototextresponse.md)\>** + +### Errors + +| Error Object | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| errors.HTTPError | 400,401,413,500 | application/json | +| errors.HTTPValidationError | 422 | application/json | +| errors.SDKError | 4xx-5xx | */* | + + +## segmentAnything2 + +Segment objects in an image. + +### Example Usage + +```typescript +import { LivepeerAI } from "livepeer-ai"; +import { openAsBlob } from "node:fs"; + +const livepeerAI = new LivepeerAI({ + httpBearer: "", +}); + +async function run() { + const result = await livepeerAI.generate.segmentAnything2({ + image: await openAsBlob("example.file"), + }); + + // Handle the result + console.log(result) +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { LivepeerAICore } from "livepeer-ai/core.js"; +import { generateSegmentAnything2 } from "livepeer-ai/funcs/generateSegmentAnything2.js"; +import { openAsBlob } from "node:fs"; + +// Use `LivepeerAICore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const livepeerAI = new LivepeerAICore({ + httpBearer: "", +}); + +async function run() { + const res = await generateSegmentAnything2(livepeerAI, { + image: await openAsBlob("example.file"), + }); + + if (!res.ok) { + throw res.error; + } + + const { value: result } = res; + + // Handle the result + console.log(result) +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [components.BodyGenSegmentAnything2](../../models/components/bodygensegmentanything2.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[operations.GenSegmentAnything2Response](../../models/operations/gensegmentanything2response.md)\>** + +### Errors + +| Error Object | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| errors.HTTPError | 400,401,500 | application/json | +| errors.HTTPValidationError | 422 | application/json | +| errors.SDKError | 4xx-5xx | */* | diff --git a/docs/sdks/livepeerai/README.md b/docs/sdks/livepeerai/README.md index 54ead0f..c296488 100644 --- a/docs/sdks/livepeerai/README.md +++ b/docs/sdks/livepeerai/README.md @@ -2,500 +2,4 @@ ## Overview -Livepeer AI Runner: An application to run AI pipelines - -### Available Operations - -* [textToImage](#texttoimage) - Text To Image -* [imageToImage](#imagetoimage) - Image To Image -* [imageToVideo](#imagetovideo) - Image To Video -* [upscale](#upscale) - Upscale -* [audioToText](#audiototext) - Audio To Text -* [segmentAnything2](#segmentanything2) - Segment Anything 2 - -## textToImage - -Generate images from text prompts. - -### Example Usage - -```typescript -import { LivepeerAI } from "livepeer-ai"; - -const livepeerAI = new LivepeerAI({ - httpBearer: "", -}); - -async function run() { - const result = await livepeerAI.textToImage({ - prompt: "", - }); - - // Handle the result - console.log(result) -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { LivepeerAICore } from "livepeer-ai/core.js"; -import { textToImage } from "livepeer-ai/funcs/textToImage.js"; - -// Use `LivepeerAICore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const livepeerAI = new LivepeerAICore({ - httpBearer: "", -}); - -async function run() { - const res = await textToImage(livepeerAI, { - prompt: "", - }); - - if (!res.ok) { - throw res.error; - } - - const { value: result } = res; - - // Handle the result - console.log(result) -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [components.TextToImageParams](../../models/components/texttoimageparams.md) | :heavy_check_mark: | The request object to use for the request. | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - -### Response - -**Promise\<[operations.TextToImageResponse](../../models/operations/texttoimageresponse.md)\>** - -### Errors - -| Error Object | Status Code | Content Type | -| -------------------------- | -------------------------- | -------------------------- | -| errors.HTTPError | 400,401,500 | application/json | -| errors.HTTPValidationError | 422 | application/json | -| errors.SDKError | 4xx-5xx | */* | - - -## imageToImage - -Apply image transformations to a provided image. - -### Example Usage - -```typescript -import { LivepeerAI } from "livepeer-ai"; -import { openAsBlob } from "node:fs"; - -const livepeerAI = new LivepeerAI({ - httpBearer: "", -}); - -async function run() { - const result = await livepeerAI.imageToImage({ - image: await openAsBlob("example.file"), - prompt: "", - }); - - // Handle the result - console.log(result) -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { LivepeerAICore } from "livepeer-ai/core.js"; -import { imageToImage } from "livepeer-ai/funcs/imageToImage.js"; -import { openAsBlob } from "node:fs"; - -// Use `LivepeerAICore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const livepeerAI = new LivepeerAICore({ - httpBearer: "", -}); - -async function run() { - const res = await imageToImage(livepeerAI, { - image: await openAsBlob("example.file"), - prompt: "", - }); - - if (!res.ok) { - throw res.error; - } - - const { value: result } = res; - - // Handle the result - console.log(result) -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [components.BodyImageToImageImageToImagePost](../../models/components/bodyimagetoimageimagetoimagepost.md) | :heavy_check_mark: | The request object to use for the request. | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - -### Response - -**Promise\<[operations.ImageToImageResponse](../../models/operations/imagetoimageresponse.md)\>** - -### Errors - -| Error Object | Status Code | Content Type | -| -------------------------- | -------------------------- | -------------------------- | -| errors.HTTPError | 400,401,500 | application/json | -| errors.HTTPValidationError | 422 | application/json | -| errors.SDKError | 4xx-5xx | */* | - - -## imageToVideo - -Generate a video from a provided image. - -### Example Usage - -```typescript -import { LivepeerAI } from "livepeer-ai"; -import { openAsBlob } from "node:fs"; - -const livepeerAI = new LivepeerAI({ - httpBearer: "", -}); - -async function run() { - const result = await livepeerAI.imageToVideo({ - image: await openAsBlob("example.file"), - }); - - // Handle the result - console.log(result) -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { LivepeerAICore } from "livepeer-ai/core.js"; -import { imageToVideo } from "livepeer-ai/funcs/imageToVideo.js"; -import { openAsBlob } from "node:fs"; - -// Use `LivepeerAICore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const livepeerAI = new LivepeerAICore({ - httpBearer: "", -}); - -async function run() { - const res = await imageToVideo(livepeerAI, { - image: await openAsBlob("example.file"), - }); - - if (!res.ok) { - throw res.error; - } - - const { value: result } = res; - - // Handle the result - console.log(result) -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [components.BodyImageToVideoImageToVideoPost](../../models/components/bodyimagetovideoimagetovideopost.md) | :heavy_check_mark: | The request object to use for the request. | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - -### Response - -**Promise\<[operations.ImageToVideoResponse](../../models/operations/imagetovideoresponse.md)\>** - -### Errors - -| Error Object | Status Code | Content Type | -| -------------------------- | -------------------------- | -------------------------- | -| errors.HTTPError | 400,401,500 | application/json | -| errors.HTTPValidationError | 422 | application/json | -| errors.SDKError | 4xx-5xx | */* | - - -## upscale - -Upscale an image by increasing its resolution. - -### Example Usage - -```typescript -import { LivepeerAI } from "livepeer-ai"; -import { openAsBlob } from "node:fs"; - -const livepeerAI = new LivepeerAI({ - httpBearer: "", -}); - -async function run() { - const result = await livepeerAI.upscale({ - image: await openAsBlob("example.file"), - prompt: "", - }); - - // Handle the result - console.log(result) -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { LivepeerAICore } from "livepeer-ai/core.js"; -import { upscale } from "livepeer-ai/funcs/upscale.js"; -import { openAsBlob } from "node:fs"; - -// Use `LivepeerAICore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const livepeerAI = new LivepeerAICore({ - httpBearer: "", -}); - -async function run() { - const res = await upscale(livepeerAI, { - image: await openAsBlob("example.file"), - prompt: "", - }); - - if (!res.ok) { - throw res.error; - } - - const { value: result } = res; - - // Handle the result - console.log(result) -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [components.BodyUpscaleUpscalePost](../../models/components/bodyupscaleupscalepost.md) | :heavy_check_mark: | The request object to use for the request. | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - -### Response - -**Promise\<[operations.UpscaleResponse](../../models/operations/upscaleresponse.md)\>** - -### Errors - -| Error Object | Status Code | Content Type | -| -------------------------- | -------------------------- | -------------------------- | -| errors.HTTPError | 400,401,500 | application/json | -| errors.HTTPValidationError | 422 | application/json | -| errors.SDKError | 4xx-5xx | */* | - - -## audioToText - -Transcribe audio files to text. - -### Example Usage - -```typescript -import { LivepeerAI } from "livepeer-ai"; -import { openAsBlob } from "node:fs"; - -const livepeerAI = new LivepeerAI({ - httpBearer: "", -}); - -async function run() { - const result = await livepeerAI.audioToText({ - audio: await openAsBlob("example.file"), - }); - - // Handle the result - console.log(result) -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { LivepeerAICore } from "livepeer-ai/core.js"; -import { audioToText } from "livepeer-ai/funcs/audioToText.js"; -import { openAsBlob } from "node:fs"; - -// Use `LivepeerAICore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const livepeerAI = new LivepeerAICore({ - httpBearer: "", -}); - -async function run() { - const res = await audioToText(livepeerAI, { - audio: await openAsBlob("example.file"), - }); - - if (!res.ok) { - throw res.error; - } - - const { value: result } = res; - - // Handle the result - console.log(result) -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [components.BodyAudioToTextAudioToTextPost](../../models/components/bodyaudiototextaudiototextpost.md) | :heavy_check_mark: | The request object to use for the request. | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - -### Response - -**Promise\<[operations.AudioToTextResponse](../../models/operations/audiototextresponse.md)\>** - -### Errors - -| Error Object | Status Code | Content Type | -| -------------------------- | -------------------------- | -------------------------- | -| errors.HTTPError | 400,401,413,500 | application/json | -| errors.HTTPValidationError | 422 | application/json | -| errors.SDKError | 4xx-5xx | */* | - - -## segmentAnything2 - -Segment objects in an image. - -### Example Usage - -```typescript -import { LivepeerAI } from "livepeer-ai"; -import { openAsBlob } from "node:fs"; - -const livepeerAI = new LivepeerAI({ - httpBearer: "", -}); - -async function run() { - const result = await livepeerAI.segmentAnything2({ - image: await openAsBlob("example.file"), - }); - - // Handle the result - console.log(result) -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { LivepeerAICore } from "livepeer-ai/core.js"; -import { segmentAnything2 } from "livepeer-ai/funcs/segmentAnything2.js"; -import { openAsBlob } from "node:fs"; - -// Use `LivepeerAICore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const livepeerAI = new LivepeerAICore({ - httpBearer: "", -}); - -async function run() { - const res = await segmentAnything2(livepeerAI, { - image: await openAsBlob("example.file"), - }); - - if (!res.ok) { - throw res.error; - } - - const { value: result } = res; - - // Handle the result - console.log(result) -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [components.BodySegmentAnything2SegmentAnything2Post](../../models/components/bodysegmentanything2segmentanything2post.md) | :heavy_check_mark: | The request object to use for the request. | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - -### Response - -**Promise\<[operations.SegmentAnything2Response](../../models/operations/segmentanything2response.md)\>** - -### Errors - -| Error Object | Status Code | Content Type | -| -------------------------- | -------------------------- | -------------------------- | -| errors.HTTPError | 400,401,500 | application/json | -| errors.HTTPValidationError | 422 | application/json | -| errors.SDKError | 4xx-5xx | */* | +Livepeer AI Runner: An application to run AI pipelines \ No newline at end of file diff --git a/jsr.json b/jsr.json index 452e7d5..d746a8c 100644 --- a/jsr.json +++ b/jsr.json @@ -1,12 +1,12 @@ { - "name": "@livepeer/ai", - "version": "0.2.0", + "name": "livepeer-ai", + "version": "0.3.0", "exports": { - ".": "./src/index.ts", - "./models/errors": "./src/models/errors/index.ts", - "./models/components": "./src/models/components/index.ts", + ".": "./src/index.ts", + "./models/errors": "./src/models/errors/index.ts", + "./models/components": "./src/models/components/index.ts", "./models/operations": "./src/models/operations/index.ts", "./lib/config": "./src/lib/config.ts", "./lib/http": "./src/lib/http.ts", diff --git a/package-lock.json b/package-lock.json index 61b398c..547f05d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,14 +1,13 @@ { - "name": "@livepeer/ai", - "version": "0.2.0", + "name": "livepeer-ai", + "version": "0.3.0", "lockfileVersion": 3, "requires": true, "packages": { "": { - "name": "@livepeer/ai", - "version": "0.2.0", + "name": "livepeer-ai", + "version": "0.3.0", "devDependencies": { - "@types/node": "^18.19.3", "@typescript-eslint/eslint-plugin": "^7.7.1", "@typescript-eslint/parser": "^7.7.1", "eslint": "^8.57.0", @@ -212,16 +211,6 @@ "dev": true, "license": "MIT" }, - "node_modules/@types/node": { - "version": "18.19.50", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.19.50.tgz", - "integrity": "sha512-xonK+NRrMBRtkL1hVCc3G+uXtjh1Al4opBLjqVmipe5ZAaBYWW6cNAiBVZ1BvmkBhep698rP3UM3aRAdSALuhg==", - "dev": true, - "license": "MIT", - "dependencies": { - "undici-types": "~5.26.4" - } - }, "node_modules/@typescript-eslint/eslint-plugin": { "version": "7.18.0", "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-7.18.0.tgz", @@ -3211,13 +3200,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/undici-types": { - "version": "5.26.5", - "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", - "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==", - "dev": true, - "license": "MIT" - }, "node_modules/uri-js": { "version": "4.4.1", "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", diff --git a/package.json b/package.json index 076d897..5dc8cc6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { - "name": "@livepeer/ai", - "version": "0.2.0", + "name": "livepeer-ai", + "version": "0.3.0", "author": "Livepeer", "main": "./index.js", "sideEffects": false, @@ -17,7 +17,6 @@ "zod": ">= 3" }, "devDependencies": { - "@types/node": "^18.19.3", "@typescript-eslint/eslint-plugin": "^7.7.1", "@typescript-eslint/parser": "^7.7.1", "eslint": "^8.57.0", @@ -26,5 +25,7 @@ "typescript": "^5.4.5", "zod": "^3.23.4" }, - "dependencies": {} + "dependencies": { + + } } diff --git a/src/funcs/audioToText.ts b/src/funcs/generateAudioToText.ts similarity index 92% rename from src/funcs/audioToText.ts rename to src/funcs/generateAudioToText.ts index 1007429..982ae8c 100644 --- a/src/funcs/audioToText.ts +++ b/src/funcs/generateAudioToText.ts @@ -31,13 +31,13 @@ import { isReadableStream } from "../types/streams.js"; * @remarks * Transcribe audio files to text. */ -export async function audioToText( +export async function generateAudioToText( client$: LivepeerAICore, - request: components.BodyAudioToTextAudioToTextPost, + request: components.BodyGenAudioToText, options?: RequestOptions, ): Promise< Result< - operations.AudioToTextResponse, + operations.GenAudioToTextResponse, | errors.HTTPError | errors.HTTPValidationError | SDKError @@ -53,8 +53,7 @@ export async function audioToText( const parsed$ = schemas$.safeParse( input$, - (value$) => - components.BodyAudioToTextAudioToTextPost$outboundSchema.parse(value$), + (value$) => components.BodyGenAudioToText$outboundSchema.parse(value$), "Input validation failed", ); if (!parsed$.ok) { @@ -89,7 +88,7 @@ export async function audioToText( const httpBearer$ = await extractSecurity(client$.options$.httpBearer); const security$ = httpBearer$ == null ? {} : { httpBearer: httpBearer$ }; const context = { - operationID: "audio_to_text", + operationID: "genAudioToText", oAuth2Scopes: [], securitySource: client$.options$.httpBearer, }; @@ -129,7 +128,7 @@ export async function audioToText( }; const [result$] = await m$.match< - operations.AudioToTextResponse, + operations.GenAudioToTextResponse, | errors.HTTPError | errors.HTTPValidationError | SDKError @@ -140,7 +139,7 @@ export async function audioToText( | RequestTimeoutError | ConnectionError >( - m$.json(200, operations.AudioToTextResponse$inboundSchema, { + m$.json(200, operations.GenAudioToTextResponse$inboundSchema, { key: "TextResponse", }), m$.jsonErr([400, 401, 413, 500], errors.HTTPError$inboundSchema), diff --git a/src/funcs/imageToImage.ts b/src/funcs/generateImageToImage.ts similarity index 93% rename from src/funcs/imageToImage.ts rename to src/funcs/generateImageToImage.ts index 21572ad..b577d64 100644 --- a/src/funcs/imageToImage.ts +++ b/src/funcs/generateImageToImage.ts @@ -31,13 +31,13 @@ import { isReadableStream } from "../types/streams.js"; * @remarks * Apply image transformations to a provided image. */ -export async function imageToImage( +export async function generateImageToImage( client$: LivepeerAICore, - request: components.BodyImageToImageImageToImagePost, + request: components.BodyGenImageToImage, options?: RequestOptions, ): Promise< Result< - operations.ImageToImageResponse, + operations.GenImageToImageResponse, | errors.HTTPError | errors.HTTPValidationError | SDKError @@ -53,8 +53,7 @@ export async function imageToImage( const parsed$ = schemas$.safeParse( input$, - (value$) => - components.BodyImageToImageImageToImagePost$outboundSchema.parse(value$), + (value$) => components.BodyGenImageToImage$outboundSchema.parse(value$), "Input validation failed", ); if (!parsed$.ok) { @@ -117,7 +116,7 @@ export async function imageToImage( const httpBearer$ = await extractSecurity(client$.options$.httpBearer); const security$ = httpBearer$ == null ? {} : { httpBearer: httpBearer$ }; const context = { - operationID: "image_to_image", + operationID: "genImageToImage", oAuth2Scopes: [], securitySource: client$.options$.httpBearer, }; @@ -157,7 +156,7 @@ export async function imageToImage( }; const [result$] = await m$.match< - operations.ImageToImageResponse, + operations.GenImageToImageResponse, | errors.HTTPError | errors.HTTPValidationError | SDKError @@ -168,7 +167,7 @@ export async function imageToImage( | RequestTimeoutError | ConnectionError >( - m$.json(200, operations.ImageToImageResponse$inboundSchema, { + m$.json(200, operations.GenImageToImageResponse$inboundSchema, { key: "ImageResponse", }), m$.jsonErr([400, 401, 500], errors.HTTPError$inboundSchema), diff --git a/src/funcs/imageToVideo.ts b/src/funcs/generateImageToVideo.ts similarity index 93% rename from src/funcs/imageToVideo.ts rename to src/funcs/generateImageToVideo.ts index 172059c..9f3883b 100644 --- a/src/funcs/imageToVideo.ts +++ b/src/funcs/generateImageToVideo.ts @@ -31,13 +31,13 @@ import { isReadableStream } from "../types/streams.js"; * @remarks * Generate a video from a provided image. */ -export async function imageToVideo( +export async function generateImageToVideo( client$: LivepeerAICore, - request: components.BodyImageToVideoImageToVideoPost, + request: components.BodyGenImageToVideo, options?: RequestOptions, ): Promise< Result< - operations.ImageToVideoResponse, + operations.GenImageToVideoResponse, | errors.HTTPError | errors.HTTPValidationError | SDKError @@ -53,8 +53,7 @@ export async function imageToVideo( const parsed$ = schemas$.safeParse( input$, - (value$) => - components.BodyImageToVideoImageToVideoPost$outboundSchema.parse(value$), + (value$) => components.BodyGenImageToVideo$outboundSchema.parse(value$), "Input validation failed", ); if (!parsed$.ok) { @@ -113,7 +112,7 @@ export async function imageToVideo( const httpBearer$ = await extractSecurity(client$.options$.httpBearer); const security$ = httpBearer$ == null ? {} : { httpBearer: httpBearer$ }; const context = { - operationID: "image_to_video", + operationID: "genImageToVideo", oAuth2Scopes: [], securitySource: client$.options$.httpBearer, }; @@ -153,7 +152,7 @@ export async function imageToVideo( }; const [result$] = await m$.match< - operations.ImageToVideoResponse, + operations.GenImageToVideoResponse, | errors.HTTPError | errors.HTTPValidationError | SDKError @@ -164,7 +163,7 @@ export async function imageToVideo( | RequestTimeoutError | ConnectionError >( - m$.json(200, operations.ImageToVideoResponse$inboundSchema, { + m$.json(200, operations.GenImageToVideoResponse$inboundSchema, { key: "VideoResponse", }), m$.jsonErr([400, 401, 500], errors.HTTPError$inboundSchema), diff --git a/src/funcs/segmentAnything2.ts b/src/funcs/generateSegmentAnything2.ts similarity index 92% rename from src/funcs/segmentAnything2.ts rename to src/funcs/generateSegmentAnything2.ts index 0a1df07..36129e4 100644 --- a/src/funcs/segmentAnything2.ts +++ b/src/funcs/generateSegmentAnything2.ts @@ -31,13 +31,13 @@ import { isReadableStream } from "../types/streams.js"; * @remarks * Segment objects in an image. */ -export async function segmentAnything2( +export async function generateSegmentAnything2( client$: LivepeerAICore, - request: components.BodySegmentAnything2SegmentAnything2Post, + request: components.BodyGenSegmentAnything2, options?: RequestOptions, ): Promise< Result< - operations.SegmentAnything2Response, + operations.GenSegmentAnything2Response, | errors.HTTPError | errors.HTTPValidationError | SDKError @@ -53,10 +53,7 @@ export async function segmentAnything2( const parsed$ = schemas$.safeParse( input$, - (value$) => - components.BodySegmentAnything2SegmentAnything2Post$outboundSchema.parse( - value$, - ), + (value$) => components.BodyGenSegmentAnything2$outboundSchema.parse(value$), "Input validation failed", ); if (!parsed$.ok) { @@ -112,7 +109,7 @@ export async function segmentAnything2( const httpBearer$ = await extractSecurity(client$.options$.httpBearer); const security$ = httpBearer$ == null ? {} : { httpBearer: httpBearer$ }; const context = { - operationID: "segment_anything_2", + operationID: "genSegmentAnything2", oAuth2Scopes: [], securitySource: client$.options$.httpBearer, }; @@ -152,7 +149,7 @@ export async function segmentAnything2( }; const [result$] = await m$.match< - operations.SegmentAnything2Response, + operations.GenSegmentAnything2Response, | errors.HTTPError | errors.HTTPValidationError | SDKError @@ -163,7 +160,7 @@ export async function segmentAnything2( | RequestTimeoutError | ConnectionError >( - m$.json(200, operations.SegmentAnything2Response$inboundSchema, { + m$.json(200, operations.GenSegmentAnything2Response$inboundSchema, { key: "MasksResponse", }), m$.jsonErr([400, 401, 500], errors.HTTPError$inboundSchema), diff --git a/src/funcs/textToImage.ts b/src/funcs/generateTextToImage.ts similarity index 94% rename from src/funcs/textToImage.ts rename to src/funcs/generateTextToImage.ts index 8193aee..18546c0 100644 --- a/src/funcs/textToImage.ts +++ b/src/funcs/generateTextToImage.ts @@ -29,13 +29,13 @@ import { Result } from "../types/fp.js"; * @remarks * Generate images from text prompts. */ -export async function textToImage( +export async function generateTextToImage( client$: LivepeerAICore, request: components.TextToImageParams, options?: RequestOptions, ): Promise< Result< - operations.TextToImageResponse, + operations.GenTextToImageResponse, | errors.HTTPError | errors.HTTPValidationError | SDKError @@ -70,7 +70,7 @@ export async function textToImage( const httpBearer$ = await extractSecurity(client$.options$.httpBearer); const security$ = httpBearer$ == null ? {} : { httpBearer: httpBearer$ }; const context = { - operationID: "text_to_image", + operationID: "genTextToImage", oAuth2Scopes: [], securitySource: client$.options$.httpBearer, }; @@ -110,7 +110,7 @@ export async function textToImage( }; const [result$] = await m$.match< - operations.TextToImageResponse, + operations.GenTextToImageResponse, | errors.HTTPError | errors.HTTPValidationError | SDKError @@ -121,7 +121,7 @@ export async function textToImage( | RequestTimeoutError | ConnectionError >( - m$.json(200, operations.TextToImageResponse$inboundSchema, { + m$.json(200, operations.GenTextToImageResponse$inboundSchema, { key: "ImageResponse", }), m$.jsonErr([400, 401, 500], errors.HTTPError$inboundSchema), diff --git a/src/funcs/upscale.ts b/src/funcs/generateUpscale.ts similarity index 93% rename from src/funcs/upscale.ts rename to src/funcs/generateUpscale.ts index 459e9f3..7cdf0f7 100644 --- a/src/funcs/upscale.ts +++ b/src/funcs/generateUpscale.ts @@ -31,13 +31,13 @@ import { isReadableStream } from "../types/streams.js"; * @remarks * Upscale an image by increasing its resolution. */ -export async function upscale( +export async function generateUpscale( client$: LivepeerAICore, - request: components.BodyUpscaleUpscalePost, + request: components.BodyGenUpscale, options?: RequestOptions, ): Promise< Result< - operations.UpscaleResponse, + operations.GenUpscaleResponse, | errors.HTTPError | errors.HTTPValidationError | SDKError @@ -53,7 +53,7 @@ export async function upscale( const parsed$ = schemas$.safeParse( input$, - (value$) => components.BodyUpscaleUpscalePost$outboundSchema.parse(value$), + (value$) => components.BodyGenUpscale$outboundSchema.parse(value$), "Input validation failed", ); if (!parsed$.ok) { @@ -98,7 +98,7 @@ export async function upscale( const httpBearer$ = await extractSecurity(client$.options$.httpBearer); const security$ = httpBearer$ == null ? {} : { httpBearer: httpBearer$ }; const context = { - operationID: "upscale", + operationID: "genUpscale", oAuth2Scopes: [], securitySource: client$.options$.httpBearer, }; @@ -138,7 +138,7 @@ export async function upscale( }; const [result$] = await m$.match< - operations.UpscaleResponse, + operations.GenUpscaleResponse, | errors.HTTPError | errors.HTTPValidationError | SDKError @@ -149,7 +149,7 @@ export async function upscale( | RequestTimeoutError | ConnectionError >( - m$.json(200, operations.UpscaleResponse$inboundSchema, { + m$.json(200, operations.GenUpscaleResponse$inboundSchema, { key: "ImageResponse", }), m$.jsonErr([400, 401, 500], errors.HTTPError$inboundSchema), diff --git a/src/lib/config.ts b/src/lib/config.ts index f8394ca..ba1d17e 100644 --- a/src/lib/config.ts +++ b/src/lib/config.ts @@ -60,8 +60,8 @@ export function serverURLFromOptions(options: SDKOptions): URL | null { export const SDK_METADATA = { language: "typescript", - openapiDocVersion: "v0.2.0", - sdkVersion: "0.2.0", - genVersion: "2.415.6", - userAgent: "speakeasy-sdk/typescript 0.2.0 2.415.6 v0.2.0 livepeer-ai", + openapiDocVersion: "v0.5.0", + sdkVersion: "0.3.0", + genVersion: "2.415.7", + userAgent: "speakeasy-sdk/typescript 0.3.0 2.415.7 v0.5.0 livepeer-ai", } as const; diff --git a/src/models/components/bodyaudiototextaudiototextpost.ts b/src/models/components/bodygenaudiototext.ts similarity index 67% rename from src/models/components/bodyaudiototextaudiototextpost.ts rename to src/models/components/bodygenaudiototext.ts index 55be094..35bed89 100644 --- a/src/models/components/bodyaudiototextaudiototextpost.ts +++ b/src/models/components/bodygenaudiototext.ts @@ -8,10 +8,10 @@ import { blobLikeSchema } from "../../types/blobs.js"; export type Audio = { fileName: string; - content: ReadableStream | Blob | ArrayBuffer | Buffer; + content: ReadableStream | Blob | ArrayBuffer; }; -export type BodyAudioToTextAudioToTextPost = { +export type BodyGenAudioToText = { /** * Uploaded audio file to be transcribed. */ @@ -30,14 +30,13 @@ export const Audio$inboundSchema: z.ZodType = z z.instanceof(ReadableStream), z.instanceof(Blob), z.instanceof(ArrayBuffer), - z.instanceof(Buffer), ]), }); /** @internal */ export type Audio$Outbound = { fileName: string; - content: ReadableStream | Blob | ArrayBuffer | Buffer; + content: ReadableStream | Blob | ArrayBuffer; }; /** @internal */ @@ -51,7 +50,6 @@ export const Audio$outboundSchema: z.ZodType< z.instanceof(ReadableStream), z.instanceof(Blob), z.instanceof(ArrayBuffer), - z.instanceof(Buffer), ]), }); @@ -69,8 +67,8 @@ export namespace Audio$ { } /** @internal */ -export const BodyAudioToTextAudioToTextPost$inboundSchema: z.ZodType< - BodyAudioToTextAudioToTextPost, +export const BodyGenAudioToText$inboundSchema: z.ZodType< + BodyGenAudioToText, z.ZodTypeDef, unknown > = z.object({ @@ -83,16 +81,16 @@ export const BodyAudioToTextAudioToTextPost$inboundSchema: z.ZodType< }); /** @internal */ -export type BodyAudioToTextAudioToTextPost$Outbound = { +export type BodyGenAudioToText$Outbound = { audio: Audio$Outbound | Blob; model_id: string; }; /** @internal */ -export const BodyAudioToTextAudioToTextPost$outboundSchema: z.ZodType< - BodyAudioToTextAudioToTextPost$Outbound, +export const BodyGenAudioToText$outboundSchema: z.ZodType< + BodyGenAudioToText$Outbound, z.ZodTypeDef, - BodyAudioToTextAudioToTextPost + BodyGenAudioToText > = z.object({ audio: z.lazy(() => Audio$outboundSchema).or(blobLikeSchema), modelId: z.string().default(""), @@ -106,11 +104,11 @@ export const BodyAudioToTextAudioToTextPost$outboundSchema: z.ZodType< * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ -export namespace BodyAudioToTextAudioToTextPost$ { - /** @deprecated use `BodyAudioToTextAudioToTextPost$inboundSchema` instead. */ - export const inboundSchema = BodyAudioToTextAudioToTextPost$inboundSchema; - /** @deprecated use `BodyAudioToTextAudioToTextPost$outboundSchema` instead. */ - export const outboundSchema = BodyAudioToTextAudioToTextPost$outboundSchema; - /** @deprecated use `BodyAudioToTextAudioToTextPost$Outbound` instead. */ - export type Outbound = BodyAudioToTextAudioToTextPost$Outbound; +export namespace BodyGenAudioToText$ { + /** @deprecated use `BodyGenAudioToText$inboundSchema` instead. */ + export const inboundSchema = BodyGenAudioToText$inboundSchema; + /** @deprecated use `BodyGenAudioToText$outboundSchema` instead. */ + export const outboundSchema = BodyGenAudioToText$outboundSchema; + /** @deprecated use `BodyGenAudioToText$Outbound` instead. */ + export type Outbound = BodyGenAudioToText$Outbound; } diff --git a/src/models/components/bodyimagetoimageimagetoimagepost.ts b/src/models/components/bodygenimagetoimage.ts similarity index 81% rename from src/models/components/bodyimagetoimageimagetoimagepost.ts rename to src/models/components/bodygenimagetoimage.ts index 911059b..6fc8ecd 100644 --- a/src/models/components/bodyimagetoimageimagetoimagepost.ts +++ b/src/models/components/bodygenimagetoimage.ts @@ -8,10 +8,10 @@ import { blobLikeSchema } from "../../types/blobs.js"; export type Image = { fileName: string; - content: ReadableStream | Blob | ArrayBuffer | Buffer; + content: ReadableStream | Blob | ArrayBuffer; }; -export type BodyImageToImageImageToImagePost = { +export type BodyGenImageToImage = { /** * Uploaded image to modify with the pipeline. */ @@ -66,14 +66,13 @@ export const Image$inboundSchema: z.ZodType = z z.instanceof(ReadableStream), z.instanceof(Blob), z.instanceof(ArrayBuffer), - z.instanceof(Buffer), ]), }); /** @internal */ export type Image$Outbound = { fileName: string; - content: ReadableStream | Blob | ArrayBuffer | Buffer; + content: ReadableStream | Blob | ArrayBuffer; }; /** @internal */ @@ -87,7 +86,6 @@ export const Image$outboundSchema: z.ZodType< z.instanceof(ReadableStream), z.instanceof(Blob), z.instanceof(ArrayBuffer), - z.instanceof(Buffer), ]), }); @@ -105,8 +103,8 @@ export namespace Image$ { } /** @internal */ -export const BodyImageToImageImageToImagePost$inboundSchema: z.ZodType< - BodyImageToImageImageToImagePost, +export const BodyGenImageToImage$inboundSchema: z.ZodType< + BodyGenImageToImage, z.ZodTypeDef, unknown > = z.object({ @@ -134,7 +132,7 @@ export const BodyImageToImageImageToImagePost$inboundSchema: z.ZodType< }); /** @internal */ -export type BodyImageToImageImageToImagePost$Outbound = { +export type BodyGenImageToImage$Outbound = { image: Image$Outbound | Blob; prompt: string; guidance_scale: number; @@ -149,10 +147,10 @@ export type BodyImageToImageImageToImagePost$Outbound = { }; /** @internal */ -export const BodyImageToImageImageToImagePost$outboundSchema: z.ZodType< - BodyImageToImageImageToImagePost$Outbound, +export const BodyGenImageToImage$outboundSchema: z.ZodType< + BodyGenImageToImage$Outbound, z.ZodTypeDef, - BodyImageToImageImageToImagePost + BodyGenImageToImage > = z.object({ image: z.lazy(() => Image$outboundSchema).or(blobLikeSchema), prompt: z.string(), @@ -181,11 +179,11 @@ export const BodyImageToImageImageToImagePost$outboundSchema: z.ZodType< * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ -export namespace BodyImageToImageImageToImagePost$ { - /** @deprecated use `BodyImageToImageImageToImagePost$inboundSchema` instead. */ - export const inboundSchema = BodyImageToImageImageToImagePost$inboundSchema; - /** @deprecated use `BodyImageToImageImageToImagePost$outboundSchema` instead. */ - export const outboundSchema = BodyImageToImageImageToImagePost$outboundSchema; - /** @deprecated use `BodyImageToImageImageToImagePost$Outbound` instead. */ - export type Outbound = BodyImageToImageImageToImagePost$Outbound; +export namespace BodyGenImageToImage$ { + /** @deprecated use `BodyGenImageToImage$inboundSchema` instead. */ + export const inboundSchema = BodyGenImageToImage$inboundSchema; + /** @deprecated use `BodyGenImageToImage$outboundSchema` instead. */ + export const outboundSchema = BodyGenImageToImage$outboundSchema; + /** @deprecated use `BodyGenImageToImage$Outbound` instead. */ + export type Outbound = BodyGenImageToImage$Outbound; } diff --git a/src/models/components/bodyimagetovideoimagetovideopost.ts b/src/models/components/bodygenimagetovideo.ts similarity index 62% rename from src/models/components/bodyimagetovideoimagetovideopost.ts rename to src/models/components/bodygenimagetovideo.ts index 2cdd970..d8b05e6 100644 --- a/src/models/components/bodyimagetovideoimagetovideopost.ts +++ b/src/models/components/bodygenimagetovideo.ts @@ -6,16 +6,16 @@ import * as z from "zod"; import { remap as remap$ } from "../../lib/primitives.js"; import { blobLikeSchema } from "../../types/blobs.js"; -export type BodyImageToVideoImageToVideoPostImage = { +export type BodyGenImageToVideoImage = { fileName: string; - content: ReadableStream | Blob | ArrayBuffer | Buffer; + content: ReadableStream | Blob | ArrayBuffer; }; -export type BodyImageToVideoImageToVideoPost = { +export type BodyGenImageToVideo = { /** * Uploaded image to generate a video from. */ - image: BodyImageToVideoImageToVideoPostImage | Blob; + image: BodyGenImageToVideoImage | Blob; /** * The frames per second of the generated video. */ @@ -55,8 +55,8 @@ export type BodyImageToVideoImageToVideoPost = { }; /** @internal */ -export const BodyImageToVideoImageToVideoPostImage$inboundSchema: z.ZodType< - BodyImageToVideoImageToVideoPostImage, +export const BodyGenImageToVideoImage$inboundSchema: z.ZodType< + BodyGenImageToVideoImage, z.ZodTypeDef, unknown > = z.object({ @@ -65,28 +65,26 @@ export const BodyImageToVideoImageToVideoPostImage$inboundSchema: z.ZodType< z.instanceof(ReadableStream), z.instanceof(Blob), z.instanceof(ArrayBuffer), - z.instanceof(Buffer), ]), }); /** @internal */ -export type BodyImageToVideoImageToVideoPostImage$Outbound = { +export type BodyGenImageToVideoImage$Outbound = { fileName: string; - content: ReadableStream | Blob | ArrayBuffer | Buffer; + content: ReadableStream | Blob | ArrayBuffer; }; /** @internal */ -export const BodyImageToVideoImageToVideoPostImage$outboundSchema: z.ZodType< - BodyImageToVideoImageToVideoPostImage$Outbound, +export const BodyGenImageToVideoImage$outboundSchema: z.ZodType< + BodyGenImageToVideoImage$Outbound, z.ZodTypeDef, - BodyImageToVideoImageToVideoPostImage + BodyGenImageToVideoImage > = z.object({ fileName: z.string(), content: z.union([ z.instanceof(ReadableStream), z.instanceof(Blob), z.instanceof(ArrayBuffer), - z.instanceof(Buffer), ]), }); @@ -94,24 +92,22 @@ export const BodyImageToVideoImageToVideoPostImage$outboundSchema: z.ZodType< * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ -export namespace BodyImageToVideoImageToVideoPostImage$ { - /** @deprecated use `BodyImageToVideoImageToVideoPostImage$inboundSchema` instead. */ - export const inboundSchema = - BodyImageToVideoImageToVideoPostImage$inboundSchema; - /** @deprecated use `BodyImageToVideoImageToVideoPostImage$outboundSchema` instead. */ - export const outboundSchema = - BodyImageToVideoImageToVideoPostImage$outboundSchema; - /** @deprecated use `BodyImageToVideoImageToVideoPostImage$Outbound` instead. */ - export type Outbound = BodyImageToVideoImageToVideoPostImage$Outbound; +export namespace BodyGenImageToVideoImage$ { + /** @deprecated use `BodyGenImageToVideoImage$inboundSchema` instead. */ + export const inboundSchema = BodyGenImageToVideoImage$inboundSchema; + /** @deprecated use `BodyGenImageToVideoImage$outboundSchema` instead. */ + export const outboundSchema = BodyGenImageToVideoImage$outboundSchema; + /** @deprecated use `BodyGenImageToVideoImage$Outbound` instead. */ + export type Outbound = BodyGenImageToVideoImage$Outbound; } /** @internal */ -export const BodyImageToVideoImageToVideoPost$inboundSchema: z.ZodType< - BodyImageToVideoImageToVideoPost, +export const BodyGenImageToVideo$inboundSchema: z.ZodType< + BodyGenImageToVideo, z.ZodTypeDef, unknown > = z.object({ - image: z.lazy(() => BodyImageToVideoImageToVideoPostImage$inboundSchema), + image: z.lazy(() => BodyGenImageToVideoImage$inboundSchema), fps: z.number().int().default(6), height: z.number().int().default(576), model_id: z.string().default(""), @@ -132,8 +128,8 @@ export const BodyImageToVideoImageToVideoPost$inboundSchema: z.ZodType< }); /** @internal */ -export type BodyImageToVideoImageToVideoPost$Outbound = { - image: BodyImageToVideoImageToVideoPostImage$Outbound | Blob; +export type BodyGenImageToVideo$Outbound = { + image: BodyGenImageToVideoImage$Outbound | Blob; fps: number; height: number; model_id: string; @@ -146,12 +142,12 @@ export type BodyImageToVideoImageToVideoPost$Outbound = { }; /** @internal */ -export const BodyImageToVideoImageToVideoPost$outboundSchema: z.ZodType< - BodyImageToVideoImageToVideoPost$Outbound, +export const BodyGenImageToVideo$outboundSchema: z.ZodType< + BodyGenImageToVideo$Outbound, z.ZodTypeDef, - BodyImageToVideoImageToVideoPost + BodyGenImageToVideo > = z.object({ - image: z.lazy(() => BodyImageToVideoImageToVideoPostImage$outboundSchema).or( + image: z.lazy(() => BodyGenImageToVideoImage$outboundSchema).or( blobLikeSchema, ), fps: z.number().int().default(6), @@ -177,11 +173,11 @@ export const BodyImageToVideoImageToVideoPost$outboundSchema: z.ZodType< * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ -export namespace BodyImageToVideoImageToVideoPost$ { - /** @deprecated use `BodyImageToVideoImageToVideoPost$inboundSchema` instead. */ - export const inboundSchema = BodyImageToVideoImageToVideoPost$inboundSchema; - /** @deprecated use `BodyImageToVideoImageToVideoPost$outboundSchema` instead. */ - export const outboundSchema = BodyImageToVideoImageToVideoPost$outboundSchema; - /** @deprecated use `BodyImageToVideoImageToVideoPost$Outbound` instead. */ - export type Outbound = BodyImageToVideoImageToVideoPost$Outbound; +export namespace BodyGenImageToVideo$ { + /** @deprecated use `BodyGenImageToVideo$inboundSchema` instead. */ + export const inboundSchema = BodyGenImageToVideo$inboundSchema; + /** @deprecated use `BodyGenImageToVideo$outboundSchema` instead. */ + export const outboundSchema = BodyGenImageToVideo$outboundSchema; + /** @deprecated use `BodyGenImageToVideo$Outbound` instead. */ + export type Outbound = BodyGenImageToVideo$Outbound; } diff --git a/src/models/components/bodysegmentanything2segmentanything2post.ts b/src/models/components/bodygensegmentanything2.ts similarity index 53% rename from src/models/components/bodysegmentanything2segmentanything2post.ts rename to src/models/components/bodygensegmentanything2.ts index 999171c..39ed93f 100644 --- a/src/models/components/bodysegmentanything2segmentanything2post.ts +++ b/src/models/components/bodygensegmentanything2.ts @@ -6,16 +6,16 @@ import * as z from "zod"; import { remap as remap$ } from "../../lib/primitives.js"; import { blobLikeSchema } from "../../types/blobs.js"; -export type BodySegmentAnything2SegmentAnything2PostImage = { +export type BodyGenSegmentAnything2Image = { fileName: string; - content: ReadableStream | Blob | ArrayBuffer | Buffer; + content: ReadableStream | Blob | ArrayBuffer; }; -export type BodySegmentAnything2SegmentAnything2Post = { +export type BodyGenSegmentAnything2 = { /** * Image to segment. */ - image: BodySegmentAnything2SegmentAnything2PostImage | Blob; + image: BodyGenSegmentAnything2Image | Blob; /** * A length 4 array given as a box prompt to the model, in XYXY format. */ @@ -51,67 +51,59 @@ export type BodySegmentAnything2SegmentAnything2Post = { }; /** @internal */ -export const BodySegmentAnything2SegmentAnything2PostImage$inboundSchema: - z.ZodType< - BodySegmentAnything2SegmentAnything2PostImage, - z.ZodTypeDef, - unknown - > = z.object({ - fileName: z.string(), - content: z.union([ - z.instanceof(ReadableStream), - z.instanceof(Blob), - z.instanceof(ArrayBuffer), - z.instanceof(Buffer), - ]), - }); +export const BodyGenSegmentAnything2Image$inboundSchema: z.ZodType< + BodyGenSegmentAnything2Image, + z.ZodTypeDef, + unknown +> = z.object({ + fileName: z.string(), + content: z.union([ + z.instanceof(ReadableStream), + z.instanceof(Blob), + z.instanceof(ArrayBuffer), + ]), +}); /** @internal */ -export type BodySegmentAnything2SegmentAnything2PostImage$Outbound = { +export type BodyGenSegmentAnything2Image$Outbound = { fileName: string; - content: ReadableStream | Blob | ArrayBuffer | Buffer; + content: ReadableStream | Blob | ArrayBuffer; }; /** @internal */ -export const BodySegmentAnything2SegmentAnything2PostImage$outboundSchema: - z.ZodType< - BodySegmentAnything2SegmentAnything2PostImage$Outbound, - z.ZodTypeDef, - BodySegmentAnything2SegmentAnything2PostImage - > = z.object({ - fileName: z.string(), - content: z.union([ - z.instanceof(ReadableStream), - z.instanceof(Blob), - z.instanceof(ArrayBuffer), - z.instanceof(Buffer), - ]), - }); +export const BodyGenSegmentAnything2Image$outboundSchema: z.ZodType< + BodyGenSegmentAnything2Image$Outbound, + z.ZodTypeDef, + BodyGenSegmentAnything2Image +> = z.object({ + fileName: z.string(), + content: z.union([ + z.instanceof(ReadableStream), + z.instanceof(Blob), + z.instanceof(ArrayBuffer), + ]), +}); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ -export namespace BodySegmentAnything2SegmentAnything2PostImage$ { - /** @deprecated use `BodySegmentAnything2SegmentAnything2PostImage$inboundSchema` instead. */ - export const inboundSchema = - BodySegmentAnything2SegmentAnything2PostImage$inboundSchema; - /** @deprecated use `BodySegmentAnything2SegmentAnything2PostImage$outboundSchema` instead. */ - export const outboundSchema = - BodySegmentAnything2SegmentAnything2PostImage$outboundSchema; - /** @deprecated use `BodySegmentAnything2SegmentAnything2PostImage$Outbound` instead. */ - export type Outbound = BodySegmentAnything2SegmentAnything2PostImage$Outbound; +export namespace BodyGenSegmentAnything2Image$ { + /** @deprecated use `BodyGenSegmentAnything2Image$inboundSchema` instead. */ + export const inboundSchema = BodyGenSegmentAnything2Image$inboundSchema; + /** @deprecated use `BodyGenSegmentAnything2Image$outboundSchema` instead. */ + export const outboundSchema = BodyGenSegmentAnything2Image$outboundSchema; + /** @deprecated use `BodyGenSegmentAnything2Image$Outbound` instead. */ + export type Outbound = BodyGenSegmentAnything2Image$Outbound; } /** @internal */ -export const BodySegmentAnything2SegmentAnything2Post$inboundSchema: z.ZodType< - BodySegmentAnything2SegmentAnything2Post, +export const BodyGenSegmentAnything2$inboundSchema: z.ZodType< + BodyGenSegmentAnything2, z.ZodTypeDef, unknown > = z.object({ - image: z.lazy(() => - BodySegmentAnything2SegmentAnything2PostImage$inboundSchema - ), + image: z.lazy(() => BodyGenSegmentAnything2Image$inboundSchema), box: z.string().optional(), mask_input: z.string().optional(), model_id: z.string().default(""), @@ -133,8 +125,8 @@ export const BodySegmentAnything2SegmentAnything2Post$inboundSchema: z.ZodType< }); /** @internal */ -export type BodySegmentAnything2SegmentAnything2Post$Outbound = { - image: BodySegmentAnything2SegmentAnything2PostImage$Outbound | Blob; +export type BodyGenSegmentAnything2$Outbound = { + image: BodyGenSegmentAnything2Image$Outbound | Blob; box?: string | undefined; mask_input?: string | undefined; model_id: string; @@ -146,14 +138,14 @@ export type BodySegmentAnything2SegmentAnything2Post$Outbound = { }; /** @internal */ -export const BodySegmentAnything2SegmentAnything2Post$outboundSchema: z.ZodType< - BodySegmentAnything2SegmentAnything2Post$Outbound, +export const BodyGenSegmentAnything2$outboundSchema: z.ZodType< + BodyGenSegmentAnything2$Outbound, z.ZodTypeDef, - BodySegmentAnything2SegmentAnything2Post + BodyGenSegmentAnything2 > = z.object({ - image: z.lazy(() => - BodySegmentAnything2SegmentAnything2PostImage$outboundSchema - ).or(blobLikeSchema), + image: z.lazy(() => BodyGenSegmentAnything2Image$outboundSchema).or( + blobLikeSchema, + ), box: z.string().optional(), maskInput: z.string().optional(), modelId: z.string().default(""), @@ -178,13 +170,11 @@ export const BodySegmentAnything2SegmentAnything2Post$outboundSchema: z.ZodType< * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ -export namespace BodySegmentAnything2SegmentAnything2Post$ { - /** @deprecated use `BodySegmentAnything2SegmentAnything2Post$inboundSchema` instead. */ - export const inboundSchema = - BodySegmentAnything2SegmentAnything2Post$inboundSchema; - /** @deprecated use `BodySegmentAnything2SegmentAnything2Post$outboundSchema` instead. */ - export const outboundSchema = - BodySegmentAnything2SegmentAnything2Post$outboundSchema; - /** @deprecated use `BodySegmentAnything2SegmentAnything2Post$Outbound` instead. */ - export type Outbound = BodySegmentAnything2SegmentAnything2Post$Outbound; +export namespace BodyGenSegmentAnything2$ { + /** @deprecated use `BodyGenSegmentAnything2$inboundSchema` instead. */ + export const inboundSchema = BodyGenSegmentAnything2$inboundSchema; + /** @deprecated use `BodyGenSegmentAnything2$outboundSchema` instead. */ + export const outboundSchema = BodyGenSegmentAnything2$outboundSchema; + /** @deprecated use `BodyGenSegmentAnything2$Outbound` instead. */ + export type Outbound = BodyGenSegmentAnything2$Outbound; } diff --git a/src/models/components/bodyupscaleupscalepost.ts b/src/models/components/bodygenupscale.ts similarity index 56% rename from src/models/components/bodyupscaleupscalepost.ts rename to src/models/components/bodygenupscale.ts index 8179efb..d1c16dc 100644 --- a/src/models/components/bodyupscaleupscalepost.ts +++ b/src/models/components/bodygenupscale.ts @@ -6,16 +6,16 @@ import * as z from "zod"; import { remap as remap$ } from "../../lib/primitives.js"; import { blobLikeSchema } from "../../types/blobs.js"; -export type BodyUpscaleUpscalePostImage = { +export type BodyGenUpscaleImage = { fileName: string; - content: ReadableStream | Blob | ArrayBuffer | Buffer; + content: ReadableStream | Blob | ArrayBuffer; }; -export type BodyUpscaleUpscalePost = { +export type BodyGenUpscale = { /** * Uploaded image to modify with the pipeline. */ - image: BodyUpscaleUpscalePostImage | Blob; + image: BodyGenUpscaleImage | Blob; /** * Text prompt(s) to guide upscaled image generation. */ @@ -39,8 +39,8 @@ export type BodyUpscaleUpscalePost = { }; /** @internal */ -export const BodyUpscaleUpscalePostImage$inboundSchema: z.ZodType< - BodyUpscaleUpscalePostImage, +export const BodyGenUpscaleImage$inboundSchema: z.ZodType< + BodyGenUpscaleImage, z.ZodTypeDef, unknown > = z.object({ @@ -49,28 +49,26 @@ export const BodyUpscaleUpscalePostImage$inboundSchema: z.ZodType< z.instanceof(ReadableStream), z.instanceof(Blob), z.instanceof(ArrayBuffer), - z.instanceof(Buffer), ]), }); /** @internal */ -export type BodyUpscaleUpscalePostImage$Outbound = { +export type BodyGenUpscaleImage$Outbound = { fileName: string; - content: ReadableStream | Blob | ArrayBuffer | Buffer; + content: ReadableStream | Blob | ArrayBuffer; }; /** @internal */ -export const BodyUpscaleUpscalePostImage$outboundSchema: z.ZodType< - BodyUpscaleUpscalePostImage$Outbound, +export const BodyGenUpscaleImage$outboundSchema: z.ZodType< + BodyGenUpscaleImage$Outbound, z.ZodTypeDef, - BodyUpscaleUpscalePostImage + BodyGenUpscaleImage > = z.object({ fileName: z.string(), content: z.union([ z.instanceof(ReadableStream), z.instanceof(Blob), z.instanceof(ArrayBuffer), - z.instanceof(Buffer), ]), }); @@ -78,22 +76,22 @@ export const BodyUpscaleUpscalePostImage$outboundSchema: z.ZodType< * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ -export namespace BodyUpscaleUpscalePostImage$ { - /** @deprecated use `BodyUpscaleUpscalePostImage$inboundSchema` instead. */ - export const inboundSchema = BodyUpscaleUpscalePostImage$inboundSchema; - /** @deprecated use `BodyUpscaleUpscalePostImage$outboundSchema` instead. */ - export const outboundSchema = BodyUpscaleUpscalePostImage$outboundSchema; - /** @deprecated use `BodyUpscaleUpscalePostImage$Outbound` instead. */ - export type Outbound = BodyUpscaleUpscalePostImage$Outbound; +export namespace BodyGenUpscaleImage$ { + /** @deprecated use `BodyGenUpscaleImage$inboundSchema` instead. */ + export const inboundSchema = BodyGenUpscaleImage$inboundSchema; + /** @deprecated use `BodyGenUpscaleImage$outboundSchema` instead. */ + export const outboundSchema = BodyGenUpscaleImage$outboundSchema; + /** @deprecated use `BodyGenUpscaleImage$Outbound` instead. */ + export type Outbound = BodyGenUpscaleImage$Outbound; } /** @internal */ -export const BodyUpscaleUpscalePost$inboundSchema: z.ZodType< - BodyUpscaleUpscalePost, +export const BodyGenUpscale$inboundSchema: z.ZodType< + BodyGenUpscale, z.ZodTypeDef, unknown > = z.object({ - image: z.lazy(() => BodyUpscaleUpscalePostImage$inboundSchema), + image: z.lazy(() => BodyGenUpscaleImage$inboundSchema), prompt: z.string(), model_id: z.string().default(""), num_inference_steps: z.number().int().default(75), @@ -108,8 +106,8 @@ export const BodyUpscaleUpscalePost$inboundSchema: z.ZodType< }); /** @internal */ -export type BodyUpscaleUpscalePost$Outbound = { - image: BodyUpscaleUpscalePostImage$Outbound | Blob; +export type BodyGenUpscale$Outbound = { + image: BodyGenUpscaleImage$Outbound | Blob; prompt: string; model_id: string; num_inference_steps: number; @@ -118,14 +116,12 @@ export type BodyUpscaleUpscalePost$Outbound = { }; /** @internal */ -export const BodyUpscaleUpscalePost$outboundSchema: z.ZodType< - BodyUpscaleUpscalePost$Outbound, +export const BodyGenUpscale$outboundSchema: z.ZodType< + BodyGenUpscale$Outbound, z.ZodTypeDef, - BodyUpscaleUpscalePost + BodyGenUpscale > = z.object({ - image: z.lazy(() => BodyUpscaleUpscalePostImage$outboundSchema).or( - blobLikeSchema, - ), + image: z.lazy(() => BodyGenUpscaleImage$outboundSchema).or(blobLikeSchema), prompt: z.string(), modelId: z.string().default(""), numInferenceSteps: z.number().int().default(75), @@ -143,11 +139,11 @@ export const BodyUpscaleUpscalePost$outboundSchema: z.ZodType< * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ -export namespace BodyUpscaleUpscalePost$ { - /** @deprecated use `BodyUpscaleUpscalePost$inboundSchema` instead. */ - export const inboundSchema = BodyUpscaleUpscalePost$inboundSchema; - /** @deprecated use `BodyUpscaleUpscalePost$outboundSchema` instead. */ - export const outboundSchema = BodyUpscaleUpscalePost$outboundSchema; - /** @deprecated use `BodyUpscaleUpscalePost$Outbound` instead. */ - export type Outbound = BodyUpscaleUpscalePost$Outbound; +export namespace BodyGenUpscale$ { + /** @deprecated use `BodyGenUpscale$inboundSchema` instead. */ + export const inboundSchema = BodyGenUpscale$inboundSchema; + /** @deprecated use `BodyGenUpscale$outboundSchema` instead. */ + export const outboundSchema = BodyGenUpscale$outboundSchema; + /** @deprecated use `BodyGenUpscale$Outbound` instead. */ + export type Outbound = BodyGenUpscale$Outbound; } diff --git a/src/models/components/index.ts b/src/models/components/index.ts index efac6cd..2f8300d 100644 --- a/src/models/components/index.ts +++ b/src/models/components/index.ts @@ -3,11 +3,11 @@ */ export * from "./apierror.js"; -export * from "./bodyaudiototextaudiototextpost.js"; -export * from "./bodyimagetoimageimagetoimagepost.js"; -export * from "./bodyimagetovideoimagetovideopost.js"; -export * from "./bodysegmentanything2segmentanything2post.js"; -export * from "./bodyupscaleupscalepost.js"; +export * from "./bodygenaudiototext.js"; +export * from "./bodygenimagetoimage.js"; +export * from "./bodygenimagetovideo.js"; +export * from "./bodygensegmentanything2.js"; +export * from "./bodygenupscale.js"; export * from "./chunk.js"; export * from "./imageresponse.js"; export * from "./masksresponse.js"; diff --git a/src/models/operations/audiototext.ts b/src/models/operations/genaudiototext.ts similarity index 70% rename from src/models/operations/audiototext.ts rename to src/models/operations/genaudiototext.ts index 3b0ed8a..3d9e540 100644 --- a/src/models/operations/audiototext.ts +++ b/src/models/operations/genaudiototext.ts @@ -6,7 +6,7 @@ import * as z from "zod"; import { remap as remap$ } from "../../lib/primitives.js"; import * as components from "../components/index.js"; -export type AudioToTextResponse = { +export type GenAudioToTextResponse = { /** * HTTP response content type for this operation */ @@ -26,8 +26,8 @@ export type AudioToTextResponse = { }; /** @internal */ -export const AudioToTextResponse$inboundSchema: z.ZodType< - AudioToTextResponse, +export const GenAudioToTextResponse$inboundSchema: z.ZodType< + GenAudioToTextResponse, z.ZodTypeDef, unknown > = z.object({ @@ -45,7 +45,7 @@ export const AudioToTextResponse$inboundSchema: z.ZodType< }); /** @internal */ -export type AudioToTextResponse$Outbound = { +export type GenAudioToTextResponse$Outbound = { ContentType: string; StatusCode: number; RawResponse: never; @@ -53,10 +53,10 @@ export type AudioToTextResponse$Outbound = { }; /** @internal */ -export const AudioToTextResponse$outboundSchema: z.ZodType< - AudioToTextResponse$Outbound, +export const GenAudioToTextResponse$outboundSchema: z.ZodType< + GenAudioToTextResponse$Outbound, z.ZodTypeDef, - AudioToTextResponse + GenAudioToTextResponse > = z.object({ contentType: z.string(), statusCode: z.number().int(), @@ -77,11 +77,11 @@ export const AudioToTextResponse$outboundSchema: z.ZodType< * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ -export namespace AudioToTextResponse$ { - /** @deprecated use `AudioToTextResponse$inboundSchema` instead. */ - export const inboundSchema = AudioToTextResponse$inboundSchema; - /** @deprecated use `AudioToTextResponse$outboundSchema` instead. */ - export const outboundSchema = AudioToTextResponse$outboundSchema; - /** @deprecated use `AudioToTextResponse$Outbound` instead. */ - export type Outbound = AudioToTextResponse$Outbound; +export namespace GenAudioToTextResponse$ { + /** @deprecated use `GenAudioToTextResponse$inboundSchema` instead. */ + export const inboundSchema = GenAudioToTextResponse$inboundSchema; + /** @deprecated use `GenAudioToTextResponse$outboundSchema` instead. */ + export const outboundSchema = GenAudioToTextResponse$outboundSchema; + /** @deprecated use `GenAudioToTextResponse$Outbound` instead. */ + export type Outbound = GenAudioToTextResponse$Outbound; } diff --git a/src/models/operations/texttoimage.ts b/src/models/operations/genimagetoimage.ts similarity index 69% rename from src/models/operations/texttoimage.ts rename to src/models/operations/genimagetoimage.ts index 0542511..e1642b6 100644 --- a/src/models/operations/texttoimage.ts +++ b/src/models/operations/genimagetoimage.ts @@ -6,7 +6,7 @@ import * as z from "zod"; import { remap as remap$ } from "../../lib/primitives.js"; import * as components from "../components/index.js"; -export type TextToImageResponse = { +export type GenImageToImageResponse = { /** * HTTP response content type for this operation */ @@ -26,8 +26,8 @@ export type TextToImageResponse = { }; /** @internal */ -export const TextToImageResponse$inboundSchema: z.ZodType< - TextToImageResponse, +export const GenImageToImageResponse$inboundSchema: z.ZodType< + GenImageToImageResponse, z.ZodTypeDef, unknown > = z.object({ @@ -45,7 +45,7 @@ export const TextToImageResponse$inboundSchema: z.ZodType< }); /** @internal */ -export type TextToImageResponse$Outbound = { +export type GenImageToImageResponse$Outbound = { ContentType: string; StatusCode: number; RawResponse: never; @@ -53,10 +53,10 @@ export type TextToImageResponse$Outbound = { }; /** @internal */ -export const TextToImageResponse$outboundSchema: z.ZodType< - TextToImageResponse$Outbound, +export const GenImageToImageResponse$outboundSchema: z.ZodType< + GenImageToImageResponse$Outbound, z.ZodTypeDef, - TextToImageResponse + GenImageToImageResponse > = z.object({ contentType: z.string(), statusCode: z.number().int(), @@ -77,11 +77,11 @@ export const TextToImageResponse$outboundSchema: z.ZodType< * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ -export namespace TextToImageResponse$ { - /** @deprecated use `TextToImageResponse$inboundSchema` instead. */ - export const inboundSchema = TextToImageResponse$inboundSchema; - /** @deprecated use `TextToImageResponse$outboundSchema` instead. */ - export const outboundSchema = TextToImageResponse$outboundSchema; - /** @deprecated use `TextToImageResponse$Outbound` instead. */ - export type Outbound = TextToImageResponse$Outbound; +export namespace GenImageToImageResponse$ { + /** @deprecated use `GenImageToImageResponse$inboundSchema` instead. */ + export const inboundSchema = GenImageToImageResponse$inboundSchema; + /** @deprecated use `GenImageToImageResponse$outboundSchema` instead. */ + export const outboundSchema = GenImageToImageResponse$outboundSchema; + /** @deprecated use `GenImageToImageResponse$Outbound` instead. */ + export type Outbound = GenImageToImageResponse$Outbound; } diff --git a/src/models/operations/imagetovideo.ts b/src/models/operations/genimagetovideo.ts similarity index 69% rename from src/models/operations/imagetovideo.ts rename to src/models/operations/genimagetovideo.ts index ac0c91a..dab394b 100644 --- a/src/models/operations/imagetovideo.ts +++ b/src/models/operations/genimagetovideo.ts @@ -6,7 +6,7 @@ import * as z from "zod"; import { remap as remap$ } from "../../lib/primitives.js"; import * as components from "../components/index.js"; -export type ImageToVideoResponse = { +export type GenImageToVideoResponse = { /** * HTTP response content type for this operation */ @@ -26,8 +26,8 @@ export type ImageToVideoResponse = { }; /** @internal */ -export const ImageToVideoResponse$inboundSchema: z.ZodType< - ImageToVideoResponse, +export const GenImageToVideoResponse$inboundSchema: z.ZodType< + GenImageToVideoResponse, z.ZodTypeDef, unknown > = z.object({ @@ -45,7 +45,7 @@ export const ImageToVideoResponse$inboundSchema: z.ZodType< }); /** @internal */ -export type ImageToVideoResponse$Outbound = { +export type GenImageToVideoResponse$Outbound = { ContentType: string; StatusCode: number; RawResponse: never; @@ -53,10 +53,10 @@ export type ImageToVideoResponse$Outbound = { }; /** @internal */ -export const ImageToVideoResponse$outboundSchema: z.ZodType< - ImageToVideoResponse$Outbound, +export const GenImageToVideoResponse$outboundSchema: z.ZodType< + GenImageToVideoResponse$Outbound, z.ZodTypeDef, - ImageToVideoResponse + GenImageToVideoResponse > = z.object({ contentType: z.string(), statusCode: z.number().int(), @@ -77,11 +77,11 @@ export const ImageToVideoResponse$outboundSchema: z.ZodType< * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ -export namespace ImageToVideoResponse$ { - /** @deprecated use `ImageToVideoResponse$inboundSchema` instead. */ - export const inboundSchema = ImageToVideoResponse$inboundSchema; - /** @deprecated use `ImageToVideoResponse$outboundSchema` instead. */ - export const outboundSchema = ImageToVideoResponse$outboundSchema; - /** @deprecated use `ImageToVideoResponse$Outbound` instead. */ - export type Outbound = ImageToVideoResponse$Outbound; +export namespace GenImageToVideoResponse$ { + /** @deprecated use `GenImageToVideoResponse$inboundSchema` instead. */ + export const inboundSchema = GenImageToVideoResponse$inboundSchema; + /** @deprecated use `GenImageToVideoResponse$outboundSchema` instead. */ + export const outboundSchema = GenImageToVideoResponse$outboundSchema; + /** @deprecated use `GenImageToVideoResponse$Outbound` instead. */ + export type Outbound = GenImageToVideoResponse$Outbound; } diff --git a/src/models/operations/segmentanything2.ts b/src/models/operations/gensegmentanything2.ts similarity index 68% rename from src/models/operations/segmentanything2.ts rename to src/models/operations/gensegmentanything2.ts index e4c9f0a..48159db 100644 --- a/src/models/operations/segmentanything2.ts +++ b/src/models/operations/gensegmentanything2.ts @@ -6,7 +6,7 @@ import * as z from "zod"; import { remap as remap$ } from "../../lib/primitives.js"; import * as components from "../components/index.js"; -export type SegmentAnything2Response = { +export type GenSegmentAnything2Response = { /** * HTTP response content type for this operation */ @@ -26,8 +26,8 @@ export type SegmentAnything2Response = { }; /** @internal */ -export const SegmentAnything2Response$inboundSchema: z.ZodType< - SegmentAnything2Response, +export const GenSegmentAnything2Response$inboundSchema: z.ZodType< + GenSegmentAnything2Response, z.ZodTypeDef, unknown > = z.object({ @@ -45,7 +45,7 @@ export const SegmentAnything2Response$inboundSchema: z.ZodType< }); /** @internal */ -export type SegmentAnything2Response$Outbound = { +export type GenSegmentAnything2Response$Outbound = { ContentType: string; StatusCode: number; RawResponse: never; @@ -53,10 +53,10 @@ export type SegmentAnything2Response$Outbound = { }; /** @internal */ -export const SegmentAnything2Response$outboundSchema: z.ZodType< - SegmentAnything2Response$Outbound, +export const GenSegmentAnything2Response$outboundSchema: z.ZodType< + GenSegmentAnything2Response$Outbound, z.ZodTypeDef, - SegmentAnything2Response + GenSegmentAnything2Response > = z.object({ contentType: z.string(), statusCode: z.number().int(), @@ -77,11 +77,11 @@ export const SegmentAnything2Response$outboundSchema: z.ZodType< * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ -export namespace SegmentAnything2Response$ { - /** @deprecated use `SegmentAnything2Response$inboundSchema` instead. */ - export const inboundSchema = SegmentAnything2Response$inboundSchema; - /** @deprecated use `SegmentAnything2Response$outboundSchema` instead. */ - export const outboundSchema = SegmentAnything2Response$outboundSchema; - /** @deprecated use `SegmentAnything2Response$Outbound` instead. */ - export type Outbound = SegmentAnything2Response$Outbound; +export namespace GenSegmentAnything2Response$ { + /** @deprecated use `GenSegmentAnything2Response$inboundSchema` instead. */ + export const inboundSchema = GenSegmentAnything2Response$inboundSchema; + /** @deprecated use `GenSegmentAnything2Response$outboundSchema` instead. */ + export const outboundSchema = GenSegmentAnything2Response$outboundSchema; + /** @deprecated use `GenSegmentAnything2Response$Outbound` instead. */ + export type Outbound = GenSegmentAnything2Response$Outbound; } diff --git a/src/models/operations/imagetoimage.ts b/src/models/operations/gentexttoimage.ts similarity index 70% rename from src/models/operations/imagetoimage.ts rename to src/models/operations/gentexttoimage.ts index 4b91b6f..d2f5d4f 100644 --- a/src/models/operations/imagetoimage.ts +++ b/src/models/operations/gentexttoimage.ts @@ -6,7 +6,7 @@ import * as z from "zod"; import { remap as remap$ } from "../../lib/primitives.js"; import * as components from "../components/index.js"; -export type ImageToImageResponse = { +export type GenTextToImageResponse = { /** * HTTP response content type for this operation */ @@ -26,8 +26,8 @@ export type ImageToImageResponse = { }; /** @internal */ -export const ImageToImageResponse$inboundSchema: z.ZodType< - ImageToImageResponse, +export const GenTextToImageResponse$inboundSchema: z.ZodType< + GenTextToImageResponse, z.ZodTypeDef, unknown > = z.object({ @@ -45,7 +45,7 @@ export const ImageToImageResponse$inboundSchema: z.ZodType< }); /** @internal */ -export type ImageToImageResponse$Outbound = { +export type GenTextToImageResponse$Outbound = { ContentType: string; StatusCode: number; RawResponse: never; @@ -53,10 +53,10 @@ export type ImageToImageResponse$Outbound = { }; /** @internal */ -export const ImageToImageResponse$outboundSchema: z.ZodType< - ImageToImageResponse$Outbound, +export const GenTextToImageResponse$outboundSchema: z.ZodType< + GenTextToImageResponse$Outbound, z.ZodTypeDef, - ImageToImageResponse + GenTextToImageResponse > = z.object({ contentType: z.string(), statusCode: z.number().int(), @@ -77,11 +77,11 @@ export const ImageToImageResponse$outboundSchema: z.ZodType< * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ -export namespace ImageToImageResponse$ { - /** @deprecated use `ImageToImageResponse$inboundSchema` instead. */ - export const inboundSchema = ImageToImageResponse$inboundSchema; - /** @deprecated use `ImageToImageResponse$outboundSchema` instead. */ - export const outboundSchema = ImageToImageResponse$outboundSchema; - /** @deprecated use `ImageToImageResponse$Outbound` instead. */ - export type Outbound = ImageToImageResponse$Outbound; +export namespace GenTextToImageResponse$ { + /** @deprecated use `GenTextToImageResponse$inboundSchema` instead. */ + export const inboundSchema = GenTextToImageResponse$inboundSchema; + /** @deprecated use `GenTextToImageResponse$outboundSchema` instead. */ + export const outboundSchema = GenTextToImageResponse$outboundSchema; + /** @deprecated use `GenTextToImageResponse$Outbound` instead. */ + export type Outbound = GenTextToImageResponse$Outbound; } diff --git a/src/models/operations/upscale.ts b/src/models/operations/genupscale.ts similarity index 71% rename from src/models/operations/upscale.ts rename to src/models/operations/genupscale.ts index b60f999..0196f0a 100644 --- a/src/models/operations/upscale.ts +++ b/src/models/operations/genupscale.ts @@ -6,7 +6,7 @@ import * as z from "zod"; import { remap as remap$ } from "../../lib/primitives.js"; import * as components from "../components/index.js"; -export type UpscaleResponse = { +export type GenUpscaleResponse = { /** * HTTP response content type for this operation */ @@ -26,8 +26,8 @@ export type UpscaleResponse = { }; /** @internal */ -export const UpscaleResponse$inboundSchema: z.ZodType< - UpscaleResponse, +export const GenUpscaleResponse$inboundSchema: z.ZodType< + GenUpscaleResponse, z.ZodTypeDef, unknown > = z.object({ @@ -45,7 +45,7 @@ export const UpscaleResponse$inboundSchema: z.ZodType< }); /** @internal */ -export type UpscaleResponse$Outbound = { +export type GenUpscaleResponse$Outbound = { ContentType: string; StatusCode: number; RawResponse: never; @@ -53,10 +53,10 @@ export type UpscaleResponse$Outbound = { }; /** @internal */ -export const UpscaleResponse$outboundSchema: z.ZodType< - UpscaleResponse$Outbound, +export const GenUpscaleResponse$outboundSchema: z.ZodType< + GenUpscaleResponse$Outbound, z.ZodTypeDef, - UpscaleResponse + GenUpscaleResponse > = z.object({ contentType: z.string(), statusCode: z.number().int(), @@ -77,11 +77,11 @@ export const UpscaleResponse$outboundSchema: z.ZodType< * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ -export namespace UpscaleResponse$ { - /** @deprecated use `UpscaleResponse$inboundSchema` instead. */ - export const inboundSchema = UpscaleResponse$inboundSchema; - /** @deprecated use `UpscaleResponse$outboundSchema` instead. */ - export const outboundSchema = UpscaleResponse$outboundSchema; - /** @deprecated use `UpscaleResponse$Outbound` instead. */ - export type Outbound = UpscaleResponse$Outbound; +export namespace GenUpscaleResponse$ { + /** @deprecated use `GenUpscaleResponse$inboundSchema` instead. */ + export const inboundSchema = GenUpscaleResponse$inboundSchema; + /** @deprecated use `GenUpscaleResponse$outboundSchema` instead. */ + export const outboundSchema = GenUpscaleResponse$outboundSchema; + /** @deprecated use `GenUpscaleResponse$Outbound` instead. */ + export type Outbound = GenUpscaleResponse$Outbound; } diff --git a/src/models/operations/index.ts b/src/models/operations/index.ts index b2a3bc8..63eb289 100644 --- a/src/models/operations/index.ts +++ b/src/models/operations/index.ts @@ -2,9 +2,9 @@ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -export * from "./audiototext.js"; -export * from "./imagetoimage.js"; -export * from "./imagetovideo.js"; -export * from "./segmentanything2.js"; -export * from "./texttoimage.js"; -export * from "./upscale.js"; +export * from "./genaudiototext.js"; +export * from "./genimagetoimage.js"; +export * from "./genimagetovideo.js"; +export * from "./gensegmentanything2.js"; +export * from "./gentexttoimage.js"; +export * from "./genupscale.js"; diff --git a/src/sdk/generate.ts b/src/sdk/generate.ts new file mode 100644 index 0000000..c0f8f68 --- /dev/null +++ b/src/sdk/generate.ts @@ -0,0 +1,118 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { generateAudioToText } from "../funcs/generateAudioToText.js"; +import { generateImageToImage } from "../funcs/generateImageToImage.js"; +import { generateImageToVideo } from "../funcs/generateImageToVideo.js"; +import { generateSegmentAnything2 } from "../funcs/generateSegmentAnything2.js"; +import { generateTextToImage } from "../funcs/generateTextToImage.js"; +import { generateUpscale } from "../funcs/generateUpscale.js"; +import { ClientSDK, RequestOptions } from "../lib/sdks.js"; +import * as components from "../models/components/index.js"; +import * as operations from "../models/operations/index.js"; +import { unwrapAsync } from "../types/fp.js"; + +export class Generate extends ClientSDK { + /** + * Text To Image + * + * @remarks + * Generate images from text prompts. + */ + async textToImage( + request: components.TextToImageParams, + options?: RequestOptions, + ): Promise { + return unwrapAsync(generateTextToImage( + this, + request, + options, + )); + } + + /** + * Image To Image + * + * @remarks + * Apply image transformations to a provided image. + */ + async imageToImage( + request: components.BodyGenImageToImage, + options?: RequestOptions, + ): Promise { + return unwrapAsync(generateImageToImage( + this, + request, + options, + )); + } + + /** + * Image To Video + * + * @remarks + * Generate a video from a provided image. + */ + async imageToVideo( + request: components.BodyGenImageToVideo, + options?: RequestOptions, + ): Promise { + return unwrapAsync(generateImageToVideo( + this, + request, + options, + )); + } + + /** + * Upscale + * + * @remarks + * Upscale an image by increasing its resolution. + */ + async upscale( + request: components.BodyGenUpscale, + options?: RequestOptions, + ): Promise { + return unwrapAsync(generateUpscale( + this, + request, + options, + )); + } + + /** + * Audio To Text + * + * @remarks + * Transcribe audio files to text. + */ + async audioToText( + request: components.BodyGenAudioToText, + options?: RequestOptions, + ): Promise { + return unwrapAsync(generateAudioToText( + this, + request, + options, + )); + } + + /** + * Segment Anything 2 + * + * @remarks + * Segment objects in an image. + */ + async segmentAnything2( + request: components.BodyGenSegmentAnything2, + options?: RequestOptions, + ): Promise { + return unwrapAsync(generateSegmentAnything2( + this, + request, + options, + )); + } +} diff --git a/src/sdk/sdk.ts b/src/sdk/sdk.ts index 5a63eaa..36356e2 100644 --- a/src/sdk/sdk.ts +++ b/src/sdk/sdk.ts @@ -2,117 +2,12 @@ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -import { audioToText } from "../funcs/audioToText.js"; -import { imageToImage } from "../funcs/imageToImage.js"; -import { imageToVideo } from "../funcs/imageToVideo.js"; -import { segmentAnything2 } from "../funcs/segmentAnything2.js"; -import { textToImage } from "../funcs/textToImage.js"; -import { upscale } from "../funcs/upscale.js"; -import { ClientSDK, RequestOptions } from "../lib/sdks.js"; -import * as components from "../models/components/index.js"; -import * as operations from "../models/operations/index.js"; -import { unwrapAsync } from "../types/fp.js"; +import { ClientSDK } from "../lib/sdks.js"; +import { Generate } from "./generate.js"; export class LivepeerAI extends ClientSDK { - /** - * Text To Image - * - * @remarks - * Generate images from text prompts. - */ - async textToImage( - request: components.TextToImageParams, - options?: RequestOptions, - ): Promise { - return unwrapAsync(textToImage( - this, - request, - options, - )); - } - - /** - * Image To Image - * - * @remarks - * Apply image transformations to a provided image. - */ - async imageToImage( - request: components.BodyImageToImageImageToImagePost, - options?: RequestOptions, - ): Promise { - return unwrapAsync(imageToImage( - this, - request, - options, - )); - } - - /** - * Image To Video - * - * @remarks - * Generate a video from a provided image. - */ - async imageToVideo( - request: components.BodyImageToVideoImageToVideoPost, - options?: RequestOptions, - ): Promise { - return unwrapAsync(imageToVideo( - this, - request, - options, - )); - } - - /** - * Upscale - * - * @remarks - * Upscale an image by increasing its resolution. - */ - async upscale( - request: components.BodyUpscaleUpscalePost, - options?: RequestOptions, - ): Promise { - return unwrapAsync(upscale( - this, - request, - options, - )); - } - - /** - * Audio To Text - * - * @remarks - * Transcribe audio files to text. - */ - async audioToText( - request: components.BodyAudioToTextAudioToTextPost, - options?: RequestOptions, - ): Promise { - return unwrapAsync(audioToText( - this, - request, - options, - )); - } - - /** - * Segment Anything 2 - * - * @remarks - * Segment objects in an image. - */ - async segmentAnything2( - request: components.BodySegmentAnything2SegmentAnything2Post, - options?: RequestOptions, - ): Promise { - return unwrapAsync(segmentAnything2( - this, - request, - options, - )); + private _generate?: Generate; + get generate(): Generate { + return (this._generate ??= new Generate(this.options$)); } }