Skip to content

Commit eb8995e

Browse files
authored
fix(kb): add base URL for kb fetches (#1701)
1 parent ce660e2 commit eb8995e

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

apps/sim/lib/knowledge/documents/document-processor.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -407,11 +407,16 @@ async function parseWithMistralOCR(fileUrl: string, filename: string, mimeType:
407407
try {
408408
const response = await retryWithExponentialBackoff(
409409
async () => {
410-
const url =
410+
let url =
411411
typeof mistralParserTool.request!.url === 'function'
412412
? mistralParserTool.request!.url(params)
413413
: mistralParserTool.request!.url
414414

415+
if (url.startsWith('/')) {
416+
const { getBaseUrl } = await import('@/lib/urls/utils')
417+
url = `${getBaseUrl()}${url}`
418+
}
419+
415420
const headers =
416421
typeof mistralParserTool.request!.headers === 'function'
417422
? mistralParserTool.request!.headers(params)

0 commit comments

Comments
 (0)