feat: enable Markdown (.md) file upload in KB Accelerator
Moved md from Phase 2 extensions to allowed formats, added extraction handler (reuses txt handler), and updated plan_limits defaults to include md for all plans. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -57,6 +57,7 @@ MAX_UPLOAD_SIZE = 10 * 1024 * 1024
|
||||
|
||||
ALLOWED_EXTENSIONS = {
|
||||
"txt": ["text/plain"],
|
||||
"md": ["text/markdown", "text/plain"],
|
||||
"docx": ["application/vnd.openxmlformats-officedocument.wordprocessingml.document"],
|
||||
}
|
||||
|
||||
@@ -64,7 +65,6 @@ ALLOWED_EXTENSIONS = {
|
||||
PHASE2_EXTENSIONS = {
|
||||
"pdf": ["application/pdf"],
|
||||
"html": ["text/html"],
|
||||
"md": ["text/markdown", "text/plain"],
|
||||
}
|
||||
|
||||
|
||||
@@ -110,7 +110,7 @@ async def _check_lifetime_limit(user: User, limits: PlanLimits, db: AsyncSession
|
||||
|
||||
|
||||
async def _check_format_allowed(source_format: str, limits: PlanLimits) -> None:
|
||||
allowed = limits.kb_allowed_formats or ["txt", "paste"]
|
||||
allowed = limits.kb_allowed_formats or ["txt", "paste", "md"]
|
||||
if source_format not in allowed:
|
||||
raise HTTPException(
|
||||
status_code=status.HTTP_403_FORBIDDEN,
|
||||
@@ -205,7 +205,7 @@ async def get_quota(
|
||||
kb_accelerator_enabled=False,
|
||||
lifetime_conversions_used=committed_count,
|
||||
lifetime_conversions_limit=0,
|
||||
allowed_formats=["txt", "paste"],
|
||||
allowed_formats=["txt", "paste", "md"],
|
||||
detailed_analysis=False,
|
||||
conversational_refinement=False,
|
||||
step_library_matching=False,
|
||||
|
||||
Reference in New Issue
Block a user