changes include: allow GET endpoints, redirect to codey.lol instead of returning status 422, clean junk from ai endpoint, add misc endpoint, add methods to lyric_search_new.sources.cache, other misc/cleanup

This commit is contained in:
2025-01-21 19:16:23 -05:00
parent e95ef3b088
commit 38dbddd297
7 changed files with 148 additions and 23 deletions

View File

@@ -4,6 +4,7 @@
import logging
import traceback
import regex
import json
from aiohttp import ClientSession, ClientTimeout
from fastapi import FastAPI, Request, HTTPException, BackgroundTasks
@@ -49,7 +50,8 @@ class AI(FastAPI):
}
for endpoint, handler in self.endpoints.items():
app.add_api_route(f"/{endpoint}/", handler, methods=["POST"])
app.add_api_route(f"/{endpoint}/", handler, methods=["POST"] if not endpoint == "testy" else ["POST", "GET"])
async def respond_via_webhook(self, data: ValidHookSongRequest, originalRequest: Request):
"""Respond via Webhook"""