Skip to content

Commit 333c0ac

Browse files
committed
refactor: update ttv.py to use ClassVar for class-level constants
1 parent 5c10ab5 commit 333c0ac

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

  • apps/models_provider/impl/minimax_model_provider/model

‎apps/models_provider/impl/minimax_model_provider/model/ttv.py‎

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# coding=utf-8
22
import time
3-
from typing import Dict, Optional
3+
from typing import ClassVar, Dict, Optional
44

55
import requests
66

@@ -19,15 +19,15 @@ class GenerationVideoModel(MaxKBBaseModel, BaseGenerationVideo):
1919
max_retries: int = 3
2020
retry_delay: int = 10 # 秒
2121

22-
DEFAULT_API_BASE = "https://api.minimaxi.com/v1"
23-
REQUEST_TIMEOUT = (10, 120) # (连接超时, 读取超时)
24-
MAX_POLL_ATTEMPTS = 60 # 最多轮询 60 次(约 10 分钟)
22+
DEFAULT_API_BASE: ClassVar[str] = "https://api.minimaxi.com/v1"
23+
REQUEST_TIMEOUT: ClassVar[tuple] = (10, 120) # (连接超时, 读取超时)
24+
MAX_POLL_ATTEMPTS: ClassVar[int] = 60 # 最多轮询 60 次(约 10 分钟)
2525

2626
# V2 (MiniMax-H3) 专用参数
27-
V2_EXTRA_FIELDS = ("resolution", "duration", "ratio", "callback_url")
28-
SUCCESS_STATUSES = frozenset({"succeeded", "Success"})
29-
FAIL_STATUSES = frozenset({"failed", "Fail", "cancelled", "Cancel"})
30-
ERROR_KEYS = ("error_message", "error", "detail", "message", "msg")
27+
V2_EXTRA_FIELDS: ClassVar[tuple] = ("resolution", "duration", "ratio", "callback_url")
28+
SUCCESS_STATUSES: ClassVar[frozenset] = frozenset({"succeeded", "Success"})
29+
FAIL_STATUSES: ClassVar[frozenset] = frozenset({"failed", "Fail", "cancelled", "Cancel"})
30+
ERROR_KEYS: ClassVar[tuple] = ("error_message", "error", "detail", "message", "msg")
3131

3232
def __init__(self, **kwargs):
3333
super().__init__(**kwargs)

0 commit comments

Comments
 (0)