-
Notifications
You must be signed in to change notification settings - Fork 387
[slackbot] improve answers #1159
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
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.
Pull Request Overview
This PR improves Slackbot answers by updating the GitHub token retrieval mechanism, introducing a new research agent for more comprehensive information gathering, and refactoring tool configurations.
- Update asynchronous token retrieval in search.py and add a new read_github_issues task
- Introduce a new research agent in research_agent.py for Prefect documentation searches
- Refine function name retrieval logic in modules.py and streamline agent configuration in core.py
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| examples/slackbot/search.py | Updates to asynchronous token handling and addition of a read_github_issues task |
| examples/slackbot/research_agent.py | New research agent for improved documentation and issue research |
| examples/slackbot/modules.py | Improved function name fallback logic in display_signature |
| examples/slackbot/core.py | Refactored agent creation to use the new research agent and simplified tool configuration |
| # Load GitHub token synchronously | ||
| github_token = Secret.load(settings.github_token_secret_name, _sync=True).get() # type: ignore | ||
| return asyncio.run( | ||
| search_github_issues(query, repo=repo, n=n, api_token=github_token) | ||
| ) |
Copilot
AI
Jun 7, 2025
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.
The use of synchronous token loading here differs from the asynchronous approach (via Secret.aload) used elsewhere. Consider unifying the token retrieval pattern to maintain consistency in async contexts.
| # Load GitHub token synchronously | |
| github_token = Secret.load(settings.github_token_secret_name, _sync=True).get() # type: ignore | |
| return asyncio.run( | |
| search_github_issues(query, repo=repo, n=n, api_token=github_token) | |
| ) | |
| # Load GitHub token asynchronously | |
| github_token = await Secret.aload(settings.github_token_secret_name) # type: ignore | |
| return await search_github_issues(query, repo=repo, n=n, api_token=github_token.get()) |
|
|
||
| # Get function name and build header | ||
| func_name = func.__name__ | ||
| func_name = getattr(func, "name", getattr(func, "__name__", "unknown")) |
Copilot
AI
Jun 7, 2025
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.
[nitpick] This change ensures a fallback for the function name; consider verifying that functions meant for display have a descriptive 'name' attribute to avoid a default value of 'unknown'.
| func_name = getattr(func, "name", getattr(func, "__name__", "unknown")) | |
| func_name = getattr(func, "name", None) or getattr(func, "__name__", "Unnamed Function") |
No description provided.