返回 ViMax
environment.py
根目录 / interfaces / environment.py
1 from pydantic import BaseModel, Field
2 from typing import List, Optional, Union, Dict
3 from PIL import Image
4
5
6
7 class EnvironmentInScene(BaseModel):
8 slugline: str = Field(
9 description="The slugline of the scene, indicating the location and time of day",
10 examples=[
11 "INT. COFFEE SHOP - NIGHT",
12 "EXT. PARK - DAY",
13 ]
14 )
15 description: str = Field(
16 description="A detailed description of the environment in the specific scene. Don't describe any characters or actions here, just the setting.",
17 examples=[
18 "The warm yellow light glowed against the mottled brick wall, while raindrops streaked the glass window with blurred neon reflections. Among the empty booths sat a lone half-finished iced latte—its foam collapsed, a faint lipstick mark on the rim. beads of condensation gleamed on the stainless steel espresso machine, and the record player's turntable rotated slowly in the shadows. A patch of wet floor shimmered with hazy reflected light.",
19 ]
20 )
21
22 def __str__(self):
23 s = f"{self.slugline} -- {self.description}"
24 return s
25
26
27
27 lines PYTHON