Skip to content

Commit

Permalink
wip errors
Browse files Browse the repository at this point in the history
  • Loading branch information
theomonnom committed Oct 29, 2024
1 parent 5ab9a73 commit 8eea8ec
Show file tree
Hide file tree
Showing 10 changed files with 10 additions and 23 deletions.
2 changes: 1 addition & 1 deletion livekit-agents/livekit/agents/stt/__init__.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
from .stream_adapter import StreamAdapter, StreamAdapterWrapper
from .stt import (
STT,
RecognitionUsage,
SpeechData,
SpeechEvent,
SpeechEventType,
SpeechStream,
STTCapabilities,
STTMetrics,
RecognitionUsage,
)

__all__ = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,24 +12,22 @@

from __future__ import annotations

import contextlib
import asyncio
import contextlib
import os
from dataclasses import dataclass
from typing import Literal

from livekit.agents import (
APIConnectionError,
APIStatusError,
APITimeoutError,
tts,
utils,
)

from .log import logger

import azure.cognitiveservices.speech as speechsdk # type: ignore

from .log import logger

AZURE_SAMPLE_RATE: int = 16000
AZURE_BITS_PER_SAMPLE: int = 16
Expand Down Expand Up @@ -231,7 +229,7 @@ def _cleanup() -> None:
try:
await asyncio.to_thread(_cleanup)
except Exception:
logger.exception(f"failed to cleanup resources")
logger.exception("failed to cleanup resources")


class _PushAudioOutputStreamCallback(speechsdk.audio.PushAudioOutputStreamCallback):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,24 +14,21 @@

from __future__ import annotations

import asyncio
import io
import json
import asyncio
import os
import time
import wave
from typing import Optional, Union

import aiohttp

from livekit.agents import (
APIConnectionError,
APIStatusError,
APITimeoutError,
stt,
utils,
)

from livekit.agents.stt import SpeechEventType, STTCapabilities
from livekit.agents.utils import AudioBuffer, merge_frames
from livekit.plugins.clova.constants import CLOVA_INPUT_SAMPLE_RATE
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
stt,
utils,
)

from livekit.agents.utils import AudioBuffer, merge_frames

from .log import logger
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
from dataclasses import dataclass
from typing import Any, List, Literal

import aiohttp
from livekit import rtc
from livekit.agents import (
APIConnectionError,
APIStatusError,
Expand All @@ -31,10 +33,6 @@
utils,
)


import aiohttp
from livekit import rtc

from .log import logger
from .models import TTSEncoding, TTSModels

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
from typing import AsyncIterable, List, Union

from livekit import agents, rtc

from livekit.agents import (
APIConnectionError,
APIStatusError,
Expand All @@ -29,6 +28,7 @@
utils,
)

from google.api_core.exceptions import DeadlineExceeded, GoogleAPICallError
from google.auth import default as gauth_default
from google.auth.exceptions import DefaultCredentialsError
from google.cloud.speech_v2 import SpeechAsyncClient
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,10 @@
utils,
)


from google.api_core.exceptions import DeadlineExceeded, GoogleAPICallError
from google.cloud import texttospeech
from google.cloud.texttospeech_v1.types import SsmlVoiceGender, SynthesizeSpeechResponse

from google.api_core.exceptions import DeadlineExceeded, GoogleAPICallError

from .log import logger
from .models import AudioEncoding, Gender, SpeechLanguages


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
APIStatusError,
APITimeoutError,
llm,
utils,
)

import openai
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@

import openai

from .log import logger
from .models import TTSModels, TTSVoices
from .utils import AsyncAzureADTokenProvider

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from __future__ import annotations

import os
import asyncio
import os
from dataclasses import dataclass
from typing import Any, List, Literal

Expand Down

0 comments on commit 8eea8ec

Please sign in to comment.