|
|
|
@@ -513,6 +513,8 @@ VALUES ($1, 5, '{"purpose":"core-flow"}'::jsonb)`, inviteCode); err != nil {
|
|
|
|
|
"simulation": true,
|
|
|
|
|
"simulationDurationMs": 5,
|
|
|
|
|
}, map[string]string{"X-Async": "true"}, http.StatusAccepted, &imageResponse)
|
|
|
|
|
waitForTaskStatus(t, server.URL, apiKeyResponse.Secret, imageResponse.Task.ID, []string{"succeeded"}, 10*time.Second)
|
|
|
|
|
doJSON(t, server.URL, http.MethodGet, "/api/v1/tasks/"+imageResponse.Task.ID, apiKeyResponse.Secret, nil, http.StatusOK, &imageResponse.Task)
|
|
|
|
|
if imageResponse.Task.Status != "succeeded" || imageResponse.Task.Result["id"] == "" {
|
|
|
|
|
t.Fatalf("unexpected image generation task: %+v", imageResponse.Task)
|
|
|
|
|
}
|
|
|
|
@@ -533,6 +535,8 @@ VALUES ($1, 5, '{"purpose":"core-flow"}'::jsonb)`, inviteCode); err != nil {
|
|
|
|
|
"simulation": true,
|
|
|
|
|
"simulationDurationMs": 5,
|
|
|
|
|
}, map[string]string{"X-Async": "true"}, http.StatusAccepted, &imageEditResponse)
|
|
|
|
|
waitForTaskStatus(t, server.URL, apiKeyResponse.Secret, imageEditResponse.Task.ID, []string{"succeeded"}, 10*time.Second)
|
|
|
|
|
doJSON(t, server.URL, http.MethodGet, "/api/v1/tasks/"+imageEditResponse.Task.ID, apiKeyResponse.Secret, nil, http.StatusOK, &imageEditResponse.Task)
|
|
|
|
|
if imageEditResponse.Task.Status != "succeeded" || imageEditResponse.Task.Result["id"] == "" {
|
|
|
|
|
t.Fatalf("unexpected image edit task: %+v", imageEditResponse.Task)
|
|
|
|
|
}
|
|
|
|
@@ -1196,6 +1200,7 @@ WHERE reference_type = 'gateway_task'
|
|
|
|
|
}, http.StatusCreated, &videoRoutePlatformModel)
|
|
|
|
|
var textToVideoTask struct {
|
|
|
|
|
Task struct {
|
|
|
|
|
ID string `json:"id"`
|
|
|
|
|
Status string `json:"status"`
|
|
|
|
|
ModelType string `json:"modelType"`
|
|
|
|
|
} `json:"task"`
|
|
|
|
@@ -1207,6 +1212,8 @@ WHERE reference_type = 'gateway_task'
|
|
|
|
|
"simulationDurationMs": 5,
|
|
|
|
|
"prompt": "text to video route",
|
|
|
|
|
}, map[string]string{"X-Async": "true"}, http.StatusAccepted, &textToVideoTask)
|
|
|
|
|
waitForTaskStatus(t, server.URL, apiKeyResponse.Secret, textToVideoTask.Task.ID, []string{"succeeded"}, 10*time.Second)
|
|
|
|
|
doJSON(t, server.URL, http.MethodGet, "/api/v1/tasks/"+textToVideoTask.Task.ID, apiKeyResponse.Secret, nil, http.StatusOK, &textToVideoTask.Task)
|
|
|
|
|
if textToVideoTask.Task.Status != "succeeded" || textToVideoTask.Task.ModelType != "video_generate" {
|
|
|
|
|
t.Fatalf("text-to-video request should use video_generate model_type: %+v", textToVideoTask.Task)
|
|
|
|
|
}
|
|
|
|
@@ -1226,6 +1233,8 @@ WHERE reference_type = 'gateway_task'
|
|
|
|
|
"prompt": "image to video route",
|
|
|
|
|
"image": "https://example.com/source.png",
|
|
|
|
|
}, map[string]string{"X-Async": "true"}, http.StatusAccepted, &imageToVideoTask)
|
|
|
|
|
waitForTaskStatus(t, server.URL, apiKeyResponse.Secret, imageToVideoTask.Task.ID, []string{"succeeded"}, 10*time.Second)
|
|
|
|
|
doJSON(t, server.URL, http.MethodGet, "/api/v1/tasks/"+imageToVideoTask.Task.ID, apiKeyResponse.Secret, nil, http.StatusOK, &imageToVideoTask.Task)
|
|
|
|
|
if imageToVideoTask.Task.Status != "succeeded" || imageToVideoTask.Task.ModelType != "image_to_video" {
|
|
|
|
|
t.Fatalf("image-to-video request should use image_to_video model_type: %+v", imageToVideoTask.Task)
|
|
|
|
|
}
|
|
|
|
|