fix(ai_auto_response): keep complete social short replies
This commit is contained in:
@@ -12,7 +12,7 @@ def finalize_reply(response: str, reply_mode: str) -> List[str]:
|
||||
text = text.replace("\n", " ").strip()
|
||||
|
||||
if reply_mode == "social_short":
|
||||
return split_reply_chunks(text, sentence_limit=2, char_limit=24, chunk_limit=2, allow_clip_split=False)
|
||||
return split_reply_chunks(text, sentence_limit=2, char_limit=42, chunk_limit=2, allow_clip_split=False)
|
||||
if reply_mode == "qa_fast":
|
||||
return split_reply_chunks(text, sentence_limit=2, char_limit=32, chunk_limit=2, allow_clip_split=False)
|
||||
if reply_mode == "qa_with_context":
|
||||
@@ -29,7 +29,7 @@ def preview_text(text: str, limit: int = 80) -> str:
|
||||
|
||||
def build_length_rule(reply_mode: str) -> str:
|
||||
if reply_mode == "social_short":
|
||||
return "默认回1句短话,通常控制在6到18个字;如果这样会把语气砍没,可以放宽到2句短消息,但别写成长段。"
|
||||
return "默认回1句短话,通常控制在6到24个字;如果为了保留语气和完整意思,可以放宽到一整句短句,别硬砍半句,也别写成长段。"
|
||||
if reply_mode == "qa_fast":
|
||||
return "优先1句话;如果确实需要,可以拆成2条短消息发出,每条优先控制在32字内,先给结论,不要主动补第二层解释。"
|
||||
if reply_mode == "qa_with_context":
|
||||
|
||||
Reference in New Issue
Block a user