Documentation
¶
Overview ¶
Package provider executes image and video requests defined by provider descriptions.
Index ¶
- Constants
- func APIErr(provModelLabel string, status int, body []byte) error
- func AdapterSettings(providerDescription *catalog.Provider, providerID string) (*catalog.AdapterAPI, error)
- func CheckOwnedPaths(providerID string, model *catalog.Model, ownedPaths ...string) error
- func NewProvider(providerDescription *catalog.Provider) (generation.Generator, error)
- func PollResponseError(identity string, status int, body []byte, transportErr error) error
- func WireParamValues(model *catalog.Model, gp params.Values, stringParams ...params.FlagType) map[string]any
Constants ¶
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
const ( APISectionMissing = "%s.json: no %s for the resolved medium" DownloadURLMissing = "%s: %s: no download url in the completed poll" FieldContextForm = "field %s" 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 ¶
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 ¶
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 ¶
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.
Source Files
¶
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. |