Gemini 3 + Decart AI로 실시간 비디오 리스타일링 에이전트 구축하기
Source: Dev.to
개요
Google의 Gemini 3(2025년 11월 18일 출시)는 멀티모달 추론 및 도구 사용을 제공하여 응답 정확도가 높은 AI 애플리케이션을 구축할 수 있게 합니다. Decart AI의 Mirage LSD—제로 레이턴시 24 FPS 실시간 스트리밍 디퓨전 모델—와 결합하면 실시간으로 비디오 스타일을 바꾸는 에이전트를 만들 수 있습니다.
processor = decart.RestylingProcessor(
initial_prompt="Change the video style to a cute animated movie with vibrant colours",
model="mirage_v2"
)
llm = gemini.LLM(model="gemini-3-pro-preview")
agent = Agent(
edge=getstream.Edge(),
agent_user=User(name="Story teller", id="agent"),
instructions="You will use the Decart processor to change the style of the video and the user's background.",
llm=llm,
tts=elevenlabs.TTS(voice_id="N2lVS1w4EtoT3dr4eOWO"),
stt=deepgram.STT(),
processors=[processor],
)
@llm.register_function(
description="Changes the prompt of the Decart processor, which in turn changes the video style and background."
)
async def change_prompt(prompt: str) -> str:
await processor.update_prompt(prompt)
return f"Prompt changed to {prompt}"
return agent
async def join_call(agent: Agent, call_type: str, call_id: str, **kwargs) -> None:
"""Join the call and start the agent."""
await agent.create_user()
call = await agent.create_call(call_type, call_id)
logger.info("🤖 Starting Agent...")
with await agent.join(call):
logger.info("Joining call")
logger.info("LLM ready")
await agent.finish() # Run until the call ends
if __name__ == "__main__":
cli(AgentLauncher(create_agent=create_agent, join_call=join_call))
에이전트 실행하기
API 인증 정보를 환경 변수로 저장하거나 프로젝트 루트에 .env 파일을 만들어 두세요:
export GOOGLE_API_KEY=your_google_key
export DECART_API_KEY=your_decart_key
export ELEVENLABS_API_KEY=your_elevenlabs_key
export DEEPGRAM_API_KEY=your_deepgram_key
export STREAM_API_KEY=your_stream_key
export STREAM_API_SECRET=your_stream_secret
그 다음 스크립트를 실행합니다:
uv run main.py
브라우저 탭이 열리면서 자동으로 입장하는 영상 통화 인터페이스가 표시됩니다. 카메라와 마이크 접근 권한을 허용한 뒤 “Make my video Studio Ghibli.” 와 같은 명령을 말하면 실시간으로 영상이 변환됩니다.
예시 대화
You: "Make it Neon Nostalgia."
Agent: "OK, I've updated the video style to Neon Nostalgia."
You: "Make it a War Zone."
Agent: "OK, I've updated the video style to a War Zone."
리소스
- Vision Agents – 공식 사이트 | GitHub 저장소
- Decart AI – 홈페이지 | Vision Agents용 Decart 플러그인
- Gemini 3 문서 –
- Stream (WebRTC) –
한 번 실행해보고 다양한 스타일을 실험해 보세요—포스트‑아포칼립스 파리, 반 고흐의 별이 빛나는 밤 등 상상할 수 있는 모든 것을 구현할 수 있습니다. 🎨