26 lines
1.2 KiB
Python
26 lines
1.2 KiB
Python
from __future__ import annotations
|
|
|
|
from typing import Any
|
|
|
|
from engine.types import Scene
|
|
|
|
from .base import BaseLLM
|
|
|
|
|
|
class MockLLM(BaseLLM):
|
|
def generate_script(self, prompt: str, context: dict[str, Any] | None = None) -> list[Scene]:
|
|
# Simple deterministic scenes for offline development.
|
|
prompt = (prompt or "").strip()
|
|
if not prompt:
|
|
prompt = "a warm city night"
|
|
return [
|
|
Scene(image_prompt=f"{prompt},城市夜景,霓虹灯,电影感", video_motion="缓慢推进镜头,轻微摇镜", narration="夜色温柔落在街灯上"),
|
|
Scene(image_prompt=f"{prompt},咖啡店窗边,暖光,细雨", video_motion="侧向平移,人物轻轻抬头", narration="雨声里藏着一段回忆"),
|
|
Scene(image_prompt=f"{prompt},桥上远景,车流光轨,温暖", video_motion="拉远全景,光轨流动", narration="我们在光里学会告别"),
|
|
]
|
|
|
|
def refine_scene(self, scene: Scene, context: dict[str, Any] | None = None) -> Scene:
|
|
# Minimal polish: append a hint.
|
|
return Scene(image_prompt=scene.image_prompt, video_motion=scene.video_motion, narration=(scene.narration + "(更凝练)")[:30])
|
|
|