Skip to content

Commit

Permalink
Last feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
PopDaph committed Mar 12, 2025
1 parent 1cba007 commit ff6c7bd
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions front/lib/api/files/upsert.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,14 +90,6 @@ const upsertSectionDocumentToDatasource: ProcessingFunction = async (
auth,
{ file, dataSource, upsertArgs }
) => {
if (upsertArgs) {
return new Err({
name: "dust_error",
code: "invalid_request_error",
message: "Upsert args are not allowed for section documents.",
});
}

// Get the content of the file.
const content = await getFileContent(auth, file);
if (!content) {
Expand Down Expand Up @@ -136,6 +128,7 @@ const upsertSectionDocumentToDatasource: ProcessingFunction = async (
`fileName:${file.fileName}`,
],
light_document_output: true,
...upsertArgs,
});

if (upsertDocumentRes.isErr()) {
Expand Down Expand Up @@ -467,7 +460,7 @@ export async function processAndUpsertToDataSource(
});
}

// When we upsert a file we don't want to be able to pass section in Upsert Args
// When we upsert a file we don't want to be able to pass section or text in Upsert Args
// We want to return an Error in the future but we start by logging the error to see if there are
// places that are using it and need to be updated. first
if (upsertArgs && ("section" in upsertArgs || "text" in upsertArgs)) {
Expand Down

0 comments on commit ff6c7bd

Please sign in to comment.