feat(chat): add tool_calls param to add_message for synthetic messages

Needed by the Discuss endpoint to persist synthetic read_article
tool exchanges before triggering generation.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-04-05 19:33:54 -04:00
parent eeb671872a
commit 7dc5af2e88
+3
View File
@@ -186,6 +186,7 @@ async def add_message(
content: str,
context_note_id: int | None = None,
status: str | None = None,
tool_calls: list | None = None,
) -> Message:
async with async_session() as session:
kwargs: dict = dict(
@@ -196,6 +197,8 @@ async def add_message(
)
if status is not None:
kwargs["status"] = status
if tool_calls is not None:
kwargs["tool_calls"] = tool_calls
msg = Message(**kwargs)
session.add(msg)
# Touch conversation updated_at