-
Notifications
You must be signed in to change notification settings - Fork 34
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
fix: consider the tool role when being in open interpreter #829
Conversation
It uses a new message role tool, that contains some context for using internal tools and the data it provides. So we need to consider it when parsing messages, or when inserting context messages Closes: #820
accepted_roles = ["user", "assistant"] | ||
if base_tool == "open interpreter": | ||
# open interpreter also uses the role "tool" | ||
accepted_roles.append("tool") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sorry to be difficult about this review.
Would it break anything if we accepted the tools either way, meaning for all clients?
What do we miss if we don't process the tool messages here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
well i was not aware if any other client using tools but wanted to be conservative about it, so that's why i filter by the client. Do you prefer that i open that and we do not filter?
src/codegate/pipeline/base.py
Outdated
user_messages.append(content_str) | ||
block_start_index = i | ||
|
||
# Specifically for Aider, when "Ok." block is found, stop | ||
if content_str == "Ok." and messages[i]["role"] == "assistant": | ||
if base_tool == "aider" and content_str == "Ok." and messages[i]["role"] == "assistant": |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how do we detect aider? I looked into get_tool_name_from_messages and I don't see aider returned from there
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i actually removed that, it is outdated, i removed the check for aider
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We did a bunch of testing offline with Yolanda and the code seems to work. I'm going to file a follow-up to support tools with openai in a more general way
It uses a new message role tool, that contains some context for using internal tools and the data it provides. So we need to consider it when parsing messages, or when inserting context messages
Closes: #820