Avoid empty chat message (#78)
This commit is contained in:
parent
b2296cfcdf
commit
5ca3c25404
|
@ -445,6 +445,13 @@ class ChatPage(BasePage):
|
||||||
state[pipeline.get_info()["id"]] = reasoning_state["pipeline"]
|
state[pipeline.get_info()["id"]] = reasoning_state["pipeline"]
|
||||||
yield chat_history + [(chat_input, text or msg_placeholder)], refs, state
|
yield chat_history + [(chat_input, text or msg_placeholder)], refs, state
|
||||||
|
|
||||||
|
if not text:
|
||||||
|
empty_msg = getattr(
|
||||||
|
flowsettings, "KH_CHAT_EMPTY_MSG_PLACEHOLDER", "(Sorry, I don't know)"
|
||||||
|
)
|
||||||
|
print(f"Generate nothing: {empty_msg}")
|
||||||
|
yield chat_history + [(chat_input, text or empty_msg)], refs, state
|
||||||
|
|
||||||
def regen_fn(self, conversation_id, chat_history, settings, state, *selecteds):
|
def regen_fn(self, conversation_id, chat_history, settings, state, *selecteds):
|
||||||
"""Regen function"""
|
"""Regen function"""
|
||||||
if not chat_history:
|
if not chat_history:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user