Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/copaw/app/channels/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ def build_agent_request_from_user_content(

if not content_parts:
content_parts = [
TextContent(type=ContentType.TEXT, text=""),
TextContent(type=ContentType.TEXT, text=" "),
]
msg = Message(
type=MessageType.MESSAGE,
Expand Down
14 changes: 8 additions & 6 deletions src/copaw/app/channels/dingtalk/handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,12 +121,14 @@ def _parse_rich_content(
# Text may be under "text" or "content" (API variation).
item_text = item.get("text") or item.get("content")
if item_text is not None:
content.append(
TextContent(
type=ContentType.TEXT,
text=(item_text or "").strip(),
),
)
stripped = (item_text or "").strip()
if stripped:
content.append(
TextContent(
type=ContentType.TEXT,
text=stripped,
),
)
# Picture items may use pictureDownloadCode or downloadCode.
dl_code = (
item.get("downloadCode")
Expand Down
Loading