mirror of
https://github.com/langflow-ai/langflow.git
synced 2026-07-24 10:50:35 +08:00
docs: build OpenAPI spec and cut version 1.10 (#13537)
* build-api * bump-version-to-1.10 * fix-broken-links
This commit is contained in:
@ -0,0 +1,19 @@
|
||||
const url = `${process.env.LANGFLOW_URL ?? ""}/api/v1/build/123e4567-e89b-12d3-a456-426614174000/events`;
|
||||
|
||||
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/v1/build/123e4567-e89b-12d3-a456-426614174000/events?stream=false`;
|
||||
|
||||
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,25 @@
|
||||
const url = `${process.env.LANGFLOW_URL ?? ""}/api/v1/build/${process.env.FLOW_ID ?? ""}/flow`;
|
||||
|
||||
const options = {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
"accept": `application/json`,
|
||||
"Content-Type": `application/json`,
|
||||
"x-api-key": `${process.env.LANGFLOW_API_KEY ?? ""}`,
|
||||
},
|
||||
body: JSON.stringify({
|
||||
"inputs": {
|
||||
"input_value": "Tell me a story"
|
||||
}
|
||||
}),
|
||||
};
|
||||
|
||||
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,30 @@
|
||||
const url = `${process.env.LANGFLOW_URL ?? ""}/api/v1/build/${process.env.FLOW_ID ?? ""}/flow`;
|
||||
|
||||
const options = {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
"accept": `application/json`,
|
||||
"Content-Type": `application/json`,
|
||||
"x-api-key": `${process.env.LANGFLOW_API_KEY ?? ""}`,
|
||||
},
|
||||
body: JSON.stringify({
|
||||
"data": {
|
||||
"nodes": [],
|
||||
"edges": []
|
||||
},
|
||||
"inputs": {
|
||||
"input_value": "Your custom input here",
|
||||
"session": "session_id"
|
||||
}
|
||||
}),
|
||||
};
|
||||
|
||||
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,23 @@
|
||||
const url = `${process.env.LANGFLOW_URL ?? ""}/api/v1/build/${process.env.FLOW_ID ?? ""}/flow`;
|
||||
|
||||
const options = {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
"accept": `application/json`,
|
||||
"Content-Type": `application/json`,
|
||||
"x-api-key": `${process.env.LANGFLOW_API_KEY ?? ""}`,
|
||||
},
|
||||
body: JSON.stringify({
|
||||
"stop_component_id": "OpenAIModel-Uksag"
|
||||
}),
|
||||
};
|
||||
|
||||
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