11# coding=utf-8
22import time
3- from typing import Dict , Optional
3+ from typing import ClassVar , Dict , Optional
44
55import 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