Added /chat endpoint to the queued services

This commit is contained in:
Saifeddine ALOUI 2024-02-11 15:56:20 +01:00 committed by GitHub
parent e3f5679672
commit c6aee7e671
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 1 deletions

View File

@ -139,7 +139,7 @@ def main():
min_queued_server = server min_queued_server = server
# Apply the queuing mechanism only for a specific endpoint. # Apply the queuing mechanism only for a specific endpoint.
if path == '/api/generate': if path == '/api/generate' or path == '/api/chat':
que = min_queued_server[1]['queue'] que = min_queued_server[1]['queue']
client_ip, client_port = self.client_address client_ip, client_port = self.client_address
self.add_access_log_entry(event="gen_request", user=self.user, ip_address=client_ip, access="Authorized", server=min_queued_server[0], nb_queued_requests_on_server=que.qsize()) self.add_access_log_entry(event="gen_request", user=self.user, ip_address=client_ip, access="Authorized", server=min_queued_server[0], nb_queued_requests_on_server=que.qsize())