WOOF
This commit is contained in:
@@ -3,13 +3,18 @@ import requests
|
|||||||
import subprocess
|
import subprocess
|
||||||
import time
|
import time
|
||||||
|
|
||||||
from flask import Flask, jsonify, request
|
from flask import Flask, jsonify, request, redirect
|
||||||
from flask_cors import CORS
|
from flask_cors import CORS
|
||||||
from auth import get_meeting_token
|
from auth import get_meeting_token
|
||||||
|
|
||||||
|
from dotenv import load_dotenv
|
||||||
|
|
||||||
|
load_dotenv()
|
||||||
|
|
||||||
app = Flask(__name__)
|
app = Flask(__name__)
|
||||||
CORS(app)
|
CORS(app)
|
||||||
|
|
||||||
|
print(f"I loaded an environment, and my FAL_KEY_ID is {os.getenv('FAL_KEY_ID')}")
|
||||||
|
|
||||||
def start_bot(bot_path, args=None):
|
def start_bot(bot_path, args=None):
|
||||||
daily_api_key = os.getenv("DAILY_API_KEY")
|
daily_api_key = os.getenv("DAILY_API_KEY")
|
||||||
@@ -27,6 +32,7 @@ def start_bot(bot_path, args=None):
|
|||||||
"enable_emoji_reactions": True,
|
"enable_emoji_reactions": True,
|
||||||
"eject_at_room_exp": True,
|
"eject_at_room_exp": True,
|
||||||
"enable_prejoin_ui": False,
|
"enable_prejoin_ui": False,
|
||||||
|
"enable_recording": "cloud"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
@@ -81,13 +87,19 @@ def start_bot(bot_path, args=None):
|
|||||||
else:
|
else:
|
||||||
config['vad_timeout_sec'] = 1.5
|
config['vad_timeout_sec'] = 1.5
|
||||||
|
|
||||||
return jsonify({"room_url": room_url, "token": meeting_token, "config": config}), 200
|
#return jsonify({"room_url": room_url, "token": meeting_token, "config": config}), 200
|
||||||
|
return redirect(room_url, code=302)
|
||||||
|
|
||||||
|
|
||||||
@app.route("/spin-up-kitty", methods=["POST"])
|
@app.route("/spin-up-kitty", methods=["POST"])
|
||||||
def spin_up_kitty():
|
def spin_up_kitty():
|
||||||
return start_bot("./src/samples/foundational/06a-golden-kitty.py")
|
return start_bot("./src/samples/foundational/06a-golden-kitty.py")
|
||||||
|
|
||||||
|
@app.route("/spin-up-kitty", methods=["GET"])
|
||||||
|
def quick_start_kitty():
|
||||||
|
return start_bot("./src/samples/foundational/06a-golden-kitty.py")
|
||||||
|
|
||||||
|
|
||||||
@app.route("/healthz")
|
@app.route("/healthz")
|
||||||
def health_check():
|
def health_check():
|
||||||
return "ok", 200
|
return "ok", 200
|
||||||
@@ -4,6 +4,10 @@ import requests
|
|||||||
import time
|
import time
|
||||||
import urllib.parse
|
import urllib.parse
|
||||||
|
|
||||||
|
from dotenv import load_dotenv
|
||||||
|
|
||||||
|
load_dotenv()
|
||||||
|
|
||||||
from dailyai.services.daily_transport_service import DailyTransportService
|
from dailyai.services.daily_transport_service import DailyTransportService
|
||||||
from dailyai.services.azure_ai_services import AzureLLMService, AzureTTSService
|
from dailyai.services.azure_ai_services import AzureLLMService, AzureTTSService
|
||||||
from dailyai.services.elevenlabs_ai_service import ElevenLabsTTSService
|
from dailyai.services.elevenlabs_ai_service import ElevenLabsTTSService
|
||||||
@@ -15,6 +19,8 @@ from dailyai.services.ai_services import AIService
|
|||||||
|
|
||||||
from typing import AsyncGenerator, List
|
from typing import AsyncGenerator, List
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class TranscriptFilter(AIService):
|
class TranscriptFilter(AIService):
|
||||||
def __init__(self, bot_participant_id=None):
|
def __init__(self, bot_participant_id=None):
|
||||||
self.bot_participant_id = bot_participant_id
|
self.bot_participant_id = bot_participant_id
|
||||||
@@ -33,7 +39,7 @@ async def main(room_url:str, token):
|
|||||||
room_url,
|
room_url,
|
||||||
token,
|
token,
|
||||||
"The Golden Kitty",
|
"The Golden Kitty",
|
||||||
5,
|
180,
|
||||||
)
|
)
|
||||||
transport.mic_enabled = True
|
transport.mic_enabled = True
|
||||||
transport.mic_sample_rate = 16000
|
transport.mic_sample_rate = 16000
|
||||||
|
|||||||
Reference in New Issue
Block a user