Skip to content

Commit

Permalink
Merge pull request #880 from pipecat-ai/aleix/ruff-check-import-linter
Browse files Browse the repository at this point in the history
ruff check import linter
  • Loading branch information
aconchillo authored Dec 17, 2024
2 parents 146a341 + b9ca667 commit fb9f72d
Show file tree
Hide file tree
Showing 135 changed files with 550 additions and 709 deletions.
7 changes: 6 additions & 1 deletion .github/workflows/format.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,12 @@ jobs:
python -m pip install --upgrade pip
pip install -r dev-requirements.txt
- name: Ruff formatter
id: ruff
id: ruff-format
run: |
source .venv/bin/activate
ruff format --diff
- name: Ruff import linter
id: ruff-check
run: |
source .venv/bin/activate
ruff check --select I
6 changes: 3 additions & 3 deletions examples/chatbot-audio-recording/bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@
# SPDX-License-Identifier: BSD 2-Clause License
#

import aiofiles
import asyncio
import datetime
import io
import os
import sys
import wave

import aiofiles
import aiohttp
import datetime
import wave
from dotenv import load_dotenv
from loguru import logger
from runner import configure
Expand Down
13 changes: 6 additions & 7 deletions examples/deployment/flyio-example/bot.py
Original file line number Diff line number Diff line change
@@ -1,22 +1,21 @@
import argparse
import asyncio
import os
import sys
import argparse

from dotenv import load_dotenv
from loguru import logger

from pipecat.audio.vad.silero import SileroVADAnalyzer
from pipecat.frames.frames import EndFrame, LLMMessagesFrame
from pipecat.pipeline.pipeline import Pipeline
from pipecat.pipeline.runner import PipelineRunner
from pipecat.pipeline.task import PipelineParams, PipelineTask
from pipecat.frames.frames import LLMMessagesFrame, EndFrame
from pipecat.processors.aggregators.openai_llm_context import OpenAILLMContext
from pipecat.services.openai import OpenAILLMService
from pipecat.services.elevenlabs import ElevenLabsTTSService
from pipecat.services.openai import OpenAILLMService
from pipecat.transports.services.daily import DailyParams, DailyTransport

from loguru import logger

from dotenv import load_dotenv

load_dotenv(override=True)

logger.remove(0)
Expand Down
12 changes: 5 additions & 7 deletions examples/deployment/flyio-example/bot_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,24 @@
# SPDX-License-Identifier: BSD 2-Clause License
#

import aiohttp
import argparse
import subprocess
import os

import subprocess
from contextlib import asynccontextmanager

from fastapi import FastAPI, Request, HTTPException
import aiohttp
from dotenv import load_dotenv
from fastapi import FastAPI, HTTPException, Request
from fastapi.middleware.cors import CORSMiddleware
from fastapi.responses import JSONResponse

from pipecat.transports.services.helpers.daily_rest import (
DailyRESTHelper,
DailyRoomObject,
DailyRoomProperties,
DailyRoomParams,
DailyRoomProperties,
)

from dotenv import load_dotenv

load_dotenv(override=True)


Expand Down
3 changes: 1 addition & 2 deletions examples/deployment/modal-example/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,11 @@

import aiohttp
import modal
from bot import _voice_bot_process
from fastapi import HTTPException
from fastapi.responses import JSONResponse
from loguru import logger

from bot import _voice_bot_process

MAX_SESSION_TIME = 15 * 60 # 15 minutes

app = modal.App("pipecat-modal")
Expand Down
13 changes: 6 additions & 7 deletions examples/dialin-chatbot/bot_daily.py
Original file line number Diff line number Diff line change
@@ -1,21 +1,20 @@
import argparse
import asyncio
import os
import sys
import argparse

from dotenv import load_dotenv
from loguru import logger

