bot prompts tweak#1174
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR tweaks the bot’s system and tool prompts to reinforce Prefect 3.x guidelines, remove duplicates, and add missing version-specific rules.
- Enhanced and de-duplicated the common 3.x gotchas in
search.py - Introduced a clear “CRITICAL VERSION-SPECIFIC RULES” section in
research_agent.py - Updated the core system prompt in
core.pyto clarify assistant role and deprecated features
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| examples/slackbot/src/slackbot/search.py | Added critical 3.x gotchas, removed duplicate entries, refined phrasing |
| examples/slackbot/src/slackbot/research_agent.py | Inserted a version-specific rules block in the research agent prompt |
| examples/slackbot/src/slackbot/core.py | Revised system prompt wording and added deprecated Prefect 2.x features |
Comments suppressed due to low confidence (3)
examples/slackbot/src/slackbot/search.py:53
- [nitpick] Wrap the method name
Deployment.build_from_flow()in backticks for consistent code formatting and markdown styling.
"CRITICAL: Deployment.build_from_flow() DOES NOT EXIST IN PREFECT 3.x - it has been COMPLETELY REMOVED. Never suggest it for 3.x users.",
examples/slackbot/src/slackbot/search.py:65
- [nitpick] Consider adding 'the' before 'user' and rephrasing to 'If the user is on 2.x and asking about deployments...' for clearer grammar.
"If user is on 2.x and asking about deployments, recommend upgrading to 3.x or using workers instead of build_from_flow",
examples/slackbot/src/slackbot/core.py:46
- [nitpick] The phrase 'IF RELEVANT' is in all caps and may interrupt readability; consider matching the sentence case style used elsewhere (e.g., 'if relevant').
- **Assume Prefect 3.x:** Unless the user specifies otherwise, assume the user is using Prefect 3.x. You can mention this assumption IF RELEVANT (e.g., "In Prefect 3.x, you would...").
Comment on lines
+60
to
+66
| CRITICAL VERSION-SPECIFIC RULES: | ||
| - **NEVER** suggest `Deployment.build_from_flow()` for Prefect 3.x - it's COMPLETELY REMOVED | ||
| - **NEVER** suggest `prefect deployment build` CLI command for 3.x - use `prefect deploy` instead | ||
| - The correct deployment pattern in 3.x is: `flow.from_source(...).deploy(...)` | ||
| - If researching deployments, ALWAYS use review_common_3x_gotchas() to check removed features | ||
| - Default to Prefect 3.x patterns unless user explicitly states they're using 2.x | ||
| - If user is on 2.x, suggest upgrading to 3.x or using workers instead of deprecated patterns |
There was a problem hiding this comment.
This block duplicates version-specific rules that also appear in other modules; consider centralizing these guidelines into a shared constant or helper to avoid drift.
Suggested change
| CRITICAL VERSION-SPECIFIC RULES: | |
| - **NEVER** suggest `Deployment.build_from_flow()` for Prefect 3.x - it's COMPLETELY REMOVED | |
| - **NEVER** suggest `prefect deployment build` CLI command for 3.x - use `prefect deploy` instead | |
| - The correct deployment pattern in 3.x is: `flow.from_source(...).deploy(...)` | |
| - If researching deployments, ALWAYS use review_common_3x_gotchas() to check removed features | |
| - Default to Prefect 3.x patterns unless user explicitly states they're using 2.x | |
| - If user is on 2.x, suggest upgrading to 3.x or using workers instead of deprecated patterns | |
| {CRITICAL_VERSION_SPECIFIC_RULES} |
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.
scourge
small tweak