Skip to content

Commit 710a719

Browse files
committed
feat: add auto-generated speakeasy SDK
This commit adds the initial autogenerated speakeasy SDK. These where generated based on the [Gateway Facing OpenAPI spec](https://github.com/livepeer/ai-worker/blob/main/runner/gateway.openapi.json) found in the [ai-worker](https://github.com/livepeer/ai-worker) repository.
1 parent a2d9eda commit 710a719

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

85 files changed

+5983
-1
lines changed

.devcontainer/README.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
2+
> **Remember to shutdown a GitHub Codespace when it is not in use!**
3+
4+
# Dev Containers Quick Start
5+
6+
The default location for usage snippets is the `samples` directory.
7+
8+
## Running a Usage Sample
9+
10+
A sample usage example has been provided in a `root.py` file. As you work with the SDK, it's expected that you will modify these samples to fit your needs. To execute this particular snippet, use the command below.
11+
12+
```
13+
python root.py
14+
```
15+
16+
## Generating Additional Usage Samples
17+
18+
The speakeasy CLI allows you to generate more usage snippets. Here's how:
19+
20+
- To generate a sample for a specific operation by providing an operation ID, use:
21+
22+
```
23+
speakeasy generate usage -s https://raw.githubusercontent.com/livepeer/ai-worker/main/runner/gateway.openapi.json -l python -i {INPUT_OPERATION_ID} -o ./samples
24+
```
25+
26+
- To generate samples for an entire namespace (like a tag or group name), use:
27+
28+
```
29+
speakeasy generate usage -s https://raw.githubusercontent.com/livepeer/ai-worker/main/runner/gateway.openapi.json -l python -n {INPUT_TAG_NAME} -o ./samples
30+
```

.devcontainer/devcontainer.json

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
2+
// README at: https://github.com/devcontainers/images/tree/main/src/python
3+
{
4+
"name": "Python",
5+
"image": "mcr.microsoft.com/devcontainers/python:1-3.11-bullseye",
6+
// Features to add to the dev container. More info: https://containers.dev/features.
7+
// "features": {},
8+
// Use 'forwardPorts' to make a list of ports inside the container available locally.
9+
// "forwardPorts": [],
10+
// Use 'postCreateCommand' to run commands after the container is created.
11+
"postCreateCommand": "sudo chmod +x ./.devcontainer/setup.sh && ./.devcontainer/setup.sh",
12+
"customizations": {
13+
"vscode": {
14+
"extensions": [
15+
"ms-python.python",
16+
"ms-python.vscode-pylance",
17+
"github.vscode-pull-request-github"
18+
],
19+
"settings": {
20+
"files.eol": "\n",
21+
"editor.formatOnSave": true,
22+
"python.formatting.provider": "black",
23+
"python.linting.enabled": true,
24+
"python.linting.pylintEnabled": true,
25+
"python.linting.flake8Enabled": true,
26+
"python.linting.banditEnabled": true,
27+
"python.testing.pytestEnabled": true
28+
}
29+
},
30+
"codespaces": {
31+
"openFiles": [
32+
".devcontainer/README.md"
33+
]
34+
}
35+
}
36+
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
37+
// "remoteUser": "root"
38+
}

.devcontainer/setup.sh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/bin/bash
2+
3+
# Install the speakeasy CLI
4+
curl -fsSL https://raw.githubusercontent.com/speakeasy-api/speakeasy/main/install.sh | sh
5+
6+
# Setup samples directory
7+
rmdir samples || true
8+
mkdir samples
9+
10+
python -m pip install --upgrade pip
11+
pip install -e .
12+
13+
# Generate starter usage sample with speakeasy
14+
speakeasy generate usage -s https://raw.githubusercontent.com/livepeer/ai-worker/main/runner/gateway.openapi.json -l python -o samples/root.py

.gitattributes

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# This allows generated code to be indexed correctly
2+
*.py linguist-generated=false

.gitignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
.venv/
2+
venv/
3+
src/*.egg-info/
4+
__pycache__/
5+
.pytest_cache/
6+
.python-version
7+
.DS_Store
8+
pyrightconfig.json
9+
README-PYPI.md

.speakeasy/gen.lock

Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
lockVersion: 2.0.0
2+
id: 2d5dbf5a-62be-411a-9c7b-bc7b6dc79e13
3+
management:
4+
docChecksum: c222ffbf28e5f62770dc8cbd99010f96
5+
docVersion: v0.1.2
6+
speakeasyVersion: 1.372.0
7+
generationVersion: 2.399.0
8+
releaseVersion: 0.0.1
9+
configChecksum: 7df6e43d97fb1f0e63c017ed688f22db
10+
features:
11+
python:
12+
additionalDependencies: 1.0.0
13+
constsAndDefaults: 1.0.2
14+
core: 5.3.8
15+
defaultEnabledRetries: 0.2.0
16+
devContainers: 3.0.0
17+
envVarSecurityUsage: 0.3.1
18+
globalSecurity: 3.0.2
19+
globalSecurityCallbacks: 1.0.0
20+
globalSecurityFlattening: 1.0.0
21+
globalServerURLs: 3.0.0
22+
multipartFileContentType: 1.0.0
23+
responseFormat: 1.0.0
24+
retries: 3.0.0
25+
sdkHooks: 1.0.0
26+
unions: 3.0.2
27+
uploadStreams: 1.0.0
28+
generatedFiles:
29+
- src/livepeer_ai/sdkconfiguration.py
30+
- src/livepeer_ai/sdk.py
31+
- .vscode/settings.json
32+
- poetry.toml
33+
- py.typed
34+
- pylintrc
35+
- pyproject.toml
36+
- scripts/compile.sh
37+
- scripts/prepare-readme.py
38+
- scripts/publish.sh
39+
- src/livepeer_ai/__init__.py
40+
- src/livepeer_ai/basesdk.py
41+
- src/livepeer_ai/httpclient.py
42+
- src/livepeer_ai/py.typed
43+
- src/livepeer_ai/types/__init__.py
44+
- src/livepeer_ai/types/basemodel.py
45+
- src/livepeer_ai/utils/__init__.py
46+
- src/livepeer_ai/utils/annotations.py
47+
- src/livepeer_ai/utils/enums.py
48+
- src/livepeer_ai/utils/eventstreaming.py
49+
- src/livepeer_ai/utils/forms.py
50+
- src/livepeer_ai/utils/headers.py
51+
- src/livepeer_ai/utils/logger.py
52+
- src/livepeer_ai/utils/metadata.py
53+
- src/livepeer_ai/utils/queryparams.py
54+
- src/livepeer_ai/utils/requestbodies.py
55+
- src/livepeer_ai/utils/retries.py
56+
- src/livepeer_ai/utils/security.py
57+
- src/livepeer_ai/utils/serializers.py
58+
- src/livepeer_ai/utils/url.py
59+
- src/livepeer_ai/utils/values.py
60+
- src/livepeer_ai/models/sdkerror.py
61+
- src/livepeer_ai/models/imageresponse.py
62+
- src/livepeer_ai/models/media.py
63+
- src/livepeer_ai/models/httperror.py
64+
- src/livepeer_ai/models/apierror.py
65+
- src/livepeer_ai/models/httpvalidationerror.py
66+
- src/livepeer_ai/models/validationerror.py
67+
- src/livepeer_ai/models/texttoimageparams.py
68+
- src/livepeer_ai/models/body_image_to_image_image_to_image_post.py
69+
- src/livepeer_ai/models/videoresponse.py
70+
- src/livepeer_ai/models/body_image_to_video_image_to_video_post.py
71+
- src/livepeer_ai/models/body_upscale_upscale_post.py
72+
- src/livepeer_ai/models/textresponse.py
73+
- src/livepeer_ai/models/chunk.py
74+
- src/livepeer_ai/models/body_audio_to_text_audio_to_text_post.py
75+
- src/livepeer_ai/models/security.py
76+
- src/livepeer_ai/models/__init__.py
77+
- docs/models/imageresponse.md
78+
- docs/models/media.md
79+
- docs/models/httperror.md
80+
- docs/models/apierror.md
81+
- docs/models/httpvalidationerror.md
82+
- docs/models/loc.md
83+
- docs/models/validationerror.md
84+
- docs/models/texttoimageparams.md
85+
- docs/models/image.md
86+
- docs/models/bodyimagetoimageimagetoimagepost.md
87+
- docs/models/videoresponse.md
88+
- docs/models/bodyimagetovideoimagetovideopostimage.md
89+
- docs/models/bodyimagetovideoimagetovideopost.md
90+
- docs/models/bodyupscaleupscalepostimage.md
91+
- docs/models/bodyupscaleupscalepost.md
92+
- docs/models/textresponse.md
93+
- docs/models/chunk.md
94+
- docs/models/audio.md
95+
- docs/models/bodyaudiototextaudiototextpost.md
96+
- docs/models/security.md
97+
- docs/models/utils/retryconfig.md
98+
- docs/sdks/livepeerai/README.md
99+
- USAGE.md
100+
- .gitattributes
101+
- .devcontainer/README.md
102+
- .devcontainer/devcontainer.json
103+
- .devcontainer/setup.sh
104+
- src/livepeer_ai/_hooks/sdkhooks.py
105+
- src/livepeer_ai/_hooks/types.py
106+
- src/livepeer_ai/_hooks/__init__.py
107+
- CONTRIBUTING.md

.speakeasy/gen.yaml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
configVersion: 2.0.0
2+
generation:
3+
devContainers:
4+
enabled: true
5+
schemaPath: https://raw.githubusercontent.com/livepeer/ai-worker/main/runner/gateway.openapi.json
6+
sdkClassName: LivepeerAi
7+
maintainOpenAPIOrder: true
8+
usageSnippets:
9+
optionalPropertyRendering: withExample
10+
useClassNamesForArrayFields: true
11+
fixes:
12+
nameResolutionDec2023: true
13+
parameterOrderingFeb2024: true
14+
requestResponseComponentNamesFeb2024: true
15+
auth:
16+
oAuth2ClientCredentialsEnabled: false
17+
python:
18+
version: 0.0.1
19+
additionalDependencies:
20+
dev: {}
21+
main: {}
22+
authors:
23+
- Speakeasy
24+
clientServerStatusCodesAsErrors: true
25+
description: Python Client SDK Generated by Speakeasy.
26+
enumFormat: enum
27+
flattenGlobalSecurity: true
28+
flattenRequests: false
29+
imports:
30+
option: openapi
31+
paths:
32+
callbacks: ""
33+
errors: ""
34+
operations: ""
35+
shared: ""
36+
webhooks: ""
37+
inputModelSuffix: input
38+
maxMethodParams: 4
39+
methodArguments: infer-optional-args
40+
outputModelSuffix: output
41+
packageName: livepeer-ai
42+
responseFormat: flat
43+
templateVersion: v2

.speakeasy/workflow.lock

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
speakeasyVersion: 1.372.0
2+
sources:
3+
livepeer_ai-OAS:
4+
sourceNamespace: livepeer-ai-oas
5+
sourceRevisionDigest: sha256:7ac58682b776e03b6609bbca82499bca46176c857e7e1c1ccdc7f916edf3de02
6+
sourceBlobDigest: sha256:26199d9d483dcc00982af07497f482f7d056c167e9e3c39543fafd1efada287c
7+
tags:
8+
- latest
9+
targets:
10+
livepeer-ai:
11+
source: livepeer_ai-OAS
12+
sourceNamespace: livepeer-ai-oas
13+
sourceRevisionDigest: sha256:7ac58682b776e03b6609bbca82499bca46176c857e7e1c1ccdc7f916edf3de02
14+
sourceBlobDigest: sha256:26199d9d483dcc00982af07497f482f7d056c167e9e3c39543fafd1efada287c
15+
outLocation: /home/ricks/development/livepeer/ai/livepeer-ai-python/livepeer-ai-python
16+
workflow:
17+
workflowVersion: 1.0.0
18+
sources:
19+
livepeer_ai-OAS:
20+
inputs:
21+
- location: https://raw.githubusercontent.com/livepeer/ai-worker/main/runner/gateway.openapi.json
22+
registry:
23+
location: registry.speakeasyapi.dev/livepeer-8mq/livepeer-ai/livepeer-ai-oas
24+
targets:
25+
livepeer-ai:
26+
target: python
27+
source: livepeer_ai-OAS

.speakeasy/workflow.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
workflowVersion: 1.0.0
2+
sources:
3+
livepeer_ai-OAS:
4+
inputs:
5+
- location: https://raw.githubusercontent.com/livepeer/ai-worker/main/runner/gateway.openapi.json
6+
registry:
7+
location: registry.speakeasyapi.dev/livepeer-8mq/livepeer-ai/livepeer-ai-oas
8+
targets:
9+
livepeer-ai:
10+
target: python
11+
source: livepeer_ai-OAS

.vscode/settings.json

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"python.testing.pytestArgs": ["tests", "-vv"],
3+
"python.testing.unittestEnabled": false,
4+
"python.testing.pytestEnabled": true,
5+
"pylint.args": [
6+
"--rcfile=pylintrc"
7+
],
8+
"workbench.colorCustomizations": {
9+
"activityBar.activeBackground": "#ffffff",
10+
"activityBar.background": "#ffffff",
11+
"activityBar.foreground": "#15202b",
12+
"activityBar.inactiveForeground": "#15202b99",
13+
"activityBarBadge.background": "#df9f9f",
14+
"activityBarBadge.foreground": "#15202b",
15+
"commandCenter.border": "#15202b99",
16+
"sash.hoverBorder": "#ffffff",
17+
"tab.activeBorder": "#ffffff",
18+
"titleBar.activeBackground": "#d8ebf7",
19+
"titleBar.activeForeground": "#15202b",
20+
"titleBar.inactiveBackground": "#d8ebf799",
21+
"titleBar.inactiveForeground": "#15202b99"
22+
},
23+
"peacock.color": "#d8ebf7"
24+
}

CONTRIBUTING.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Contributing to This Repository
2+
3+
Thank you for your interest in contributing to this repository. Please note that this repository contains generated code. As such, we do not accept direct changes or pull requests. Instead, we encourage you to follow the guidelines below to report issues and suggest improvements.
4+
5+
## How to Report Issues
6+
7+
If you encounter any bugs or have suggestions for improvements, please open an issue on GitHub. When reporting an issue, please provide as much detail as possible to help us reproduce the problem. This includes:
8+
9+
- A clear and descriptive title
10+
- Steps to reproduce the issue
11+
- Expected and actual behavior
12+
- Any relevant logs, screenshots, or error messages
13+
- Information about your environment (e.g., operating system, software versions)
14+
- For example can be collected using the `npx envinfo` command from your terminal if you have Node.js installed
15+
16+
## Issue Triage and Upstream Fixes
17+
18+
We will review and triage issues as quickly as possible. Our goal is to address bugs and incorporate improvements in the upstream source code. Fixes will be included in the next generation of the generated code.
19+
20+
## Contact
21+
22+
If you have any questions or need further assistance, please feel free to reach out by opening an issue.
23+
24+
Thank you for your understanding and cooperation!
25+
26+
The Maintainers

0 commit comments

Comments
 (0)