3434
3535client = Ark (
3636 api_key = getenv ("MODEL_AGENT_API_KEY" ),
37- base_url = DEFAULT_MODEL_AGENT_API_BASE ,
37+ base_url = getenv ( "MODEL_AGENT_API_BASE" , DEFAULT_MODEL_AGENT_API_BASE ) ,
3838)
3939
4040
@@ -43,15 +43,15 @@ async def generate(prompt, first_frame_image=None, last_frame_image=None):
4343 if first_frame_image is None :
4444 logger .debug ("text generation" )
4545 response = client .content_generation .tasks .create (
46- model = DEFAULT_VIDEO_MODEL_NAME ,
46+ model = getenv ( "MODEL_VIDEO_NAME" , DEFAULT_VIDEO_MODEL_NAME ) ,
4747 content = [
4848 {"type" : "text" , "text" : prompt },
4949 ],
5050 )
5151 elif last_frame_image is None :
5252 logger .debug ("first frame generation" )
5353 response = client .content_generation .tasks .create (
54- model = DEFAULT_VIDEO_MODEL_NAME ,
54+ model = getenv ( "MODEL_VIDEO_NAME" , DEFAULT_VIDEO_MODEL_NAME ) ,
5555 content = cast (
5656 list [CreateTaskContentParam ], # avoid IDE warning
5757 [
@@ -66,7 +66,7 @@ async def generate(prompt, first_frame_image=None, last_frame_image=None):
6666 else :
6767 logger .debug ("last frame generation" )
6868 response = client .content_generation .tasks .create (
69- model = DEFAULT_VIDEO_MODEL_NAME ,
69+ model = getenv ( "MODEL_VIDEO_NAME" , DEFAULT_VIDEO_MODEL_NAME ) ,
7070 content = [
7171 {"type" : "text" , "text" : prompt },
7272 {
@@ -263,8 +263,8 @@ async def video_generate(params: list, tool_context: ToolContext) -> Dict:
263263 output_part = output_part ,
264264 output_tokens = total_tokens ,
265265 total_tokens = total_tokens ,
266- request_model = DEFAULT_VIDEO_MODEL_NAME ,
267- response_model = DEFAULT_VIDEO_MODEL_NAME ,
266+ request_model = getenv ( "MODEL_VIDEO_NAME" , DEFAULT_VIDEO_MODEL_NAME ) ,
267+ response_model = getenv ( "MODEL_VIDEO_NAME" , DEFAULT_VIDEO_MODEL_NAME ) ,
268268 )
269269
270270 if len (success_list ) == 0 :
0 commit comments