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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user