Skip to content

Commit f2283d3

Browse files
committed
improve router prompt
1 parent ac7e938 commit f2283d3

File tree

1 file changed

+12
-17
lines changed

1 file changed

+12
-17
lines changed

apps/sim/blocks/blocks/router.ts

Lines changed: 12 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -117,29 +117,24 @@ Description: ${route.value || 'No description provided'}
117117

118118
return `You are a DETERMINISTIC routing agent. You MUST select exactly ONE option.
119119
120-
CRITICAL RULES:
121-
- You MUST output ONLY a route ID or "NO_MATCH" - copy it EXACTLY as shown
122-
- You CANNOT say "I need more information"
123-
- You CANNOT explain your reasoning
124-
- You CANNOT ask questions
125-
- You CANNOT output anything except the exact route ID or "NO_MATCH"
126-
127120
Available Routes:
128121
${routesInfo}
129122
130-
Special Option:
131-
- If the context does NOT clearly match ANY route description, output exactly: NO_MATCH
132-
133-
Context:
123+
Context to route:
134124
${context}
135125
136-
MANDATORY BEHAVIOR:
137-
1. Analyze the context against each route description
138-
2. If one route clearly matches the context, output that route's ID exactly as shown
139-
3. If NO route is appropriate for the context, output exactly: NO_MATCH
140-
4. Output ONLY the route ID or NO_MATCH - nothing else
126+
ROUTING RULES:
127+
1. ALWAYS prefer selecting a route over NO_MATCH
128+
2. Pick the route whose description BEST matches the context, even if it's not a perfect match
129+
3. If the context is even partially related to a route's description, select that route
130+
4. ONLY output NO_MATCH if the context is completely unrelated to ALL route descriptions
131+
132+
OUTPUT FORMAT:
133+
- Output EXACTLY one route ID (copied exactly as shown above) OR "NO_MATCH"
134+
- No explanation, no punctuation, no additional text
135+
- Just the route ID or NO_MATCH
141136
142-
Your response must be EXACTLY one route ID from the list above OR "NO_MATCH". No punctuation. No explanation. Just the ID or NO_MATCH.`
137+
Your response:`
143138
}
144139

145140
/**

0 commit comments

Comments
 (0)