Skip to content

Commit

Permalink
ci: add speakeasy github action (#1)
Browse files Browse the repository at this point in the history
This commit adds the SpeakEasy SDK creation GitHub action.
  • Loading branch information
rickstaa authored Aug 21, 2024
1 parent 09d680e commit 7c2701b
Show file tree
Hide file tree
Showing 34 changed files with 168 additions and 136 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/sdk_generation.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Generate
permissions:
checks: write
contents: write
pull-requests: write
statuses: write
"on":
workflow_dispatch:
inputs:
force:
description: Force generation of SDKs
type: boolean
default: false
set_version:
description: optionally set a specific SDK version
type: string
schedule:
- cron: 0 0 * * *
jobs:
generate:
uses: speakeasy-api/sdk-generation-action/.github/workflows/workflow-executor.yaml@v15
with:
force: ${{ github.event.inputs.force }}
mode: pr
set_version: ${{ github.event.inputs.set_version }}
speakeasy_version: latest
secrets:
github_access_token: ${{ secrets.GITHUB_TOKEN }}
speakeasy_api_key: ${{ secrets.SPEAKEASY_API_KEY }}
11 changes: 6 additions & 5 deletions .speakeasy/gen.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ id: 98621ff3-f200-4a5c-9c69-bc1fe845e39c
management:
docChecksum: c222ffbf28e5f62770dc8cbd99010f96
docVersion: v0.1.2
speakeasyVersion: 1.372.0
generationVersion: 2.399.0
releaseVersion: 0.0.1
configChecksum: 4d04c7089724a1b7f5b95edac2a0ddea
speakeasyVersion: 1.377.0
generationVersion: 2.404.0
releaseVersion: 0.1.2
configChecksum: 9eb1d780a24ea18d23a76ec422c1cb4d
features:
go:
additionalDependencies: 0.1.0
constsAndDefaults: 0.1.6
core: 3.5.4
core: 3.5.5
defaultEnabledRetries: 0.2.0
devContainers: 2.90.0
envVarSecurityUsage: 0.3.0
Expand All @@ -24,6 +24,7 @@ features:
retries: 2.83.0
sdkHooks: 0.1.0
unions: 2.85.9
uploadStreams: 0.1.0
generatedFiles:
- livepeerai.go
- go.mod
Expand Down
7 changes: 4 additions & 3 deletions .speakeasy/gen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ generation:
devContainers:
enabled: true
schemaPath: https://raw.githubusercontent.com/livepeer/ai-worker/main/runner/gateway.openapi.json
sdkClassName: Livepeerai
baseServerUrl: https://raw.githubusercontent.com/livepeer/ai-worker/main/runner/gateway.openapi.json
sdkClassName: LivepeerAI
maintainOpenAPIOrder: true
usageSnippets:
optionalPropertyRendering: withExample
Expand All @@ -15,7 +16,7 @@ generation:
auth:
oAuth2ClientCredentialsEnabled: false
go:
version: 0.0.1
version: 0.1.2
additionalDependencies: {}
allowUnknownFieldsInWeakUnions: false
clientServerStatusCodesAsErrors: true
Expand All @@ -32,5 +33,5 @@ go:
maxMethodParams: 4
methodArguments: require-security-and-request
outputModelSuffix: output
packageName: github.com/my-company/livepeerai
packageName: github.com/livepeer/livepeer-ai-go
responseFormat: envelope-http
13 changes: 10 additions & 3 deletions .speakeasy/workflow.lock
Original file line number Diff line number Diff line change
@@ -1,20 +1,27 @@
speakeasyVersion: 1.372.0
speakeasyVersion: 1.377.0
sources:
livepeerai-OAS:
sourceNamespace: livepeerai-oas
sourceRevisionDigest: sha256:352de9d035faa99fb663874d1cb218b371712b95f172339174111f12b91b50ad
sourceRevisionDigest: sha256:d5d5448674c5945b56ea82b32a01c9bb5bfa977ce0db559f609135346f028189
sourceBlobDigest: sha256:48b0747b8e9a3740e70354e85817a677ea764896e39a5c31ec3060fd570e555f
tags:
- latest
targets:
livepeerai:
source: livepeerai-OAS
sourceNamespace: livepeerai-oas
sourceRevisionDigest: sha256:352de9d035faa99fb663874d1cb218b371712b95f172339174111f12b91b50ad
sourceRevisionDigest: sha256:d5d5448674c5945b56ea82b32a01c9bb5bfa977ce0db559f609135346f028189
sourceBlobDigest: sha256:48b0747b8e9a3740e70354e85817a677ea764896e39a5c31ec3060fd570e555f
outLocation: /home/ricks/development/livepeer/ai/livepeer-ai-go
livepeerai-go:
source: livepeerai-OAS
sourceNamespace: livepeerai-oas
sourceRevisionDigest: sha256:d5d5448674c5945b56ea82b32a01c9bb5bfa977ce0db559f609135346f028189
sourceBlobDigest: sha256:48b0747b8e9a3740e70354e85817a677ea764896e39a5c31ec3060fd570e555f
outLocation: /home/ricks/development/livepeer/ai/livepeer-ai-go
workflow:
workflowVersion: 1.0.0
speakeasyVersion: latest
sources:
livepeerai-OAS:
inputs:
Expand Down
3 changes: 2 additions & 1 deletion .speakeasy/workflow.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
workflowVersion: 1.0.0
speakeasyVersion: latest
sources:
livepeerai-OAS:
inputs:
- location: https://raw.githubusercontent.com/livepeer/ai-worker/main/runner/gateway.openapi.json
registry:
location: registry.speakeasyapi.dev/livepeer-8mq/livepeer-ai/livepeerai-oas
targets:
livepeerai:
livepeerai-go:
target: go
source: livepeerai-OAS
17 changes: 0 additions & 17 deletions .vscode/settings.json

This file was deleted.

60 changes: 30 additions & 30 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,16 @@ package main

import (
"context"
"github.com/my-company/livepeerai"
"github.com/my-company/livepeerai/models/components"
"github.com/my-company/livepeerai/retry"
livepeeraigo "github.com/livepeer/livepeer-ai-go"
"github.com/livepeer/livepeer-ai-go/models/components"
"github.com/livepeer/livepeer-ai-go/retry"
"log"
"models/operations"
)

func main() {
s := livepeerai.New(
livepeerai.WithSecurity("<YOUR_BEARER_TOKEN_HERE>"),
s := livepeeraigo.New(
livepeeraigo.WithSecurity("<YOUR_BEARER_TOKEN_HERE>"),
)
request := components.TextToImageParams{
Prompt: "<value>",
Expand Down Expand Up @@ -56,15 +56,15 @@ package main

import (
"context"
"github.com/my-company/livepeerai"
"github.com/my-company/livepeerai/models/components"
"github.com/my-company/livepeerai/retry"
livepeeraigo "github.com/livepeer/livepeer-ai-go"
"github.com/livepeer/livepeer-ai-go/models/components"
"github.com/livepeer/livepeer-ai-go/retry"
"log"
)

func main() {
s := livepeerai.New(
livepeerai.WithRetryConfig(
s := livepeeraigo.New(
livepeeraigo.WithRetryConfig(
retry.Config{
Strategy: "backoff",
Backoff: &retry.BackoffStrategy{
Expand All @@ -75,7 +75,7 @@ func main() {
},
RetryConnectionErrors: false,
}),
livepeerai.WithSecurity("<YOUR_BEARER_TOKEN_HERE>"),
livepeeraigo.WithSecurity("<YOUR_BEARER_TOKEN_HERE>"),
)
request := components.TextToImageParams{
Prompt: "<value>",
Expand Down Expand Up @@ -112,15 +112,15 @@ package main
import (
"context"
"errors"
"github.com/my-company/livepeerai"
"github.com/my-company/livepeerai/models/components"
"github.com/my-company/livepeerai/models/sdkerrors"
livepeeraigo "github.com/livepeer/livepeer-ai-go"
"github.com/livepeer/livepeer-ai-go/models/components"
"github.com/livepeer/livepeer-ai-go/models/sdkerrors"
"log"
)

func main() {
s := livepeerai.New(
livepeerai.WithSecurity("<YOUR_BEARER_TOKEN_HERE>"),
s := livepeeraigo.New(
livepeeraigo.WithSecurity("<YOUR_BEARER_TOKEN_HERE>"),
)
request := components.TextToImageParams{
Prompt: "<value>",
Expand Down Expand Up @@ -170,15 +170,15 @@ package main

import (
"context"
"github.com/my-company/livepeerai"
"github.com/my-company/livepeerai/models/components"
livepeeraigo "github.com/livepeer/livepeer-ai-go"
"github.com/livepeer/livepeer-ai-go/models/components"
"log"
)

func main() {
s := livepeerai.New(
livepeerai.WithServerIndex(0),
livepeerai.WithSecurity("<YOUR_BEARER_TOKEN_HERE>"),
s := livepeeraigo.New(
livepeeraigo.WithServerIndex(0),
livepeeraigo.WithSecurity("<YOUR_BEARER_TOKEN_HERE>"),
)
request := components.TextToImageParams{
Prompt: "<value>",
Expand All @@ -204,15 +204,15 @@ package main

import (
"context"
"github.com/my-company/livepeerai"
"github.com/my-company/livepeerai/models/components"
livepeeraigo "github.com/livepeer/livepeer-ai-go"
"github.com/livepeer/livepeer-ai-go/models/components"
"log"
)

func main() {
s := livepeerai.New(
livepeerai.WithServerURL("https://dream-gateway.livepeer.cloud"),
livepeerai.WithSecurity("<YOUR_BEARER_TOKEN_HERE>"),
s := livepeeraigo.New(
livepeeraigo.WithServerURL("https://dream-gateway.livepeer.cloud"),
livepeeraigo.WithSecurity("<YOUR_BEARER_TOKEN_HERE>"),
)
request := components.TextToImageParams{
Prompt: "<value>",
Expand Down Expand Up @@ -276,14 +276,14 @@ package main

import (
"context"
"github.com/my-company/livepeerai"
"github.com/my-company/livepeerai/models/components"
livepeeraigo "github.com/livepeer/livepeer-ai-go"
"github.com/livepeer/livepeer-ai-go/models/components"
"log"
)

func main() {
s := livepeerai.New(
livepeerai.WithSecurity("<YOUR_BEARER_TOKEN_HERE>"),
s := livepeeraigo.New(
livepeeraigo.WithSecurity("<YOUR_BEARER_TOKEN_HERE>"),
)
request := components.TextToImageParams{
Prompt: "<value>",
Expand Down
8 changes: 4 additions & 4 deletions USAGE.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ package main

import (
"context"
"github.com/my-company/livepeerai"
"github.com/my-company/livepeerai/models/components"
livepeeraigo "github.com/livepeer/livepeer-ai-go"
"github.com/livepeer/livepeer-ai-go/models/components"
"log"
)

func main() {
s := livepeerai.New(
livepeerai.WithSecurity("<YOUR_BEARER_TOKEN_HERE>"),
s := livepeeraigo.New(
livepeeraigo.WithSecurity("<YOUR_BEARER_TOKEN_HERE>"),
)
request := components.TextToImageParams{
Prompt: "<value>",
Expand Down
2 changes: 1 addition & 1 deletion docs/models/components/audio.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
| Field | Type | Required | Description |
| ------------------ | ------------------ | ------------------ | ------------------ |
| `FileName` | *string* | :heavy_check_mark: | N/A |
| `Content` | *[]byte* | :heavy_check_mark: | N/A |
| `Content` | *any* | :heavy_check_mark: | N/A |
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
| Field | Type | Required | Description |
| ------------------ | ------------------ | ------------------ | ------------------ |
| `FileName` | *string* | :heavy_check_mark: | N/A |
| `Content` | *[]byte* | :heavy_check_mark: | N/A |
| `Content` | *any* | :heavy_check_mark: | N/A |
2 changes: 1 addition & 1 deletion docs/models/components/bodyupscaleupscalepostimage.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
| Field | Type | Required | Description |
| ------------------ | ------------------ | ------------------ | ------------------ |
| `FileName` | *string* | :heavy_check_mark: | N/A |
| `Content` | *[]byte* | :heavy_check_mark: | N/A |
| `Content` | *any* | :heavy_check_mark: | N/A |
2 changes: 1 addition & 1 deletion docs/models/components/image.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
| Field | Type | Required | Description |
| ------------------ | ------------------ | ------------------ | ------------------ |
| `FileName` | *string* | :heavy_check_mark: | N/A |
| `Content` | *[]byte* | :heavy_check_mark: | N/A |
| `Content` | *any* | :heavy_check_mark: | N/A |
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/my-company/livepeerai
module github.com/livepeer/livepeer-ai-go

go 1.20

Expand Down
2 changes: 1 addition & 1 deletion internal/utils/form.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (

"github.com/ericlagergren/decimal"

"github.com/my-company/livepeerai/types"
"github.com/livepeer/livepeer-ai-go/types"
)

func populateForm(paramName string, explode bool, objType reflect.Type, objValue reflect.Value, delimiter string, getFieldName func(reflect.StructField) string) url.Values {
Expand Down
2 changes: 1 addition & 1 deletion internal/utils/json.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
"time"
"unsafe"

"github.com/my-company/livepeerai/types"
"github.com/livepeer/livepeer-ai-go/types"

"github.com/ericlagergren/decimal"
)
Expand Down
2 changes: 1 addition & 1 deletion internal/utils/pathparams.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (

"github.com/ericlagergren/decimal"

"github.com/my-company/livepeerai/types"
"github.com/livepeer/livepeer-ai-go/types"
)

func GenerateURL(_ context.Context, serverURL, path string, pathParams interface{}, globals interface{}) (string, error) {
Expand Down
2 changes: 1 addition & 1 deletion internal/utils/queryparams.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (

"github.com/ericlagergren/decimal"

"github.com/my-company/livepeerai/types"
"github.com/livepeer/livepeer-ai-go/types"
)

func PopulateQueryParams(_ context.Context, req *http.Request, queryParams interface{}, globals interface{}) error {
Expand Down
Loading

0 comments on commit 7c2701b

Please sign in to comment.