-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Assistant's LLM tools list contains duplicates causing tools list limit OpenAI error #254
Comments
i also faced this issue |
i think a simple deduplication of the list should work. self.llm.tools = list({tool.name: tool for tool in self.llm.tools}.values()) but using a dict might be better |
i also faced this issue |
@ysolanky and I are working on a fix. |
@jacobweiss2305 awesome -- happy to help out in any way |
i also faced this issue, please fix it. Thanks so much! |
please! |
PR is already out for this issue. It will be fixed in the next release 🙂 |
Fixed via #973 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Assistant tools are updated after every run. When they are updated, tools are appended to the llm's list of tools, but it doesn't appear that the tools are deduplicated before they are appended to the list. The result is that if there are enough runs performed, then the list of tools will exceed the allowed number of tools in an LLM request. Specifically for OpenAI GPT-4 that limit is 128.
When I ran the LLM OS and had a chat with around 8 interactions, I received this OpenAI error:
I manually logged the tools argument and could see in the console that the list simply grows longer after every exchange, and that the list contains duplicate tools. To reproduce, you can load up the LLM OS cookbook, and have a conversation with the LLM with roughly 8 exchanges.
Happy to take a pass at addressing this (once someone confirms)! Looks like it will have to involve doing a full list check, unless the tools attribute is replaced with a Dict perhaps (the llm functions attribute look like a Dict though).
The text was updated successfully, but these errors were encountered: