fix: only pass region if set
This commit is contained in:
@@ -488,11 +488,14 @@ class GladiaSTTService(STTService):
|
|||||||
|
|
||||||
async def _setup_gladia(self, settings: Dict[str, Any]):
|
async def _setup_gladia(self, settings: Dict[str, Any]):
|
||||||
async with aiohttp.ClientSession() as session:
|
async with aiohttp.ClientSession() as session:
|
||||||
|
params = {}
|
||||||
|
if self._region:
|
||||||
|
params["region"] = self._region
|
||||||
async with session.post(
|
async with session.post(
|
||||||
self._url,
|
self._url,
|
||||||
headers={"X-Gladia-Key": self._api_key},
|
headers={"X-Gladia-Key": self._api_key},
|
||||||
json=settings,
|
json=settings,
|
||||||
params={"region": self._region or "eu-west"},
|
params=params,
|
||||||
) as response:
|
) as response:
|
||||||
if response.ok:
|
if response.ok:
|
||||||
return await response.json()
|
return await response.json()
|
||||||
|
|||||||
Reference in New Issue
Block a user