Skip to content

Commit

Permalink
ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.405.6 (#18)
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 Oct 1, 2024
1 parent 3d2ee42 commit fc8808a
Show file tree
Hide file tree
Showing 35 changed files with 784 additions and 108 deletions.
30 changes: 23 additions & 7 deletions .speakeasy/gen.lock
Original file line number Diff line number Diff line change
@@ -1,20 +1,19 @@
lockVersion: 2.0.0
id: 8bd6d3b6-cae6-4e55-b72f-6fdc1dbce9a1
management:
docChecksum: 4a28bceb165adf1c1dd97bbc8fe41a27
docVersion: v0.5.0
speakeasyVersion: 1.401.2
generationVersion: 2.421.3
releaseVersion: 0.3.4
configChecksum: 2f966a11db44fc8cc16835f471c700a8
docChecksum: 21334b8071b6c8e28a5dda229ceafd7e
speakeasyVersion: 1.405.6
generationVersion: 2.428.1
releaseVersion: 0.4.0
configChecksum: afd3c6579111409ef5d5b0b954be5634
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.6
core: 3.18.1
defaultEnabledRetries: 0.1.0
envVarSecurityUsage: 0.1.1
globalSecurity: 2.82.11
Expand All @@ -41,13 +40,15 @@ generatedFiles:
- docs/models/components/bodygenimagetoimage.md
- docs/models/components/bodygenimagetovideo.md
- docs/models/components/bodygenimagetovideoimage.md
- docs/models/components/bodygenllm.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
- docs/models/components/llmresponse.md
- docs/models/components/loc.md
- docs/models/components/masksresponse.md
- docs/models/components/media.md
Expand All @@ -61,6 +62,7 @@ generatedFiles:
- docs/models/operations/genaudiototextresponse.md
- docs/models/operations/genimagetoimageresponse.md
- docs/models/operations/genimagetovideoresponse.md
- docs/models/operations/genllmresponse.md
- docs/models/operations/gensegmentanything2response.md
- docs/models/operations/gentexttoimageresponse.md
- docs/models/operations/genupscaleresponse.md
Expand All @@ -72,6 +74,7 @@ generatedFiles:
- src/funcs/generateAudioToText.ts
- src/funcs/generateImageToImage.ts
- src/funcs/generateImageToVideo.ts
- src/funcs/generateLlm.ts
- src/funcs/generateSegmentAnything2.ts
- src/funcs/generateTextToImage.ts
- src/funcs/generateUpscale.ts
Expand All @@ -98,11 +101,13 @@ generatedFiles:
- src/models/components/bodygenaudiototext.ts
- src/models/components/bodygenimagetoimage.ts
- src/models/components/bodygenimagetovideo.ts
- src/models/components/bodygenllm.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
- src/models/components/llmresponse.ts
- src/models/components/masksresponse.ts
- src/models/components/media.ts
- src/models/components/security.ts
Expand All @@ -119,6 +124,7 @@ generatedFiles:
- src/models/operations/genaudiototext.ts
- src/models/operations/genimagetoimage.ts
- src/models/operations/genimagetovideo.ts
- src/models/operations/genllm.ts
- src/models/operations/gensegmentanything2.ts
- src/models/operations/gentexttoimage.ts
- src/models/operations/genupscale.ts
Expand Down Expand Up @@ -196,3 +202,13 @@ examples:
"400":
application/json: {"detail": {"msg": "<value>"}}
"422": {}
genLLM:
speakeasy-default-gen-LLM:
requestBody:
application/x-www-form-urlencoded: {"prompt": "<value>"}
responses:
"200":
application/json: {"response": "<value>", "tokens_used": 60712}
"400":
application/json: {"detail": {"msg": "<value>"}}
"422": {}
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.4
version: 0.4.0
additionalDependencies:
dependencies:
jest: ^29.7.0
Expand Down
12 changes: 6 additions & 6 deletions .speakeasy/workflow.lock
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
speakeasyVersion: 1.401.2
speakeasyVersion: 1.405.6
sources:
livepeer-ai-OAS:
sourceNamespace: livepeer-ai-oas
sourceRevisionDigest: sha256:c315b1b7b5fabfea70de7cbb604a022f512b8a0a8866d3d2b5d2720902b1737e
sourceBlobDigest: sha256:ffdfa01671cab29ecdb8b014925f080497ace7616108fe5a4b9153cc0e562f93
sourceRevisionDigest: sha256:28d29014d26e0617906dcc16a4ceef1e093bd486b956a13eba844f8653004fca
sourceBlobDigest: sha256:1381f76cad0ec28b51d5559fdf87a0b14f39e2946fe25e0c21c0b8b0fe42cf99
tags:
- latest
- main
targets:
livepeer-ai-ts:
source: livepeer-ai-OAS
sourceNamespace: livepeer-ai-oas
sourceRevisionDigest: sha256:c315b1b7b5fabfea70de7cbb604a022f512b8a0a8866d3d2b5d2720902b1737e
sourceBlobDigest: sha256:ffdfa01671cab29ecdb8b014925f080497ace7616108fe5a4b9153cc0e562f93
sourceRevisionDigest: sha256:28d29014d26e0617906dcc16a4ceef1e093bd486b956a13eba844f8653004fca
sourceBlobDigest: sha256:1381f76cad0ec28b51d5559fdf87a0b14f39e2946fe25e0c21c0b8b0fe42cf99
codeSamplesNamespace: code-samples-typescript-livepeer-ts
codeSamplesRevisionDigest: sha256:717ed852ff71a07f8e1e0c3dd3675a8d5b73894c5b81b902d5d6b08cd0031a4c
codeSamplesRevisionDigest: sha256:dbf36c79c6b1c0a0c034081e1b0b210571b9f155e26c0f5bdf524ae4f3d05214
workflow:
workflowVersion: 1.0.0
speakeasyVersion: latest
Expand Down
2 changes: 1 addition & 1 deletion FUNCTIONS.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ async function run() {
const { value: result } = res;

// Handle the result
console.log(result)
console.log(result);
}

run();
Expand Down
27 changes: 20 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ run();
* [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
* [llm](docs/sdks/generate/README.md#llm) - LLM


</details>
Expand All @@ -111,6 +112,7 @@ To read more about standalone functions, check [FUNCTIONS.md](./FUNCTIONS.md).
- [generateAudioToText](docs/sdks/generate/README.md#audiototext)
- [generateImageToImage](docs/sdks/generate/README.md#imagetoimage)
- [generateImageToVideo](docs/sdks/generate/README.md#imagetovideo)
- [generateLlm](docs/sdks/generate/README.md#llm)
- [generateSegmentAnything2](docs/sdks/generate/README.md#segmentanything2)
- [generateTextToImage](docs/sdks/generate/README.md#texttoimage)
- [generateUpscale](docs/sdks/generate/README.md#upscale)
Expand Down Expand Up @@ -228,16 +230,25 @@ run();
<!-- Start Error Handling [errors] -->
## Error Handling

All SDK methods return a response object or throw an error. If Error objects are specified in your OpenAPI Spec, the SDK will throw the appropriate Error type.
All SDK methods return a response object or throw an error. By default, an API error will throw a `errors.SDKError`.

| Error Object | Status Code | Content Type |
| -------------------------- | -------------------------- | -------------------------- |
| errors.HTTPError | 400,401,500 | application/json |
| errors.HTTPValidationError | 422 | application/json |
| errors.SDKError | 4xx-5xx | */* |
If a HTTP request fails, an operation my also throw an error from the `models/errors/httpclienterrors.ts` module:

| HTTP Client Error | Description |
| ---------------------------------------------------- | ---------------------------------------------------- |
| RequestAbortedError | HTTP request was aborted by the client |
| RequestTimeoutError | HTTP request timed out due to an AbortSignal signal |
| ConnectionError | HTTP client was unable to make a request to a server |
| InvalidRequestError | Any input used to create a request is invalid |
| UnexpectedClientError | Unrecognised or unexpected error |

Validation errors can also occur when either method arguments or data returned from the server do not match the expected format. The `SDKValidationError` that is thrown as a result will capture the raw value that failed validation in an attribute called `rawValue`. Additionally, a `pretty()` method is available on this error that can be used to log a nicely formatted string since validation errors can list many issues and the plain error string may be difficult read when debugging.
In addition, when custom error responses are specified for an operation, the SDK may throw their associated Error type. You can refer to respective *Errors* tables in SDK docs for more details on possible error types for each operation. For example, the `textToImage` method may throw the following errors:

| Error Type | Status Code | Content Type |
| -------------------------- | -------------------------- | -------------------------- |
| errors.HTTPError | 400, 401, 500 | application/json |
| errors.HTTPValidationError | 422 | application/json |
| errors.SDKError | 4XX, 5XX | \*/\* |

```typescript
import { Livepeer } from "@livepeer/ai";
Expand Down Expand Up @@ -289,6 +300,8 @@ async function run() {
run();

```

Validation errors can also occur when either method arguments or data returned from the server do not match the expected format. The `SDKValidationError` that is thrown as a result will capture the raw value that failed validation in an attribute called `rawValue`. Additionally, a `pretty()` method is available on this error that can be used to log a nicely formatted string since validation errors can list many issues and the plain error string may be difficult read when debugging.
<!-- End Error Handling [errors] -->

<!-- Start Server Selection [server] -->
Expand Down
12 changes: 11 additions & 1 deletion RELEASES.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,4 +80,14 @@ Based on:
### Generated
- [typescript v0.3.4] .
### Releases
- [NPM v0.3.4] https://www.npmjs.com/package/@livepeer/ai/v/0.3.4 - .
- [NPM v0.3.4] https://www.npmjs.com/package/@livepeer/ai/v/0.3.4 - .

## 2024-10-01 20:49:24
### Changes
Based on:
- OpenAPI Doc
- Speakeasy CLI 1.405.6 (2.428.1) https://github.com/speakeasy-api/speakeasy
### Generated
- [typescript v0.4.0] .
### Releases
- [NPM v0.4.0] https://www.npmjs.com/package/@livepeer/ai/v/0.4.0 - .
137 changes: 131 additions & 6 deletions codeSamples.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,34 +8,159 @@ actions:
x-codeSamples:
- lang: typescript
label: genAudioToText
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();"
source: |-
import { Livepeer } from "@livepeer/ai";
import { openAsBlob } from "node:fs";
const livepeer = new Livepeer({
httpBearer: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await livepeer.generate.audioToText({
audio: await openAsBlob("example.file"),
});
// Handle the result
console.log(result);
}
run();
- target: $["paths"]["/image-to-image"]["post"]
update:
x-codeSamples:
- lang: typescript
label: genImageToImage
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();"
source: |-
import { Livepeer } from "@livepeer/ai";
import { openAsBlob } from "node:fs";
const livepeer = new Livepeer({
httpBearer: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await livepeer.generate.imageToImage({
prompt: "<value>",
image: await openAsBlob("example.file"),
});
// Handle the result
console.log(result);
}
run();
- target: $["paths"]["/image-to-video"]["post"]
update:
x-codeSamples:
- lang: typescript
label: genImageToVideo
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();"
source: |-
import { Livepeer } from "@livepeer/ai";
import { openAsBlob } from "node:fs";
const livepeer = new Livepeer({
httpBearer: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await livepeer.generate.imageToVideo({
image: await openAsBlob("example.file"),
});
// Handle the result
console.log(result);
}
run();
- target: $["paths"]["/llm"]["post"]
update:
x-codeSamples:
- lang: typescript
label: genLLM
source: |-
import { Livepeer } from "@livepeer/ai";
const livepeer = new Livepeer({
httpBearer: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await livepeer.generate.llm({
prompt: "<value>",
});
// Handle the result
console.log(result);
}
run();
- target: $["paths"]["/segment-anything-2"]["post"]
update:
x-codeSamples:
- lang: typescript
label: genSegmentAnything2
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();"
source: |-
import { Livepeer } from "@livepeer/ai";
import { openAsBlob } from "node:fs";
const livepeer = new Livepeer({
httpBearer: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await livepeer.generate.segmentAnything2({
image: await openAsBlob("example.file"),
});
// Handle the result
console.log(result);
}
run();
- target: $["paths"]["/text-to-image"]["post"]
update:
x-codeSamples:
- lang: typescript
label: genTextToImage
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();"
source: |-
import { Livepeer } from "@livepeer/ai";
const livepeer = new Livepeer({
httpBearer: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await livepeer.generate.textToImage({
prompt: "<value>",
});
// Handle the result
console.log(result);
}
run();
- target: $["paths"]["/upscale"]["post"]
update:
x-codeSamples:
- lang: typescript
label: genUpscale
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();"
source: |-
import { Livepeer } from "@livepeer/ai";
import { openAsBlob } from "node:fs";
const livepeer = new Livepeer({
httpBearer: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await livepeer.generate.upscale({
prompt: "<value>",
image: await openAsBlob("example.file"),
});
// Handle the result
console.log(result);
}
run();
Loading

0 comments on commit fc8808a

Please sign in to comment.