diff --git a/backend/director/agents/upload.py b/backend/director/agents/upload.py index 899a293..19f7104 100644 --- a/backend/director/agents/upload.py +++ b/backend/director/agents/upload.py @@ -46,7 +46,7 @@ def __init__(self, session: Session, **kwargs): self.parameters = UPLOAD_AGENT_PARAMETERS super().__init__(session=session, **kwargs) - def _upload(self, url: str, media_type: str, name: str): + def _upload(self, url: str, media_type: str, name: str = None): """Upload the media with the given URL.""" try: if media_type == "video": diff --git a/backend/director/entrypoint/api/routes.py b/backend/director/entrypoint/api/routes.py index 22c2e90..8614ee8 100644 --- a/backend/director/entrypoint/api/routes.py +++ b/backend/director/entrypoint/api/routes.py @@ -12,7 +12,7 @@ config_bp = Blueprint("config", __name__, url_prefix="/config") -@agent_bp.route("/", methods=["GET"]) +@agent_bp.route("/", methods=["GET"], strict_slashes=False) def agent(): """ Handle the agent request @@ -23,7 +23,7 @@ def agent(): return chat_handler.agents_list() -@session_bp.route("/", methods=["GET"]) +@session_bp.route("/", methods=["GET"], strict_slashes=False) def get_sessions(): """ Get all the sessions diff --git a/backend/director/handler.py b/backend/director/handler.py index 1a21a61..dcee183 100644 --- a/backend/director/handler.py +++ b/backend/director/handler.py @@ -109,11 +109,11 @@ def __init__(self, db: BaseDB, **kwargs): def get_sessions(self): session = Session(db=self.db) return session.get_all() - + def get_session(self, session_id): session = Session(db=self.db, session_id=session_id) return session.get() - + def delete_session(self, session_id): session = Session(db=self.db, session_id=session_id) return session.delete() @@ -142,11 +142,14 @@ def get_videos(self): class ConfigHandler: def check(self): - values = dotenv_values() - env_keys = set(values.keys()) - videodb_configured = "VIDEO_DB_API_KEY" in env_keys - llm_keys = ("OPENAI_API_KEY",) - llm_configured = any(llm_key in env_keys for llm_key in llm_keys) + """Check the configuration of the server.""" + videodb_configured = True if os.getenv("VIDEO_DB_API_KEY") else False + openai_key_configured = True if os.getenv("OPENAI_API_KEY") else False + + llm_configured = False + if openai_key_configured: + llm_configured = True + db = load_db(os.getenv("SERVER_DB_TYPE", "sqlite")) db_configured = db.health_check() return {