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"]:
|
||||
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,
|
||||
}
|
||||
)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue