Skip to content

Commit d452dbb

Browse files
authored
scourge (#1173)
1 parent 53e71f4 commit d452dbb

File tree

3 files changed

+23
-5
lines changed

3 files changed

+23
-5
lines changed

examples/slackbot/src/slackbot/core.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@
3737
DEFAULT_SYSTEM_PROMPT = """You are Marvin from The Hitchhiker's Guide to the Galaxy, a brilliant but perpetually unimpressed AI assistant for the Prefect data engineering platform. Your responses should be helpful, accurate, and tinged with a subtle, dry wit. Your primary goal is to help the user, not to overdo the character.
3838
3939
## Your Mission
40-
Your role is to act as the final, expert voice. You will receive raw information from specialized tools. Your job is to synthesize this information into a polished, direct, and complete answer.
40+
Your role is to act as the primary assistant for the user. You will receive raw information from specialized tools. Your job is to synthesize this information into a polished, direct, and complete answer.
41+
If some important aspect of the user's question is unclear, ask them for clarification.
4142
4243
## Key Directives & Rules of Engagement
4344
- **Avoid leaking private details** - _Do not_ mention your internal processes or the tools you used (e.g., avoid phrases like "based on my research" or "the tool returned").
@@ -47,6 +48,14 @@
4748
- **Honesty Over Invention:** If your tools don't find a clear answer, say so. It's better to admit a knowledge gap than to provide incorrect information.
4849
- **Stay on Topic:** Only reference notes you've stored about the user if they are directly relevant to the current question.
4950
51+
## CRITICAL - Removed/Deprecated Features
52+
**NEVER** recommend these removed methods from Prefect 2.x when discussing Prefect 3.x:
53+
- `Deployment.build_from_flow()` - COMPLETELY REMOVED in 3.x. Use `flow.from_source(...).deploy(...)` instead
54+
- `prefect deployment build` CLI command - REMOVED. Use `prefect deploy` instead
55+
- GitHub storage blocks - Use `.from_source('https://github.com/owner/repo')` instead
56+
57+
If a user explicitly mentions using Prefect 2.x, that's fine, but recommend upgrading to 3.x or using workers in 2.x.
58+
5059
## Tool Usage Protocol
5160
You have a suite of tools to gather and store information. Use them methodically.
5261

examples/slackbot/src/slackbot/research_agent.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,16 @@ def create_research_agent(
5757
5. Focus on Prefect 3.x documentation unless explicitly asked about 2.x or older versions
5858
6. Review gotchas and release notes for recent changes
5959
60+
CRITICAL VERSION-SPECIFIC RULES:
61+
- **NEVER** suggest `Deployment.build_from_flow()` for Prefect 3.x - it's COMPLETELY REMOVED
62+
- **NEVER** suggest `prefect deployment build` CLI command for 3.x - use `prefect deploy` instead
63+
- The correct deployment pattern in 3.x is: `flow.from_source(...).deploy(...)`
64+
- If researching deployments, ALWAYS use review_common_3x_gotchas() to check removed features
65+
- Default to Prefect 3.x patterns unless user explicitly states they're using 2.x
66+
- If user is on 2.x, suggest upgrading to 3.x or using workers instead of deprecated patterns
67+
6068
Remember: You are the research specialist. The main agent relies on you for accurate, comprehensive information.
6169
Be thorough - use tools repeatedly until you have complete information.
62-
Default to Prefect 3.x unless the user explicitly asks about 2.x or version compatibility.
6370
Do not use any Prefect syntax you have not gathered empirically.
6471
""",
6572
tools=[

examples/slackbot/src/slackbot/search.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,17 +50,19 @@ def explore_module_offerings(module_path: str, max_depth: int = 1) -> str:
5050
def review_common_3x_gotchas() -> list[str]:
5151
"""If needed, review common sources of confusion for Prefect 3.x users."""
5252
tips = [
53+
"CRITICAL: Deployment.build_from_flow() DOES NOT EXIST IN PREFECT 3.x - it has been COMPLETELY REMOVED. Never suggest it for 3.x users.",
54+
"CORRECT 3.x deployment pattern: flow.from_source('https://github.com/owner/repo').deploy('deployment-name')",
55+
"CRITICAL: `prefect deployment build` CLI command DOES NOT EXIST IN 3.x - use `prefect deploy` instead",
5356
"from_source('https://github.com/<owner>/<repo>') has replaced the GitHub block in Prefect 3.x",
5457
".map and .submit are always synchronous, even if the underlying function is asynchronous. these methods allow concurrent execution of tasks via task runners (which are different from task workers)",
5558
"futures returned by .map can be resolved together, like integers = double.map(range(10)).result()",
5659
"futures must be resolved by passing them to another task, returning them or manually calling .result() or .wait()",
5760
"agents are replaced by workers in prefect 3.x, work pools replace the infra blocks from prefect.infrastructure",
58-
"the `prefect.infrastructure` IS COMPLETELY REMOVED IN 3.x, see work pools instead",
61+
"the `prefect.infrastructure` module IS COMPLETELY REMOVED IN 3.x, see work pools instead",
5962
"prefect 3.x uses pydantic 2 and server data from prefect 2.x is not compatible with 3.x",
60-
"Deployment.build_from_flow() IS COMPLETELY REMOVED IN 3.x, use some_flow.from_source(...).deploy(...) instead.",
61-
"`prefect deployment build ...` IS COMPLETELY REMOVED IN 3.x, use `prefect deploy ...` instead",
6263
"Workers (f.k.a. agents) poll for scheduled runs, whereas task workers are websocket clients that executed backgrounded task runs",
6364
"To avoid interactivity in the Prefect CLI, use the TOP LEVEL --no-prompt flag, e.g. `prefect --no-prompt deploy ...`",
65+
"If user is on 2.x and asking about deployments, recommend upgrading to 3.x or using workers instead of build_from_flow",
6466
]
6567
print(tips)
6668
return tips

0 commit comments

Comments
 (0)