Skip to content
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

Merged

Conversation

YujingYang666777
Copy link
Contributor

No description provided.

Copy link
Collaborator

@20001LastOrder 20001LastOrder left a 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":
Copy link
Collaborator

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 = (
Copy link
Collaborator

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(
Copy link
Collaborator

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

Copy link
Collaborator

@saminegash saminegash left a 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

@@ -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")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove test print stmts

@20001LastOrder
Copy link
Collaborator

As many of these changes do not influence the main functionality, I will merge this PR and make these required changes as new issues.

@saminegash
Copy link
Collaborator

please rebase this @YujingYang666777

@20001LastOrder 20001LastOrder merged commit 5ad07e8 into Aggregate-Intellect:main Aug 16, 2023
@20001LastOrder 20001LastOrder deleted the repeated_action branch August 29, 2023 19:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants