Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
/examples/node_modules
/mcp-server
/bin
.DS_Store
**/.speakeasy/temp/
**/.speakeasy/logs/
.DS_Store
.env
.env.local
.env.*.local
/.eslintcache
/.speakeasy/reports
/react-query
Expand Down
1 change: 1 addition & 0 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
!/REACT_QUERY.md
!/**/*.ts
!/**/*.js
!/**/*.mjs
!/**/*.json
!/**/*.map

Expand Down
67 changes: 37 additions & 30 deletions .speakeasy/gen.lock
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@
lockVersion: 2.0.0
id: 8bd6d3b6-cae6-4e55-b72f-6fdc1dbce9a1
management:
docChecksum: 6657dd3e876a909472f364dc1fe34d72
docVersion: 0.0.0
speakeasyVersion: 1.480.0
generationVersion: 2.499.0
releaseVersion: 0.6.2
configChecksum: f41c806c90a2fadee46578cb5e358e89
docChecksum: ccf6085748e452cf3e6a2d9f287f99de
docVersion: 0.13.11
speakeasyVersion: 1.656.1
generationVersion: 2.753.1
releaseVersion: 0.7.0
configChecksum: 1549945a7985e25805dafaab884a9366
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.18.20
constsAndDefaults: 0.1.12
core: 3.26.6
defaultEnabledRetries: 0.1.0
envVarSecurityUsage: 0.1.2
globalSecurity: 2.82.12
globalSecurity: 2.82.14
globalSecurityCallbacks: 0.1.0
globalSecurityFlattening: 0.1.0
globalServerURLs: 2.82.4
globalServerURLs: 2.83.0
nameOverrides: 2.81.2
responseFormat: 0.2.3
retries: 2.83.0
sdkHooks: 0.2.0
unions: 2.85.8
sdkHooks: 0.3.0
unions: 2.86.0
uploadStreams: 0.1.0
generatedFiles:
- .gitattributes
Expand Down Expand Up @@ -82,8 +82,11 @@ generatedFiles:
- docs/models/operations/gentexttospeechresponse.md
- docs/models/operations/genupscaleresponse.md
- docs/sdks/generate/README.md
- docs/sdks/livepeer/README.md
- eslint.config.mjs
- examples/.env.template
- examples/README.md
- examples/generateTextToImage.example.ts
- examples/package.json
- jsr.json
- package.json
- src/core.ts
Expand Down Expand Up @@ -148,6 +151,8 @@ generatedFiles:
- src/models/errors/httperror.ts
- src/models/errors/httpvalidationerror.ts
- src/models/errors/index.ts
- src/models/errors/livepeererror.ts
- src/models/errors/responsevalidationerror.ts
- src/models/errors/sdkerror.ts
- src/models/errors/sdkvalidationerror.ts
- src/models/operations/genaudiototext.ts
Expand All @@ -164,6 +169,7 @@ generatedFiles:
- src/sdk/generate.ts
- src/sdk/index.ts
- src/sdk/sdk.ts
- src/types/async.ts
- src/types/blobs.ts
- src/types/constdatetime.ts
- src/types/enums.ts
Expand All @@ -180,7 +186,7 @@ examples:
application/json: {"model_id": "", "loras": "", "prompt": "<value>", "height": 576, "width": 1024, "guidance_scale": 7.5, "negative_prompt": "", "safety_check": true, "num_inference_steps": 50, "num_images_per_prompt": 1}
responses:
"200":
application/json: {"images": [{"url": "https://hateful-cruelty.name", "seed": 857392, "nsfw": true}]}
application/json: {"images": []}
"400":
application/json: {"detail": {"msg": "<value>"}}
"422":
Expand All @@ -190,10 +196,10 @@ examples:
genImageToImage:
speakeasy-default-gen-image-to-image:
requestBody:
multipart/form-data: {"prompt": "<value>", "image": {"": "x-file: example.file"}, "model_id": "", "loras": "", "strength": 0.8, "guidance_scale": 7.5, "image_guidance_scale": 1.5, "negative_prompt": "", "safety_check": true, "num_inference_steps": 100, "num_images_per_prompt": 1}
multipart/form-data: {"prompt": "<value>", "image": "x-file: example.file", "model_id": "", "loras": "", "strength": 0.8, "guidance_scale": 7.5, "image_guidance_scale": 1.5, "negative_prompt": "", "safety_check": true, "num_inference_steps": 100, "num_images_per_prompt": 1}
responses:
"200":
application/json: {"images": [{"url": "https://selfish-operating.name/", "seed": 976514, "nsfw": false}]}
application/json: {"images": []}
"400":
application/json: {"detail": {"msg": "<value>"}}
"422":
Expand All @@ -203,10 +209,10 @@ examples:
genImageToVideo:
speakeasy-default-gen-image-to-video:
requestBody:
multipart/form-data: {"image": {"": "x-file: example.file"}, "model_id": "", "height": 576, "width": 1024, "fps": 6, "motion_bucket_id": 127, "noise_aug_strength": 0.02, "safety_check": true, "num_inference_steps": 25}
multipart/form-data: {"image": "x-file: example.file", "model_id": "", "height": 576, "width": 1024, "fps": 6, "motion_bucket_id": 127, "noise_aug_strength": 0.02, "safety_check": true, "num_inference_steps": 25}
responses:
"200":
application/json: {"images": [{"url": "https://low-handover.name/", "seed": 87160, "nsfw": true}]}
application/json: {"images": []}
"400":
application/json: {"detail": {"msg": "<value>"}}
"422":
Expand All @@ -216,10 +222,10 @@ examples:
genUpscale:
speakeasy-default-gen-upscale:
requestBody:
multipart/form-data: {"prompt": "<value>", "image": {"": "x-file: example.file"}, "model_id": "", "safety_check": true, "num_inference_steps": 75}
multipart/form-data: {"prompt": "<value>", "image": "x-file: example.file", "model_id": "", "safety_check": true, "num_inference_steps": 75}
responses:
"200":
application/json: {"images": [{"url": "https://bogus-typewriter.net", "seed": 311567, "nsfw": false}]}
application/json: {"images": []}
"400":
application/json: {"detail": {"msg": "<value>"}}
"422":
Expand All @@ -229,10 +235,10 @@ examples:
genAudioToText:
speakeasy-default-gen-audio-to-text:
requestBody:
multipart/form-data: {"audio": {"": "x-file: example.file"}, "model_id": "", "return_timestamps": "true"}
multipart/form-data: {"audio": "x-file: example.file", "model_id": "", "return_timestamps": "true"}
responses:
"200":
application/json: {"text": "<value>", "chunks": [{"timestamp": ["<value>", "<value>"], "text": "<value>"}, {"timestamp": [], "text": "<value>"}]}
application/json: {"text": "<value>", "chunks": []}
"400":
application/json: {"detail": {"msg": "<value>"}}
"422":
Expand All @@ -242,7 +248,7 @@ examples:
genSegmentAnything2:
speakeasy-default-gen-segment-anything2:
requestBody:
multipart/form-data: {"image": {"": "x-file: example.file"}, "model_id": "", "multimask_output": true, "return_logits": true, "normalize_coords": true}
multipart/form-data: {"image": "x-file: example.file", "model_id": "", "multimask_output": true, "return_logits": true, "normalize_coords": true}
responses:
"200":
application/json: {"masks": "<value>", "scores": "<value>", "logits": "<value>"}
Expand All @@ -255,10 +261,10 @@ examples:
genLLM:
speakeasy-default-gen-LLM:
requestBody:
application/json: {"messages": [], "model": "", "temperature": 0.7, "max_tokens": 256, "top_p": 1, "top_k": -1, "stream": false}
application/json: {"messages": [{"role": "<value>", "content": "<value>"}], "model": "", "temperature": 0.7, "max_tokens": 256, "top_p": 1, "top_k": -1, "stream": false}
responses:
"200":
application/json: {"id": "<id>", "model": "Expedition", "created": 755586, "usage": {"prompt_tokens": 348799, "completion_tokens": 332397, "total_tokens": 528534}, "choices": []}
application/json: {"id": "<id>", "model": "Explorer", "created": 166063, "usage": {"prompt_tokens": 213097, "completion_tokens": 185693, "total_tokens": 530500}, "choices": []}
"400":
application/json: {"detail": {"msg": "<value>"}}
"422":
Expand All @@ -268,7 +274,7 @@ examples:
genImageToText:
speakeasy-default-gen-image-to-text:
requestBody:
multipart/form-data: {"image": {"": "x-file: example.file"}, "prompt": "", "model_id": ""}
multipart/form-data: {"image": "x-file: example.file", "prompt": "", "model_id": ""}
responses:
"200":
application/json: {"text": "<value>"}
Expand All @@ -281,10 +287,10 @@ examples:
genLiveVideoToVideo:
speakeasy-default-gen-live-video-to-video:
requestBody:
application/json: {"subscribe_url": "https://soulful-lava.org/", "publish_url": "https://vain-tabletop.biz", "control_url": "", "events_url": "", "model_id": ""}
application/json: {"subscribe_url": "https://soulful-finding.biz", "publish_url": "https://monumental-representation.biz/", "control_url": "", "events_url": "", "model_id": "", "gateway_request_id": "", "manifest_id": "", "stream_id": ""}
responses:
"200":
application/json: {"subscribe_url": "https://vain-kiss.name", "publish_url": "https://frail-duffel.com", "control_url": "", "events_url": ""}
application/json: {"subscribe_url": "https://any-expense.com/", "publish_url": "https://early-abacus.org", "control_url": "", "events_url": "", "request_id": "", "manifest_id": ""}
"400":
application/json: {"detail": {"msg": "<value>"}}
"422":
Expand All @@ -297,12 +303,13 @@ examples:
application/json: {"model_id": "", "text": "", "description": "A male speaker delivers a slightly expressive and animated speech with a moderate speed and pitch."}
responses:
"200":
application/json: {"audio": {"url": "https://accurate-parsnip.net/"}}
application/json: {"audio": {"url": "https://slushy-elevation.net/"}}
"400":
application/json: {"detail": {"msg": "<value>"}}
"422":
application/json: {}
"500":
application/json: {"detail": {"msg": "<value>"}}
examplesVersion: 1.0.0
examplesVersion: 1.0.2
generatedTests: {}
releaseNotes: "## Typescript SDK Changes Detected:\n* `livepeer.generate.liveVideoToVideo()`: \n * `request` **Changed**\n * `response` **Changed**\n"
29 changes: 27 additions & 2 deletions .speakeasy/gen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,27 @@ generation:
maintainOpenAPIOrder: true
usageSnippets:
optionalPropertyRendering: withExample
sdkInitStyle: constructor
fixes:
nameResolutionDec2023: false
nameResolutionFeb2025: false
parameterOrderingFeb2024: false
requestResponseComponentNamesFeb2024: false
securityFeb2025: false
sharedErrorComponentsApr2025: false
auth:
oAuth2ClientCredentialsEnabled: false
oAuth2PasswordEnabled: false
hoistGlobalSecurity: true
schemas:
allOfMergeStrategy: shallowMerge
requestBodyFieldName: ""
tests:
generateTests: true
generateNewTests: false
skipResponseBodyAssertions: false
typescript:
version: 0.6.2
version: 0.7.0
acceptHeaderEnum: true
additionalDependencies:
dependencies:
jest: ^29.7.0
Expand All @@ -22,14 +34,21 @@ typescript:
'@types/jest': ^29.5.12
peerDependencies: {}
additionalPackageJSON: {}
additionalScripts: {}
alwaysIncludeInboundAndOutbound: false
author: Livepeer
baseErrorName: LivepeerError
clientServerStatusCodesAsErrors: true
constFieldsAlwaysOptional: true
defaultErrorName: SDKError
enableCustomCodeRegions: false
enableMCPServer: false
enableReactQuery: false
enumFormat: enum
exportZodModelNamespace: false
flattenGlobalSecurity: true
flatteningOrder: body-first
generateExamples: true
imports:
option: openapi
paths:
Expand All @@ -39,11 +58,17 @@ typescript:
shared: models/components
webhooks: models/webhooks
inputModelSuffix: input
jsonpath: legacy
maxMethodParams: 4
methodArguments: require-security-and-request
modelPropertyCasing: camel
moduleFormat: commonjs
outputModelSuffix: output
packageName: '@livepeer/ai'
responseFormat: envelope
sseFlatResponse: false
templateVersion: v2
unionStrategy: left-to-right
usageSDKInitImports: []
useIndexModules: true
zodVersion: v3
16 changes: 8 additions & 8 deletions .speakeasy/workflow.lock
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
speakeasyVersion: 1.480.0
speakeasyVersion: 1.656.1
sources:
livepeer-ai-OAS:
sourceNamespace: livepeer-ai-oas
sourceRevisionDigest: sha256:3f780bb89b27b717229bf3fb0cc8eafe6ca754e3da17e0f65d6cf8deabcb95e8
sourceBlobDigest: sha256:7c0df39c1c5f0ffe580b63f5dc6cb0f81181f5361a80f63f41314cf81d0f3bf4
sourceRevisionDigest: sha256:8e99fdc55b750db963079293d391dec5168c325a849ee9a52ef1dda1952b8917
sourceBlobDigest: sha256:3268e3640001fb0f0582a9328448f3235d0fe88448fa7a1249a4524ebdd452c8
tags:
- latest
- speakeasy-sdk-regen-1736899286
- 0.0.0
- speakeasy-sdk-regen-1739404875
- 0.13.11
targets:
livepeer-ai-ts:
source: livepeer-ai-OAS
sourceNamespace: livepeer-ai-oas
sourceRevisionDigest: sha256:3f780bb89b27b717229bf3fb0cc8eafe6ca754e3da17e0f65d6cf8deabcb95e8
sourceBlobDigest: sha256:7c0df39c1c5f0ffe580b63f5dc6cb0f81181f5361a80f63f41314cf81d0f3bf4
sourceRevisionDigest: sha256:8e99fdc55b750db963079293d391dec5168c325a849ee9a52ef1dda1952b8917
sourceBlobDigest: sha256:3268e3640001fb0f0582a9328448f3235d0fe88448fa7a1249a4524ebdd452c8
codeSamplesNamespace: code-samples-typescript-livepeer-ts
codeSamplesRevisionDigest: sha256:b095b4fd79d259a27df817458a7f17eb84321fad3599de4460aa913719fae2b6
codeSamplesRevisionDigest: sha256:b4d86a2571a91ffbc1bcf9ba9037ff3dba6725f3e3d993a1b7b2ba153e4c3e36
workflow:
workflowVersion: 1.0.0
speakeasyVersion: latest
Expand Down
36 changes: 5 additions & 31 deletions FUNCTIONS.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ specific category of applications.
```typescript
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 `LivepeerCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
Expand All @@ -31,39 +30,14 @@ const livepeer = new LivepeerCore({

async function run() {
const res = await generateTextToImage(livepeer, {
modelId: "",
loras: "",
prompt: "<value>",
height: 576,
width: 1024,
guidanceScale: 7.5,
negativePrompt: "",
safetyCheck: true,
numInferenceSteps: 50,
numImagesPerPrompt: 1,
});

switch (true) {
case res.ok:
// The success case will be handled outside of the switch block
break;
case res.error instanceof SDKValidationError:
// Pretty-print validation errors.
return console.log(res.error.pretty());
case res.error instanceof Error:
return console.log(res.error);
default:
// TypeScript's type checking will fail on the following line if the above
// cases were not exhaustive.
res.error satisfies never;
throw new Error("Assertion failed: expected error checks to be exhaustive: " + res.error);
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("generateTextToImage failed:", res.error);
}


const { value: result } = res;

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

run();
Expand Down
Loading