This commit is contained in:
Timothy Jaeryang Baek
2025-09-08 18:50:23 +04:00
parent f71834720e
commit b5bb6ae177
5 changed files with 45 additions and 12 deletions

View File

@@ -1408,6 +1408,14 @@ async def chat_completion(
model_item = form_data.pop("model_item", {})
tasks = form_data.pop("background_tasks", None)
oauth_token = None
try:
oauth_token = request.app.state.oauth_manager.get_oauth_token(
user.id, request.cookies.get("oauth_session_id", None)
)
except Exception as e:
log.error(f"Error getting OAuth token: {e}")
metadata = {}
try:
if not model_item.get("direct", False):