-
Notifications
You must be signed in to change notification settings - Fork 85
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
* fix: consider the tool role when being in open interpreter 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 * fix lint * fix tests * change logic for open interpreter * fix linting
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