mirror of
https://github.com/langflow-ai/langflow.git
synced 2026-07-24 18:31:48 +08:00
docs: cut version 1.9.0 (#12681)
* version-1.9.0-docs * [autofix.ci] apply automated fixes * [autofix.ci] apply automated fixes (attempt 2/3) --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
This commit is contained in:
@ -0,0 +1,19 @@
|
||||
const url = `${process.env.LANGFLOW_URL ?? ""}/api/v2/files`;
|
||||
|
||||
const options = {
|
||||
method: 'DELETE',
|
||||
headers: {
|
||||
"accept": `application/json`,
|
||||
"x-api-key": `${process.env.LANGFLOW_API_KEY ?? ""}`,
|
||||
},
|
||||
};
|
||||
|
||||
fetch(url, options)
|
||||
.then(async (response) => {
|
||||
if (!response.ok) {
|
||||
throw new Error(`HTTP ${response.status}`);
|
||||
}
|
||||
const text = await response.text();
|
||||
console.log(text);
|
||||
})
|
||||
.catch((error) => console.error(error));
|
||||
@ -0,0 +1,19 @@
|
||||
const url = `${process.env.LANGFLOW_URL ?? ""}/api/v1/files/delete/${process.env.FLOW_ID ?? ""}/2024-12-30_15-19-43_your_file.txt`;
|
||||
|
||||
const options = {
|
||||
method: 'DELETE',
|
||||
headers: {
|
||||
"accept": `application/json`,
|
||||
"x-api-key": `${process.env.LANGFLOW_API_KEY ?? ""}`,
|
||||
},
|
||||
};
|
||||
|
||||
fetch(url, options)
|
||||
.then(async (response) => {
|
||||
if (!response.ok) {
|
||||
throw new Error(`HTTP ${response.status}`);
|
||||
}
|
||||
const text = await response.text();
|
||||
console.log(text);
|
||||
})
|
||||
.catch((error) => console.error(error));
|
||||
@ -0,0 +1,19 @@
|
||||
const url = `${process.env.LANGFLOW_URL ?? ""}/api/v2/files/${process.env.FILE_ID ?? ""}`;
|
||||
|
||||
const options = {
|
||||
method: 'DELETE',
|
||||
headers: {
|
||||
"accept": `application/json`,
|
||||
"x-api-key": `${process.env.LANGFLOW_API_KEY ?? ""}`,
|
||||
},
|
||||
};
|
||||
|
||||
fetch(url, options)
|
||||
.then(async (response) => {
|
||||
if (!response.ok) {
|
||||
throw new Error(`HTTP ${response.status}`);
|
||||
}
|
||||
const text = await response.text();
|
||||
console.log(text);
|
||||
})
|
||||
.catch((error) => console.error(error));
|
||||
@ -0,0 +1,19 @@
|
||||
const url = `${process.env.LANGFLOW_URL ?? ""}/api/v1/files/download/${process.env.FLOW_ID ?? ""}/2024-12-30_15-19-43_your_file.txt`;
|
||||
|
||||
const options = {
|
||||
method: 'GET',
|
||||
headers: {
|
||||
"accept": `application/json`,
|
||||
"x-api-key": `${process.env.LANGFLOW_API_KEY ?? ""}`,
|
||||
},
|
||||
};
|
||||
|
||||
fetch(url, options)
|
||||
.then(async (response) => {
|
||||
if (!response.ok) {
|
||||
throw new Error(`HTTP ${response.status}`);
|
||||
}
|
||||
const data = await response.arrayBuffer();
|
||||
console.log("Received binary response for downloaded_file.txt", data.byteLength);
|
||||
})
|
||||
.catch((error) => console.error(error));
|
||||
@ -0,0 +1,19 @@
|
||||
const url = `${process.env.LANGFLOW_URL ?? ""}/api/v2/files/c7b22c4c-d5e0-4ec9-af97-5d85b7657a34`;
|
||||
|
||||
const options = {
|
||||
method: 'GET',
|
||||
headers: {
|
||||
"accept": `application/json`,
|
||||
"x-api-key": `${process.env.LANGFLOW_API_KEY ?? ""}`,
|
||||
},
|
||||
};
|
||||
|
||||
fetch(url, options)
|
||||
.then(async (response) => {
|
||||
if (!response.ok) {
|
||||
throw new Error(`HTTP ${response.status}`);
|
||||
}
|
||||
const data = await response.arrayBuffer();
|
||||
console.log("Received binary response for downloaded_file.txt", data.byteLength);
|
||||
})
|
||||
.catch((error) => console.error(error));
|
||||
@ -0,0 +1,19 @@
|
||||
const url = `${process.env.LANGFLOW_URL ?? ""}/api/v2/files/${process.env.FILE_ID ?? ""}?name=new_file_name`;
|
||||
|
||||
const options = {
|
||||
method: 'PUT',
|
||||
headers: {
|
||||
"accept": `application/json`,
|
||||
"x-api-key": `${process.env.LANGFLOW_API_KEY ?? ""}`,
|
||||
},
|
||||
};
|
||||
|
||||
fetch(url, options)
|
||||
.then(async (response) => {
|
||||
if (!response.ok) {
|
||||
throw new Error(`HTTP ${response.status}`);
|
||||
}
|
||||
const text = await response.text();
|
||||
console.log(text);
|
||||
})
|
||||
.catch((error) => console.error(error));
|
||||
@ -0,0 +1,19 @@
|
||||
const url = `${process.env.LANGFLOW_URL ?? ""}/api/v1/files/list/${process.env.FLOW_ID ?? ""}`;
|
||||
|
||||
const options = {
|
||||
method: 'GET',
|
||||
headers: {
|
||||
"accept": `application/json`,
|
||||
"x-api-key": `${process.env.LANGFLOW_API_KEY ?? ""}`,
|
||||
},
|
||||
};
|
||||
|
||||
fetch(url, options)
|
||||
.then(async (response) => {
|
||||
if (!response.ok) {
|
||||
throw new Error(`HTTP ${response.status}`);
|
||||
}
|
||||
const text = await response.text();
|
||||
console.log(text);
|
||||
})
|
||||
.catch((error) => console.error(error));
|
||||
@ -0,0 +1,19 @@
|
||||
const url = `${process.env.LANGFLOW_URL ?? ""}/api/v2/files`;
|
||||
|
||||
const options = {
|
||||
method: 'GET',
|
||||
headers: {
|
||||
"accept": `application/json`,
|
||||
"x-api-key": `${process.env.LANGFLOW_API_KEY ?? ""}`,
|
||||
},
|
||||
};
|
||||
|
||||
fetch(url, options)
|
||||
.then(async (response) => {
|
||||
if (!response.ok) {
|
||||
throw new Error(`HTTP ${response.status}`);
|
||||
}
|
||||
const text = await response.text();
|
||||
console.log(text);
|
||||
})
|
||||
.catch((error) => console.error(error));
|
||||
@ -0,0 +1,31 @@
|
||||
const url = `${process.env.LANGFLOW_URL ?? ""}/api/v1/run/${process.env.FLOW_ID ?? ""}`;
|
||||
|
||||
const options = {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
"Content-Type": `application/json`,
|
||||
"x-api-key": `${process.env.LANGFLOW_API_KEY ?? ""}`,
|
||||
},
|
||||
body: JSON.stringify({
|
||||
"input_value": "what do you see?",
|
||||
"output_type": "chat",
|
||||
"input_type": "text",
|
||||
"tweaks": {
|
||||
"Read-File-1olS3": {
|
||||
"path": [
|
||||
"07e5b864-e367-4f52-b647-a48035ae7e5e/3a290013-fe1e-4d3d-a454-cacae81288f3.pdf"
|
||||
]
|
||||
}
|
||||
}
|
||||
}),
|
||||
};
|
||||
|
||||
fetch(url, options)
|
||||
.then(async (response) => {
|
||||
if (!response.ok) {
|
||||
throw new Error(`HTTP ${response.status}`);
|
||||
}
|
||||
const text = await response.text();
|
||||
console.log(text);
|
||||
})
|
||||
.catch((error) => console.error(error));
|
||||
@ -0,0 +1,32 @@
|
||||
const fs = require("fs");
|
||||
const path = require("path");
|
||||
|
||||
const fixturesDir = path.join(__dirname, "../../fixtures");
|
||||
const defaultUpload = path.join(fixturesDir, "sample-upload.txt");
|
||||
const uploadPath = process.env.SAMPLE_UPLOAD_FILE || defaultUpload;
|
||||
const uploadBuf = fs.readFileSync(uploadPath);
|
||||
const uploadName = path.basename(uploadPath);
|
||||
|
||||
const url = `${process.env.LANGFLOW_URL ?? ""}/api/v2/files`;
|
||||
|
||||
const formData = new FormData();
|
||||
formData.append("file", new Blob([uploadBuf]), uploadName);
|
||||
|
||||
const options = {
|
||||
method: "POST",
|
||||
headers: {
|
||||
accept: "application/json",
|
||||
"x-api-key": `${process.env.LANGFLOW_API_KEY ?? ""}`,
|
||||
},
|
||||
body: formData,
|
||||
};
|
||||
|
||||
fetch(url, options)
|
||||
.then(async (response) => {
|
||||
if (!response.ok) {
|
||||
throw new Error(`HTTP ${response.status}`);
|
||||
}
|
||||
const text = await response.text();
|
||||
console.log(text);
|
||||
})
|
||||
.catch((error) => console.error(error));
|
||||
@ -0,0 +1,32 @@
|
||||
const fs = require("fs");
|
||||
const path = require("path");
|
||||
|
||||
const fixturesDir = path.join(__dirname, "../../fixtures");
|
||||
const defaultUpload = path.join(fixturesDir, "sample-upload.txt");
|
||||
const uploadPath = process.env.SAMPLE_UPLOAD_FILE || defaultUpload;
|
||||
const uploadBuf = fs.readFileSync(uploadPath);
|
||||
const uploadName = path.basename(uploadPath);
|
||||
|
||||
const url = `${process.env.LANGFLOW_URL ?? ""}/api/v1/files/upload/${process.env.FLOW_ID ?? ""}`;
|
||||
|
||||
const formData = new FormData();
|
||||
formData.append("file", new Blob([uploadBuf]), uploadName);
|
||||
|
||||
const options = {
|
||||
method: "POST",
|
||||
headers: {
|
||||
accept: "application/json",
|
||||
"x-api-key": `${process.env.LANGFLOW_API_KEY ?? ""}`,
|
||||
},
|
||||
body: formData,
|
||||
};
|
||||
|
||||
fetch(url, options)
|
||||
.then(async (response) => {
|
||||
if (!response.ok) {
|
||||
throw new Error(`HTTP ${response.status}`);
|
||||
}
|
||||
const text = await response.text();
|
||||
console.log(text);
|
||||
})
|
||||
.catch((error) => console.error(error));
|
||||
@ -0,0 +1,32 @@
|
||||
const fs = require("fs");
|
||||
const path = require("path");
|
||||
|
||||
const fixturesDir = path.join(__dirname, "../../fixtures");
|
||||
const defaultUpload = path.join(fixturesDir, "sample-upload.txt");
|
||||
const uploadPath = process.env.SAMPLE_UPLOAD_FILE || defaultUpload;
|
||||
const uploadBuf = fs.readFileSync(uploadPath);
|
||||
const uploadName = path.basename(uploadPath);
|
||||
|
||||
const url = `${process.env.LANGFLOW_URL ?? ""}/api/v2/files`;
|
||||
|
||||
const formData = new FormData();
|
||||
formData.append("file", new Blob([uploadBuf]), uploadName);
|
||||
|
||||
const options = {
|
||||
method: "POST",
|
||||
headers: {
|
||||
accept: "application/json",
|
||||
"x-api-key": `${process.env.LANGFLOW_API_KEY ?? ""}`,
|
||||
},
|
||||
body: formData,
|
||||
};
|
||||
|
||||
fetch(url, options)
|
||||
.then(async (response) => {
|
||||
if (!response.ok) {
|
||||
throw new Error(`HTTP ${response.status}`);
|
||||
}
|
||||
const text = await response.text();
|
||||
console.log(text);
|
||||
})
|
||||
.catch((error) => console.error(error));
|
||||
@ -0,0 +1,19 @@
|
||||
const url = `${process.env.LANGFLOW_URL ?? ""}/api/v1/users/whoami`;
|
||||
|
||||
const options = {
|
||||
method: 'GET',
|
||||
headers: {
|
||||
"accept": `application/json`,
|
||||
"x-api-key": `${process.env.LANGFLOW_API_KEY ?? ""}`,
|
||||
},
|
||||
};
|
||||
|
||||
fetch(url, options)
|
||||
.then(async (response) => {
|
||||
if (!response.ok) {
|
||||
throw new Error(`HTTP ${response.status}`);
|
||||
}
|
||||
const text = await response.text();
|
||||
console.log(text);
|
||||
})
|
||||
.catch((error) => console.error(error));
|
||||
@ -0,0 +1,29 @@
|
||||
const url = `${process.env.LANGFLOW_URL ?? ""}/api/v1/run/a430cc57-06bb-4c11-be39-d3d4de68d2c4?stream=false`;
|
||||
|
||||
const options = {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
"Content-Type": `application/json`,
|
||||
"x-api-key": `${process.env.LANGFLOW_API_KEY ?? ""}`,
|
||||
},
|
||||
body: JSON.stringify({
|
||||
"output_type": "chat",
|
||||
"input_type": "chat",
|
||||
"tweaks": {
|
||||
"ChatInput-b67sL": {
|
||||
"files": "a430cc57-06bb-4c11-be39-d3d4de68d2c4/2024-11-27_14-47-50_image-file.png",
|
||||
"input_value": "describe this image"
|
||||
}
|
||||
}
|
||||
}),
|
||||
};
|
||||
|
||||
fetch(url, options)
|
||||
.then(async (response) => {
|
||||
if (!response.ok) {
|
||||
throw new Error(`HTTP ${response.status}`);
|
||||
}
|
||||
const text = await response.text();
|
||||
console.log(text);
|
||||
})
|
||||
.catch((error) => console.error(error));
|
||||
@ -0,0 +1,31 @@
|
||||
const fs = require("fs");
|
||||
const path = require("path");
|
||||
|
||||
const fixturesDir = path.join(__dirname, "../../fixtures");
|
||||
const defaultImage = path.join(fixturesDir, "sample-upload.png");
|
||||
const imagePath = process.env.SAMPLE_IMAGE_FILE || defaultImage;
|
||||
const imageBuf = fs.readFileSync(imagePath);
|
||||
const imageName = path.basename(imagePath);
|
||||
|
||||
const url = `${process.env.LANGFLOW_URL ?? ""}/api/v1/files/upload/${process.env.FLOW_ID ?? ""}`;
|
||||
|
||||
const formData = new FormData();
|
||||
formData.append("file", new Blob([imageBuf]), imageName);
|
||||
|
||||
const options = {
|
||||
method: "POST",
|
||||
headers: {
|
||||
"x-api-key": `${process.env.LANGFLOW_API_KEY ?? ""}`,
|
||||
},
|
||||
body: formData,
|
||||
};
|
||||
|
||||
fetch(url, options)
|
||||
.then(async (response) => {
|
||||
if (!response.ok) {
|
||||
throw new Error(`HTTP ${response.status}`);
|
||||
}
|
||||
const text = await response.text();
|
||||
console.log(text);
|
||||
})
|
||||
.catch((error) => console.error(error));
|
||||
Reference in New Issue
Block a user