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"]: if msg.type not in ["human", "ai"]:
continue continue
# Convert content to string if needed # Skip messages with non-string content (e.g., tool calls)
content = msg.content if isinstance(msg.content, str) else str(msg.content) if not isinstance(msg.content, str):
continue
messages.append( messages.append(
{ {
"role": ROLE_MAP.get(msg.type, msg.type), "role": ROLE_MAP.get(msg.type, msg.type),
"content": content, "content": msg.content,
} }
) )