-
Notifications
You must be signed in to change notification settings - Fork 45
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
reformulate query if the query is duplicate #69
reformulate query if the query is duplicate #69
Conversation
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.
Thanks for the PR; please check these comments.
@@ -150,6 +152,29 @@ def run(self, task: str) -> str: | |||
action = self.output_parser.parse(assistant_reply) | |||
print("action:", action) | |||
tools = {t.name: t for t in self.tools} | |||
if action == previous_action: | |||
if action.name == "Search" or action.name == "Context Search": |
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 recommend we drop this condition since we may want to check duplication for all tools. (We don't need to worry about the finish
tool for now as it will be separated and it will also break the loop)
if action == previous_action: | ||
if action.name == "Search" or action.name == "Context Search": | ||
print("Action name: ", action.name, "\nStart reformulating the query") | ||
instruction = ( |
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.
If I understand correctly, this prompt only asks for a different input for the same tool. Is this intended?
f"Reformulated query:\n\n" | ||
) | ||
openai.api_key = environ.get("OPENAI_KEY") | ||
response = openai.Completion.create( |
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 may want to use self.llm
so that we don't need to provide extra configurations of the LLM 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.
Thanks for the PR; please try to address this issues on this PR for approval
apps/slackbot/task_agent.py
Outdated
@@ -150,6 +152,29 @@ def run(self, task: str) -> str: | |||
action = self.output_parser.parse(assistant_reply) | |||
print("action:", action) | |||
tools = {t.name: t for t in self.tools} | |||
if action == previous_action: | |||
if action.name == "Search" or action.name == "Context Search": | |||
print("Action name: ", action.name, "\nStart reformulating the query") |
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.
remove test print stmts
As many of these changes do not influence the main functionality, I will merge this PR and make these required changes as new issues. |
please rebase this @YujingYang666777 |
No description provided.