(20241205) LLM endpoint active now.

This commit is contained in:
2024-12-05 18:09:32 +05:30
parent 0ec57089b0
commit 81550898eb
10 changed files with 347 additions and 383 deletions
+1 -1
View File
@@ -247,7 +247,7 @@ async def handle_gmail_callback() -> render_template:
@log_chain_to_mongo(attr_name = "logs_mongo")
@should_not_be_under_maintenance(attr_name = "is_under_maintenance")
@handle_cancelled_request()
async def mail_callback(
async def mail_auth_callback(
mail_client: str = None,
inbound_headers: dict = None,
inbound_data: dict = None,
+4
View File
@@ -126,6 +126,7 @@ def init(blueprint_setup_state):
async def sync_mails(
user_info: dict,
mongo_conn: AsyncMongo,
llm: ChatOpenAI,
inbound_headers: dict,
@@ -145,6 +146,7 @@ async def sync_mails(
# Try to sync the mails:
return await current_app.mail_sync_model.sync(
session_token = inbound_headers["X-Session-Token"],
user_info = user_info,
mongo_conn = mongo_conn,
token_id = inbound_data.tokenId,
llm = llm,
@@ -213,6 +215,7 @@ async def sync_mail(
if mode in ["background", "bg"]:
current_app.add_background_task(
sync_mails,
user_info = kwargs["session_info"],
mongo_conn = current_app.data_mongo,
llm = current_app.llm,
inbound_headers = inbound_headers,
@@ -226,6 +229,7 @@ async def sync_mail(
# Otherwise we process it right here:
sync_results = await sync_mails(
user_info = kwargs["session_info"],
mongo_conn = current_app.data_mongo,
llm = current_app.llm,
inbound_headers = inbound_headers,