Skip to content

Latest commit

 

History

History
30 lines (26 loc) · 559 Bytes

USAGE.md

File metadata and controls

30 lines (26 loc) · 559 Bytes
package main

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

func main() {
	s := livepeeraigo.New(
		livepeeraigo.WithSecurity("<YOUR_BEARER_TOKEN_HERE>"),
	)

	ctx := context.Background()
	res, err := s.Generate.TextToImage(ctx, components.TextToImageParams{
		Prompt: "<value>",
	})
	if err != nil {
		log.Fatal(err)
	}
	if res.ImageResponse != nil {
		// handle response
	}
}