Skip to content

Commit

Permalink
addressed review (urllib import and linting
Browse files Browse the repository at this point in the history
  • Loading branch information
jptaylor committed Jun 4, 2024
1 parent 6591e07 commit ba45c2a
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/pipecat/transports/services/helpers/daily_rest.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@
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
Expand All @@ -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:
Expand All @@ -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(
Expand Down

0 comments on commit ba45c2a

Please sign in to comment.