tweak prompt and hoist mod tools#1170
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
Refactors GitHub integration into its own module, replaces hard-coded slice length with a named constant, and adds module-exploration tools to the agent.
- Extract GitHub token retrieval and Pydantic models into
slackbot.github - Introduce
TOKEN_LIMITconstant and replace the literal1000inslice_tokens - Register
display_callable_signatureandexplore_module_offeringsas agent tools and refine the research prompt
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| examples/slackbot/src/slackbot/search.py | Hoist GitHub logic, import _get_token & GitHubIssue, add TOKEN_LIMIT constant |
| examples/slackbot/src/slackbot/research_agent.py | Enhance prompt text with clarifications and an empirical-syntax rule |
| examples/slackbot/src/slackbot/github.py | New module defining _get_token and Pydantic models for GitHub entities |
| examples/slackbot/src/slackbot/core.py | Import and register display_callable_signature & explore_module_offerings tools |
Comments suppressed due to low confidence (5)
examples/slackbot/src/slackbot/research_agent.py:63
- [nitpick] This line isn’t numbered like the surrounding steps. Prefix it with a step number or bullet to maintain consistent formatting in the prompt.
Do not use any Prefect syntax you have not gathered empirically.
examples/slackbot/src/slackbot/core.py:25
- Neither
display_callable_signaturenorexplore_module_offeringsare defined inslackbot.search. This import will fail at runtime; you should import them from the modules where they’re actually defined (e.g.,pretty_mod).
display_callable_signature,
examples/slackbot/src/slackbot/github.py:63
default_factoryshould create alist[GitHubLabel], not a singleGitHubLabelinstance. Usedefault_factory=listto produce an empty list.
labels: list[GitHubLabel] = Field(default_factory=GitHubLabel)
examples/slackbot/src/slackbot/github.py:62
- The original validator that coerced
Noneto""was removed. If the API returnsnullforbody, Pydantic will error on astrfield. Consider re-adding a validator or making the fieldOptional[str]with a default of"".
body: str = Field(default="")
examples/slackbot/src/slackbot/search.py:166
- [nitpick] Defining
TOKEN_LIMITinside the function redeclares it on every call. Move it to the module level (or a config) so it’s only defined once and can be shared.
TOKEN_LIMIT = 1500
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.