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:
@@ -186,6 +186,7 @@ async def add_message(
|
|||||||
content: str,
|
content: str,
|
||||||
context_note_id: int | None = None,
|
context_note_id: int | None = None,
|
||||||
status: str | None = None,
|
status: str | None = None,
|
||||||
|
tool_calls: list | None = None,
|
||||||
) -> Message:
|
) -> Message:
|
||||||
async with async_session() as session:
|
async with async_session() as session:
|
||||||
kwargs: dict = dict(
|
kwargs: dict = dict(
|
||||||
@@ -196,6 +197,8 @@ async def add_message(
|
|||||||
)
|
)
|
||||||
if status is not None:
|
if status is not None:
|
||||||
kwargs["status"] = status
|
kwargs["status"] = status
|
||||||
|
if tool_calls is not None:
|
||||||
|
kwargs["tool_calls"] = tool_calls
|
||||||
msg = Message(**kwargs)
|
msg = Message(**kwargs)
|
||||||
session.add(msg)
|
session.add(msg)
|
||||||
# Touch conversation updated_at
|
# Touch conversation updated_at
|
||||||
|
|||||||
Reference in New Issue
Block a user