ui tars integration fix (#2714)

This commit is contained in:
Wyatt Marshall
2025-06-13 16:52:14 -04:00
committed by GitHub
parent 84a0ff4e4c
commit 346b36fa4d
2 changed files with 11 additions and 49 deletions

View File

@@ -97,7 +97,11 @@ async def llm_messages_builder_with_history(
},
}
current_user_messages.append(message)
messages.append({"role": "user", "content": current_user_messages})
# Only append a user message if there's actually content to add
if current_user_messages:
messages.append({"role": "user", "content": current_user_messages})
# anthropic has hard limit of image & document messages (20 as of Apr 2025)
# limit the number of image type messages to 10 for anthropic
# delete the oldest image type message if the number of image type messages is greater than 10