This commit is contained in:
Timothy Jaeryang Baek 2024-12-13 22:51:43 -08:00
parent f9a05dd1e1
commit 6efca03a8f
4 changed files with 9 additions and 0 deletions

View File

@ -230,6 +230,7 @@ async def generate_function_chat_completion(
"role": user.role,
},
"__metadata__": metadata,
"__request__": request,
}
extra_params["__tools__"] = get_tools(
request,

View File

@ -173,6 +173,11 @@ async def user_count(sid):
await sio.emit("user-count", {"count": len(USER_POOL.items())})
@sio.on("chat")
async def chat(sid, data):
print("chat", sid, SESSION_POOL[sid], data)
@sio.event
async def disconnect(sid):
if sid in SESSION_POOL:

View File

@ -237,6 +237,7 @@ async def chat_completed(request: Request, form_data: dict, user: Any):
"__id__": filter_id,
"__event_emitter__": __event_emitter__,
"__event_call__": __event_call__,
"__request__": request,
}
# Add extra params in contained in function signature
@ -334,6 +335,7 @@ async def chat_action(request: Request, action_id: str, form_data: dict, user: A
"__id__": sub_action_id if sub_action_id is not None else action_id,
"__event_emitter__": __event_emitter__,
"__event_call__": __event_call__,
"__request__": request,
}
# Add extra params in contained in function signature

View File

@ -382,6 +382,7 @@ async def process_chat_payload(request, form_data, user, model):
"role": user.role,
},
"__metadata__": metadata,
"__request__": request,
}
# Initialize events to store additional event to be sent to the client