|
3 | 3 | title: CodeSamples overlay for python target |
4 | 4 | version: 0.0.0 |
5 | 5 | 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" |
12 | 6 | - target: $["paths"]["/text-to-image"]["post"] |
13 | 7 | update: |
14 | | - "x-codeSamples": |
15 | | - - "lang": "python" |
16 | | - "label": "text_to_image" |
17 | | - "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" |
| 8 | + x-codeSamples: |
| 9 | + - lang: python |
| 10 | + label: text_to_image |
| 11 | + source: |- |
| 12 | + from livepeer_ai import LivepeerAI |
| 13 | +
|
| 14 | + s = LivepeerAI( |
| 15 | + http_bearer="<YOUR_BEARER_TOKEN_HERE>", |
| 16 | + ) |
| 17 | +
|
| 18 | +
|
| 19 | + res = s.text_to_image(request={ |
| 20 | + "prompt": "<value>", |
| 21 | + }) |
| 22 | +
|
| 23 | + if res.image_response is not None: |
| 24 | + # handle response |
| 25 | + pass |
18 | 26 | - target: $["paths"]["/image-to-image"]["post"] |
19 | 27 | update: |
20 | | - "x-codeSamples": |
21 | | - - "lang": "python" |
22 | | - "label": "image_to_image" |
23 | | - "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" |
| 28 | + x-codeSamples: |
| 29 | + - lang: python |
| 30 | + label: image_to_image |
| 31 | + source: |- |
| 32 | + from livepeer_ai import LivepeerAI |
| 33 | +
|
| 34 | + s = LivepeerAI( |
| 35 | + http_bearer="<YOUR_BEARER_TOKEN_HERE>", |
| 36 | + ) |
| 37 | +
|
| 38 | +
|
| 39 | + res = s.image_to_image(request={ |
| 40 | + "prompt": "<value>", |
| 41 | + "image": { |
| 42 | + "file_name": "your_file_here", |
| 43 | + "content": open("<file_path>", "rb"), |
| 44 | + }, |
| 45 | + }) |
| 46 | +
|
| 47 | + if res.image_response is not None: |
| 48 | + # handle response |
| 49 | + pass |
24 | 50 | - target: $["paths"]["/image-to-video"]["post"] |
25 | 51 | update: |
26 | | - "x-codeSamples": |
27 | | - - "lang": "python" |
28 | | - "label": "image_to_video" |
29 | | - "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" |
| 52 | + x-codeSamples: |
| 53 | + - lang: python |
| 54 | + label: image_to_video |
| 55 | + source: |- |
| 56 | + from livepeer_ai import LivepeerAI |
| 57 | +
|
| 58 | + s = LivepeerAI( |
| 59 | + http_bearer="<YOUR_BEARER_TOKEN_HERE>", |
| 60 | + ) |
| 61 | +
|
| 62 | +
|
| 63 | + res = s.image_to_video(request={ |
| 64 | + "image": { |
| 65 | + "file_name": "your_file_here", |
| 66 | + "content": open("<file_path>", "rb"), |
| 67 | + }, |
| 68 | + }) |
| 69 | +
|
| 70 | + if res.video_response is not None: |
| 71 | + # handle response |
| 72 | + pass |
30 | 73 | - target: $["paths"]["/upscale"]["post"] |
31 | 74 | update: |
32 | | - "x-codeSamples": |
33 | | - - "lang": "python" |
34 | | - "label": "upscale" |
35 | | - "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" |
| 75 | + x-codeSamples: |
| 76 | + - lang: python |
| 77 | + label: upscale |
| 78 | + source: |- |
| 79 | + from livepeer_ai import LivepeerAI |
| 80 | +
|
| 81 | + s = LivepeerAI( |
| 82 | + http_bearer="<YOUR_BEARER_TOKEN_HERE>", |
| 83 | + ) |
| 84 | +
|
| 85 | +
|
| 86 | + res = s.upscale(request={ |
| 87 | + "prompt": "<value>", |
| 88 | + "image": { |
| 89 | + "file_name": "your_file_here", |
| 90 | + "content": open("<file_path>", "rb"), |
| 91 | + }, |
| 92 | + }) |
| 93 | +
|
| 94 | + if res.image_response is not None: |
| 95 | + # handle response |
| 96 | + pass |
| 97 | + - target: $["paths"]["/audio-to-text"]["post"] |
| 98 | + update: |
| 99 | + x-codeSamples: |
| 100 | + - lang: python |
| 101 | + label: audio_to_text |
| 102 | + source: |- |
| 103 | + from livepeer_ai import LivepeerAI |
| 104 | +
|
| 105 | + s = LivepeerAI( |
| 106 | + http_bearer="<YOUR_BEARER_TOKEN_HERE>", |
| 107 | + ) |
| 108 | +
|
| 109 | +
|
| 110 | + res = s.audio_to_text(request={ |
| 111 | + "audio": { |
| 112 | + "file_name": "your_file_here", |
| 113 | + "content": open("<file_path>", "rb"), |
| 114 | + }, |
| 115 | + }) |
| 116 | +
|
| 117 | + if res.text_response is not None: |
| 118 | + # handle response |
| 119 | + pass |
0 commit comments