creamy-zoo-29272
07/17/2025, 6:06 AMearly-cartoon-84199
07/17/2025, 6:53 AMearly-cartoon-84199
07/17/2025, 6:53 AMearly-cartoon-84199
07/17/2025, 6:54 AMcreamy-zoo-29272
07/17/2025, 7:17 AMprehistoric-airplane-85682
07/17/2025, 2:26 PMjs
const fileUrl = workflow.url[0] // Get the cleaned file URL
const knowledgeBaseId1 = '<your-kb-id>' // Assuming the KB1 knowledge base ID
const name = workflow.companyName
//Add the file to the knowledge base
const file = await client.uploadFile({
key: `${knowledgeBaseId1}/${name}.pdf`, // Each file needs a unique key under your bot
url: fileUrl, // This is the external URL where the file is currently located
contentType: 'application/pdf',
index: true,
tags: {
// Tags are optional but are useful for filtering files by a custom criteria you choose when using the "List Files" or "Search Files" API endpoints. You can change or remove the tags below based on your needs.
knowledgeBaseName: 'brand-pdfs',
source: 'knowledge-base',
kbId: knowledgeBaseId1,
title: workflow.companyName
},
})creamy-zoo-29272
07/18/2025, 6:08 AMcreamy-zoo-29272
07/18/2025, 10:01 AMprehistoric-airplane-85682
07/18/2025, 1:45 PM