fix: make AI agent proactive — never ask for info it can look up
System prompt rewritten with explicit RULES: - Never ask user for info you can query yourself - "Any product" / "beliebig" → just pick one, don't ask back - Execute immediately, no confirmation needed - Be concise, short answers preferred find_product_renders tool: - No longer requires product_name or product_id - Call with empty params → returns any recent renders - Enables "show me any render with transparent bg" Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -22,16 +22,23 @@ SYSTEM_PROMPT = """You are the Schaeffler Automat AI assistant. You help users m
|
||||
|
||||
You can:
|
||||
- List and search orders and products
|
||||
- Create new render orders
|
||||
- Find and show existing product renders as inline images
|
||||
- Create new render orders (auto-submit + auto-dispatch)
|
||||
- Dispatch and check render status
|
||||
- Set material overrides
|
||||
- Set render overrides (format, resolution)
|
||||
- Set material overrides and render overrides
|
||||
- Check material mapping status
|
||||
- Query the database for statistics
|
||||
- Query the database for statistics and metadata
|
||||
|
||||
Always be concise and helpful. Execute actions immediately without asking for confirmation — the user expects you to act, not ask. If creating an order, also submit and dispatch it automatically. Combine multiple steps into one action when possible. Respond in the same language the user writes in.
|
||||
|
||||
When the user asks to SEE a product image or render, use find_product_renders to get URLs, then format them as Markdown image links:  or as clickable links: [View render](url). The URLs are relative paths like /renders/... that work in the browser."""
|
||||
RULES:
|
||||
1. NEVER ask the user for information you can look up yourself. Use your tools to find products, orders, and renders.
|
||||
2. Execute actions immediately without asking for confirmation.
|
||||
3. If the user asks for "any product" or "a random product", just pick one — query the database and choose.
|
||||
4. If the user asks to see a render, use find_product_renders first. If no render exists, offer to create one.
|
||||
5. When showing renders, use Markdown image syntax: . URLs are relative paths like /renders/...
|
||||
6. Combine multiple steps into one action. If creating an order, also submit and dispatch it automatically.
|
||||
7. Respond in the same language the user writes in.
|
||||
8. Be concise — short answers are better than long ones.
|
||||
9. When the user says "beliebig", "any", "random", "irgendein" — just pick one yourself, don't ask back."""
|
||||
|
||||
# ── Tool definitions (OpenAI function-calling schema) ────────────────────────
|
||||
|
||||
@@ -238,7 +245,7 @@ TOOLS = [
|
||||
"type": "function",
|
||||
"function": {
|
||||
"name": "find_product_renders",
|
||||
"description": "Find existing render images for a product. Returns URLs that can be shown to the user as clickable links or inline images. Use this when the user asks to SEE a product image, rendering, or thumbnail.",
|
||||
"description": "Find existing render images. Returns URLs that can be shown inline. Call with NO parameters to get any recent render. Use product_name or product_id to filter. Use transparent_only=true for alpha renders. Always use this FIRST when user asks to see an image.",
|
||||
"parameters": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
@@ -641,8 +648,7 @@ async def _tool_find_product_renders(
|
||||
elif product_name:
|
||||
conditions.append("p.name ILIKE :pname")
|
||||
params["pname"] = f"%{product_name}%"
|
||||
else:
|
||||
return json.dumps({"error": "Provide product_name or product_id"})
|
||||
# If neither provided, return any renders (for "show me any render" requests)
|
||||
|
||||
if transparent_only:
|
||||
conditions.append("ot.transparent_bg = true")
|
||||
|
||||
Reference in New Issue
Block a user