Skip to content

Commit

Permalink
examples: move runner.py and auth.py into dailyai.examples package
Browse files Browse the repository at this point in the history
  • Loading branch information
aconchillo committed Mar 18, 2024
1 parent 69c2637 commit a970595
Show file tree
Hide file tree
Showing 20 changed files with 80 additions and 25 deletions.
5 changes: 4 additions & 1 deletion examples/foundational/01-say-one-thing.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@
from dailyai.services.daily_transport_service import DailyTransportService
from dailyai.services.elevenlabs_ai_service import ElevenLabsTTSService

from examples.support.runner import configure
from dailyai.examples.runner import configure

from dotenv import load_dotenv
load_dotenv()

logging.basicConfig(format=f"%(levelno)s %(asctime)s %(message)s")
logger = logging.getLogger("dailyai")
Expand Down
5 changes: 4 additions & 1 deletion examples/foundational/02-llm-say-one-thing.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@
from dailyai.services.elevenlabs_ai_service import ElevenLabsTTSService
from dailyai.services.open_ai_services import OpenAILLMService

from examples.support.runner import configure
from dailyai.examples.runner import configure

from dotenv import load_dotenv
load_dotenv()

logging.basicConfig(format=f"%(levelno)s %(asctime)s %(message)s")
logger = logging.getLogger("dailyai")
Expand Down
5 changes: 4 additions & 1 deletion examples/foundational/03-still-frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@
from dailyai.services.daily_transport_service import DailyTransportService
from dailyai.services.fal_ai_services import FalImageGenService

from examples.support.runner import configure
from dailyai.examples.runner import configure

from dotenv import load_dotenv
load_dotenv()

logging.basicConfig(format=f"%(levelno)s %(asctime)s %(message)s")
logger = logging.getLogger("dailyai")
Expand Down
6 changes: 5 additions & 1 deletion examples/foundational/04-utterance-and-speech.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,11 @@
from dailyai.services.deepgram_ai_services import DeepgramTTSService
from dailyai.pipeline.frames import EndFrame, EndPipeFrame, LLMMessagesQueueFrame, TextFrame
from dailyai.services.elevenlabs_ai_service import ElevenLabsTTSService
from examples.support.runner import configure

from dailyai.examples.runner import configure

from dotenv import load_dotenv
load_dotenv()

logging.basicConfig(format=f"%(levelno)s %(asctime)s %(message)s")
logger = logging.getLogger("dailyai")
Expand Down
5 changes: 4 additions & 1 deletion examples/foundational/05-sync-speech-and-image.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,10 @@
from dailyai.services.elevenlabs_ai_service import ElevenLabsTTSService
from dailyai.services.fal_ai_services import FalImageGenService

from examples.support.runner import configure
from dailyai.examples.runner import configure

from dotenv import load_dotenv
load_dotenv()

logging.basicConfig(format=f"%(levelno)s %(asctime)s %(message)s")
logger = logging.getLogger("dailyai")
Expand Down
5 changes: 4 additions & 1 deletion examples/foundational/06-listen-and-respond.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@
LLMAssistantContextAggregator,
LLMUserContextAggregator,
)
from examples.support.runner import configure
from dailyai.examples.runner import configure

from dotenv import load_dotenv
load_dotenv()

logging.basicConfig(format=f"%(levelno)s %(asctime)s %(message)s")
logger = logging.getLogger("dailyai")
Expand Down
6 changes: 5 additions & 1 deletion examples/foundational/06a-image-sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,11 @@
from dailyai.services.open_ai_services import OpenAILLMService
from dailyai.services.elevenlabs_ai_service import ElevenLabsTTSService
from dailyai.services.fal_ai_services import FalImageGenService
from examples.support.runner import configure

from dailyai.examples.runner import configure

from dotenv import load_dotenv
load_dotenv()

logging.basicConfig(format=f"%(levelno)s %(asctime)s %(message)s")
logger = logging.getLogger("dailyai")
Expand Down
6 changes: 5 additions & 1 deletion examples/foundational/07-interruptible.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,11 @@
from dailyai.services.daily_transport_service import DailyTransportService
from dailyai.services.open_ai_services import OpenAILLMService
from dailyai.services.elevenlabs_ai_service import ElevenLabsTTSService
from examples.support.runner import configure

from dailyai.examples.runner import configure

from dotenv import load_dotenv
load_dotenv()

logging.basicConfig(format=f"%(levelno)s %(asctime)s %(message)s")
logger = logging.getLogger("dailyai")
Expand Down
6 changes: 5 additions & 1 deletion examples/foundational/08-bots-arguing.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,11 @@
from dailyai.services.elevenlabs_ai_service import ElevenLabsTTSService
from dailyai.services.fal_ai_services import FalImageGenService
from dailyai.pipeline.frames import AudioFrame, EndFrame, ImageFrame, LLMMessagesQueueFrame, TextFrame
from examples.support.runner import configure

from dailyai.examples.runner import configure

from dotenv import load_dotenv
load_dotenv()

logging.basicConfig(format=f"%(levelno)s %(asctime)s %(message)s")
logger = logging.getLogger("dailyai")
Expand Down
6 changes: 5 additions & 1 deletion examples/foundational/10-wake-word.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,11 @@
TranscriptionQueueFrame,
)
from dailyai.services.ai_services import AIService
from examples.support.runner import configure

