Help us shape the future of Go! Take the 2026 Go Developer Survey

provider

package
v0.0.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 4, 2026 License: MIT Imports: 21 Imported by: 0

Documentation

Overview

Package provider executes image and video requests defined by provider descriptions.

Index

Constants

View Source
const (
	CreationResponseContext = "creation response"
	PollResponseContext     = "poll response"
)

Response labels provide context for failed decoding.

  • CreationResponseContext: the response that creates a job or task
  • PollResponseContext: a status response for a running job or task
View Source
const (
	APISectionMissing         = "%s.json: no %s for the resolved medium"
	DownloadURLMissing        = "%s: %s: no download url in the completed poll"
	FieldContextForm          = "field %s"
	FrameFieldUnavailable     = "a frame prefix reached a request with no frame field"
	FrameMediaUndescribed     = "provider has no frame-media request description"
	FrameRoleDuplicate        = "duplicate frame role %s"
	FrameTimeUnresolved       = "unresolved frame time on %s"
	JSONMediaPartsUnsupported = "JSON requests cannot contain multipart file parts"
	JobDecodeErrorForm        = "jobID %q: %w"
	MissingResponseValue      = "missing"
	RespEntryForm             = "%s: entry %d"
	SingleMediaNoVideo        = "single-or-array request does not accept video"
	StartContextForm          = "%s start"
	UnknownStatusForm         = "%s (%s): %s"
)

The internal/provider section of the copy catalog, one constant per entry.

Variables

This section is empty.

Functions

func APIErr

func APIErr(provModelLabel string, status int, body []byte) error

APIErr classifies an unsuccessful HTTP response and preserves a recognized server message. Otherwise it includes a bounded body excerpt. Statuses 429, 502, 503, and 504 are temporary.

func AdapterSettings

func AdapterSettings(providerDescription *catalog.Provider, providerID string) (*catalog.AdapterAPI, error)

AdapterSettings returns an owned copy of the selected provider's adapter settings. A missing description or adapter section returns a configuration error naming providerID.

func CheckOwnedPaths

func CheckOwnedPaths(providerID string, model *catalog.Model, ownedPaths ...string) error

CheckOwnedPaths rejects configured assignments that overlap fields an adapter must construct. The adapter supplies its own protocol paths; generic configured-path consistency is checked when the catalog is decoded.

func NewProvider

func NewProvider(providerDescription *catalog.Provider) (generation.Generator, error)

NewProvider validates the API sections required by the models and returns a generator with independent copies of the request settings.

func PollResponseError

func PollResponseError(identity string, status int, body []byte, transportErr error) error

PollResponseError combines an unsuccessful HTTP status with any transport error. A successful or unavailable status returns the transport error unchanged.

func WireParamValues

func WireParamValues(model *catalog.Model, gp params.Values, stringParams ...params.FlagType) map[string]any

WireParamValues returns supplied parameters under their configured request paths. It omits parameters without paths and formats the selected parameters as strings. Dotted paths create nested objects shared by parameters with the same parent.

Types

This section is empty.

Directories

Path Synopsis
Package bfl provides image and video generation through the Black Forest Labs asynchronous API.
Package bfl provides image and video generation through the Black Forest Labs asynchronous API.
Package config embeds the descriptor-class provider configurations: the providers served entirely by the shared request code in internal/provider, each declared by one JSON document named after its ID and nothing else.
Package config embeds the descriptor-class provider configurations: the providers served entirely by the shared request code in internal/provider, each declared by one JSON document named after its ID and nothing else.
Package google provides image and video generation through Google media APIs.
Package google provides image and video generation through Google media APIs.
Package kling provides image and video generation through the Kling API.
Package kling provides image and video generation through the Kling API.
Package sourceful provides image generation through the Sourceful Design API.
Package sourceful provides image generation through the Sourceful Design API.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL