feat(briefing): extend post_message() to accept optional metadata dict

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-25 10:31:25 -04:00
parent 5665f484ed
commit e44eb185d5
2 changed files with 34 additions and 1 deletions
@@ -41,7 +41,12 @@ async def get_or_create_today_conversation(user_id: int, model: str) -> Conversa
return conv
async def post_message(conversation_id: int, role: str, content: str) -> Message:
async def post_message(
conversation_id: int,
role: str,
content: str,
metadata: dict | None = None,
) -> Message:
"""Append a message to a briefing conversation."""
async with async_session() as session:
msg = Message(
@@ -49,6 +54,7 @@ async def post_message(conversation_id: int, role: str, content: str) -> Message
role=role,
content=content,
status="complete",
msg_metadata=metadata,
)
session.add(msg)
# Bump conversation updated_at