Documentation
¶
Overview ¶
Package kling implements engine.Engine for the Kling (快手可灵) API.
Video generation is async: POST /v1/videos/text2video or /v1/videos/image2video creates a task, then GET /v1/videos/{task_id} polls for completion. Image generation: POST /v1/images/generations, GET /v1/images/{task_id}. Auth: Authorization: Bearer {key}, env KLING_API_KEY.
Index ¶
Constants ¶
View Source
const ( ModelKlingV2 = "kling-v2" ModelKlingV2Master = "kling-v2-master" ModelKlingV1 = "kling-v1" )
Model constants.
View Source
const ( EndpointText2Video = "text2video" EndpointImage2Video = "image2video" EndpointImage = "image" )
Endpoint selects the generation mode.
Variables ¶
View Source
var ErrMissingPrompt = fmt.Errorf("kling: missing prompt in workflow graph")
Functions ¶
func ConfigSchema ¶
func ConfigSchema() []engine.ConfigField
ConfigSchema returns the configuration fields required by the Kling engine.
func ModelsByCapability ¶
ModelsByCapability returns all known Kling models grouped by capability.
Types ¶
type Config ¶
type Config struct {
APIKey string
BaseURL string
Model string
Endpoint string // "text2video", "image2video", or "image"
HTTPClient *http.Client
WaitForCompletion bool
PollInterval time.Duration
OnProgress epoll.OnProgress
}
Config configures the Kling engine.
type Engine ¶
type Engine struct {
// contains filtered or unexported fields
}
Engine implements engine.Engine for Kling.
func (*Engine) Capabilities ¶
func (e *Engine) Capabilities() engine.Capability
Capabilities implements engine.Describer.
Click to show internal directories.
Click to hide internal directories.