Initial project import

This commit is contained in:
XM
2026-09-18 03:46:58 +08:00
commit b600da4b76
209 changed files with 45904 additions and 0 deletions
+19
View File
@@ -0,0 +1,19 @@
from __future__ import annotations
from services.account_service import account_service
from services.openai_backend_api import OpenAIBackendAPI, SEARCH_MODEL
MODEL = SEARCH_MODEL
def handle(body: dict[str, object]) -> dict[str, object]:
token = account_service.get_text_access_token()
account = account_service.get_account(token) or {}
backend = OpenAIBackendAPI(token)
try:
result = backend.search(str(body["prompt"]))
finally:
backend.close()
account_service.mark_text_used(token)
result["_account_email"] = str(account.get("email") or "")
return result