mirror of
https://github.com/QuantumNous/new-api.git
synced 2026-09-08 10:46:58 +00:00
32 lines
893 B
Go
32 lines
893 B
Go
package plugins_test
|
|
|
|
import "testing"
|
|
|
|
func TestKlingResponsesProtocol(t *testing.T) {
|
|
testVideoResponsesProtocol(t, videoResponsesTestCase{
|
|
pluginKey: "kling",
|
|
model: "kling-v2-master",
|
|
requestBody: map[string]any{
|
|
"model": "kling-v2-master",
|
|
"input": []any{map[string]any{"role": "user", "content": []any{
|
|
map[string]any{"type": "input_text", "text": "camera orbit"},
|
|
map[string]any{"type": "input_image", "image_url": "https://cdn.example/frame.png"},
|
|
}}},
|
|
"seconds": 10,
|
|
"metadata": map[string]any{
|
|
"mode": "pro",
|
|
},
|
|
},
|
|
wantAction: "image_to_video",
|
|
wantRequest: map[string]any{
|
|
"model": "kling-v2-master",
|
|
"prompt": "camera orbit",
|
|
"image": "https://cdn.example/frame.png",
|
|
"duration": float64(10),
|
|
"metadata": map[string]any{"mode": "pro"},
|
|
},
|
|
wantUsageKeys: []string{"units"},
|
|
wantVendorName: "kling",
|
|
})
|
|
}
|