from pipecat.audio.vad.silero import SileroVADAnalyzer
from pipecat.frames.frames import EndFrame, LLMMessagesFrame
from pipecat.pipeline.pipeline import Pipeline
from pipecat.pipeline.runner import PipelineRunner
from pipecat.pipeline.task import PipelineParams, PipelineTask
from pipecat.frames.frames import LLMMessagesFrame, EndFrame
from pipecat.processors.aggregators.openai_llm_context import OpenAILLMContext
from pipecat.services.elevenlabs import ElevenLabsTTSService
from pipecat.services.openai import OpenAILLMService
from pipecat.transports.services.daily import DailyParams, DailyTransport, DailyDialinSettings

from loguru import logger

from dotenv import load_dotenv
from pipecat.transports.services.daily import DailyDialinSettings, DailyParams, DailyTransport

load_dotenv(override=True)

Expand Down
12 changes: 5 additions & 7 deletions examples/dialin-chatbot/bot_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,28 +7,26 @@
Refer to README for more information.
"""

import aiohttp
import os
import argparse
import os
import subprocess

from contextlib import asynccontextmanager

from fastapi import FastAPI, Request, HTTPException
import aiohttp
from dotenv import load_dotenv
from fastapi import FastAPI, HTTPException, Request
from fastapi.middleware.cors import CORSMiddleware
from fastapi.responses import JSONResponse, PlainTextResponse
from twilio.twiml.voice_response import VoiceResponse

from pipecat.transports.services.helpers.daily_rest import (
DailyRESTHelper,
DailyRoomObject,
DailyRoomParams,
DailyRoomProperties,
DailyRoomSipParams,
DailyRoomParams,
)

from dotenv import load_dotenv

load_dotenv(override=True)


Expand Down
14 changes: 6 additions & 8 deletions examples/dialin-chatbot/bot_twilio.py
Original file line number Diff line number Diff line change
@@ -1,24 +1,22 @@
import argparse
import asyncio
import os
import sys
import argparse

from dotenv import load_dotenv
from loguru import logger
from twilio.rest import Client

from pipecat.audio.vad.silero import SileroVADAnalyzer
from pipecat.frames.frames import EndFrame, LLMMessagesFrame
from pipecat.pipeline.pipeline import Pipeline
from pipecat.pipeline.runner import PipelineRunner
from pipecat.pipeline.task import PipelineParams, PipelineTask
from pipecat.frames.frames import LLMMessagesFrame, EndFrame
from pipecat.processors.aggregators.openai_llm_context import OpenAILLMContext
from pipecat.services.elevenlabs import ElevenLabsTTSService
from pipecat.services.openai import OpenAILLMService
from pipecat.transports.services.daily import DailyParams, DailyTransport

from twilio.rest import Client

from loguru import logger

from dotenv import load_dotenv

load_dotenv(override=True)

logger.remove(0)
Expand Down
14 changes: 6 additions & 8 deletions examples/foundational/01-say-one-thing.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,21 @@
#

import asyncio
import aiohttp
import os
import sys

import aiohttp
from dotenv import load_dotenv
from loguru import logger
from runner import configure

from pipecat.frames.frames import EndFrame, TTSSpeakFrame
from pipecat.pipeline.pipeline import Pipeline
from pipecat.pipeline.task import PipelineTask
from pipecat.pipeline.runner import PipelineRunner
from pipecat.pipeline.task import PipelineTask
from pipecat.services.cartesia import CartesiaTTSService
from pipecat.transports.services.daily import DailyParams, DailyTransport

from runner import configure

from loguru import logger

from dotenv import load_dotenv

load_dotenv(override=True)

logger.remove(0)
Expand Down
9 changes: 4 additions & 5 deletions examples/foundational/01a-local-audio.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,13 @@
#

import asyncio
import aiohttp
import os
import sys

import aiohttp
from dotenv import load_dotenv
from loguru import logger

from pipecat.frames.frames import EndFrame, TTSSpeakFrame
from pipecat.pipeline.pipeline import Pipeline
from pipecat.pipeline.runner import PipelineRunner
Expand All @@ -17,10 +20,6 @@
from pipecat.transports.base_transport import TransportParams
from pipecat.transports.local.audio import LocalAudioTransport

from loguru import logger

from dotenv import load_dotenv

load_dotenv(override=True)

logger.remove(0)
Expand Down
9 changes: 3 additions & 6 deletions examples/foundational/01b-livekit-audio.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
import sys

import aiohttp
from dotenv import load_dotenv
from livekit import api
from loguru import logger

from pipecat.frames.frames import TextFrame
from pipecat.pipeline.pipeline import Pipeline
Expand All @@ -12,12 +15,6 @@
from pipecat.services.cartesia import CartesiaTTSService
from pipecat.transports.services.livekit import LiveKitParams, LiveKitTransport

from livekit import api

from loguru import logger

from dotenv import load_dotenv

load_dotenv(override=True)

logger.remove(0)
Expand Down
14 changes: 6 additions & 8 deletions examples/foundational/01c-fastpitch.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,21 @@
#

import asyncio
import aiohttp
import os
import sys

import aiohttp
from dotenv import load_dotenv
from loguru import logger
from runner import configure

from pipecat.frames.frames import EndFrame, TTSSpeakFrame
from pipecat.pipeline.pipeline import Pipeline
from pipecat.pipeline.task import PipelineTask
from pipecat.pipeline.runner import PipelineRunner
from pipecat.pipeline.task import PipelineTask
from pipecat.services.riva import FastPitchTTSService
from pipecat.transports.services.daily import DailyParams, DailyTransport

from runner import configure

from loguru import logger

from dotenv import load_dotenv

load_dotenv(override=True)

logger.remove(0)
Expand Down
12 changes: 5 additions & 7 deletions examples/foundational/02-llm-say-one-thing.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,14 @@
#

import asyncio
import aiohttp
import os
import sys

import aiohttp
from dotenv import load_dotenv
from loguru import logger
from runner import configure

from pipecat.frames.frames import EndFrame, LLMMessagesFrame
from pipecat.pipeline.pipeline import Pipeline
from pipecat.pipeline.runner import PipelineRunner
Expand All @@ -17,12 +21,6 @@
from pipecat.services.openai import OpenAILLMService
from pipecat.transports.services.daily import DailyParams, DailyTransport

from runner import configure

from loguru import logger

from dotenv import load_dotenv

load_dotenv(override=True)

logger.remove(0)
Expand Down
12 changes: 5 additions & 7 deletions examples/foundational/03-still-frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,21 @@
#

import asyncio
import aiohttp
import os
import sys

import aiohttp
from dotenv import load_dotenv
from loguru import logger
from runner import configure

from pipecat.frames.frames import EndFrame, TextFrame
from pipecat.pipeline.pipeline import Pipeline
from pipecat.pipeline.runner import PipelineRunner
from pipecat.pipeline.task import PipelineTask
from pipecat.services.fal import FalImageGenService
from pipecat.transports.services.daily import DailyParams, DailyTransport

from runner import configure

from loguru import logger

from dotenv import load_dotenv

load_dotenv(override=True)

logger.remove(0)
Expand Down
10 changes: 4 additions & 6 deletions examples/foundational/03a-local-still-frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,14 @@
#

import asyncio
import aiohttp
import os
import sys

import tkinter as tk

import aiohttp
from dotenv import load_dotenv
from loguru import logger

from pipecat.frames.frames import TextFrame
from pipecat.pipeline.pipeline import Pipeline
from pipecat.pipeline.runner import PipelineRunner
Expand All @@ -19,10 +21,6 @@
from pipecat.transports.base_transport import TransportParams
from pipecat.transports.local.tk import TkLocalTransport

from loguru import logger

from dotenv import load_dotenv

load_dotenv(override=True)

logger.remove(0)
Expand Down
Loading

0 comments on commit fb9f72d

Please sign in to comment.