"""
Module contains luna-video-agent client adapted for usage in lambda
"""
from typing import Awaitable
from luna3.common.luna_response import LunaResponse
from luna3.public.sdk import VideoSDKInput
from luna3.video_agent.video_agent import VideoAgentApi
[docs]
class LVA:
"""Luna-video-agent client"""
[docs]
def __init__(self, lvaClient: VideoAgentApi, accountId: str):
self._accountId = accountId
self._lvaClient = lvaClient
def getAddress(self) -> str:
"""Get luna-video-agent address"""
return self._lvaClient.baseUri
def videosdk(self, videoSDKInput: VideoSDKInput, **kwargs) -> Awaitable[LunaResponse] | LunaResponse:
"""
Process video
Args:
videoSDKInput: video properties including url and analytics params
Returns:
class:`~.LunaResponse` or *asyncio coroutine* with *LunaResponse*.
In body of :class: `~.LunaResponse` json with samples, exif, filename for succeeded images and
errors for failed images will be returned.
"""
return self._lvaClient.videosdk(videoSDKInput, **kwargs)