Skip to content

Commit

Permalink
feat: add code examples
Browse files Browse the repository at this point in the history
This commit adds code-examples and improves the target naming.
  • Loading branch information
rickstaa committed Aug 21, 2024
1 parent 23d58a1 commit aab3aa2
Show file tree
Hide file tree
Showing 7 changed files with 52 additions and 11 deletions.
4 changes: 2 additions & 2 deletions .speakeasy/gen.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ management:
docVersion: v0.1.2
speakeasyVersion: 1.377.0
generationVersion: 2.404.0
releaseVersion: 0.1.3
configChecksum: c9eb4ad242dedf278dc1178b9b835a8e
releaseVersion: 0.1.4
configChecksum: a4b1b6e1d971710b6648986f1a937812
features:
python:
additionalDependencies: 1.0.0
Expand Down
2 changes: 1 addition & 1 deletion .speakeasy/gen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ generation:
auth:
oAuth2ClientCredentialsEnabled: false
python:
version: 0.1.3
version: 0.1.4
additionalDependencies:
dev: {}
main: {}
Expand Down
14 changes: 10 additions & 4 deletions .speakeasy/workflow.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ speakeasyVersion: 1.377.0
sources:
livepeer_ai-OAS:
sourceNamespace: livepeer-ai-oas
sourceRevisionDigest: sha256:2252c0a4efdf8964ad2153ca03ed71fe531dd05f4e52888940da66d2c3c9a158
sourceRevisionDigest: sha256:f935b84686090859578d89ad592a698315085140725eef75bc986b278d06c8eb
sourceBlobDigest: sha256:e79605d14184030c02569e5f04d51cf4c2ecf820554cac6822c0519753983b97
tags:
- latest
Expand All @@ -13,11 +13,13 @@ targets:
sourceRevisionDigest: sha256:7ac58682b776e03b6609bbca82499bca46176c857e7e1c1ccdc7f916edf3de02
sourceBlobDigest: sha256:26199d9d483dcc00982af07497f482f7d056c167e9e3c39543fafd1efada287c
outLocation: /home/ricks/development/livepeer/ai/livepeer-ai-python
livepeer-python:
livepeer-ai-python:
source: livepeer_ai-OAS
sourceNamespace: livepeer-ai-oas
sourceRevisionDigest: sha256:2252c0a4efdf8964ad2153ca03ed71fe531dd05f4e52888940da66d2c3c9a158
sourceRevisionDigest: sha256:f935b84686090859578d89ad592a698315085140725eef75bc986b278d06c8eb
sourceBlobDigest: sha256:e79605d14184030c02569e5f04d51cf4c2ecf820554cac6822c0519753983b97
codeSamplesNamespace: code-samples-python-livepeer-python
codeSamplesRevisionDigest: sha256:591e8faefb83c96ac59afb02ddd1ec51b58481a1c1630de2f4c76419bb73d0fd
outLocation: /home/ricks/development/livepeer/ai/livepeer-ai-python
workflow:
workflowVersion: 1.0.0
Expand All @@ -29,6 +31,10 @@ workflow:
registry:
location: registry.speakeasyapi.dev/livepeer-8mq/livepeer-ai/livepeer-ai-oas
targets:
livepeer-python:
livepeer-ai-python:
target: python
source: livepeer_ai-OAS
codeSamples:
output: codeSamples.yaml
registry:
location: registry.speakeasyapi.dev/livepeer-8mq/livepeer-ai/code-samples-python-livepeer-python
2 changes: 1 addition & 1 deletion .speakeasy/workflow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ sources:
registry:
location: registry.speakeasyapi.dev/livepeer-8mq/livepeer-ai/livepeer-ai-oas
targets:
livepeer-python:
livepeer-ai-python:
target: python
source: livepeer_ai-OAS
codeSamples:
Expand Down
35 changes: 35 additions & 0 deletions codeSamples.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
overlay: 1.0.0
info:
title: CodeSamples overlay for python target
version: 0.0.0
actions:
- target: $["paths"]["/upscale"]["post"]
update:
"x-codeSamples":
- "lang": "python"
"label": "upscale"
"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"
- target: $["paths"]["/audio-to-text"]["post"]
update:
"x-codeSamples":
- "lang": "python"
"label": "audio_to_text"
"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"
- target: $["paths"]["/text-to-image"]["post"]
update:
"x-codeSamples":
- "lang": "python"
"label": "text_to_image"
"source": "from livepeer_ai import LivepeerAI\n\ns = LivepeerAI(\n http_bearer=\"<YOUR_BEARER_TOKEN_HERE>\",\n)\n\n\nres = s.text_to_image(request={\n \"prompt\": \"<value>\",\n})\n\nif res.image_response is not None:\n # handle response\n pass"
- target: $["paths"]["/image-to-image"]["post"]
update:
"x-codeSamples":
- "lang": "python"
"label": "image_to_image"
"source": "from livepeer_ai import LivepeerAI\n\ns = LivepeerAI(\n http_bearer=\"<YOUR_BEARER_TOKEN_HERE>\",\n)\n\n\nres = s.image_to_image(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"
- target: $["paths"]["/image-to-video"]["post"]
update:
"x-codeSamples":
- "lang": "python"
"label": "image_to_video"
"source": "from livepeer_ai import LivepeerAI\n\ns = LivepeerAI(\n http_bearer=\"<YOUR_BEARER_TOKEN_HERE>\",\n)\n\n\nres = s.image_to_video(request={\n \"image\": {\n \"file_name\": \"your_file_here\",\n \"content\": open(\"<file_path>\", \"rb\"),\n },\n})\n\nif res.video_response is not None:\n # handle response\n pass"
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "livepeer-ai"
version = "0.1.3"
version = "0.1.4"
description = "Python Client SDK for the Livepeer AI API."
authors = ["Livepeer",]
readme = "README-PYPI.md"
Expand Down
4 changes: 2 additions & 2 deletions src/livepeer_ai/sdkconfiguration.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ class SDKConfiguration:
server_idx: Optional[int] = 0
language: str = "python"
openapi_doc_version: str = "v0.1.2"
sdk_version: str = "0.1.3"
sdk_version: str = "0.1.4"
gen_version: str = "2.404.0"
user_agent: str = "speakeasy-sdk/python 0.1.3 2.404.0 v0.1.2 livepeer-ai"
user_agent: str = "speakeasy-sdk/python 0.1.4 2.404.0 v0.1.2 livepeer-ai"
retry_config: OptionalNullable[RetryConfig] = Field(default_factory=lambda: UNSET)
timeout_ms: Optional[int] = None

Expand Down

0 comments on commit aab3aa2

Please sign in to comment.