Skip to content

Commit

Permalink
ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.398.1 (#16)
Browse files Browse the repository at this point in the history
Co-authored-by: speakeasybot <[email protected]>
  • Loading branch information
github-actions[bot] and speakeasybot authored Sep 17, 2024
1 parent 8160f12 commit d8fbdde
Show file tree
Hide file tree
Showing 47 changed files with 4,930 additions and 1,664 deletions.
21 changes: 17 additions & 4 deletions .speakeasy/gen.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ id: 8bd6d3b6-cae6-4e55-b72f-6fdc1dbce9a1
management:
docChecksum: 5649b2692e9b9f3c1065851a47fbba06
docVersion: v0.5.0
speakeasyVersion: 1.398.0
speakeasyVersion: 1.398.1
generationVersion: 2.415.8
releaseVersion: 0.3.2
configChecksum: 233760f35f485f692b0ac4fae9a1ae2e
releaseVersion: 0.3.3
configChecksum: eefe05e12f05c605ef3a39485c1596c1
repoURL: https://github.com/livepeer/livepeer-ai-js.git
installationURL: https://github.com/livepeer/livepeer-ai-js
published: true
Expand Down Expand Up @@ -58,8 +58,14 @@ generatedFiles:
- docs/models/components/videoresponse.md
- docs/models/errors/httperror.md
- docs/models/errors/httpvalidationerror.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/sdk/README.md
- docs/sdks/livepeer/README.md
- jsr.json
- package.json
- src/core.ts
Expand Down Expand Up @@ -110,6 +116,13 @@ generatedFiles:
- src/models/errors/index.ts
- src/models/errors/sdkerror.ts
- src/models/errors/sdkvalidationerror.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/sdk/generate.ts
- src/sdk/index.ts
- src/sdk/sdk.ts
Expand Down
2 changes: 1 addition & 1 deletion .speakeasy/gen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ generation:
auth:
oAuth2ClientCredentialsEnabled: false
typescript:
version: 0.3.2
version: 0.3.3
additionalDependencies:
dependencies:
jest: ^29.7.0
Expand Down
8 changes: 4 additions & 4 deletions .speakeasy/workflow.lock
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
speakeasyVersion: 1.398.0
speakeasyVersion: 1.398.1
sources:
livepeer-ai-OAS:
sourceNamespace: livepeer-ai-oas
sourceRevisionDigest: sha256:2669ab1291e247bb0e107d4bb7cb28c63c6b05f7175432f08ccfffb6345ca88d
sourceRevisionDigest: sha256:ecb4cf674e1ac45f4116cd5eebcfabd9446312c5f5a6fc6ff95c8e0b6d3ab3f0
sourceBlobDigest: sha256:84962d1cdd2b3ec311a1e3de4848a560478cefda5b3038810a518281c8032152
tags:
- latest
Expand All @@ -11,10 +11,10 @@ targets:
livepeer-ai-ts:
source: livepeer-ai-OAS
sourceNamespace: livepeer-ai-oas
sourceRevisionDigest: sha256:2669ab1291e247bb0e107d4bb7cb28c63c6b05f7175432f08ccfffb6345ca88d
sourceRevisionDigest: sha256:ecb4cf674e1ac45f4116cd5eebcfabd9446312c5f5a6fc6ff95c8e0b6d3ab3f0
sourceBlobDigest: sha256:84962d1cdd2b3ec311a1e3de4848a560478cefda5b3038810a518281c8032152
codeSamplesNamespace: code-samples-typescript-livepeer-ts
codeSamplesRevisionDigest: sha256:c60f96803da3346cc88704ebeb80dd54f05d92dd85f69a516bc80a212e656f08
codeSamplesRevisionDigest: sha256:c7c5056503bcc37a38d70ed10bafd2ee5d820cddeaac64aef6224d8290571a90
workflow:
workflowVersion: 1.0.0
speakeasyVersion: latest
Expand Down
12 changes: 6 additions & 6 deletions FUNCTIONS.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,18 @@ specific category of applications.
## Example

```typescript
import { SDKCore } from "openapi/core.js";
import { generateTextToImage } from "openapi/funcs/generateTextToImage.js";
import { SDKValidationError } from "openapi/models/errors/sdkvalidationerror.js";
import { LivepeerCore } from "@livepeer/ai/core.js";
import { generateTextToImage } from "@livepeer/ai/funcs/generateTextToImage.js";
import { SDKValidationError } from "@livepeer/ai/models/errors/sdkvalidationerror.js";

// Use `SDKCore` for best tree-shaking performance.
// Use `LivepeerCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const sdk = new SDKCore({
const livepeer = new LivepeerCore({
httpBearer: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
const res = await generateTextToImage(sdk, {
const res = await generateTextToImage(livepeer, {
prompt: "<value>",
});

Expand Down
68 changes: 34 additions & 34 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,25 +17,25 @@ The SDK can be installed with either [npm](https://www.npmjs.com/), [pnpm](https
### NPM

```bash
npm add openapi
npm add @livepeer/ai
```

### PNPM

```bash
pnpm add openapi
pnpm add @livepeer/ai
```

### Bun

```bash
bun add openapi
bun add @livepeer/ai
```

### Yarn

```bash
yarn add openapi zod
yarn add @livepeer/ai zod

# Note that Yarn does not install peer dependencies automatically. You will need
# to install zod as shown above.
Expand All @@ -54,14 +54,14 @@ For supported JavaScript runtimes, please consult [RUNTIMES.md](RUNTIMES.md).
### Example

```typescript
import { SDK } from "openapi";
import { Livepeer } from "@livepeer/ai";

const sdk = new SDK({
const livepeer = new Livepeer({
httpBearer: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
const result = await sdk.generate.textToImage({
const result = await livepeer.generate.textToImage({
prompt: "<value>",
});

Expand Down Expand Up @@ -134,15 +134,15 @@ Certain SDK methods accept files as part of a multi-part request. It is possible
> - **Node.js v18:** A file stream can be created using the `fileFrom` helper from [`fetch-blob/from.js`](https://www.npmjs.com/package/fetch-blob).
```typescript
import { Livepeer } from "@livepeer/ai";
import { openAsBlob } from "node:fs";
import { SDK } from "openapi";

const sdk = new SDK({
const livepeer = new Livepeer({
httpBearer: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
const result = await sdk.generate.imageToImage({
const result = await livepeer.generate.imageToImage({
image: await openAsBlob("example.file"),
prompt: "<value>",
});
Expand All @@ -163,14 +163,14 @@ Some of the endpoints in this SDK support retries. If you use the SDK without a

To change the default retry strategy for a single API call, simply provide a retryConfig object to the call:
```typescript
import { SDK } from "openapi";
import { Livepeer } from "@livepeer/ai";

const sdk = new SDK({
const livepeer = new Livepeer({
httpBearer: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
const result = await sdk.generate.textToImage({
const result = await livepeer.generate.textToImage({
prompt: "<value>",
}, {
retries: {
Expand All @@ -195,9 +195,9 @@ run();

If you'd like to override the default retry strategy for all operations that support retries, you can provide a retryConfig at SDK initialization:
```typescript
import { SDK } from "openapi";
import { Livepeer } from "@livepeer/ai";

const sdk = new SDK({
const livepeer = new Livepeer({
retryConfig: {
strategy: "backoff",
backoff: {
Expand All @@ -212,7 +212,7 @@ const sdk = new SDK({
});

async function run() {
const result = await sdk.generate.textToImage({
const result = await livepeer.generate.textToImage({
prompt: "<value>",
});

Expand Down Expand Up @@ -240,21 +240,21 @@ Validation errors can also occur when either method arguments or data returned f


```typescript
import { SDK } from "openapi";
import { Livepeer } from "@livepeer/ai";
import {
HTTPError,
HTTPValidationError,
SDKValidationError,
} from "openapi/models/errors";
} from "@livepeer/ai/models/errors";

const sdk = new SDK({
const livepeer = new Livepeer({
httpBearer: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
let result;
try {
result = await sdk.generate.textToImage({
result = await livepeer.generate.textToImage({
prompt: "<value>",
});

Expand Down Expand Up @@ -304,15 +304,15 @@ You can override the default server globally by passing a server index to the `s
| 1 | `https://livepeer.studio/api/beta/generate` | None |

```typescript
import { SDK } from "openapi";
import { Livepeer } from "@livepeer/ai";

const sdk = new SDK({
const livepeer = new Livepeer({
serverIdx: 1,
httpBearer: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
const result = await sdk.generate.textToImage({
const result = await livepeer.generate.textToImage({
prompt: "<value>",
});

Expand All @@ -330,15 +330,15 @@ run();
The default server can also be overridden globally by passing a URL to the `serverURL` optional parameter when initializing the SDK client instance. For example:

```typescript
import { SDK } from "openapi";
import { Livepeer } from "@livepeer/ai";

const sdk = new SDK({
const livepeer = new Livepeer({
serverURL: "https://dream-gateway.livepeer.cloud",
httpBearer: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
const result = await sdk.generate.textToImage({
const result = await livepeer.generate.textToImage({
prompt: "<value>",
});

Expand Down Expand Up @@ -369,8 +369,8 @@ custom header and a timeout to requests and how to use the `"requestError"` hook
to log errors:

```typescript
import { SDK } from "openapi";
import { HTTPClient } from "openapi/lib/http";
import { Livepeer } from "@livepeer/ai";
import { HTTPClient } from "@livepeer/ai/lib/http";

const httpClient = new HTTPClient({
// fetcher takes a function that has the same signature as native `fetch`.
Expand All @@ -396,7 +396,7 @@ httpClient.addHook("requestError", (error, request) => {
console.groupEnd();
});

const sdk = new SDK({ httpClient });
const sdk = new Livepeer({ httpClient });
```
<!-- End Custom HTTP Client [http-client] -->

Expand All @@ -413,14 +413,14 @@ This SDK supports the following security scheme globally:

To authenticate with the API the `httpBearer` parameter must be set when initializing the SDK client instance. For example:
```typescript
import { SDK } from "openapi";
import { Livepeer } from "@livepeer/ai";

const sdk = new SDK({
const livepeer = new Livepeer({
httpBearer: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
const result = await sdk.generate.textToImage({
const result = await livepeer.generate.textToImage({
prompt: "<value>",
});

Expand All @@ -444,9 +444,9 @@ You can pass a logger that matches `console`'s interface as an SDK option.
> Beware that debug logging will reveal secrets, like API tokens in headers, in log messages printed to a console or files. It's recommended to use this feature only during local development and not in production.
```typescript
import { SDK } from "openapi";
import { Livepeer } from "@livepeer/ai";

const sdk = new SDK({ debugLogger: console });
const sdk = new Livepeer({ debugLogger: console });
```
<!-- End Debugging [debug] -->

Expand Down
12 changes: 11 additions & 1 deletion RELEASES.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,4 +60,14 @@ Based on:
### Generated
- [typescript v0.3.2] .
### Releases
- [NPM v0.3.2] https://www.npmjs.com/package/openapi/v/0.3.2 - .
- [NPM v0.3.2] https://www.npmjs.com/package/openapi/v/0.3.2 - .

## 2024-09-17 17:20:06
### Changes
Based on:
- OpenAPI Doc
- Speakeasy CLI 1.398.1 (2.415.8) https://github.com/speakeasy-api/speakeasy
### Generated
- [typescript v0.3.3] .
### Releases
- [NPM v0.3.3] https://www.npmjs.com/package/@livepeer/ai/v/0.3.3 - .
6 changes: 3 additions & 3 deletions USAGE.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<!-- Start SDK Example Usage [usage] -->
```typescript
import { SDK } from "openapi";
import { Livepeer } from "@livepeer/ai";

const sdk = new SDK({
const livepeer = new Livepeer({
httpBearer: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
const result = await sdk.generate.textToImage({
const result = await livepeer.generate.textToImage({
prompt: "<value>",
});

Expand Down
12 changes: 6 additions & 6 deletions codeSamples.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,34 +8,34 @@ actions:
x-codeSamples:
- lang: typescript
label: genAudioToText
source: "import { openAsBlob } from \"node:fs\";\nimport { SDK } from \"openapi\";\n\nconst sdk = new SDK({\n httpBearer: \"<YOUR_BEARER_TOKEN_HERE>\",\n});\n\nasync function run() {\n const result = await sdk.generate.audioToText({\n audio: await openAsBlob(\"example.file\"),\n });\n \n // Handle the result\n console.log(result)\n}\n\nrun();"
source: "import { Livepeer } from \"@livepeer/ai\";\nimport { openAsBlob } from \"node:fs\";\n\nconst livepeer = new Livepeer({\n httpBearer: \"<YOUR_BEARER_TOKEN_HERE>\",\n});\n\nasync function run() {\n const result = await livepeer.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: genImageToImage
source: "import { openAsBlob } from \"node:fs\";\nimport { SDK } from \"openapi\";\n\nconst sdk = new SDK({\n httpBearer: \"<YOUR_BEARER_TOKEN_HERE>\",\n});\n\nasync function run() {\n const result = await sdk.generate.imageToImage({\n prompt: \"<value>\",\n image: await openAsBlob(\"example.file\"),\n });\n \n // Handle the result\n console.log(result)\n}\n\nrun();"
source: "import { Livepeer } from \"@livepeer/ai\";\nimport { openAsBlob } from \"node:fs\";\n\nconst livepeer = new Livepeer({\n httpBearer: \"<YOUR_BEARER_TOKEN_HERE>\",\n});\n\nasync function run() {\n const result = await livepeer.generate.imageToImage({\n prompt: \"<value>\",\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: genImageToVideo
source: "import { openAsBlob } from \"node:fs\";\nimport { SDK } from \"openapi\";\n\nconst sdk = new SDK({\n httpBearer: \"<YOUR_BEARER_TOKEN_HERE>\",\n});\n\nasync function run() {\n const result = await sdk.generate.imageToVideo({\n image: await openAsBlob(\"example.file\"),\n });\n \n // Handle the result\n console.log(result)\n}\n\nrun();"
source: "import { Livepeer } from \"@livepeer/ai\";\nimport { openAsBlob } from \"node:fs\";\n\nconst livepeer = new Livepeer({\n httpBearer: \"<YOUR_BEARER_TOKEN_HERE>\",\n});\n\nasync function run() {\n const result = await livepeer.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: genSegmentAnything2
source: "import { openAsBlob } from \"node:fs\";\nimport { SDK } from \"openapi\";\n\nconst sdk = new SDK({\n httpBearer: \"<YOUR_BEARER_TOKEN_HERE>\",\n});\n\nasync function run() {\n const result = await sdk.generate.segmentAnything2({\n image: await openAsBlob(\"example.file\"),\n });\n \n // Handle the result\n console.log(result)\n}\n\nrun();"
source: "import { Livepeer } from \"@livepeer/ai\";\nimport { openAsBlob } from \"node:fs\";\n\nconst livepeer = new Livepeer({\n httpBearer: \"<YOUR_BEARER_TOKEN_HERE>\",\n});\n\nasync function run() {\n const result = await livepeer.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: genTextToImage
source: "import { SDK } from \"openapi\";\n\nconst sdk = new SDK({\n httpBearer: \"<YOUR_BEARER_TOKEN_HERE>\",\n});\n\nasync function run() {\n const result = await sdk.generate.textToImage({\n prompt: \"<value>\",\n });\n \n // Handle the result\n console.log(result)\n}\n\nrun();"
source: "import { Livepeer } from \"@livepeer/ai\";\n\nconst livepeer = new Livepeer({\n httpBearer: \"<YOUR_BEARER_TOKEN_HERE>\",\n});\n\nasync function run() {\n const result = await livepeer.generate.textToImage({\n prompt: \"<value>\",\n });\n \n // Handle the result\n console.log(result)\n}\n\nrun();"
- target: $["paths"]["/upscale"]["post"]
update:
x-codeSamples:
- lang: typescript
label: genUpscale
source: "import { openAsBlob } from \"node:fs\";\nimport { SDK } from \"openapi\";\n\nconst sdk = new SDK({\n httpBearer: \"<YOUR_BEARER_TOKEN_HERE>\",\n});\n\nasync function run() {\n const result = await sdk.generate.upscale({\n prompt: \"<value>\",\n image: await openAsBlob(\"example.file\"),\n });\n \n // Handle the result\n console.log(result)\n}\n\nrun();"
source: "import { Livepeer } from \"@livepeer/ai\";\nimport { openAsBlob } from \"node:fs\";\n\nconst livepeer = new Livepeer({\n httpBearer: \"<YOUR_BEARER_TOKEN_HERE>\",\n});\n\nasync function run() {\n const result = await livepeer.generate.upscale({\n prompt: \"<value>\",\n image: await openAsBlob(\"example.file\"),\n });\n \n // Handle the result\n console.log(result)\n}\n\nrun();"
Loading

0 comments on commit d8fbdde

Please sign in to comment.