-
Notifications
You must be signed in to change notification settings - Fork 5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug]: #2341
Comments
Thanks for this great feedback! |
@sonichi I believe the error occurs at here It is possible that the Would the following update resolve the issue? if len(messages):
message = messages[-1]
else:
message = "empty message" Of courese, @WaelKarkoub , we need to update this function such that we should avoid returning an empty list. Maybe we can cut the message and get the first few tokens. |
@BeibinLi I opened a PR to fix this behavior. @aullrich2013 would you be able to test your setup with this PR #2350? |
Describe the bug
When attempting to use the
transforms.MessageTokenLimiter(max_tokens=1000)
on a chatbot,I receive error
IndexError: list index out of range
Because
/home/ish/.venv/lib/python3.11/site-packages/autogen/agentchat/conversable_agent.py
line1659
fails becausemessages
is an empty list and notNone
as expectedSteps to reproduce
create a chatbot agent with registered functions and attempt to add the MessageTokenLimiter
context_handling.add_to_agent(chatbot)
Model Used
No response
Expected Behavior
No response
Screenshots and logs
No response
Additional Information
No response
The text was updated successfully, but these errors were encountered: