Spaces:
Running
Running
Upload 6 files
Browse files
app.py
CHANGED
@@ -667,6 +667,7 @@ def generate_trace_id():
|
|
667 |
|
668 |
def send_message(message, model, think=False):
|
669 |
"""Flua traktado kaj plusendo de mesaĝoj"""
|
|
|
670 |
(session, cookies, session_token, conversation_id, model_map, user_index) = get_user_data()
|
671 |
|
672 |
# 获取并保存当前的conversation_id(可能是旧的,用于稍后删除)
|
@@ -790,7 +791,6 @@ def send_message(message, model, think=False):
|
|
790 |
update_model_stats(model, prompt_tokens, completion_tokens)
|
791 |
|
792 |
# 如果需要删除上一个对话且上一个对话ID不为空且与当前不同
|
793 |
-
global DELETE_CHAT, LAST_CONVERSATION_IDS
|
794 |
if DELETE_CHAT and last_conversation_id and last_conversation_id != conversation_id:
|
795 |
delete_conversation(session, cookies, session_token, last_conversation_id)
|
796 |
|
@@ -806,6 +806,7 @@ def send_message(message, model, think=False):
|
|
806 |
|
807 |
def send_message_non_stream(message, model, think=False):
|
808 |
"""Ne-flua traktado de mesaĝoj"""
|
|
|
809 |
(session, cookies, session_token, conversation_id, model_map, user_index) = get_user_data()
|
810 |
|
811 |
# 获取并保存当前的conversation_id(可能是旧的,用于稍后删除)
|
@@ -919,7 +920,6 @@ def send_message_non_stream(message, model, think=False):
|
|
919 |
update_model_stats(model, prompt_tokens, completion_tokens)
|
920 |
|
921 |
# 如果需要删除上一个对话且上一个对话ID不为空且与当前不同
|
922 |
-
global DELETE_CHAT, LAST_CONVERSATION_IDS
|
923 |
if DELETE_CHAT and last_conversation_id and last_conversation_id != conversation_id:
|
924 |
delete_conversation(session, cookies, session_token, last_conversation_id)
|
925 |
|
@@ -957,7 +957,6 @@ def send_message_non_stream(message, model, think=False):
|
|
957 |
update_model_stats(model, prompt_tokens, completion_tokens)
|
958 |
|
959 |
# 如果需要删除上一个对话且上一个对话ID不为空且与当前不同
|
960 |
-
global DELETE_CHAT, LAST_CONVERSATION_IDS
|
961 |
if DELETE_CHAT and last_conversation_id and last_conversation_id != conversation_id:
|
962 |
delete_conversation(session, cookies, session_token, last_conversation_id)
|
963 |
|
|
|
667 |
|
668 |
def send_message(message, model, think=False):
|
669 |
"""Flua traktado kaj plusendo de mesaĝoj"""
|
670 |
+
global DELETE_CHAT, LAST_CONVERSATION_IDS
|
671 |
(session, cookies, session_token, conversation_id, model_map, user_index) = get_user_data()
|
672 |
|
673 |
# 获取并保存当前的conversation_id(可能是旧的,用于稍后删除)
|
|
|
791 |
update_model_stats(model, prompt_tokens, completion_tokens)
|
792 |
|
793 |
# 如果需要删除上一个对话且上一个对话ID不为空且与当前不同
|
|
|
794 |
if DELETE_CHAT and last_conversation_id and last_conversation_id != conversation_id:
|
795 |
delete_conversation(session, cookies, session_token, last_conversation_id)
|
796 |
|
|
|
806 |
|
807 |
def send_message_non_stream(message, model, think=False):
|
808 |
"""Ne-flua traktado de mesaĝoj"""
|
809 |
+
global DELETE_CHAT, LAST_CONVERSATION_IDS
|
810 |
(session, cookies, session_token, conversation_id, model_map, user_index) = get_user_data()
|
811 |
|
812 |
# 获取并保存当前的conversation_id(可能是旧的,用于稍后删除)
|
|
|
920 |
update_model_stats(model, prompt_tokens, completion_tokens)
|
921 |
|
922 |
# 如果需要删除上一个对话且上一个对话ID不为空且与当前不同
|
|
|
923 |
if DELETE_CHAT and last_conversation_id and last_conversation_id != conversation_id:
|
924 |
delete_conversation(session, cookies, session_token, last_conversation_id)
|
925 |
|
|
|
957 |
update_model_stats(model, prompt_tokens, completion_tokens)
|
958 |
|
959 |
# 如果需要删除上一个对话且上一个对话ID不为空且与当前不同
|
|
|
960 |
if DELETE_CHAT and last_conversation_id and last_conversation_id != conversation_id:
|
961 |
delete_conversation(session, cookies, session_token, last_conversation_id)
|
962 |
|