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 => (