From ba45c2ab5bf4544dee7c38617e1c7164185f0d57 Mon Sep 17 00:00:00 2001 From: Jon Taylor Date: Tue, 4 Jun 2024 18:39:35 +0200 Subject: [PATCH] addressed review (urllib import and linting --- src/pipecat/transports/services/helpers/daily_rest.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/pipecat/transports/services/helpers/daily_rest.py b/src/pipecat/transports/services/helpers/daily_rest.py index c496f3be0..bd361582d 100644 --- a/src/pipecat/transports/services/helpers/daily_rest.py +++ b/src/pipecat/transports/services/helpers/daily_rest.py @@ -10,8 +10,7 @@ Daily REST Helpers Methods that wrap the Daily API to create rooms, check room URLs, and get meeting tokens. """ -import urllib.parse -import urllib +from urllib.parse import urlparse import requests from typing import Literal, Optional from time import time @@ -32,8 +31,8 @@ class DailyRoomProperties(BaseModel): enable_emoji_reactions: bool = False eject_at_room_exp: bool = True enable_dialout: Optional[bool] = None - sip: DailyRoomSipParams = None - sip_uri: dict = None + sip: DailyRoomSipParams = DailyRoomSipParams() + sip_uri: dict = {} @property def sip_endpoint(self) -> str: @@ -57,12 +56,12 @@ class DailyRoomObject(BaseModel): class DailyRESTHelper: - def __init__(self, daily_api_key: str, daily_api_url: str = "api.daily.co/v1"): + def __init__(self, daily_api_key: str, daily_api_url: str = "https://api.daily.co/v1"): self.daily_api_key = daily_api_key self.daily_api_url = daily_api_url def _get_name_from_url(self, room_url: str) -> str: - return urllib.parse.urlparse(room_url).path[1:] + return urlparse(room_url).path[1:] def create_room(self, params: DailyRoomParams) -> DailyRoomObject: res = requests.post(