fix: hide tool calls from chatbot history
This commit is contained in:
parent
9bf454823b
commit
179b848ecb
1 changed files with 4 additions and 3 deletions
|
|
@ -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,
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue