Skip to content

how to append multiple tags using JavaScript #682

Closed Answered by dluc
yonggang-xiao asked this question in 1. Q&A
Discussion options

You must be logged in to vote

this should work:

const axios = require("axios");
const fs = require("fs");
const FormData = require("form-data");

async function run() {
  const fileBuffer = await fs.promises.readFile("README.md");

  const formData = new FormData();
  formData.append("file1", fileBuffer, { filename: "README.md" });

  // setting the document ID, e.g. for updating an existing one
  formData.append("documentId", "doc01");

  // setting the index name
  formData.append("index", "default");

  // setting multiple tags
  formData.append("tags", "type:news");
  formData.append("tags", "year:2024");

  // overriding the list of steps to execute
  formData.append("steps", "extract,partition,gen_embeddings,sav…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by yonggang-xiao
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
1. Q&A
Labels
None yet
2 participants