from dailyai.examples.runner import configure

from dotenv import load_dotenv
load_dotenv()

logging.basicConfig(format=f"%(levelno)s %(asctime)s %(message)s")
logger = logging.getLogger("dailyai")
Expand Down
5 changes: 4 additions & 1 deletion examples/foundational/11-sound-effects.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,10 @@
)
from typing import AsyncGenerator

from examples.support.runner import configure
from dailyai.examples.runner import configure

from dotenv import load_dotenv
load_dotenv()

logging.basicConfig(format=f"%(levelno)s %(asctime)s %(message)s")
logger = logging.getLogger("dailyai")
Expand Down
6 changes: 5 additions & 1 deletion examples/foundational/13-whisper-transcription.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@

from dailyai.services.daily_transport_service import DailyTransportService
from dailyai.services.whisper_ai_services import WhisperSTTService
from examples.support.runner import configure

from dailyai.examples.runner import configure

from dotenv import load_dotenv
load_dotenv()

logging.basicConfig(format=f"%(levelno)s %(asctime)s %(message)s")
logger = logging.getLogger("dailyai")
Expand Down
5 changes: 4 additions & 1 deletion examples/internal/11a-dial-out.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@
from dailyai.pipeline.frames import Frame, AudioFrame, LLMResponseEndFrame, LLMMessagesQueueFrame
from typing import AsyncGenerator

from examples.support.runner import configure
from dailyai.examples.runner import configure

from dotenv import load_dotenv
load_dotenv()

sounds = {}
sound_files = [
Expand Down
4 changes: 2 additions & 2 deletions examples/server/daily-bot-manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@

from flask import Flask, jsonify, request, redirect
from flask_cors import CORS
from examples.server.auth import get_meeting_token

from dotenv import load_dotenv
from dailyai.examples.auth import get_meeting_token

from dotenv import load_dotenv
load_dotenv()

app = Flask(__name__)
Expand Down
6 changes: 5 additions & 1 deletion examples/starter-apps/chatbot.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,11 @@
from dailyai.services.daily_transport_service import DailyTransportService
from dailyai.services.open_ai_services import OpenAILLMService
from dailyai.services.elevenlabs_ai_service import ElevenLabsTTSService
from examples.support.runner import configure

from dailyai.examples.runner import configure

from dotenv import load_dotenv
load_dotenv()

logging.basicConfig(format=f"%(levelno)s %(asctime)s %(message)s")
logger = logging.getLogger("dailyai")
Expand Down
6 changes: 5 additions & 1 deletion examples/starter-apps/patient-intake.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
from dailyai.services.open_ai_services import OpenAILLMService
from dailyai.services.deepgram_ai_services import DeepgramTTSService
from dailyai.services.elevenlabs_ai_service import ElevenLabsTTSService
from examples.support.runner import configure
from dailyai.pipeline.frames import (
OpenAILLMContextFrame,
TranscriptionQueueFrame,
Expand All @@ -36,6 +35,11 @@
ChatCompletionToolParam,
)

from dailyai.examples.runner import configure

from dotenv import load_dotenv
load_dotenv()

logging.basicConfig(format="%(levelno)s %(asctime)s %(message)s")
logger = logging.getLogger("dailyai")
logger.setLevel(logging.DEBUG)
Expand Down
6 changes: 5 additions & 1 deletion examples/starter-apps/storybot.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
UserResponseAggregator,
LLMResponseAggregator,
)
from examples.support.runner import configure
from dailyai.pipeline.frames import (
EndPipeFrame,
LLMMessagesQueueFrame,
Expand All @@ -43,6 +42,11 @@
)
from dailyai.services.ai_services import FrameLogger, AIService

from dailyai.examples.runner import configure

from dotenv import load_dotenv
load_dotenv()

logging.basicConfig(format=f"%(levelno)s %(asctime)s %(message)s")
logger = logging.getLogger("dailyai")
logger.setLevel(logging.DEBUG)
Expand Down
6 changes: 5 additions & 1 deletion examples/starter-apps/translator.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,11 @@
from dailyai.services.azure_ai_services import AzureTTSService
from dailyai.services.open_ai_services import OpenAILLMService
from dailyai.services.elevenlabs_ai_service import ElevenLabsTTSService
from examples.support.runner import configure

from dailyai.examples.runner import configure

from dotenv import load_dotenv
load_dotenv()

logging.basicConfig(format=f"%(levelno)s %(asctime)s %(message)s")
logger = logging.getLogger("dailyai")
Expand Down
3 changes: 0 additions & 3 deletions examples/server/auth.py → src/dailyai/examples/auth.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
import time
import urllib

from dotenv import load_dotenv
import requests
from flask import jsonify
import os

load_dotenv()


def get_meeting_token(room_name, daily_api_key, token_expiry):
api_path = os.getenv('DAILY_API_PATH') or 'https://api.daily.co/v1'
Expand Down
3 changes: 0 additions & 3 deletions examples/support/runner.py → src/dailyai/examples/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@
import urllib
import requests

from dotenv import load_dotenv
load_dotenv()


def configure():
parser = argparse.ArgumentParser(description="Daily AI SDK Bot Sample")
Expand Down

0 comments on commit a970595

Please sign in to comment.