Skip to content

Commit fe5a80e

Browse files
feat: update error field
1 parent fe51ca6 commit fe5a80e

File tree

2 files changed

+12
-29
lines changed

2 files changed

+12
-29
lines changed

volcenginesdkarkruntime/types/content_generation/content_generation_task.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,14 @@ class Content(BaseModel):
1313
"""The URL of the generated video, if any."""
1414

1515

16+
class ContentGenerationError(BaseModel):
17+
message: str
18+
"""The reason for task failure"""
19+
20+
code: str
21+
"""The error code for task failure"""
22+
23+
1624
class ContentGenerationTask(BaseModel):
1725
id: str
1826
"""A unique identifier for the task."""
@@ -23,8 +31,8 @@ class ContentGenerationTask(BaseModel):
2331
status: str
2432
"""The status of the task (running, failed, queued, succeeded, cancelled)."""
2533

26-
failure_reason: str
27-
"""The reason for failure, if applicable."""
34+
error: ContentGenerationError
35+
"""The error body, if applicable."""
2836

2937
content: Content
3038
"""The content generated by the task."""
Lines changed: 2 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
from typing import List
22

3+
from .content_generation_task import ContentGenerationTask
34
from volcenginesdkarkruntime._models import BaseModel
45

56
__all__ = ["ListContentGenerationTasksResponse"]
@@ -15,35 +16,9 @@ class Usage(BaseModel):
1516
"""Number of tokens used during the content generation process."""
1617

1718

18-
class Item(BaseModel):
19-
id: str
20-
"""Unique identifier for the content generation task."""
21-
22-
model: str
23-
"""Name or identifier of the model used for generation."""
24-
25-
status: str
26-
"""Status of the content generation task (e.g., 'succeed', 'failed')."""
27-
28-
failure_reason: str
29-
"""Description of why the task failed, if it did. Otherwise empty."""
30-
31-
content: Content
32-
"""Generated content details (e.g., video URL)."""
33-
34-
usage: Usage
35-
"""Usage statistics for the content generation task."""
36-
37-
created_at: int
38-
"""Timestamp (in Unix epoch) of when the task was created."""
39-
40-
updated_at: int
41-
"""Timestamp (in Unix epoch) of when the task was last updated."""
42-
43-
4419
class ListContentGenerationTasksResponse(BaseModel):
4520
total: int
4621
"""Total number of filtered content generation tasks."""
4722

48-
items: List[Item]
23+
items: List[ContentGenerationTask]
4924
"""List of content generation task items."""

0 commit comments

Comments
 (0)