fix: hide tool calls from chatbot history

This commit is contained in:
Christopher Gondek 2025-10-08 17:22:07 +02:00
parent 9bf454823b
commit 179b848ecb

View file

@ -561,13 +561,14 @@ async def get_thread_messages_from_langgraph(
if msg.type not in ["human", "ai"]:
continue
# Convert content to string if needed
content = msg.content if isinstance(msg.content, str) else str(msg.content)
# Skip messages with non-string content (e.g., tool calls)
if not isinstance(msg.content, str):
continue
messages.append(
{
"role": ROLE_MAP.get(msg.type, msg.type),
"content": content,
"content": msg.content,
}
)