From fe3c651115b938afe0e626b028ad35e65a0646d6 Mon Sep 17 00:00:00 2001 From: chihlasm Date: Wed, 11 Mar 2026 22:56:40 -0400 Subject: [PATCH] fix: remove "Let AI Decide" option from KB Accelerator upload MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The uploader should know their content type — auto-detection adds complexity and currently just defaults to troubleshooting anyway. Co-Authored-By: Claude Opus 4.6 --- backend/app/api/endpoints/kb_accelerator.py | 8 ++++---- .../src/components/kb-accelerator/UploadScreen.tsx | 11 +++-------- frontend/src/pages/KBAcceleratorPage.tsx | 6 +++--- 3 files changed, 10 insertions(+), 15 deletions(-) diff --git a/backend/app/api/endpoints/kb_accelerator.py b/backend/app/api/endpoints/kb_accelerator.py index 058430b4..4544479b 100644 --- a/backend/app/api/endpoints/kb_accelerator.py +++ b/backend/app/api/endpoints/kb_accelerator.py @@ -288,11 +288,11 @@ async def upload_kb_article( else: raise HTTPException(status_code=400, detail="Provide either a file or content text.") - # Validate target_type - if target_type and target_type not in ("troubleshooting", "procedural"): - raise HTTPException(status_code=400, detail="target_type must be 'troubleshooting' or 'procedural'.") + # Validate target_type (required — frontend must specify) if not target_type: - target_type = "troubleshooting" # Default; Phase 2 adds "let AI decide" + target_type = "troubleshooting" + if target_type not in ("troubleshooting", "procedural"): + raise HTTPException(status_code=400, detail="target_type must be 'troubleshooting' or 'procedural'.") # Create KB import record kb_import = KBImport( diff --git a/frontend/src/components/kb-accelerator/UploadScreen.tsx b/frontend/src/components/kb-accelerator/UploadScreen.tsx index 339a77ce..a9b1c850 100644 --- a/frontend/src/components/kb-accelerator/UploadScreen.tsx +++ b/frontend/src/components/kb-accelerator/UploadScreen.tsx @@ -5,7 +5,7 @@ import { Textarea } from '@/components/ui/Textarea' import { Input } from '@/components/ui/Input' import type { KBQuotaResponse } from '@/types/kbAccelerator' -type TargetType = 'troubleshooting' | 'procedural' | 'auto' +type TargetType = 'troubleshooting' | 'procedural' interface UploadScreenProps { quota: KBQuotaResponse | null @@ -25,11 +25,6 @@ const TARGET_TYPES = [ label: 'Project Flow', description: 'Step-by-step procedure with warnings and variables', }, - { - value: 'auto' as const, - label: 'Let AI Decide', - description: 'AI will determine the best flow type from your content', - }, ] const FORMAT_LABELS: Record = { @@ -45,7 +40,7 @@ export function UploadScreen({ quota, onSubmitText, onSubmitFile, loading }: Upl const [mode, setMode] = useState<'paste' | 'file'>('paste') const [content, setContent] = useState('') const [title, setTitle] = useState('') - const [targetType, setTargetType] = useState('auto') + const [targetType, setTargetType] = useState('troubleshooting') const [file, setFile] = useState(null) const [dragOver, setDragOver] = useState(false) const fileInputRef = useRef(null) @@ -231,7 +226,7 @@ export function UploadScreen({ quota, onSubmitText, onSubmitFile, loading }: Upl

Target Flow Type

-
+
{TARGET_TYPES.map(t => (