@@ -198,15 +198,14 @@ export async function POST(req: NextRequest, { params }: { params: Promise<{ id:
198198 `[${ requestId } ] Starting controlled async processing of ${ createdDocuments . length } documents`
199199 )
200200
201- // Track bulk document upload
202201 try {
203- const { trackPlatformEvent } = await import ( '@/lib/core/telemetry' )
204- trackPlatformEvent ( 'platform.knowledge_base.documents_uploaded' , {
205- 'knowledge_base.id' : knowledgeBaseId ,
206- 'documents.count' : createdDocuments . length ,
207- 'documents.upload_type' : 'bulk' ,
208- 'processing.chunk_size' : validatedData . processingOptions . chunkSize ,
209- 'processing. recipe' : validatedData . processingOptions . recipe ,
202+ const { PlatformEvents } = await import ( '@/lib/core/telemetry' )
203+ PlatformEvents . knowledgeBaseDocumentsUploaded ( {
204+ knowledgeBaseId,
205+ documentsCount : createdDocuments . length ,
206+ uploadType : 'bulk' ,
207+ chunkSize : validatedData . processingOptions . chunkSize ,
208+ recipe : validatedData . processingOptions . recipe ,
210209 } )
211210 } catch ( _e ) {
212211 // Silently fail
@@ -262,15 +261,14 @@ export async function POST(req: NextRequest, { params }: { params: Promise<{ id:
262261 userId
263262 )
264263
265- // Track single document upload
266264 try {
267- const { trackPlatformEvent } = await import ( '@/lib/core/telemetry' )
268- trackPlatformEvent ( 'platform.knowledge_base.documents_uploaded' , {
269- 'knowledge_base.id' : knowledgeBaseId ,
270- 'documents.count' : 1 ,
271- 'documents.upload_type' : 'single' ,
272- 'document.mime_type' : validatedData . mimeType ,
273- 'document.file_size' : validatedData . fileSize ,
265+ const { PlatformEvents } = await import ( '@/lib/core/telemetry' )
266+ PlatformEvents . knowledgeBaseDocumentsUploaded ( {
267+ knowledgeBaseId,
268+ documentsCount : 1 ,
269+ uploadType : 'single' ,
270+ mimeType : validatedData . mimeType ,
271+ fileSize : validatedData . fileSize ,
274272 } )
275273 } catch ( _e ) {
276274 // Silently fail
0 commit comments