Skip to content

Commit 9716da1

Browse files
authored
chore: update OpenAPI spec filetype (#2)
This commit ensures that the SDKs are generated using the new yaml OpenAPI spec instead of the Json one. It also fixes a small issue with the python configuration which caused parts of the docs to show as UNSET.
1 parent c4a588d commit 9716da1

30 files changed

Lines changed: 179 additions & 57 deletions

.devcontainer/README.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11

2+
<div align="center">
3+
<a href="https://codespaces.new/livepeer/livepeer-ai-python.git/tree/main"><img src="https://github.com/codespaces/badge.svg" /></a>
4+
</div>
5+
<br>
6+
27
> **Remember to shutdown a GitHub Codespace when it is not in use!**
38
49
# Dev Containers Quick Start
@@ -20,11 +25,11 @@ The speakeasy CLI allows you to generate more usage snippets. Here's how:
2025
- To generate a sample for a specific operation by providing an operation ID, use:
2126

2227
```
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
28+
speakeasy generate usage -s https://raw.githubusercontent.com/livepeer/ai-worker/main/runner/gateway.openapi.yaml -l python -i {INPUT_OPERATION_ID} -o ./samples
2429
```
2530

2631
- To generate samples for an entire namespace (like a tag or group name), use:
2732

2833
```
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
34+
speakeasy generate usage -s https://raw.githubusercontent.com/livepeer/ai-worker/main/runner/gateway.openapi.yaml -l python -n {INPUT_TAG_NAME} -o ./samples
3035
```

.devcontainer/setup.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@ python -m pip install --upgrade pip
1111
pip install -e .
1212

1313
# 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
14+
speakeasy generate usage -s https://raw.githubusercontent.com/livepeer/ai-worker/main/runner/gateway.openapi.yaml -l python -o samples/root.py

.speakeasy/gen.lock

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
lockVersion: 2.0.0
22
id: 2d5dbf5a-62be-411a-9c7b-bc7b6dc79e13
33
management:
4-
docChecksum: c222ffbf28e5f62770dc8cbd99010f96
4+
docChecksum: cd6c43d2e31a6a23e22275e50c38d52e
55
docVersion: v0.1.2
6-
speakeasyVersion: 1.377.0
7-
generationVersion: 2.404.0
8-
releaseVersion: 0.1.4
9-
configChecksum: a4b1b6e1d971710b6648986f1a937812
6+
speakeasyVersion: 1.379.0
7+
generationVersion: 2.404.3
8+
releaseVersion: 0.1.5
9+
configChecksum: 35690181912086c4003337e1ec0bd202
1010
repoURL: https://github.com/livepeer/livepeer-ai-python.git
1111
installationURL: https://github.com/livepeer/livepeer-ai-python.git
1212
features:

.speakeasy/gen.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ configVersion: 2.0.0
22
generation:
33
devContainers:
44
enabled: true
5-
schemaPath: https://raw.githubusercontent.com/livepeer/ai-worker/main/runner/gateway.openapi.json
5+
schemaPath: https://raw.githubusercontent.com/livepeer/ai-worker/main/runner/gateway.openapi.yaml
66
sdkClassName: LivepeerAI
77
maintainOpenAPIOrder: true
88
usageSnippets:
@@ -15,7 +15,7 @@ generation:
1515
auth:
1616
oAuth2ClientCredentialsEnabled: false
1717
python:
18-
version: 0.1.4
18+
version: 0.1.5
1919
additionalDependencies:
2020
dev: {}
2121
main: {}

.speakeasy/workflow.lock

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
1-
speakeasyVersion: 1.377.0
1+
speakeasyVersion: 1.379.0
22
sources:
33
livepeer_ai-OAS:
44
sourceNamespace: livepeer-ai-oas
5-
sourceRevisionDigest: sha256:eaa66566d7629ca0b84b572f39576e8b38b87667aaa688ea98cf87629f7647ea
6-
sourceBlobDigest: sha256:88b77186fc98fe193435d3069ab2e85fe4d404e802e4e23761979e984649ff70
5+
sourceRevisionDigest: sha256:6bd4223c4f6c0a9963663242f118035124c716e7c436049608219d24717cf099
6+
sourceBlobDigest: sha256:a025967b0b9169763c785bb89478cb7716f70241d4e11d762734f3655b7fb0e5
77
tags:
88
- latest
9-
- main
109
targets:
1110
livepeer-ai:
1211
source: livepeer_ai-OAS
@@ -17,18 +16,18 @@ targets:
1716
livepeer-ai-python:
1817
source: livepeer_ai-OAS
1918
sourceNamespace: livepeer-ai-oas
20-
sourceRevisionDigest: sha256:eaa66566d7629ca0b84b572f39576e8b38b87667aaa688ea98cf87629f7647ea
21-
sourceBlobDigest: sha256:88b77186fc98fe193435d3069ab2e85fe4d404e802e4e23761979e984649ff70
19+
sourceRevisionDigest: sha256:6bd4223c4f6c0a9963663242f118035124c716e7c436049608219d24717cf099
20+
sourceBlobDigest: sha256:a025967b0b9169763c785bb89478cb7716f70241d4e11d762734f3655b7fb0e5
2221
codeSamplesNamespace: code-samples-python-livepeer-python
23-
codeSamplesRevisionDigest: sha256:4b4d5d53563acb0a29f44c857bb3b87e8455831c298a17c1b3d02a7f235caca0
24-
outLocation: /github/workspace/repo
22+
codeSamplesRevisionDigest: sha256:901ab5f5b4d211b224c6482b451f186affa42c56cdf08c25f191f875146987d5
23+
outLocation: /home/ricks/development/livepeer/ai/livepeer-ai-python
2524
workflow:
2625
workflowVersion: 1.0.0
2726
speakeasyVersion: latest
2827
sources:
2928
livepeer_ai-OAS:
3029
inputs:
31-
- location: https://raw.githubusercontent.com/livepeer/ai-worker/main/runner/gateway.openapi.json
30+
- location: https://raw.githubusercontent.com/livepeer/ai-worker/main/runner/gateway.openapi.yaml
3231
registry:
3332
location: registry.speakeasyapi.dev/livepeer-8mq/livepeer-ai/livepeer-ai-oas
3433
targets:

.speakeasy/workflow.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ speakeasyVersion: latest
33
sources:
44
livepeer_ai-OAS:
55
inputs:
6-
- location: https://raw.githubusercontent.com/livepeer/ai-worker/main/runner/gateway.openapi.json
6+
- location: https://raw.githubusercontent.com/livepeer/ai-worker/main/runner/gateway.openapi.yaml
77
registry:
88
location: registry.speakeasyapi.dev/livepeer-8mq/livepeer-ai/livepeer-ai-oas
99
targets:

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@ Welcome to the [Livepeer AI](https://livepeer.ai/) Python! This library offers a
1414

1515
PIP
1616
```bash
17-
pip install git+<UNSET>.git
17+
pip install git+https://github.com/livepeer/livepeer-ai-python.git
1818
```
1919

2020
Poetry
2121
```bash
22-
poetry add git+<UNSET>.git
22+
poetry add git+https://github.com/livepeer/livepeer-ai-python.git
2323
```
2424
<!-- End SDK Installation [installation] -->
2525

codeSamples.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,12 @@ info:
33
title: CodeSamples overlay for python target
44
version: 0.0.0
55
actions:
6+
- target: $["paths"]["/audio-to-text"]["post"]
7+
update:
8+
"x-codeSamples":
9+
- "lang": "python"
10+
"label": "audio_to_text"
11+
"source": "from livepeer_ai import LivepeerAI\n\ns = LivepeerAI(\n http_bearer=\"<YOUR_BEARER_TOKEN_HERE>\",\n)\n\n\nres = s.audio_to_text(request={\n \"audio\": {\n \"file_name\": \"your_file_here\",\n \"content\": open(\"<file_path>\", \"rb\"),\n },\n})\n\nif res.text_response is not None:\n # handle response\n pass"
612
- target: $["paths"]["/text-to-image"]["post"]
713
update:
814
"x-codeSamples":
@@ -27,9 +33,3 @@ actions:
2733
- "lang": "python"
2834
"label": "upscale"
2935
"source": "from livepeer_ai import LivepeerAI\n\ns = LivepeerAI(\n http_bearer=\"<YOUR_BEARER_TOKEN_HERE>\",\n)\n\n\nres = s.upscale(request={\n \"prompt\": \"<value>\",\n \"image\": {\n \"file_name\": \"your_file_here\",\n \"content\": open(\"<file_path>\", \"rb\"),\n },\n})\n\nif res.image_response is not None:\n # handle response\n pass"
30-
- target: $["paths"]["/audio-to-text"]["post"]
31-
update:
32-
"x-codeSamples":
33-
- "lang": "python"
34-
"label": "audio_to_text"
35-
"source": "from livepeer_ai import LivepeerAI\n\ns = LivepeerAI(\n http_bearer=\"<YOUR_BEARER_TOKEN_HERE>\",\n)\n\n\nres = s.audio_to_text(request={\n \"audio\": {\n \"file_name\": \"your_file_here\",\n \"content\": open(\"<file_path>\", \"rb\"),\n },\n})\n\nif res.text_response is not None:\n # handle response\n pass"

docs/models/apierror.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
# APIError
22

3+
API error response model.
4+
35

46
## Fields
57

68
| Field | Type | Required | Description |
79
| ------------------ | ------------------ | ------------------ | ------------------ |
8-
| `msg` | *str* | :heavy_check_mark: | N/A |
10+
| `msg` | *str* | :heavy_check_mark: | The error message. |

docs/models/chunk.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
# Chunk
22

3+
A chunk of text with a timestamp.
4+
35

46
## Fields
57

6-
| Field | Type | Required | Description |
7-
| ------------------ | ------------------ | ------------------ | ------------------ |
8-
| `timestamp` | List[*Any*] | :heavy_check_mark: | N/A |
9-
| `text` | *str* | :heavy_check_mark: | N/A |
8+
| Field | Type | Required | Description |
9+
| --------------------------- | --------------------------- | --------------------------- | --------------------------- |
10+
| `timestamp` | List[*Any*] | :heavy_check_mark: | The timestamp of the chunk. |
11+
| `text` | *str* | :heavy_check_mark: | The text of the chunk. |

0 commit comments

Comments
 (0)