Skip to content

Commit

Permalink
add unit in desc
Browse files Browse the repository at this point in the history
  • Loading branch information
HRashidi committed Jul 11, 2024
1 parent 31eb34b commit 84fa594
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion aana/core/models/video.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ class VideoMetadata(BaseModel):

title: str = Field(None, description="The title of the video.")
description: str = Field(None, description="The description of the video.")
duration: float | None = Field(None, description="The duration of the video.")
duration: float | None = Field(None, description="The duration of the video in seconds.")
model_config = ConfigDict(
json_schema_extra={
"description": "Metadata of a video.",
Expand Down
4 changes: 2 additions & 2 deletions aana/integrations/external/yt_dlp.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def get_video_metadata(video_url: str) -> VideoMetadata:
Returns:
metadata (VideoMetadata): the metadata of the video
"""

ydl_options = {
"extract_flat": True,
"hls_prefer_native": True,
Expand All @@ -36,7 +36,7 @@ def get_video_metadata(video_url: str) -> VideoMetadata:
return VideoMetadata(
title=title,
description=description,
duration= duration,
duration=duration,
)
except DownloadError as e:
error_message = e.msg.split(";")[0]
Expand Down
4 changes: 3 additions & 1 deletion aana/projects/chat_with_video/endpoints.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,9 @@ async def run(
yield {
"media_id": media_id,
"metadata": VideoMetadata(
title=video_obj.title, description=video_obj.description, duration=video_duration
title=video_obj.title,
description=video_obj.description,
duration=video_duration,
),
}

Expand Down
2 changes: 1 addition & 1 deletion aana/storage/services/video.py
Original file line number Diff line number Diff line change
Expand Up @@ -392,5 +392,5 @@ def load_video_metadata(
return VideoMetadata(
title=video_entity.title,
description=video_entity.description,
duration=video_entity.duration
duration=video_entity.duration,
)

0 comments on commit 84fa594

Please sign in to comment.