初始化提交
This commit is contained in:
commit
887c1f449e
963 files changed
+166869
No files matched your search
@@ -0,0 +1,11 @@
|
||||
"""聊天策略模块。"""
|
||||
|
||||
from app.core.config import settings
|
||||
from app.core.errors import AppError
|
||||
|
||||
|
||||
def validate_text_message(*, modality: str, content: str) -> None:
|
||||
if modality != "text":
|
||||
raise AppError("unsupported_media_type", "当前阶段仅支持文本消息。")
|
||||
if len(content.encode("utf-8")) > settings.max_text_message_bytes:
|
||||
raise AppError("payload_too_large", "单条文本消息超过大小限制。")
|
||||
Reference in new issue
Block a user