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

Flag options #200

Merged
merged 19 commits into from
Nov 16, 2023
Merged

Flag options #200

merged 19 commits into from
Nov 16, 2023

Conversation

20001LastOrder
Copy link
Collaborator

@20001LastOrder 20001LastOrder commented Oct 27, 2023

  • Use argparse to support different flag options to slack sherpa
  • Refactor existing flag option to be handled with argparse for more reliable results
  • Move message parsing (Slack Specific) from the agent to the slack app
  • Added some more flag options that will be used in the future
  • More tests

@20001LastOrder 20001LastOrder requested a review from Eyobyb October 27, 2023 03:55
@20001LastOrder 20001LastOrder requested a review from oshoma November 2, 2023 19:17
Copy link
Collaborator

@oshoma oshoma left a comment

Choose a reason for hiding this comment

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

These changes with renaming the test modules all look solid

Copy link
Collaborator

@oshoma oshoma left a comment

Choose a reason for hiding this comment

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

Hi folks, I did a thorough walkthrough. In general I like how this PR cleans things up. I made some suggestions for readability and maintainability.

src/tests/unit_tests/config/test_task_config.py Outdated Show resolved Hide resolved
src/sherpa_ai/tools.py Outdated Show resolved Hide resolved
src/sherpa_ai/tools.py Outdated Show resolved Hide resolved
src/sherpa_ai/config/task_config.py Outdated Show resolved Hide resolved
src/sherpa_ai/task_agent.py Outdated Show resolved Hide resolved
src/apps/slackapp/slackapp/bolt_app.py Outdated Show resolved Hide resolved
src/apps/slackapp/slackapp/bolt_app.py Outdated Show resolved Hide resolved
src/apps/slackapp/slackapp/bolt_app.py Outdated Show resolved Hide resolved
src/apps/slackapp/slackapp/bolt_app.py Show resolved Hide resolved
Copy link
Collaborator

@oshoma oshoma left a comment

Choose a reason for hiding this comment

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

I think we are almost done here. My remaining unresolved comments are about the tests.

src/tests/unit_tests/config/test_task_config.py Outdated Show resolved Hide resolved
def test_get_question():
question = "What is AutoGPT and how does it compare with MetaGPT"

if cfg.SERPER_API_KEY is None:
Copy link
Collaborator

Choose a reason for hiding this comment

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

OK. @20001LastOrder can you rename real to something more explicit, e.g. external-api-caller?

@oshoma
Copy link
Collaborator

oshoma commented Nov 13, 2023

@20001LastOrder @YujingYang666777 I see there are also conflicts with the main branch. Please merge main into this branch to resolve conflicts.

Copy link
Collaborator

@oshoma oshoma left a comment

Choose a reason for hiding this comment

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

I added a few change requests.

Also, please ensure make test runs clean. When I run it I get 15 failed, 27 passed, 1 skipped, 7 warnings. Maybe I'm doing something wrong?

src/sherpa_ai/task_agent.py Outdated Show resolved Hide resolved
def execute(self, query) -> str:
query = self.config_gsite_query(query)
Copy link
Collaborator

Choose a reason for hiding this comment

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

This code adds site: to the query by calling config_gsite_query.
Then SearchTool._run adds site: to the query by calling query_with_gsqite.
(Assuming they are both using the same config.)
We should just add site to the query once, either here in GoogleSearch or in SearchTool.

If gsite is intended to be specific to google search then do the work here in GoogleSearch.

Either way I suggest calling the function query_with_gsite or something like that.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

OK, I had a look at the implementation. It seems that this feature is meant to be added to the SearchTool, so the one in the GoogleSearch action is removed. And I moved the test accordingly.

@20001LastOrder
Copy link
Collaborator Author

I added a few change requests.

Also, please ensure make test runs clean. When I run it I get 15 failed, 27 passed, 1 skipped, 7 warnings. Maybe I'm doing something wrong?

I was able to get the same failures. I fixed some of the failed tests due to the change introduced to the search tool. However, it seems other tests also fail on the main branch. We should tackle these failure cases in a separate pr.

@oshoma
Copy link
Collaborator

oshoma commented Nov 16, 2023

I reduced test failures somewhat. We now have 7 failed, 33 passed, 1 skipped, 7 warnings in 678.56s (0:11:18) .

oshoma
oshoma previously approved these changes Nov 16, 2023
We should use dashes instead of underscores in command line options.
This confirms with the [Gnu style guide](https://www.gnu.org/software/libc/manual/html_node/Argument-Syntax.html)
@oshoma oshoma merged commit d6abb62 into Aggregate-Intellect:main Nov 16, 2023
@20001LastOrder 20001LastOrder deleted the flag_options branch December 13, 2023 02:57
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.

[FEATURE] Add option for searching a particular domain in the search tool
3 participants