mirror of
https://github.com/langflow-ai/langflow.git
synced 2026-07-24 00:39:35 +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:
@ -19,14 +19,14 @@ repos:
|
||||
language: system
|
||||
types_or: [python, pyi]
|
||||
args: [--fix]
|
||||
exclude: ^docs/docs/API-Reference/python-examples/
|
||||
exclude: ^docs/.*/API-Reference/python-examples/
|
||||
- id: ruff-format
|
||||
name: ruff format
|
||||
entry: uv run ruff format
|
||||
language: system
|
||||
types_or: [python, pyi]
|
||||
args: [--config, pyproject.toml]
|
||||
exclude: ^docs/docs/API-Reference/python-examples/
|
||||
exclude: ^docs/.*/API-Reference/python-examples/
|
||||
- id: validate-migrations
|
||||
name: Validate Alembic Migrations (Expand-Contract)
|
||||
entry: python src/backend/base/langflow/alembic/migration_validator.py
|
||||
|
||||
@ -111,15 +111,19 @@ const config = {
|
||||
sidebarPath: require.resolve("./sidebars.js"), // Use sidebars.js file
|
||||
sidebarCollapsed: true,
|
||||
// Versioning configuration
|
||||
lastVersion: "1.8.0",
|
||||
lastVersion: "1.9.0",
|
||||
versions: {
|
||||
current: {
|
||||
label: "1.9.x (Next)",
|
||||
label: "1.10.x (Next)",
|
||||
path: "next",
|
||||
},
|
||||
"1.9.0": {
|
||||
label: "1.9.x",
|
||||
path: "",
|
||||
},
|
||||
"1.8.0": {
|
||||
label: "1.8.x",
|
||||
path: "",
|
||||
path: "1.8.0",
|
||||
},
|
||||
},
|
||||
beforeDefaultRemarkPlugins: [
|
||||
|
||||
@ -491,10 +491,6 @@ module.exports = {
|
||||
id: "API-Reference/api-flows-run",
|
||||
label: "Flow trigger endpoints",
|
||||
},
|
||||
"API-Reference/api-reference-api-examples",
|
||||
"API-Reference/typescript-client",
|
||||
"API-Reference/flow-devops-sdk",
|
||||
"API-Reference/api-flows-run",
|
||||
{
|
||||
type: "category",
|
||||
label: "Developer API (Beta)",
|
||||
|
||||
25
docs/versioned_docs/version-1.9.0/API-Reference/README.md
Normal file
25
docs/versioned_docs/version-1.9.0/API-Reference/README.md
Normal file
@ -0,0 +1,25 @@
|
||||
# API Examples (Local Test Harness)
|
||||
|
||||
Run all API example suites against a local Langflow server:
|
||||
|
||||
```bash
|
||||
make api_examples_local
|
||||
```
|
||||
|
||||
Run one test suite:
|
||||
|
||||
```bash
|
||||
make api_examples_local suites=python
|
||||
make api_examples_local suites=javascript
|
||||
make api_examples_local suites=curl
|
||||
```
|
||||
|
||||
The following examples are not executed in this harness:
|
||||
|
||||
- `api-build/build-flow-and-stream-events-2.py`
|
||||
- `api-build/build-flow-and-stream-events-3.py`
|
||||
- `api-flows-run/stream-llm-token-responses.py`
|
||||
- `api-openai-responses/example-streaming-request.py`
|
||||
- `api-logs/stream-logs.py`
|
||||
- `api-logs/retrieve-logs-with-optional-parameters.py`
|
||||
- `api-users/reset-password.py`
|
||||
198
docs/versioned_docs/version-1.9.0/API-Reference/api-build.mdx
Normal file
198
docs/versioned_docs/version-1.9.0/API-Reference/api-build.mdx
Normal file
@ -0,0 +1,198 @@
|
||||
---
|
||||
title: Build endpoints
|
||||
slug: /api-build
|
||||
---
|
||||
import CodeSnippet from '@site/src/components/CodeSnippet';
|
||||
import exampleApiBuildBuildFlowAndStreamEvents from '!!raw-loader!@site/docs/API-Reference/curl-examples/api-build/build-flow-and-stream-events.sh';
|
||||
import resultApiBuildResultBuildFlowAndStreamEvents from '!!raw-loader!@site/docs/API-Reference/curl-examples/api-build/result-build-flow-and-stream-events.json';
|
||||
import exampleApiBuildBuildFlowAndStreamEvents2 from '!!raw-loader!@site/docs/API-Reference/curl-examples/api-build/build-flow-and-stream-events-2.sh';
|
||||
import resultApiBuildResultBuildFlowAndStreamEvents2 from '!!raw-loader!@site/docs/API-Reference/curl-examples/api-build/result-build-flow-and-stream-events-2.json';
|
||||
import exampleApiBuildBuildFlowAndStreamEvents3 from '!!raw-loader!@site/docs/API-Reference/curl-examples/api-build/build-flow-and-stream-events-3.sh';
|
||||
import exampleApiBuildSetStartAndStopPoints from '!!raw-loader!@site/docs/API-Reference/curl-examples/api-build/set-start-and-stop-points.sh';
|
||||
import exampleApiBuildOverrideFlowParameters from '!!raw-loader!@site/docs/API-Reference/curl-examples/api-build/override-flow-parameters.sh';
|
||||
import resultApiBuildResultOverrideFlowParameters from '!!raw-loader!@site/docs/API-Reference/curl-examples/api-build/result-override-flow-parameters.json';
|
||||
import Tabs from '@theme/Tabs';
|
||||
import TabItem from '@theme/TabItem';
|
||||
import examplePythonApiBuildBuildFlowAndStreamEvents from '!!raw-loader!@site/docs/API-Reference/python-examples/api-build/build-flow-and-stream-events.py';
|
||||
import exampleJavascriptApiBuildBuildFlowAndStreamEvents from '!!raw-loader!@site/docs/API-Reference/javascript-examples/api-build/build-flow-and-stream-events.js';
|
||||
import examplePythonApiBuildBuildFlowAndStreamEvents2 from '!!raw-loader!@site/docs/API-Reference/python-examples/api-build/build-flow-and-stream-events-2.py';
|
||||
import exampleJavascriptApiBuildBuildFlowAndStreamEvents2 from '!!raw-loader!@site/docs/API-Reference/javascript-examples/api-build/build-flow-and-stream-events-2.js';
|
||||
import examplePythonApiBuildBuildFlowAndStreamEvents3 from '!!raw-loader!@site/docs/API-Reference/python-examples/api-build/build-flow-and-stream-events-3.py';
|
||||
import exampleJavascriptApiBuildBuildFlowAndStreamEvents3 from '!!raw-loader!@site/docs/API-Reference/javascript-examples/api-build/build-flow-and-stream-events-3.js';
|
||||
import examplePythonApiBuildSetStartAndStopPoints from '!!raw-loader!@site/docs/API-Reference/python-examples/api-build/set-start-and-stop-points.py';
|
||||
import exampleJavascriptApiBuildSetStartAndStopPoints from '!!raw-loader!@site/docs/API-Reference/javascript-examples/api-build/set-start-and-stop-points.js';
|
||||
import examplePythonApiBuildOverrideFlowParameters from '!!raw-loader!@site/docs/API-Reference/python-examples/api-build/override-flow-parameters.py';
|
||||
import exampleJavascriptApiBuildOverrideFlowParameters from '!!raw-loader!@site/docs/API-Reference/javascript-examples/api-build/override-flow-parameters.js';
|
||||
|
||||
|
||||
|
||||
:::info
|
||||
The `/build` endpoints are used by Langflow's frontend visual editor code.
|
||||
These endpoints are part of the internal Langflow codebase.
|
||||
|
||||
Don't use these endpoints to run flows in applications that use your Langflow flows.
|
||||
To run flows in your apps, see [Flow trigger endpoints](/api-flows-run).
|
||||
:::
|
||||
|
||||
The `/build` endpoints support Langflow's frontend code for building flows in the Langflow visual editor.
|
||||
You can use these endpoints to build vertices and flows, as well as execute flows with streaming event responses.
|
||||
You might need to use or understand these endpoints when contributing to the Langflow codebase.
|
||||
|
||||
## Build flow and stream events
|
||||
|
||||
This endpoint builds and executes a flow, returning a job ID that can be used to stream execution events.
|
||||
|
||||
1. Send a POST request to the `/build/$FLOW_ID/flow` endpoint:
|
||||
|
||||
<Tabs>
|
||||
<TabItem value="Python" label="Python" default>
|
||||
|
||||
<CodeSnippet source={examplePythonApiBuildBuildFlowAndStreamEvents} language="python" />
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="JavaScript" label="JavaScript">
|
||||
|
||||
<CodeSnippet source={exampleJavascriptApiBuildBuildFlowAndStreamEvents} language="javascript" />
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="curl" label="curl">
|
||||
|
||||
<CodeSnippet source={exampleApiBuildBuildFlowAndStreamEvents} language="bash" />
|
||||
|
||||
</TabItem>
|
||||
</Tabs>
|
||||
|
||||
<details>
|
||||
<summary>Result</summary>
|
||||
|
||||
<CodeSnippet source={resultApiBuildResultBuildFlowAndStreamEvents} language="json" />
|
||||
|
||||
</details>
|
||||
|
||||
2. After receiving a job ID from the build endpoint, use the `/build/$JOB_ID/events` endpoint to stream the execution results:
|
||||
|
||||
<Tabs>
|
||||
<TabItem value="Python" label="Python" default>
|
||||
|
||||
<CodeSnippet source={examplePythonApiBuildBuildFlowAndStreamEvents2} language="python" />
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="JavaScript" label="JavaScript">
|
||||
|
||||
<CodeSnippet source={exampleJavascriptApiBuildBuildFlowAndStreamEvents2} language="javascript" />
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="curl" label="curl">
|
||||
|
||||
<CodeSnippet source={exampleApiBuildBuildFlowAndStreamEvents2} language="bash" />
|
||||
|
||||
</TabItem>
|
||||
</Tabs>
|
||||
|
||||
<details>
|
||||
<summary>Result</summary>
|
||||
|
||||
<CodeSnippet source={resultApiBuildResultBuildFlowAndStreamEvents2} language="json" />
|
||||
|
||||
</details>
|
||||
|
||||
The `/build/$FLOW_ID/events` endpoint has a `stream` query parameter that defaults to `true`.
|
||||
To disable streaming and get all events at once, set `?stream=false`.
|
||||
|
||||
<Tabs>
|
||||
<TabItem value="Python" label="Python" default>
|
||||
|
||||
<CodeSnippet source={examplePythonApiBuildBuildFlowAndStreamEvents3} language="python" />
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="JavaScript" label="JavaScript">
|
||||
|
||||
<CodeSnippet source={exampleJavascriptApiBuildBuildFlowAndStreamEvents3} language="javascript" />
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="curl" label="curl">
|
||||
|
||||
<CodeSnippet source={exampleApiBuildBuildFlowAndStreamEvents3} language="bash" />
|
||||
|
||||
</TabItem>
|
||||
</Tabs>
|
||||
|
||||
## Build headers
|
||||
|
||||
| Header | Info | Example |
|
||||
|--------|------|---------|
|
||||
| Content-Type | Required. Specifies the JSON format. | "application/json" |
|
||||
| accept | Optional. Specifies the response format. | "application/json" |
|
||||
| x-api-key | Optional. Required only if authentication is enabled. | "sk-..." |
|
||||
|
||||
## Build parameters
|
||||
|
||||
| Parameter | Type | Description |
|
||||
|-----------|------|-------------|
|
||||
| inputs | object | Optional. Input values for flow components. |
|
||||
| data | object | Optional. Flow data to override stored configuration. |
|
||||
| files | array[string] | Optional. List of file paths to use. |
|
||||
| start_component_id | string | Optional. ID of the component where the execution should start. Component `id` values can be found in [Langflow JSON files](/concepts-flows-import#langflow-json-file-contents) |
|
||||
| stop_component_id | string | Optional. ID of the component where the execution should stop. Component `id` values can be found in [Langflow JSON files](/concepts-flows-import#langflow-json-file-contents).|
|
||||
| log_builds | Boolean | Whether to record build logs. Default: Enabled (`true`). |
|
||||
|
||||
### Set start and stop points
|
||||
|
||||
The `/build` endpoint accepts optional values for `start_component_id` and `stop_component_id` to control where the flow run starts and stops.
|
||||
Setting `stop_component_id` for a component triggers the same behavior as clicking **Run component** on that component in the visual editor: The specified component and all dependent components leading up to that component will run.
|
||||
|
||||
The following example stops flow execution at an **OpenAI** component:
|
||||
|
||||
<Tabs>
|
||||
<TabItem value="Python" label="Python" default>
|
||||
|
||||
<CodeSnippet source={examplePythonApiBuildSetStartAndStopPoints} language="python" />
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="JavaScript" label="JavaScript">
|
||||
|
||||
<CodeSnippet source={exampleJavascriptApiBuildSetStartAndStopPoints} language="javascript" />
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="curl" label="curl">
|
||||
|
||||
<CodeSnippet source={exampleApiBuildSetStartAndStopPoints} language="bash" />
|
||||
|
||||
</TabItem>
|
||||
</Tabs>
|
||||
|
||||
### Override flow parameters
|
||||
|
||||
The `/build` endpoint also accepts inputs for `data` directly, instead of using the values stored in the Langflow database.
|
||||
This is useful for running flows without having to pass custom values through the visual editor.
|
||||
|
||||
<Tabs>
|
||||
<TabItem value="Python" label="Python" default>
|
||||
|
||||
<CodeSnippet source={examplePythonApiBuildOverrideFlowParameters} language="python" />
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="JavaScript" label="JavaScript">
|
||||
|
||||
<CodeSnippet source={exampleJavascriptApiBuildOverrideFlowParameters} language="javascript" />
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="curl" label="curl">
|
||||
|
||||
<CodeSnippet source={exampleApiBuildOverrideFlowParameters} language="bash" />
|
||||
|
||||
</TabItem>
|
||||
</Tabs>
|
||||
|
||||
<details>
|
||||
<summary>Result</summary>
|
||||
|
||||
<CodeSnippet source={resultApiBuildResultOverrideFlowParameters} language="json" />
|
||||
|
||||
</details>
|
||||
|
||||
## See also
|
||||
|
||||
- [Get Vertex builds](/api-monitor#get-vertex-builds)
|
||||
- [Delete Vertex builds](/api-monitor#delete-vertex-builds)
|
||||
- [Session ID](/session-id)
|
||||
576
docs/versioned_docs/version-1.9.0/API-Reference/api-files.mdx
Normal file
576
docs/versioned_docs/version-1.9.0/API-Reference/api-files.mdx
Normal file
@ -0,0 +1,576 @@
|
||||
---
|
||||
title: Files endpoints
|
||||
slug: /api-files
|
||||
---
|
||||
import CodeSnippet from '@site/src/components/CodeSnippet';
|
||||
import exampleApiFilesUploadFileV1 from '!!raw-loader!@site/docs/API-Reference/curl-examples/api-files/upload-file-v1.sh';
|
||||
import resultApiFilesResultUploadFileV1 from '!!raw-loader!@site/docs/API-Reference/curl-examples/api-files/result-upload-file-v1.json';
|
||||
import exampleApiFilesUploadImageFilesV1 from '!!raw-loader!@site/docs/API-Reference/curl-examples/api-files/upload-image-files-v1.sh';
|
||||
import exampleApiFilesUploadImageFilesV12 from '!!raw-loader!@site/docs/API-Reference/curl-examples/api-files/upload-image-files-v1-2.sh';
|
||||
import exampleApiFilesListFilesV1 from '!!raw-loader!@site/docs/API-Reference/curl-examples/api-files/list-files-v1.sh';
|
||||
import resultApiFilesResultListFilesV1 from '!!raw-loader!@site/docs/API-Reference/curl-examples/api-files/result-list-files-v1.json';
|
||||
import exampleApiFilesDownloadFileV1 from '!!raw-loader!@site/docs/API-Reference/curl-examples/api-files/download-file-v1.sh';
|
||||
import resultApiFilesResultDownloadFileV1 from '!!raw-loader!@site/docs/API-Reference/curl-examples/api-files/result-download-file-v1.txt';
|
||||
import exampleApiFilesDeleteFileV1 from '!!raw-loader!@site/docs/API-Reference/curl-examples/api-files/delete-file-v1.sh';
|
||||
import resultApiFilesResultDeleteFileV1 from '!!raw-loader!@site/docs/API-Reference/curl-examples/api-files/result-delete-file-v1.json';
|
||||
import exampleApiFilesUploadFileV2 from '!!raw-loader!@site/docs/API-Reference/curl-examples/api-files/upload-file-v2.sh';
|
||||
import resultApiFilesResultUploadFileV2 from '!!raw-loader!@site/docs/API-Reference/curl-examples/api-files/result-upload-file-v2.txt';
|
||||
import exampleApiFilesUploadFileV22 from '!!raw-loader!@site/docs/API-Reference/curl-examples/api-files/upload-file-v2-2.sh';
|
||||
import exampleApiFilesSendFilesToYourFlowsV2 from '!!raw-loader!@site/docs/API-Reference/curl-examples/api-files/send-files-to-your-flows-v2.sh';
|
||||
import exampleApiFilesSendFilesToYourFlowsV22 from '!!raw-loader!@site/docs/API-Reference/curl-examples/api-files/send-files-to-your-flows-v2-2.sh';
|
||||
import exampleApiFilesListFilesV2 from '!!raw-loader!@site/docs/API-Reference/curl-examples/api-files/list-files-v2.sh';
|
||||
import resultApiFilesResultListFilesV2 from '!!raw-loader!@site/docs/API-Reference/curl-examples/api-files/result-list-files-v2.json';
|
||||
import exampleApiFilesDownloadFileV2 from '!!raw-loader!@site/docs/API-Reference/curl-examples/api-files/download-file-v2.sh';
|
||||
import resultApiFilesResultDownloadFileV2 from '!!raw-loader!@site/docs/API-Reference/curl-examples/api-files/result-download-file-v2.txt';
|
||||
import exampleApiFilesEditFileNameV2 from '!!raw-loader!@site/docs/API-Reference/curl-examples/api-files/edit-file-name-v2.sh';
|
||||
import resultApiFilesResultEditFileNameV2 from '!!raw-loader!@site/docs/API-Reference/curl-examples/api-files/result-edit-file-name-v2.json';
|
||||
import exampleApiFilesDeleteFileV2 from '!!raw-loader!@site/docs/API-Reference/curl-examples/api-files/delete-file-v2.sh';
|
||||
import resultApiFilesResultDeleteFileV2 from '!!raw-loader!@site/docs/API-Reference/curl-examples/api-files/result-delete-file-v2.json';
|
||||
import exampleApiFilesDeleteAllFilesV2 from '!!raw-loader!@site/docs/API-Reference/curl-examples/api-files/delete-all-files-v2.sh';
|
||||
import resultApiFilesResultDeleteAllFilesV2 from '!!raw-loader!@site/docs/API-Reference/curl-examples/api-files/result-delete-all-files-v2.json';
|
||||
import Tabs from '@theme/Tabs';
|
||||
import TabItem from '@theme/TabItem';
|
||||
import examplePythonApiFilesUploadFileV1 from '!!raw-loader!@site/docs/API-Reference/python-examples/api-files/upload-file-v1.py';
|
||||
import exampleJavascriptApiFilesUploadFileV1 from '!!raw-loader!@site/docs/API-Reference/javascript-examples/api-files/upload-file-v1.js';
|
||||
import examplePythonApiFilesUploadImageFilesV1 from '!!raw-loader!@site/docs/API-Reference/python-examples/api-files/upload-image-files-v1.py';
|
||||
import exampleJavascriptApiFilesUploadImageFilesV1 from '!!raw-loader!@site/docs/API-Reference/javascript-examples/api-files/upload-image-files-v1.js';
|
||||
import examplePythonApiFilesUploadImageFilesV12 from '!!raw-loader!@site/docs/API-Reference/python-examples/api-files/upload-image-files-v1-2.py';
|
||||
import exampleJavascriptApiFilesUploadImageFilesV12 from '!!raw-loader!@site/docs/API-Reference/javascript-examples/api-files/upload-image-files-v1-2.js';
|
||||
import examplePythonApiFilesListFilesV1 from '!!raw-loader!@site/docs/API-Reference/python-examples/api-files/list-files-v1.py';
|
||||
import exampleJavascriptApiFilesListFilesV1 from '!!raw-loader!@site/docs/API-Reference/javascript-examples/api-files/list-files-v1.js';
|
||||
import examplePythonApiFilesDownloadFileV1 from '!!raw-loader!@site/docs/API-Reference/python-examples/api-files/download-file-v1.py';
|
||||
import exampleJavascriptApiFilesDownloadFileV1 from '!!raw-loader!@site/docs/API-Reference/javascript-examples/api-files/download-file-v1.js';
|
||||
import examplePythonApiFilesDeleteFileV1 from '!!raw-loader!@site/docs/API-Reference/python-examples/api-files/delete-file-v1.py';
|
||||
import exampleJavascriptApiFilesDeleteFileV1 from '!!raw-loader!@site/docs/API-Reference/javascript-examples/api-files/delete-file-v1.js';
|
||||
import examplePythonApiFilesUploadFileV2 from '!!raw-loader!@site/docs/API-Reference/python-examples/api-files/upload-file-v2.py';
|
||||
import exampleJavascriptApiFilesUploadFileV2 from '!!raw-loader!@site/docs/API-Reference/javascript-examples/api-files/upload-file-v2.js';
|
||||
import examplePythonApiFilesUploadFileV22 from '!!raw-loader!@site/docs/API-Reference/python-examples/api-files/upload-file-v2-2.py';
|
||||
import exampleJavascriptApiFilesUploadFileV22 from '!!raw-loader!@site/docs/API-Reference/javascript-examples/api-files/upload-file-v2-2.js';
|
||||
import examplePythonApiFilesSendFilesToYourFlowsV2 from '!!raw-loader!@site/docs/API-Reference/python-examples/api-files/send-files-to-your-flows-v2.py';
|
||||
import exampleJavascriptApiFilesSendFilesToYourFlowsV2 from '!!raw-loader!@site/docs/API-Reference/javascript-examples/api-files/send-files-to-your-flows-v2.js';
|
||||
import examplePythonApiFilesSendFilesToYourFlowsV22 from '!!raw-loader!@site/docs/API-Reference/python-examples/api-files/send-files-to-your-flows-v2-2.py';
|
||||
import exampleJavascriptApiFilesSendFilesToYourFlowsV22 from '!!raw-loader!@site/docs/API-Reference/javascript-examples/api-files/send-files-to-your-flows-v2-2.js';
|
||||
import examplePythonApiFilesListFilesV2 from '!!raw-loader!@site/docs/API-Reference/python-examples/api-files/list-files-v2.py';
|
||||
import exampleJavascriptApiFilesListFilesV2 from '!!raw-loader!@site/docs/API-Reference/javascript-examples/api-files/list-files-v2.js';
|
||||
import examplePythonApiFilesDownloadFileV2 from '!!raw-loader!@site/docs/API-Reference/python-examples/api-files/download-file-v2.py';
|
||||
import exampleJavascriptApiFilesDownloadFileV2 from '!!raw-loader!@site/docs/API-Reference/javascript-examples/api-files/download-file-v2.js';
|
||||
import examplePythonApiFilesEditFileNameV2 from '!!raw-loader!@site/docs/API-Reference/python-examples/api-files/edit-file-name-v2.py';
|
||||
import exampleJavascriptApiFilesEditFileNameV2 from '!!raw-loader!@site/docs/API-Reference/javascript-examples/api-files/edit-file-name-v2.js';
|
||||
import examplePythonApiFilesDeleteFileV2 from '!!raw-loader!@site/docs/API-Reference/python-examples/api-files/delete-file-v2.py';
|
||||
import exampleJavascriptApiFilesDeleteFileV2 from '!!raw-loader!@site/docs/API-Reference/javascript-examples/api-files/delete-file-v2.js';
|
||||
import examplePythonApiFilesDeleteAllFilesV2 from '!!raw-loader!@site/docs/API-Reference/python-examples/api-files/delete-all-files-v2.py';
|
||||
import exampleJavascriptApiFilesDeleteAllFilesV2 from '!!raw-loader!@site/docs/API-Reference/javascript-examples/api-files/delete-all-files-v2.js';
|
||||
|
||||
|
||||
|
||||
Use the `/files` endpoints to move files between your local machine and Langflow.
|
||||
|
||||
All `/files` endpoints (both `/v1/files` and `/v2/files`) require authentication with a Langflow API key.
|
||||
You can only access files that belong to your own user account, even as a superuser.
|
||||
|
||||
## Differences between `/v1/files` and `/v2/files`
|
||||
|
||||
There are two versions of the `/files` endpoints.
|
||||
|
||||
`/v2/files` offers the following improvements over `/v1/files`:
|
||||
|
||||
- `/v2` files are organized by `user_id` instead of `flow_id`.
|
||||
This means files are owned by users, and they aren't attached to specific flows.
|
||||
You can upload a file to Langflow one time, and use it with multiple flows.
|
||||
- `/v2` files are tracked in the Langflow database.
|
||||
- `/v2` supports bulk upload and delete.
|
||||
- `/v2` responses contain more descriptive metadata.
|
||||
|
||||
However, `/v2/files` doesn't support image files.
|
||||
To send image files to your flows through the API, use [Upload image files (v1)](#upload-image-files-v1).
|
||||
|
||||
## Files/V1 endpoints
|
||||
|
||||
Use the `/files` endpoints to move files between your local machine and Langflow.
|
||||
|
||||
### Upload file (v1)
|
||||
|
||||
Upload a file to the `v1/files/upload/$FLOW_ID` endpoint:
|
||||
Replace **FILE_NAME** with the uploaded file name.
|
||||
|
||||
<Tabs>
|
||||
<TabItem value="Python" label="Python" default>
|
||||
|
||||
<CodeSnippet source={examplePythonApiFilesUploadFileV1} language="python" />
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="JavaScript" label="JavaScript">
|
||||
|
||||
<CodeSnippet source={exampleJavascriptApiFilesUploadFileV1} language="javascript" />
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="curl" label="curl">
|
||||
|
||||
<CodeSnippet source={exampleApiFilesUploadFileV1} language="bash" />
|
||||
|
||||
</TabItem>
|
||||
</Tabs>
|
||||
|
||||
Replace `FILE_NAME.txt` with the name and extension of the file you want to upload.
|
||||
Not all file types are supported.
|
||||
|
||||
<details>
|
||||
<summary>Result</summary>
|
||||
|
||||
<CodeSnippet source={resultApiFilesResultUploadFileV1} language="json" />
|
||||
|
||||
</details>
|
||||
|
||||
### Upload image files (v1)
|
||||
|
||||
Send image files to Langflow to use them in flows.
|
||||
|
||||
The default file limit is 1024 MB.
|
||||
To change this limit, set the `LANGFLOW_MAX_FILE_SIZE_UPLOAD` [environment variable](/environment-variables).
|
||||
|
||||
1. Attach the image to a `POST /v1/files/upload/$FLOW_ID` request with `--form` (`-F`) and the file path:
|
||||
|
||||
<Tabs>
|
||||
<TabItem value="Python" label="Python" default>
|
||||
|
||||
<CodeSnippet source={examplePythonApiFilesUploadImageFilesV1} language="python" />
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="JavaScript" label="JavaScript">
|
||||
|
||||
<CodeSnippet source={exampleJavascriptApiFilesUploadImageFilesV1} language="javascript" />
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="curl" label="curl">
|
||||
|
||||
<CodeSnippet source={exampleApiFilesUploadImageFilesV1} language="bash" />
|
||||
|
||||
</TabItem>
|
||||
</Tabs>
|
||||
|
||||
A successful request returns the `file_path` for the image in the Langflow file management system in the format `FLOW_ID/TIMESTAMP_FILENAME.TYPE`.
|
||||
For example:
|
||||
|
||||
```json
|
||||
{
|
||||
"flowId": "a430cc57-06bb-4c11-be39-d3d4de68d2c4",
|
||||
"file_path": "a430cc57-06bb-4c11-be39-d3d4de68d2c4/2024-11-27_14-47-50_image-file.png"
|
||||
}
|
||||
```
|
||||
|
||||
2. Use the returned `file_path` to send the image file to other components that can accept file input. Where you specify the file path depends on the component type.
|
||||
|
||||
The following example runs the **Basic Prompting** template flow, passing the image file and the query `describe this image` as input for the **Chat Input** component.
|
||||
In this case, the file path is specified in `tweaks`.
|
||||
|
||||
<Tabs>
|
||||
<TabItem value="Python" label="Python" default>
|
||||
|
||||
<CodeSnippet source={examplePythonApiFilesUploadImageFilesV12} language="python" />
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="JavaScript" label="JavaScript">
|
||||
|
||||
<CodeSnippet source={exampleJavascriptApiFilesUploadImageFilesV12} language="javascript" />
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="curl" label="curl">
|
||||
|
||||
<CodeSnippet source={exampleApiFilesUploadImageFilesV12} language="bash" />
|
||||
|
||||
</TabItem>
|
||||
</Tabs>
|
||||
|
||||
:::tip
|
||||
For help with tweaks, use the **Input Schema** in a flow's [**API access** pane](/concepts-publish#api-access).
|
||||
Setting tweaks with **Input Schema** also automatically populates the required component IDs.
|
||||
:::
|
||||
|
||||
### List files (v1)
|
||||
|
||||
List all files associated with a specific flow.
|
||||
|
||||
<Tabs>
|
||||
<TabItem value="Python" label="Python" default>
|
||||
|
||||
<CodeSnippet source={examplePythonApiFilesListFilesV1} language="python" />
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="JavaScript" label="JavaScript">
|
||||
|
||||
<CodeSnippet source={exampleJavascriptApiFilesListFilesV1} language="javascript" />
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="curl" label="curl">
|
||||
|
||||
<CodeSnippet source={exampleApiFilesListFilesV1} language="bash" />
|
||||
|
||||
</TabItem>
|
||||
</Tabs>
|
||||
|
||||
<details>
|
||||
<summary>Result</summary>
|
||||
|
||||
<CodeSnippet source={resultApiFilesResultListFilesV1} language="json" />
|
||||
|
||||
</details>
|
||||
|
||||
### Download file (v1)
|
||||
|
||||
Download a specific file from a flow.
|
||||
|
||||
<Tabs>
|
||||
<TabItem value="Python" label="Python" default>
|
||||
|
||||
<CodeSnippet source={examplePythonApiFilesDownloadFileV1} language="python" />
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="JavaScript" label="JavaScript">
|
||||
|
||||
<CodeSnippet source={exampleJavascriptApiFilesDownloadFileV1} language="javascript" />
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="curl" label="curl">
|
||||
|
||||
<CodeSnippet source={exampleApiFilesDownloadFileV1} language="bash" />
|
||||
|
||||
</TabItem>
|
||||
</Tabs>
|
||||
|
||||
<details>
|
||||
<summary>Result</summary>
|
||||
|
||||
<CodeSnippet source={resultApiFilesResultDownloadFileV1} language="text" />
|
||||
|
||||
</details>
|
||||
|
||||
### Delete file (v1)
|
||||
|
||||
Delete a specific file from a flow.
|
||||
|
||||
<Tabs>
|
||||
<TabItem value="Python" label="Python" default>
|
||||
|
||||
<CodeSnippet source={examplePythonApiFilesDeleteFileV1} language="python" />
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="JavaScript" label="JavaScript">
|
||||
|
||||
<CodeSnippet source={exampleJavascriptApiFilesDeleteFileV1} language="javascript" />
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="curl" label="curl">
|
||||
|
||||
<CodeSnippet source={exampleApiFilesDeleteFileV1} language="bash" />
|
||||
|
||||
</TabItem>
|
||||
</Tabs>
|
||||
|
||||
<details>
|
||||
<summary>Result</summary>
|
||||
|
||||
<CodeSnippet source={resultApiFilesResultDeleteFileV1} language="json" />
|
||||
|
||||
</details>
|
||||
|
||||
## Files/V2 endpoints
|
||||
|
||||
Use the `/files` endpoints to move files between your local machine and Langflow.
|
||||
|
||||
The `/v2/files` endpoints can be authenticated by an API key or JWT.
|
||||
To create a Langflow API key and export it as an environment variable, see [Get started with the Langflow API](/api-reference-api-examples).
|
||||
|
||||
### Upload file (v2)
|
||||
|
||||
Upload a file to your user account. The file can be used across multiple flows.
|
||||
|
||||
The file is uploaded in the format `USER_ID/FILE_ID.FILE_EXTENSION`, such as `07e5b864-e367-4f52-b647-a48035ae7e5e/d44dc2e1-9ae9-4cf6-9114-8d34a6126c94.pdf`.
|
||||
|
||||
1. To retrieve your current `user_id`, call the `/whoami` endpoint:
|
||||
|
||||
<Tabs>
|
||||
<TabItem value="Python" label="Python" default>
|
||||
|
||||
<CodeSnippet source={examplePythonApiFilesUploadFileV2} language="python" />
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="JavaScript" label="JavaScript">
|
||||
|
||||
<CodeSnippet source={exampleJavascriptApiFilesUploadFileV2} language="javascript" />
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="curl" label="curl">
|
||||
|
||||
<CodeSnippet source={exampleApiFilesUploadFileV2} language="bash" />
|
||||
|
||||
</TabItem>
|
||||
</Tabs>
|
||||
|
||||
<details>
|
||||
<summary>Result</summary>
|
||||
|
||||
<CodeSnippet source={resultApiFilesResultUploadFileV2} language="text" />
|
||||
|
||||
</details>
|
||||
|
||||
2. In the POST request to `v2/files`, replace **@FILE_NAME.EXTENSION** with the uploaded file name and its extension.
|
||||
You must include the ampersand (`@`) in the request to instruct curl to upload the contents of the file, not the string `FILE_NAME.EXTENSION`.
|
||||
|
||||
<Tabs>
|
||||
<TabItem value="Python" label="Python" default>
|
||||
|
||||
<CodeSnippet source={examplePythonApiFilesUploadFileV22} language="python" />
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="JavaScript" label="JavaScript">
|
||||
|
||||
<CodeSnippet source={exampleJavascriptApiFilesUploadFileV22} language="javascript" />
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="curl" label="curl">
|
||||
|
||||
<CodeSnippet source={exampleApiFilesUploadFileV22} language="bash" />
|
||||
|
||||
</TabItem>
|
||||
</Tabs>
|
||||
|
||||
The file is uploaded in the format `USER_ID/FILE_ID.FILE_EXTENSION`, and the API returns metadata about the uploaded file:
|
||||
|
||||
```json
|
||||
{
|
||||
"id":"d44dc2e1-9ae9-4cf6-9114-8d34a6126c94",
|
||||
"name":"engine_manual",
|
||||
"path":"07e5b864-e367-4f52-b647-a48035ae7e5e/d44dc2e1-9ae9-4cf6-9114-8d34a6126c94.pdf",
|
||||
"size":851160,
|
||||
"provider":null
|
||||
}
|
||||
```
|
||||
|
||||
### Send files to your flows (v2)
|
||||
|
||||
:::info
|
||||
The `/v2/files` endpoint can't send image files to flows.
|
||||
To send image files to your flows through the API, see [Upload image files (v1)](#upload-image-files-v1).
|
||||
:::
|
||||
|
||||
This endpoint uploads files to your Langflow server's file management system.
|
||||
To use an uploaded file in a flow, send the file path to a flow with a [**Read File** component](/read-file).
|
||||
|
||||
The default file limit is 1024 MB. To configure this value, change the `LANGFLOW_MAX_FILE_SIZE_UPLOAD` [environment variable](/environment-variables).
|
||||
|
||||
1. To send a file to your flow with the API, POST the file to the `/api/v2/files` endpoint.
|
||||
|
||||
Replace **FILE_NAME.EXTENSION** with the name and extension of the file you want to upload.
|
||||
This is the same step described in [Upload file (v2)](#upload-file-v2), but since you need the filename to upload to your flow, it is included here.
|
||||
|
||||
<Tabs>
|
||||
<TabItem value="Python" label="Python" default>
|
||||
|
||||
<CodeSnippet source={examplePythonApiFilesSendFilesToYourFlowsV2} language="python" />
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="JavaScript" label="JavaScript">
|
||||
|
||||
<CodeSnippet source={exampleJavascriptApiFilesSendFilesToYourFlowsV2} language="javascript" />
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="curl" label="curl">
|
||||
|
||||
<CodeSnippet source={exampleApiFilesSendFilesToYourFlowsV2} language="bash" />
|
||||
|
||||
</TabItem>
|
||||
</Tabs>
|
||||
|
||||
The file is uploaded in the format `USER_ID/FILE_ID.FILE_EXTENSION`, and the API returns metadata about the uploaded file:
|
||||
|
||||
```json
|
||||
{
|
||||
"id":"d44dc2e1-9ae9-4cf6-9114-8d34a6126c94",
|
||||
"name":"engine_manual",
|
||||
"path":"07e5b864-e367-4f52-b647-a48035ae7e5e/d44dc2e1-9ae9-4cf6-9114-8d34a6126c94.pdf",
|
||||
"size":851160,
|
||||
"provider": null
|
||||
}
|
||||
```
|
||||
|
||||
2. To use this file in your flow, add a **Read File** component to your flow.
|
||||
This component loads files into flows from your local machine or Langflow file management.
|
||||
|
||||
3. Run the flow, passing the `path` to the `Read-File` component in the `tweaks` object:
|
||||
|
||||
<Tabs>
|
||||
<TabItem value="Python" label="Python" default>
|
||||
|
||||
<CodeSnippet source={examplePythonApiFilesSendFilesToYourFlowsV22} language="python" />
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="JavaScript" label="JavaScript">
|
||||
|
||||
<CodeSnippet source={exampleJavascriptApiFilesSendFilesToYourFlowsV22} language="javascript" />
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="curl" label="curl">
|
||||
|
||||
<CodeSnippet source={exampleApiFilesSendFilesToYourFlowsV22} language="bash" />
|
||||
|
||||
</TabItem>
|
||||
</Tabs>
|
||||
|
||||
To get the `Read-File` component's ID, call the [Read flow](/api-flows#read-flow) endpoint or inspect the component in the visual editor.
|
||||
|
||||
If the file path is valid, the flow runs successfully.
|
||||
|
||||
### List files (v2)
|
||||
|
||||
List all files associated with your user account.
|
||||
|
||||
<Tabs>
|
||||
<TabItem value="Python" label="Python" default>
|
||||
|
||||
<CodeSnippet source={examplePythonApiFilesListFilesV2} language="python" />
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="JavaScript" label="JavaScript">
|
||||
|
||||
<CodeSnippet source={exampleJavascriptApiFilesListFilesV2} language="javascript" />
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="curl" label="curl">
|
||||
|
||||
<CodeSnippet source={exampleApiFilesListFilesV2} language="bash" />
|
||||
|
||||
</TabItem>
|
||||
</Tabs>
|
||||
|
||||
<details>
|
||||
<summary>Result</summary>
|
||||
|
||||
<CodeSnippet source={resultApiFilesResultListFilesV2} language="json" />
|
||||
|
||||
</details>
|
||||
|
||||
### Download file (v2)
|
||||
|
||||
Download a specific file by its ID and file extension.
|
||||
|
||||
You must specify the file type you expect in the `--output` value.
|
||||
|
||||
<Tabs>
|
||||
<TabItem value="Python" label="Python" default>
|
||||
|
||||
<CodeSnippet source={examplePythonApiFilesDownloadFileV2} language="python" />
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="JavaScript" label="JavaScript">
|
||||
|
||||
<CodeSnippet source={exampleJavascriptApiFilesDownloadFileV2} language="javascript" />
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="curl" label="curl">
|
||||
|
||||
<CodeSnippet source={exampleApiFilesDownloadFileV2} language="bash" />
|
||||
|
||||
</TabItem>
|
||||
</Tabs>
|
||||
|
||||
<details>
|
||||
<summary>Result</summary>
|
||||
|
||||
<CodeSnippet source={resultApiFilesResultDownloadFileV2} language="text" />
|
||||
|
||||
</details>
|
||||
|
||||
### Edit file name (v2)
|
||||
|
||||
Change a file name.
|
||||
|
||||
<Tabs>
|
||||
<TabItem value="Python" label="Python" default>
|
||||
|
||||
<CodeSnippet source={examplePythonApiFilesEditFileNameV2} language="python" />
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="JavaScript" label="JavaScript">
|
||||
|
||||
<CodeSnippet source={exampleJavascriptApiFilesEditFileNameV2} language="javascript" />
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="curl" label="curl">
|
||||
|
||||
<CodeSnippet source={exampleApiFilesEditFileNameV2} language="bash" />
|
||||
|
||||
</TabItem>
|
||||
</Tabs>
|
||||
|
||||
<details>
|
||||
<summary>Result</summary>
|
||||
|
||||
<CodeSnippet source={resultApiFilesResultEditFileNameV2} language="json" />
|
||||
|
||||
</details>
|
||||
|
||||
### Delete file (v2)
|
||||
|
||||
Delete a specific file by its ID.
|
||||
|
||||
<Tabs>
|
||||
<TabItem value="Python" label="Python" default>
|
||||
|
||||
<CodeSnippet source={examplePythonApiFilesDeleteFileV2} language="python" />
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="JavaScript" label="JavaScript">
|
||||
|
||||
<CodeSnippet source={exampleJavascriptApiFilesDeleteFileV2} language="javascript" />
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="curl" label="curl">
|
||||
|
||||
<CodeSnippet source={exampleApiFilesDeleteFileV2} language="bash" />
|
||||
|
||||
</TabItem>
|
||||
</Tabs>
|
||||
|
||||
<details>
|
||||
<summary>Result</summary>
|
||||
|
||||
<CodeSnippet source={resultApiFilesResultDeleteFileV2} language="json" />
|
||||
|
||||
</details>
|
||||
|
||||
### Delete all files (v2)
|
||||
|
||||
Delete all files associated with your user account.
|
||||
|
||||
<Tabs>
|
||||
<TabItem value="Python" label="Python" default>
|
||||
|
||||
<CodeSnippet source={examplePythonApiFilesDeleteAllFilesV2} language="python" />
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="JavaScript" label="JavaScript">
|
||||
|
||||
<CodeSnippet source={exampleJavascriptApiFilesDeleteAllFilesV2} language="javascript" />
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="curl" label="curl">
|
||||
|
||||
<CodeSnippet source={exampleApiFilesDeleteAllFilesV2} language="bash" />
|
||||
|
||||
</TabItem>
|
||||
</Tabs>
|
||||
|
||||
<details>
|
||||
<summary>Result</summary>
|
||||
|
||||
<CodeSnippet source={resultApiFilesResultDeleteAllFilesV2} language="json" />
|
||||
|
||||
</details>
|
||||
|
||||
## Create upload file (Deprecated)
|
||||
|
||||
This endpoint is deprecated. Use the `/files` endpoints instead.
|
||||
|
||||
## See also
|
||||
|
||||
* [Manage files](/concepts-file-management)
|
||||
@ -0,0 +1,274 @@
|
||||
---
|
||||
title: Flow trigger endpoints
|
||||
slug: /api-flows-run
|
||||
---
|
||||
import CodeSnippet from '@site/src/components/CodeSnippet';
|
||||
import exampleApiFlowsRunRunFlow from '!!raw-loader!@site/docs/API-Reference/curl-examples/api-flows-run/run-flow.sh';
|
||||
import exampleApiFlowsRunStreamLlmTokenResponses from '!!raw-loader!@site/docs/API-Reference/curl-examples/api-flows-run/stream-llm-token-responses.sh';
|
||||
import exampleApiFlowsRunRequestExampleWithAllHeadersAndParameters from '!!raw-loader!@site/docs/API-Reference/curl-examples/api-flows-run/request-example-with-all-headers-and-parameters.sh';
|
||||
import exampleApiFlowsRunPassGlobalVariablesInRequestHeaders from '!!raw-loader!@site/docs/API-Reference/curl-examples/api-flows-run/pass-global-variables-in-request-headers.sh';
|
||||
import exampleApiFlowsRunWebhookRunFlow from '!!raw-loader!@site/docs/API-Reference/curl-examples/api-flows-run/webhook-run-flow.sh';
|
||||
import resultApiFlowsRunResultWebhookRunFlow from '!!raw-loader!@site/docs/API-Reference/curl-examples/api-flows-run/result-webhook-run-flow.json';
|
||||
import examplePythonApiFlowsRunRunFlow from '!!raw-loader!@site/docs/API-Reference/python-examples/api-flows-run/run-flow.py';
|
||||
import exampleJavascriptApiFlowsRunRunFlow from '!!raw-loader!@site/docs/API-Reference/javascript-examples/api-flows-run/run-flow.js';
|
||||
import examplePythonApiFlowsRunStreamLlmTokenResponses from '!!raw-loader!@site/docs/API-Reference/python-examples/api-flows-run/stream-llm-token-responses.py';
|
||||
import exampleJavascriptApiFlowsRunStreamLlmTokenResponses from '!!raw-loader!@site/docs/API-Reference/javascript-examples/api-flows-run/stream-llm-token-responses.js';
|
||||
import examplePythonApiFlowsRunRequestExampleWithAllHeadersAndParameters from '!!raw-loader!@site/docs/API-Reference/python-examples/api-flows-run/request-example-with-all-headers-and-parameters.py';
|
||||
import exampleJavascriptApiFlowsRunRequestExampleWithAllHeadersAndParameters from '!!raw-loader!@site/docs/API-Reference/javascript-examples/api-flows-run/request-example-with-all-headers-and-parameters.js';
|
||||
import examplePythonApiFlowsRunPassGlobalVariablesInRequestHeaders from '!!raw-loader!@site/docs/API-Reference/python-examples/api-flows-run/pass-global-variables-in-request-headers.py';
|
||||
import exampleJavascriptApiFlowsRunPassGlobalVariablesInRequestHeaders from '!!raw-loader!@site/docs/API-Reference/javascript-examples/api-flows-run/pass-global-variables-in-request-headers.js';
|
||||
import examplePythonApiFlowsRunWebhookRunFlow from '!!raw-loader!@site/docs/API-Reference/python-examples/api-flows-run/webhook-run-flow.py';
|
||||
import exampleJavascriptApiFlowsRunWebhookRunFlow from '!!raw-loader!@site/docs/API-Reference/javascript-examples/api-flows-run/webhook-run-flow.js';
|
||||
|
||||
|
||||
|
||||
|
||||
import Tabs from '@theme/Tabs';
|
||||
import TabItem from '@theme/TabItem';
|
||||
|
||||
Use the `/run` and `/webhook` endpoints to run flows.
|
||||
|
||||
To create, read, update, and delete flows, see [Flow management endpoints](/api-flows).
|
||||
|
||||
## Run flow
|
||||
|
||||
:::tip
|
||||
Langflow automatically generates Python, JavaScript, and curl code snippets for the `/v1/run/$FLOW_ID` endpoint for all flows.
|
||||
For more information, see [Generate API code snippets](/concepts-publish#generate-api-code-snippets).
|
||||
:::
|
||||
|
||||
Execute a specified flow by ID or name.
|
||||
Flow IDs can be found on the code snippets on the [**API access** pane](/concepts-publish#api-access) or in a flow's URL.
|
||||
|
||||
The following example runs the **Basic Prompting** template flow with flow parameters passed in the request body.
|
||||
This flow requires a chat input string (`input_value`), and uses default values for all other parameters.
|
||||
|
||||
<Tabs>
|
||||
<TabItem value="Python" label="Python" default>
|
||||
|
||||
<CodeSnippet source={examplePythonApiFlowsRunRunFlow} language="python" />
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="JavaScript" label="JavaScript">
|
||||
|
||||
<CodeSnippet source={exampleJavascriptApiFlowsRunRunFlow} language="javascript" />
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="curl" label="curl">
|
||||
|
||||
<CodeSnippet source={exampleApiFlowsRunRunFlow} language="bash" />
|
||||
|
||||
</TabItem>
|
||||
</Tabs>
|
||||
|
||||
The response from `/v1/run/$FLOW_ID` includes metadata, inputs, and outputs for the run.
|
||||
|
||||
<details>
|
||||
<summary>Result</summary>
|
||||
|
||||
The following example illustrates a response from a Basic Prompting flow:
|
||||
|
||||
```json
|
||||
{
|
||||
"session_id": "chat-123",
|
||||
"outputs": [{
|
||||
"inputs": {
|
||||
"input_value": "Tell me about something interesting!"
|
||||
},
|
||||
"outputs": [{
|
||||
"results": {
|
||||
"message": {
|
||||
"text": "Sure! Have you ever heard of the phenomenon known as \"bioluminescence\"? It's a fascinating natural occurrence where living organisms produce and emit light. This ability is found in various species, including certain types of jellyfish, fireflies, and deep-sea creatures like anglerfish.\n\nBioluminescence occurs through a chemical reaction in which a light-emitting molecule called luciferin reacts with oxygen, catalyzed by an enzyme called luciferase. The result is a beautiful glow that can serve various purposes, such as attracting mates, deterring predators, or luring prey.\n\nOne of the most stunning displays of bioluminescence can be seen in the ocean, where certain plankton emit light when disturbed, creating a mesmerizing blue glow in the water. This phenomenon is often referred to as \"sea sparkle\" and can be seen in coastal areas around the world.\n\nBioluminescence not only captivates our imagination but also has practical applications in science and medicine, including the development of biosensors and imaging techniques. It's a remarkable example of nature's creativity and complexity!",
|
||||
"sender": "Machine",
|
||||
"sender_name": "AI",
|
||||
"session_id": "chat-123",
|
||||
"timestamp": "2025-03-03T17:17:37+00:00",
|
||||
"flow_id": "d2bbd92b-187e-4c84-b2d4-5df365704201",
|
||||
"properties": {
|
||||
"source": {
|
||||
"id": "OpenAIModel-d1wOZ",
|
||||
"display_name": "OpenAI",
|
||||
"source": "gpt-4o-mini"
|
||||
},
|
||||
"icon": "OpenAI"
|
||||
},
|
||||
"component_id": "ChatOutput-ylMzN"
|
||||
}
|
||||
}
|
||||
}]
|
||||
}]
|
||||
}
|
||||
```
|
||||
</details>
|
||||
|
||||
If you are parsing the response in an application, you most likely need to extract the relevant content from the response, rather than pass the entire response back to the user.
|
||||
For an example of a script that extracts data from a Langflow API response, see the [Quickstart](/get-started-quickstart).
|
||||
|
||||
### Stream LLM token responses
|
||||
|
||||
With `/v1/run/$FLOW_ID`, the flow is executed as a batch with optional LLM token response streaming.
|
||||
|
||||
To stream LLM token responses, append the `?stream=true` query parameter to the request:
|
||||
|
||||
<Tabs>
|
||||
<TabItem value="Python" label="Python" default>
|
||||
|
||||
<CodeSnippet source={examplePythonApiFlowsRunStreamLlmTokenResponses} language="python" />
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="JavaScript" label="JavaScript">
|
||||
|
||||
<CodeSnippet source={exampleJavascriptApiFlowsRunStreamLlmTokenResponses} language="javascript" />
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="curl" label="curl">
|
||||
|
||||
<CodeSnippet source={exampleApiFlowsRunStreamLlmTokenResponses} language="bash" />
|
||||
|
||||
</TabItem>
|
||||
</Tabs>
|
||||
|
||||
LLM chat responses are streamed back as `token` events, culminating in a final `end` event that closes the connection.
|
||||
|
||||
<details>
|
||||
<summary>Result</summary>
|
||||
|
||||
The following example is truncated to illustrate a series of `token` events as well as the final `end` event that closes the LLM's token streaming response:
|
||||
|
||||
```text
|
||||
{"event": "add_message", "data": {"timestamp": "2025-03-03T17:20:18", "sender": "User", "sender_name": "User", "session_id": "chat-123", "text": "Tell me about something interesting!", "files": [], "error": false, "edit": false, "properties": {"text_color": "", "background_color": "", "edited": false, "source": {"id": null, "display_name": null, "source": null}, "icon": "", "allow_markdown": false, "positive_feedback": null, "state": "complete", "targets": []}, "category": "message", "content_blocks": [], "id": "0103a21b-ebf7-4c02-9d72-017fb297f812", "flow_id": "d2bbd92b-187e-4c84-b2d4-5df365704201"}}
|
||||
|
||||
{"event": "add_message", "data": {"timestamp": "2025-03-03T17:20:18", "sender": "Machine", "sender_name": "AI", "session_id": "chat-123", "text": "", "files": [], "error": false, "edit": false, "properties": {"text_color": "", "background_color": "", "edited": false, "source": {"id": "OpenAIModel-d1wOZ", "display_name": "OpenAI", "source": "gpt-4o-mini"}, "icon": "OpenAI", "allow_markdown": false, "positive_feedback": null, "state": "complete", "targets": []}, "category": "message", "content_blocks": [], "id": "27b66789-e673-4c65-9e81-021752925161", "flow_id": "d2bbd92b-187e-4c84-b2d4-5df365704201"}}
|
||||
|
||||
{"event": "token", "data": {"chunk": " Have", "id": "27b66789-e673-4c65-9e81-021752925161", "timestamp": "2025-03-03 17:20:18 UTC"}}
|
||||
|
||||
{"event": "token", "data": {"chunk": " you", "id": "27b66789-e673-4c65-9e81-021752925161", "timestamp": "2025-03-03 17:20:18 UTC"}}
|
||||
|
||||
{"event": "token", "data": {"chunk": " ever", "id": "27b66789-e673-4c65-9e81-021752925161", "timestamp": "2025-03-03 17:20:18 UTC"}}
|
||||
|
||||
{"event": "token", "data": {"chunk": " heard", "id": "27b66789-e673-4c65-9e81-021752925161", "timestamp": "2025-03-03 17:20:18 UTC"}}
|
||||
|
||||
{"event": "token", "data": {"chunk": " of", "id": "27b66789-e673-4c65-9e81-021752925161", "timestamp": "2025-03-03 17:20:18 UTC"}}
|
||||
|
||||
{"event": "token", "data": {"chunk": " the", "id": "27b66789-e673-4c65-9e81-021752925161", "timestamp": "2025-03-03 17:20:18 UTC"}}
|
||||
|
||||
{"event": "token", "data": {"chunk": " phenomenon", "id": "27b66789-e673-4c65-9e81-021752925161", "timestamp": "2025-03-03 17:20:18 UTC"}}
|
||||
|
||||
{"event": "end", "data": {"result": {"session_id": "chat-123", "message": "Sure! Have you ever heard of the phenomenon known as \"bioluminescence\"?..."}}}
|
||||
```
|
||||
|
||||
</details>
|
||||
|
||||
### Run endpoint headers
|
||||
|
||||
| Header | Info | Example |
|
||||
|--------|------|---------|
|
||||
| Content-Type | Required. Specifies the JSON format. | "application/json" |
|
||||
| accept | Optional. Specifies the response format. Defaults to JSON if not specified. | "application/json" |
|
||||
| x-api-key | Required. Your Langflow API key for authentication. Can be passed as a header or query parameter. | "sk-..." |
|
||||
| `X-LANGFLOW-GLOBAL-VAR-*` | Optional. Pass global variables to the flow. Variable names are automatically converted to uppercase. These variables take precedence over OS environment variables and are only available during this specific request execution. | `"X-LANGFLOW-GLOBAL-VAR-API_KEY: sk-..."` |
|
||||
|
||||
### Run endpoint parameters
|
||||
|
||||
| Parameter | Type | Info |
|
||||
|-----------|------|------|
|
||||
| flow_id | UUID/string | Required. Part of URL: `/run/$FLOW_ID` |
|
||||
| stream | Boolean | Optional. Query parameter: `/run/$FLOW_ID?stream=true` |
|
||||
| input_value | string | Optional. JSON body field. Main input text/prompt. Default: `null` |
|
||||
| input_type | string | Optional. JSON body field. Input type ("chat" or "text"). Default: `"chat"` |
|
||||
| output_type | string | Optional. JSON body field. Output type ("chat", "any", "debug"). Default: `"chat"` |
|
||||
| output_component | string | Optional. JSON body field. Target component for output. Default: `""` |
|
||||
| tweaks | object | Optional. JSON body field. Component adjustments. Default: `null` |
|
||||
| session_id | string | Optional. JSON body field. Conversation context ID. See [Session ID](/session-id). Default: `null` |
|
||||
|
||||
### Request example with all headers and parameters
|
||||
|
||||
<Tabs>
|
||||
<TabItem value="Python" label="Python" default>
|
||||
|
||||
<CodeSnippet source={examplePythonApiFlowsRunRequestExampleWithAllHeadersAndParameters} language="python" />
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="JavaScript" label="JavaScript">
|
||||
|
||||
<CodeSnippet source={exampleJavascriptApiFlowsRunRequestExampleWithAllHeadersAndParameters} language="javascript" />
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="curl" label="curl">
|
||||
|
||||
<CodeSnippet source={exampleApiFlowsRunRequestExampleWithAllHeadersAndParameters} language="bash" />
|
||||
|
||||
</TabItem>
|
||||
</Tabs>
|
||||
|
||||
### Pass global variables in request headers {#pass-global-variables-in-headers}
|
||||
|
||||
You can pass global variables to your flow using HTTP headers with the format `X-LANGFLOW-GLOBAL-VAR-{VARIABLE_NAME}`.
|
||||
|
||||
Variables passed in headers take precedence over OS environment variables. If a variable is provided in both a header and an environment variable, the header value is used. Variables are only available during this specific request execution and aren't persisted.
|
||||
|
||||
Variable names are automatically converted to uppercase. For example, `X-LANGFLOW-GLOBAL-VAR-api-key` becomes `API_KEY` in your flow.
|
||||
|
||||
You don't need to create these variables in Langflow's Global Variables section first. Pass any variable name using this header format.
|
||||
|
||||
<Tabs>
|
||||
<TabItem value="Python" label="Python" default>
|
||||
|
||||
<CodeSnippet source={examplePythonApiFlowsRunPassGlobalVariablesInRequestHeaders} language="python" />
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="JavaScript" label="JavaScript">
|
||||
|
||||
<CodeSnippet source={exampleJavascriptApiFlowsRunPassGlobalVariablesInRequestHeaders} language="javascript" />
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="curl" label="curl">
|
||||
|
||||
<CodeSnippet source={exampleApiFlowsRunPassGlobalVariablesInRequestHeaders} language="bash" />
|
||||
|
||||
</TabItem>
|
||||
</Tabs>
|
||||
|
||||
If your flow components reference variables that aren't provided in headers or your Langflow database, the flow fails by default. To avoid this, you can set `LANGFLOW_FALLBACK_TO_ENV_VAR=True` in your `.env` file, which allows the flow to use values from OS environment variables if they aren't otherwise specified.
|
||||
|
||||
|
||||
## Webhook run flow
|
||||
|
||||
Use the `/webhook` endpoint to start a flow by sending an HTTP `POST` request.
|
||||
|
||||
:::tip
|
||||
After you add a [**Webhook** component](/webhook) to a flow, open the [**API access** pane](/concepts-publish), and then click the **Webhook curl** tab to get an automatically generated `POST /webhook` request for your flow.
|
||||
For more information, see [Trigger flows with webhooks](/webhook).
|
||||
:::
|
||||
|
||||
<Tabs>
|
||||
<TabItem value="Python" label="Python" default>
|
||||
|
||||
<CodeSnippet source={examplePythonApiFlowsRunWebhookRunFlow} language="python" />
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="JavaScript" label="JavaScript">
|
||||
|
||||
<CodeSnippet source={exampleJavascriptApiFlowsRunWebhookRunFlow} language="javascript" />
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="curl" label="curl">
|
||||
|
||||
<CodeSnippet source={exampleApiFlowsRunWebhookRunFlow} language="bash" />
|
||||
|
||||
</TabItem>
|
||||
</Tabs>
|
||||
|
||||
<details>
|
||||
<summary>Result</summary>
|
||||
|
||||
<CodeSnippet source={resultApiFlowsRunResultWebhookRunFlow} language="json" />
|
||||
|
||||
</details>
|
||||
|
||||
## Deprecated flow trigger endpoints
|
||||
|
||||
The following endpoints are deprecated and replaced by the `/run` endpoint:
|
||||
|
||||
* `/process`
|
||||
* `/predict`
|
||||
330
docs/versioned_docs/version-1.9.0/API-Reference/api-flows.mdx
Normal file
330
docs/versioned_docs/version-1.9.0/API-Reference/api-flows.mdx
Normal file
@ -0,0 +1,330 @@
|
||||
---
|
||||
title: Flow management endpoints
|
||||
slug: /api-flows
|
||||
---
|
||||
import CodeSnippet from '@site/src/components/CodeSnippet';
|
||||
import exampleApiFlowsCreateFlow from '!!raw-loader!@site/docs/API-Reference/curl-examples/api-flows/create-flow.sh';
|
||||
import resultApiFlowsResultCreateFlow from '!!raw-loader!@site/docs/API-Reference/curl-examples/api-flows/result-create-flow.json';
|
||||
import exampleApiFlowsCreateFlows from '!!raw-loader!@site/docs/API-Reference/curl-examples/api-flows/create-flows.sh';
|
||||
import exampleApiFlowsReadFlow from '!!raw-loader!@site/docs/API-Reference/curl-examples/api-flows/read-flow.sh';
|
||||
import resultApiFlowsResultReadFlow from '!!raw-loader!@site/docs/API-Reference/curl-examples/api-flows/result-read-flow.json';
|
||||
import exampleApiFlowsReadFlows from '!!raw-loader!@site/docs/API-Reference/curl-examples/api-flows/read-flows.sh';
|
||||
import exampleApiFlowsReadFlows2 from '!!raw-loader!@site/docs/API-Reference/curl-examples/api-flows/read-flows-2.sh';
|
||||
import exampleApiFlowsReadSampleFlows from '!!raw-loader!@site/docs/API-Reference/curl-examples/api-flows/read-sample-flows.sh';
|
||||
import exampleApiFlowsUpdateFlow from '!!raw-loader!@site/docs/API-Reference/curl-examples/api-flows/update-flow.sh';
|
||||
import resultApiFlowsResultUpdateFlow from '!!raw-loader!@site/docs/API-Reference/curl-examples/api-flows/result-update-flow.json';
|
||||
import exampleApiFlowsDeleteFlow from '!!raw-loader!@site/docs/API-Reference/curl-examples/api-flows/delete-flow.sh';
|
||||
import resultApiFlowsResultDeleteFlow from '!!raw-loader!@site/docs/API-Reference/curl-examples/api-flows/result-delete-flow.json';
|
||||
import exampleApiFlowsExportFlows from '!!raw-loader!@site/docs/API-Reference/curl-examples/api-flows/export-flows.sh';
|
||||
import resultApiFlowsResultExportFlows from '!!raw-loader!@site/docs/API-Reference/curl-examples/api-flows/result-export-flows.txt';
|
||||
import exampleApiFlowsImportFlows from '!!raw-loader!@site/docs/API-Reference/curl-examples/api-flows/import-flows.sh';
|
||||
import Tabs from '@theme/Tabs';
|
||||
import TabItem from '@theme/TabItem';
|
||||
import examplePythonApiFlowsCreateFlow from '!!raw-loader!@site/docs/API-Reference/python-examples/api-flows/create-flow.py';
|
||||
import exampleJavascriptApiFlowsCreateFlow from '!!raw-loader!@site/docs/API-Reference/javascript-examples/api-flows/create-flow.js';
|
||||
import examplePythonApiFlowsCreateFlows from '!!raw-loader!@site/docs/API-Reference/python-examples/api-flows/create-flows.py';
|
||||
import exampleJavascriptApiFlowsCreateFlows from '!!raw-loader!@site/docs/API-Reference/javascript-examples/api-flows/create-flows.js';
|
||||
import examplePythonApiFlowsReadFlow from '!!raw-loader!@site/docs/API-Reference/python-examples/api-flows/read-flow.py';
|
||||
import exampleJavascriptApiFlowsReadFlow from '!!raw-loader!@site/docs/API-Reference/javascript-examples/api-flows/read-flow.js';
|
||||
import examplePythonApiFlowsReadFlows from '!!raw-loader!@site/docs/API-Reference/python-examples/api-flows/read-flows.py';
|
||||
import exampleJavascriptApiFlowsReadFlows from '!!raw-loader!@site/docs/API-Reference/javascript-examples/api-flows/read-flows.js';
|
||||
import examplePythonApiFlowsReadFlows2 from '!!raw-loader!@site/docs/API-Reference/python-examples/api-flows/read-flows-2.py';
|
||||
import exampleJavascriptApiFlowsReadFlows2 from '!!raw-loader!@site/docs/API-Reference/javascript-examples/api-flows/read-flows-2.js';
|
||||
import examplePythonApiFlowsReadSampleFlows from '!!raw-loader!@site/docs/API-Reference/python-examples/api-flows/read-sample-flows.py';
|
||||
import exampleJavascriptApiFlowsReadSampleFlows from '!!raw-loader!@site/docs/API-Reference/javascript-examples/api-flows/read-sample-flows.js';
|
||||
import examplePythonApiFlowsUpdateFlow from '!!raw-loader!@site/docs/API-Reference/python-examples/api-flows/update-flow.py';
|
||||
import exampleJavascriptApiFlowsUpdateFlow from '!!raw-loader!@site/docs/API-Reference/javascript-examples/api-flows/update-flow.js';
|
||||
import examplePythonApiFlowsDeleteFlow from '!!raw-loader!@site/docs/API-Reference/python-examples/api-flows/delete-flow.py';
|
||||
import exampleJavascriptApiFlowsDeleteFlow from '!!raw-loader!@site/docs/API-Reference/javascript-examples/api-flows/delete-flow.js';
|
||||
import examplePythonApiFlowsExportFlows from '!!raw-loader!@site/docs/API-Reference/python-examples/api-flows/export-flows.py';
|
||||
import exampleJavascriptApiFlowsExportFlows from '!!raw-loader!@site/docs/API-Reference/javascript-examples/api-flows/export-flows.js';
|
||||
import examplePythonApiFlowsImportFlows from '!!raw-loader!@site/docs/API-Reference/python-examples/api-flows/import-flows.py';
|
||||
import exampleJavascriptApiFlowsImportFlows from '!!raw-loader!@site/docs/API-Reference/javascript-examples/api-flows/import-flows.js';
|
||||
|
||||
|
||||
|
||||
Use the `/flows` endpoint to create, read, update, and delete flows.
|
||||
|
||||
If you want to use the Langflow API to run a flow, see [Flow trigger endpoints](/api-flows-run).
|
||||
|
||||
## Create flow
|
||||
|
||||
Creates a new flow.
|
||||
|
||||
<Tabs>
|
||||
<TabItem value="Python" label="Python" default>
|
||||
|
||||
<CodeSnippet source={examplePythonApiFlowsCreateFlow} language="python" />
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="JavaScript" label="JavaScript">
|
||||
|
||||
<CodeSnippet source={exampleJavascriptApiFlowsCreateFlow} language="javascript" />
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="curl" label="curl">
|
||||
|
||||
<CodeSnippet source={exampleApiFlowsCreateFlow} language="bash" />
|
||||
|
||||
</TabItem>
|
||||
</Tabs>
|
||||
|
||||
<details>
|
||||
<summary>Result</summary>
|
||||
|
||||
<CodeSnippet source={resultApiFlowsResultCreateFlow} language="json" />
|
||||
|
||||
</details>
|
||||
|
||||
## Create flows
|
||||
|
||||
Creates multiple new flows, returning an array of flow objects.
|
||||
|
||||
<Tabs>
|
||||
<TabItem value="Python" label="Python" default>
|
||||
|
||||
<CodeSnippet source={examplePythonApiFlowsCreateFlows} language="python" />
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="JavaScript" label="JavaScript">
|
||||
|
||||
<CodeSnippet source={exampleJavascriptApiFlowsCreateFlows} language="javascript" />
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="curl" label="curl">
|
||||
|
||||
<CodeSnippet source={exampleApiFlowsCreateFlows} language="bash" />
|
||||
|
||||
</TabItem>
|
||||
</Tabs>
|
||||
|
||||
## Read flow
|
||||
|
||||
Retrieves a specific flow by its ID.
|
||||
|
||||
<Tabs>
|
||||
<TabItem value="Python" label="Python" default>
|
||||
|
||||
<CodeSnippet source={examplePythonApiFlowsReadFlow} language="python" />
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="JavaScript" label="JavaScript">
|
||||
|
||||
<CodeSnippet source={exampleJavascriptApiFlowsReadFlow} language="javascript" />
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="curl" label="curl">
|
||||
|
||||
<CodeSnippet source={exampleApiFlowsReadFlow} language="bash" />
|
||||
|
||||
</TabItem>
|
||||
</Tabs>
|
||||
|
||||
<details>
|
||||
<summary>Result</summary>
|
||||
|
||||
<CodeSnippet source={resultApiFlowsResultReadFlow} language="json" />
|
||||
|
||||
</details>
|
||||
|
||||
## Read flows
|
||||
|
||||
Returns a JSON object containing a list of flows.
|
||||
|
||||
Retrieve all flows with pagination:
|
||||
|
||||
<Tabs>
|
||||
<TabItem value="Python" label="Python" default>
|
||||
|
||||
<CodeSnippet source={examplePythonApiFlowsReadFlows} language="python" />
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="JavaScript" label="JavaScript">
|
||||
|
||||
<CodeSnippet source={exampleJavascriptApiFlowsReadFlows} language="javascript" />
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="curl" label="curl">
|
||||
|
||||
<CodeSnippet source={exampleApiFlowsReadFlows} language="bash" />
|
||||
|
||||
</TabItem>
|
||||
</Tabs>
|
||||
|
||||
To retrieve flows from a specific project, use the `project_id` query parameter:
|
||||
|
||||
<Tabs>
|
||||
<TabItem value="Python" label="Python" default>
|
||||
|
||||
<CodeSnippet source={examplePythonApiFlowsReadFlows2} language="python" />
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="JavaScript" label="JavaScript">
|
||||
|
||||
<CodeSnippet source={exampleJavascriptApiFlowsReadFlows2} language="javascript" />
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="curl" label="curl">
|
||||
|
||||
<CodeSnippet source={exampleApiFlowsReadFlows2} language="bash" />
|
||||
|
||||
</TabItem>
|
||||
</Tabs>
|
||||
|
||||
## Read sample flows
|
||||
|
||||
Retrieves a list of sample flows:
|
||||
|
||||
<Tabs>
|
||||
<TabItem value="Python" label="Python" default>
|
||||
|
||||
<CodeSnippet source={examplePythonApiFlowsReadSampleFlows} language="python" />
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="JavaScript" label="JavaScript">
|
||||
|
||||
<CodeSnippet source={exampleJavascriptApiFlowsReadSampleFlows} language="javascript" />
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="curl" label="curl">
|
||||
|
||||
<CodeSnippet source={exampleApiFlowsReadSampleFlows} language="bash" />
|
||||
|
||||
</TabItem>
|
||||
</Tabs>
|
||||
|
||||
## Update flow
|
||||
|
||||
Updates an existing flow by its ID.
|
||||
|
||||
This example changes the value for `endpoint_name` from a random UUID to `my_new_endpoint_name`.
|
||||
|
||||
<Tabs>
|
||||
<TabItem value="Python" label="Python" default>
|
||||
|
||||
<CodeSnippet source={examplePythonApiFlowsUpdateFlow} language="python" />
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="JavaScript" label="JavaScript">
|
||||
|
||||
<CodeSnippet source={exampleJavascriptApiFlowsUpdateFlow} language="javascript" />
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="curl" label="curl">
|
||||
|
||||
<CodeSnippet source={exampleApiFlowsUpdateFlow} language="bash" />
|
||||
|
||||
</TabItem>
|
||||
</Tabs>
|
||||
|
||||
<details>
|
||||
<summary>Result</summary>
|
||||
|
||||
<CodeSnippet source={resultApiFlowsResultUpdateFlow} language="json" />
|
||||
|
||||
</details>
|
||||
|
||||
## Delete flow
|
||||
|
||||
Deletes a specific flow by its ID.
|
||||
|
||||
<Tabs>
|
||||
<TabItem value="Python" label="Python" default>
|
||||
|
||||
<CodeSnippet source={examplePythonApiFlowsDeleteFlow} language="python" />
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="JavaScript" label="JavaScript">
|
||||
|
||||
<CodeSnippet source={exampleJavascriptApiFlowsDeleteFlow} language="javascript" />
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="curl" label="curl">
|
||||
|
||||
<CodeSnippet source={exampleApiFlowsDeleteFlow} language="bash" />
|
||||
|
||||
</TabItem>
|
||||
</Tabs>
|
||||
|
||||
<details>
|
||||
<summary>Result</summary>
|
||||
|
||||
<CodeSnippet source={resultApiFlowsResultDeleteFlow} language="json" />
|
||||
|
||||
</details>
|
||||
|
||||
## Export flows
|
||||
|
||||
Exports specified flows to a ZIP file.
|
||||
|
||||
This endpoint downloads a ZIP file containing [Langflow JSON files](/concepts-flows-import#langflow-json-file-contents) for each flow ID listed in the request body.
|
||||
|
||||
<Tabs>
|
||||
<TabItem value="Python" label="Python" default>
|
||||
|
||||
<CodeSnippet source={examplePythonApiFlowsExportFlows} language="python" />
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="JavaScript" label="JavaScript">
|
||||
|
||||
<CodeSnippet source={exampleJavascriptApiFlowsExportFlows} language="javascript" />
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="curl" label="curl">
|
||||
|
||||
<CodeSnippet source={exampleApiFlowsExportFlows} language="bash" />
|
||||
|
||||
</TabItem>
|
||||
</Tabs>
|
||||
|
||||
<details>
|
||||
<summary>Result</summary>
|
||||
|
||||
<CodeSnippet source={resultApiFlowsResultExportFlows} language="text" />
|
||||
|
||||
</details>
|
||||
|
||||
## Import flows
|
||||
|
||||
Imports flows by uploading a [Langflow-compatible JSON file](/concepts-flows-import#langflow-json-file-contents).
|
||||
|
||||
To specify a target project for the flow, include the query parameter `folder_id`.
|
||||
The target `folder_id` must already exist before uploading a flow. Call the [/api/v1/projects/](/api-projects#read-projects) endpoint for a list of available folders and projects.
|
||||
|
||||
This example uploads a local file named `agent-with-astra-db-tool.json` to a folder specified by a `FOLDER_ID` variable:
|
||||
|
||||
<Tabs>
|
||||
<TabItem value="Python" label="Python" default>
|
||||
|
||||
<CodeSnippet source={examplePythonApiFlowsImportFlows} language="python" />
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="JavaScript" label="JavaScript">
|
||||
|
||||
<CodeSnippet source={exampleJavascriptApiFlowsImportFlows} language="javascript" />
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="curl" label="curl">
|
||||
|
||||
<CodeSnippet source={exampleApiFlowsImportFlows} language="bash" />
|
||||
|
||||
</TabItem>
|
||||
</Tabs>
|
||||
|
||||
<details>
|
||||
<summary>Result</summary>
|
||||
|
||||
```json
|
||||
[
|
||||
{
|
||||
"name": "agent-with-astra-db-tool",
|
||||
"description": "",
|
||||
"icon": null,
|
||||
"icon_bg_color": null,
|
||||
"gradient": null,
|
||||
"data": {}
|
||||
...
|
||||
}
|
||||
]
|
||||
```
|
||||
</details>
|
||||
96
docs/versioned_docs/version-1.9.0/API-Reference/api-logs.mdx
Normal file
96
docs/versioned_docs/version-1.9.0/API-Reference/api-logs.mdx
Normal file
@ -0,0 +1,96 @@
|
||||
---
|
||||
title: Logs endpoints
|
||||
slug: /api-logs
|
||||
---
|
||||
import CodeSnippet from '@site/src/components/CodeSnippet';
|
||||
import exampleApiLogsStreamLogs from '!!raw-loader!@site/docs/API-Reference/curl-examples/api-logs/stream-logs.sh';
|
||||
import resultApiLogsResultStreamLogs from '!!raw-loader!@site/docs/API-Reference/curl-examples/api-logs/result-stream-logs.txt';
|
||||
import exampleApiLogsRetrieveLogsWithOptionalParameters from '!!raw-loader!@site/docs/API-Reference/curl-examples/api-logs/retrieve-logs-with-optional-parameters.sh';
|
||||
import resultApiLogsResultRetrieveLogsWithOptionalParameters from '!!raw-loader!@site/docs/API-Reference/curl-examples/api-logs/result-retrieve-logs-with-optional-parameters.txt';
|
||||
import Tabs from '@theme/Tabs';
|
||||
import TabItem from '@theme/TabItem';
|
||||
import examplePythonApiLogsStreamLogs from '!!raw-loader!@site/docs/API-Reference/python-examples/api-logs/stream-logs.py';
|
||||
import exampleJavascriptApiLogsStreamLogs from '!!raw-loader!@site/docs/API-Reference/javascript-examples/api-logs/stream-logs.js';
|
||||
import examplePythonApiLogsRetrieveLogsWithOptionalParameters from '!!raw-loader!@site/docs/API-Reference/python-examples/api-logs/retrieve-logs-with-optional-parameters.py';
|
||||
import exampleJavascriptApiLogsRetrieveLogsWithOptionalParameters from '!!raw-loader!@site/docs/API-Reference/javascript-examples/api-logs/retrieve-logs-with-optional-parameters.js';
|
||||
|
||||
|
||||
|
||||
Retrieve logs for your Langflow flows and server.
|
||||
|
||||
## Enable log retrieval
|
||||
|
||||
The `/logs` endpoint requires log retrieval to be enabled in your Langflow instance.
|
||||
|
||||
To enable log retrieval, set the following [environment variables](/environment-variables) in your Langflow `.env` file, and then start Langflow with `uv run langflow run --env-file .env`:
|
||||
|
||||
```text
|
||||
LANGFLOW_ENABLE_LOG_RETRIEVAL=True
|
||||
LANGFLOW_LOG_RETRIEVER_BUFFER_SIZE=10000 // Must be greater than 0
|
||||
LANGFLOW_LOG_LEVEL=DEBUG // Can be DEBUG, ERROR, INFO, WARNING, or CRITICAL
|
||||
```
|
||||
|
||||
## Stream logs
|
||||
|
||||
Stream logs in real-time using Server Sent Events (SSE):
|
||||
|
||||
<Tabs>
|
||||
<TabItem value="Python" label="Python" default>
|
||||
|
||||
<CodeSnippet source={examplePythonApiLogsStreamLogs} language="python" />
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="JavaScript" label="JavaScript">
|
||||
|
||||
<CodeSnippet source={exampleJavascriptApiLogsStreamLogs} language="javascript" />
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="curl" label="curl">
|
||||
|
||||
<CodeSnippet source={exampleApiLogsStreamLogs} language="bash" />
|
||||
|
||||
</TabItem>
|
||||
</Tabs>
|
||||
|
||||
<details>
|
||||
<summary>Result</summary>
|
||||
|
||||
<CodeSnippet source={resultApiLogsResultStreamLogs} language="text" />
|
||||
|
||||
</details>
|
||||
|
||||
## Retrieve logs with optional parameters
|
||||
|
||||
Retrieve logs with optional query parameters:
|
||||
|
||||
- `lines_before`: The number of logs before the timestamp or the last log.
|
||||
- `lines_after`: The number of logs after the timestamp.
|
||||
- `timestamp`: The timestamp to start getting logs from.
|
||||
|
||||
The default values for all three parameters is `0`.
|
||||
With default values, the endpoint returns the last 10 lines of logs.
|
||||
|
||||
<Tabs>
|
||||
<TabItem value="Python" label="Python" default>
|
||||
|
||||
<CodeSnippet source={examplePythonApiLogsRetrieveLogsWithOptionalParameters} language="python" />
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="JavaScript" label="JavaScript">
|
||||
|
||||
<CodeSnippet source={exampleJavascriptApiLogsRetrieveLogsWithOptionalParameters} language="javascript" />
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="curl" label="curl">
|
||||
|
||||
<CodeSnippet source={exampleApiLogsRetrieveLogsWithOptionalParameters} language="bash" />
|
||||
|
||||
</TabItem>
|
||||
</Tabs>
|
||||
|
||||
<details>
|
||||
<summary>Result</summary>
|
||||
|
||||
<CodeSnippet source={resultApiLogsResultRetrieveLogsWithOptionalParameters} language="text" />
|
||||
|
||||
</details>
|
||||
429
docs/versioned_docs/version-1.9.0/API-Reference/api-monitor.mdx
Normal file
429
docs/versioned_docs/version-1.9.0/API-Reference/api-monitor.mdx
Normal file
@ -0,0 +1,429 @@
|
||||
---
|
||||
title: Monitor endpoints
|
||||
slug: /api-monitor
|
||||
---
|
||||
import CodeSnippet from '@site/src/components/CodeSnippet';
|
||||
import exampleApiMonitorGetVertexBuilds from '!!raw-loader!@site/docs/API-Reference/curl-examples/api-monitor/get-vertex-builds.sh';
|
||||
import resultApiMonitorResultGetVertexBuilds from '!!raw-loader!@site/docs/API-Reference/curl-examples/api-monitor/result-get-vertex-builds.json';
|
||||
import exampleApiMonitorDeleteVertexBuilds from '!!raw-loader!@site/docs/API-Reference/curl-examples/api-monitor/delete-vertex-builds.sh';
|
||||
import resultApiMonitorResultDeleteVertexBuilds from '!!raw-loader!@site/docs/API-Reference/curl-examples/api-monitor/result-delete-vertex-builds.txt';
|
||||
import exampleApiMonitorGetMessages from '!!raw-loader!@site/docs/API-Reference/curl-examples/api-monitor/get-messages.sh';
|
||||
import exampleApiMonitorGetMessages2 from '!!raw-loader!@site/docs/API-Reference/curl-examples/api-monitor/get-messages-2.sh';
|
||||
import resultApiMonitorResultGetMessages2 from '!!raw-loader!@site/docs/API-Reference/curl-examples/api-monitor/result-get-messages-2.json';
|
||||
import exampleApiMonitorDeleteMessages from '!!raw-loader!@site/docs/API-Reference/curl-examples/api-monitor/delete-messages.sh';
|
||||
import resultApiMonitorResultDeleteMessages from '!!raw-loader!@site/docs/API-Reference/curl-examples/api-monitor/result-delete-messages.txt';
|
||||
import exampleApiMonitorUpdateMessage from '!!raw-loader!@site/docs/API-Reference/curl-examples/api-monitor/update-message.sh';
|
||||
import resultApiMonitorResultUpdateMessage from '!!raw-loader!@site/docs/API-Reference/curl-examples/api-monitor/result-update-message.json';
|
||||
import exampleApiMonitorUpdateSessionId from '!!raw-loader!@site/docs/API-Reference/curl-examples/api-monitor/update-session-id.sh';
|
||||
import resultApiMonitorResultUpdateSessionId from '!!raw-loader!@site/docs/API-Reference/curl-examples/api-monitor/result-update-session-id.json';
|
||||
import exampleApiMonitorDeleteMessagesBySession from '!!raw-loader!@site/docs/API-Reference/curl-examples/api-monitor/delete-messages-by-session.sh';
|
||||
import resultApiMonitorResultDeleteMessagesBySession from '!!raw-loader!@site/docs/API-Reference/curl-examples/api-monitor/result-delete-messages-by-session.txt';
|
||||
import exampleApiMonitorExampleRequest from '!!raw-loader!@site/docs/API-Reference/curl-examples/api-monitor/example-request.sh';
|
||||
import exampleApiMonitorGetTransactions from '!!raw-loader!@site/docs/API-Reference/curl-examples/api-monitor/get-transactions.sh';
|
||||
import resultApiMonitorResultGetTransactions from '!!raw-loader!@site/docs/API-Reference/curl-examples/api-monitor/result-get-transactions.json';
|
||||
import examplePythonApiMonitorExampleRequest from '!!raw-loader!@site/docs/API-Reference/python-examples/api-monitor/example-request.py';
|
||||
import examplePythonApiMonitorGetVertexBuilds from '!!raw-loader!@site/docs/API-Reference/python-examples/api-monitor/get-vertex-builds.py';
|
||||
import exampleJavascriptApiMonitorGetVertexBuilds from '!!raw-loader!@site/docs/API-Reference/javascript-examples/api-monitor/get-vertex-builds.js';
|
||||
import examplePythonApiMonitorDeleteVertexBuilds from '!!raw-loader!@site/docs/API-Reference/python-examples/api-monitor/delete-vertex-builds.py';
|
||||
import exampleJavascriptApiMonitorDeleteVertexBuilds from '!!raw-loader!@site/docs/API-Reference/javascript-examples/api-monitor/delete-vertex-builds.js';
|
||||
import examplePythonApiMonitorGetMessages from '!!raw-loader!@site/docs/API-Reference/python-examples/api-monitor/get-messages.py';
|
||||
import exampleJavascriptApiMonitorGetMessages from '!!raw-loader!@site/docs/API-Reference/javascript-examples/api-monitor/get-messages.js';
|
||||
import examplePythonApiMonitorGetMessages2 from '!!raw-loader!@site/docs/API-Reference/python-examples/api-monitor/get-messages-2.py';
|
||||
import exampleJavascriptApiMonitorGetMessages2 from '!!raw-loader!@site/docs/API-Reference/javascript-examples/api-monitor/get-messages-2.js';
|
||||
import examplePythonApiMonitorDeleteMessages from '!!raw-loader!@site/docs/API-Reference/python-examples/api-monitor/delete-messages.py';
|
||||
import exampleJavascriptApiMonitorDeleteMessages from '!!raw-loader!@site/docs/API-Reference/javascript-examples/api-monitor/delete-messages.js';
|
||||
import examplePythonApiMonitorUpdateMessage from '!!raw-loader!@site/docs/API-Reference/python-examples/api-monitor/update-message.py';
|
||||
import exampleJavascriptApiMonitorUpdateMessage from '!!raw-loader!@site/docs/API-Reference/javascript-examples/api-monitor/update-message.js';
|
||||
import examplePythonApiMonitorUpdateSessionId from '!!raw-loader!@site/docs/API-Reference/python-examples/api-monitor/update-session-id.py';
|
||||
import exampleJavascriptApiMonitorUpdateSessionId from '!!raw-loader!@site/docs/API-Reference/javascript-examples/api-monitor/update-session-id.js';
|
||||
import examplePythonApiMonitorDeleteMessagesBySession from '!!raw-loader!@site/docs/API-Reference/python-examples/api-monitor/delete-messages-by-session.py';
|
||||
import exampleJavascriptApiMonitorDeleteMessagesBySession from '!!raw-loader!@site/docs/API-Reference/javascript-examples/api-monitor/delete-messages-by-session.js';
|
||||
import examplePythonApiMonitorGetTransactions from '!!raw-loader!@site/docs/API-Reference/python-examples/api-monitor/get-transactions.py';
|
||||
import exampleJavascriptApiMonitorGetTransactions from '!!raw-loader!@site/docs/API-Reference/javascript-examples/api-monitor/get-transactions.js';
|
||||
|
||||
|
||||
|
||||
|
||||
import Tabs from '@theme/Tabs';
|
||||
import TabItem from '@theme/TabItem';
|
||||
|
||||
The `/monitor` endpoints are for internal Langflow functionality, primarily related to running flows in the **Playground**, storing chat history, and generating flow logs.
|
||||
|
||||
This information is primarily for those who are building custom components or contributing to the Langflow codebase in a way that requires calling or understanding these endpoints.
|
||||
|
||||
For typical application development with Langflow, there are more appropriate options for monitoring, debugging, and memory management.
|
||||
For more information, see the following:
|
||||
|
||||
* [Logs](/logging): Langflow log storage locations, customization options, and where to view logs in the visual editor
|
||||
* [Test flows in the Playground](/concepts-playground): Run flows and inspect message history
|
||||
* [Memory management options](/memory): Langflow storage locations and options, including the database, cache, and chat history
|
||||
|
||||
## Vertex builds
|
||||
|
||||
The Vertex build endpoints (`/monitor/builds`) are exclusively for **Playground** functionality.
|
||||
|
||||
When you run a flow in the **Playground**, Langflow calls the `/build/$FLOW_ID/flow` endpoint in [chat.py](https://github.com/langflow-ai/langflow/blob/main/src/backend/base/langflow/api/v1/chat.py#L130). This call retrieves the flow data, builds a graph, and executes the graph. As each component (or node) is executed, the `build_vertex` function calls `build_and_run`, which may call the individual components' `def_build` method, if it exists. If a component doesn't have a `def_build` function, the build still returns a component.
|
||||
|
||||
The `build` function allows components to execute logic at runtime. For example, the [**Recursive Character Text Splitter** component](https://github.com/langflow-ai/langflow/blob/main/src/lfx/src/lfx/components/langchain_utilities/recursive_character.py) is a child of the `LCTextSplitterComponent` class. When text needs to be processed, the parent class's `build` method is called, which creates a `RecursiveCharacterTextSplitter` object and uses it to split the text according to the defined parameters. The split text is then passed on to the next component. This all occurs when the component is built.
|
||||
|
||||
### Get Vertex builds
|
||||
|
||||
Retrieve Vertex builds for a specific flow.
|
||||
|
||||
<Tabs>
|
||||
<TabItem value="Python" label="Python" default>
|
||||
|
||||
<CodeSnippet source={examplePythonApiMonitorGetVertexBuilds} language="python" />
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="JavaScript" label="JavaScript">
|
||||
|
||||
<CodeSnippet source={exampleJavascriptApiMonitorGetVertexBuilds} language="javascript" />
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="curl" label="curl">
|
||||
|
||||
<CodeSnippet source={exampleApiMonitorGetVertexBuilds} language="bash" />
|
||||
|
||||
</TabItem>
|
||||
</Tabs>
|
||||
|
||||
<details>
|
||||
<summary>Result</summary>
|
||||
|
||||
<CodeSnippet source={resultApiMonitorResultGetVertexBuilds} language="json" />
|
||||
|
||||
</details>
|
||||
|
||||
### Delete Vertex builds
|
||||
|
||||
Delete Vertex builds for a specific flow.
|
||||
|
||||
<Tabs>
|
||||
<TabItem value="Python" label="Python" default>
|
||||
|
||||
<CodeSnippet source={examplePythonApiMonitorDeleteVertexBuilds} language="python" />
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="JavaScript" label="JavaScript">
|
||||
|
||||
<CodeSnippet source={exampleJavascriptApiMonitorDeleteVertexBuilds} language="javascript" />
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="curl" label="curl">
|
||||
|
||||
<CodeSnippet source={exampleApiMonitorDeleteVertexBuilds} language="bash" />
|
||||
|
||||
</TabItem>
|
||||
</Tabs>
|
||||
|
||||
<details>
|
||||
<summary>Result</summary>
|
||||
|
||||
<CodeSnippet source={resultApiMonitorResultDeleteVertexBuilds} language="text" />
|
||||
|
||||
</details>
|
||||
|
||||
## Messages endpoints
|
||||
|
||||
The `/monitor/messages` endpoints store, retrieve, edit, and delete records in the message table in [`langflow.db`](/memory)
|
||||
Typically, these are called implicitly when running flows that produce message history, or when inspecting and modifying **Playground** memories.
|
||||
|
||||
### Get messages
|
||||
|
||||
Retrieve a list of all messages:
|
||||
|
||||
<Tabs>
|
||||
<TabItem value="Python" label="Python" default>
|
||||
|
||||
<CodeSnippet source={examplePythonApiMonitorGetMessages} language="python" />
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="JavaScript" label="JavaScript">
|
||||
|
||||
<CodeSnippet source={exampleJavascriptApiMonitorGetMessages} language="javascript" />
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="curl" label="curl">
|
||||
|
||||
<CodeSnippet source={exampleApiMonitorGetMessages} language="bash" />
|
||||
|
||||
</TabItem>
|
||||
</Tabs>
|
||||
|
||||
To filter messages, use the `flow_id`, `session_id`, `sender`, and `sender_name` query parameters.
|
||||
|
||||
To sort the results, use the `order_by` query parameter.
|
||||
|
||||
This example retrieves messages sent by `Machine` and `AI` in a given chat session (`session_id`) and orders the messages by timestamp.
|
||||
|
||||
<Tabs>
|
||||
<TabItem value="Python" label="Python" default>
|
||||
|
||||
<CodeSnippet source={examplePythonApiMonitorGetMessages2} language="python" />
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="JavaScript" label="JavaScript">
|
||||
|
||||
<CodeSnippet source={exampleJavascriptApiMonitorGetMessages2} language="javascript" />
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="curl" label="curl">
|
||||
|
||||
<CodeSnippet source={exampleApiMonitorGetMessages2} language="bash" />
|
||||
|
||||
</TabItem>
|
||||
</Tabs>
|
||||
|
||||
<details>
|
||||
<summary>Result</summary>
|
||||
|
||||
<CodeSnippet source={resultApiMonitorResultGetMessages2} language="json" />
|
||||
|
||||
</details>
|
||||
|
||||
### Delete messages
|
||||
|
||||
Delete specific messages by their IDs.
|
||||
|
||||
This example deletes the message retrieved in the previous `GET /messages` example.
|
||||
|
||||
<Tabs>
|
||||
<TabItem value="Python" label="Python" default>
|
||||
|
||||
<CodeSnippet source={examplePythonApiMonitorDeleteMessages} language="python" />
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="JavaScript" label="JavaScript">
|
||||
|
||||
<CodeSnippet source={exampleJavascriptApiMonitorDeleteMessages} language="javascript" />
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="curl" label="curl">
|
||||
|
||||
<CodeSnippet source={exampleApiMonitorDeleteMessages} language="bash" />
|
||||
|
||||
</TabItem>
|
||||
</Tabs>
|
||||
|
||||
<details>
|
||||
<summary>Result</summary>
|
||||
|
||||
<CodeSnippet source={resultApiMonitorResultDeleteMessages} language="text" />
|
||||
|
||||
</details>
|
||||
|
||||
### Update message
|
||||
|
||||
Update a specific message by its ID.
|
||||
|
||||
This example updates the `text` value of message `3ab66cc6-c048-48f8-ab07-570f5af7b160`.
|
||||
|
||||
<Tabs>
|
||||
<TabItem value="Python" label="Python" default>
|
||||
|
||||
<CodeSnippet source={examplePythonApiMonitorUpdateMessage} language="python" />
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="JavaScript" label="JavaScript">
|
||||
|
||||
<CodeSnippet source={exampleJavascriptApiMonitorUpdateMessage} language="javascript" />
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="curl" label="curl">
|
||||
|
||||
<CodeSnippet source={exampleApiMonitorUpdateMessage} language="bash" />
|
||||
|
||||
</TabItem>
|
||||
</Tabs>
|
||||
|
||||
<details>
|
||||
<summary>Result</summary>
|
||||
|
||||
<CodeSnippet source={resultApiMonitorResultUpdateMessage} language="json" />
|
||||
|
||||
</details>
|
||||
|
||||
### Update session ID
|
||||
|
||||
Update the session ID for messages.
|
||||
|
||||
This example updates the `session_ID` value `01ce083d-748b-4b8d-97b6-33adbb6a528a` to `different_session_id`.
|
||||
|
||||
<Tabs>
|
||||
<TabItem value="Python" label="Python" default>
|
||||
|
||||
<CodeSnippet source={examplePythonApiMonitorUpdateSessionId} language="python" />
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="JavaScript" label="JavaScript">
|
||||
|
||||
<CodeSnippet source={exampleJavascriptApiMonitorUpdateSessionId} language="javascript" />
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="curl" label="curl">
|
||||
|
||||
<CodeSnippet source={exampleApiMonitorUpdateSessionId} language="bash" />
|
||||
|
||||
</TabItem>
|
||||
</Tabs>
|
||||
|
||||
<details>
|
||||
<summary>Result</summary>
|
||||
|
||||
<CodeSnippet source={resultApiMonitorResultUpdateSessionId} language="json" />
|
||||
|
||||
</details>
|
||||
|
||||
### Delete messages by session
|
||||
|
||||
Delete all messages for a specific session.
|
||||
|
||||
<Tabs>
|
||||
<TabItem value="Python" label="Python" default>
|
||||
|
||||
<CodeSnippet source={examplePythonApiMonitorDeleteMessagesBySession} language="python" />
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="JavaScript" label="JavaScript">
|
||||
|
||||
<CodeSnippet source={exampleJavascriptApiMonitorDeleteMessagesBySession} language="javascript" />
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="curl" label="curl">
|
||||
|
||||
<CodeSnippet source={exampleApiMonitorDeleteMessagesBySession} language="bash" />
|
||||
|
||||
</TabItem>
|
||||
</Tabs>
|
||||
|
||||
<details>
|
||||
<summary>Result</summary>
|
||||
|
||||
<CodeSnippet source={resultApiMonitorResultDeleteMessagesBySession} language="text" />
|
||||
|
||||
</details>
|
||||
|
||||
## Get traces
|
||||
|
||||
Retrieve trace metadata and span trees for a specific flow.
|
||||
|
||||
### Example request
|
||||
|
||||
Use `GET /monitor/traces` and filter by `flow_id`:
|
||||
|
||||
<Tabs>
|
||||
<TabItem value="python" label="Python">
|
||||
|
||||
<CodeSnippet source={examplePythonApiMonitorExampleRequest} language="python" />
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="typescript" label="TypeScript">
|
||||
|
||||
```ts
|
||||
const baseUrl = process.env.LANGFLOW_SERVER_URL ?? "http://localhost:7860";
|
||||
const apiKey = process.env.LANGFLOW_API_KEY!;
|
||||
const flowId = "YOUR_FLOW_ID";
|
||||
|
||||
async function listTraces() {
|
||||
const url = new URL("/api/v1/monitor/traces", baseUrl);
|
||||
url.searchParams.set("flow_id", flowId);
|
||||
url.searchParams.set("page", "1");
|
||||
url.searchParams.set("size", "50");
|
||||
|
||||
const res = await fetch(url.toString(), {
|
||||
headers: {
|
||||
accept: "application/json",
|
||||
"x-api-key": apiKey,
|
||||
},
|
||||
});
|
||||
|
||||
if (!res.ok) {
|
||||
throw new Error(`Request failed with status ${res.status}`);
|
||||
}
|
||||
|
||||
const data = await res.json();
|
||||
console.log(data);
|
||||
}
|
||||
|
||||
listTraces().catch(console.error);
|
||||
```
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="curl" label="curl">
|
||||
|
||||
<CodeSnippet source={exampleApiMonitorExampleRequest} language="bash" />
|
||||
|
||||
</TabItem>
|
||||
</Tabs>
|
||||
|
||||
### Example response
|
||||
|
||||
```json
|
||||
{
|
||||
"traces": [
|
||||
{
|
||||
"id": "426656db-fc3c-4a3a-acf8-c60acf099543",
|
||||
"name": "Simple Agent - 9e774f60-857b-44b4-bbcd-87bd23848ee8",
|
||||
"status": "ok",
|
||||
"startTime": "2026-03-03T19:13:30.692628Z",
|
||||
"totalLatencyMs": 18693,
|
||||
"totalTokens": 2050,
|
||||
"flowId": "9e774f60-857b-44b4-bbcd-87bd23848ee8",
|
||||
"sessionId": "9e774f60-857b-44b4-bbcd-87bd23848ee8",
|
||||
"input": {
|
||||
"input_value": "Use tools to teach me about vertex graphs"
|
||||
},
|
||||
"output": {
|
||||
"message": {
|
||||
"text_key": "text",
|
||||
"data": {
|
||||
"timestamp": "2026-03-03 19:13:30 UTC",
|
||||
"sender": "Machine",
|
||||
"sender_name": "AI",
|
||||
"session_id": "9e774f60-857b-44b4-bbcd-87bd23848ee8",
|
||||
"text": "I can teach you the concept, but I couldn’t pull the Wikipedia pages with the tool ... (truncated)"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"total": 1,
|
||||
"pages": 1
|
||||
}
|
||||
```
|
||||
|
||||
## Get transactions
|
||||
|
||||
Retrieve all transactions, which are interactions between components, for a specific flow.
|
||||
This information is also available in [flow logs](/logging).
|
||||
|
||||
<Tabs>
|
||||
<TabItem value="Python" label="Python" default>
|
||||
|
||||
<CodeSnippet source={examplePythonApiMonitorGetTransactions} language="python" />
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="JavaScript" label="JavaScript">
|
||||
|
||||
<CodeSnippet source={exampleJavascriptApiMonitorGetTransactions} language="javascript" />
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="curl" label="curl">
|
||||
|
||||
<CodeSnippet source={exampleApiMonitorGetTransactions} language="bash" />
|
||||
|
||||
</TabItem>
|
||||
</Tabs>
|
||||
|
||||
<details>
|
||||
<summary>Result</summary>
|
||||
|
||||
<CodeSnippet source={resultApiMonitorResultGetTransactions} language="json" />
|
||||
|
||||
</details>
|
||||
|
||||
## See also
|
||||
|
||||
- [Use voice mode](/concepts-voice-mode)
|
||||
- [Session ID](/session-id)
|
||||
@ -0,0 +1,529 @@
|
||||
---
|
||||
title: OpenAI Responses API
|
||||
slug: /api-openai-responses
|
||||
---
|
||||
import CodeSnippet from '@site/src/components/CodeSnippet';
|
||||
import exampleApiOpenaiResponsesExampleRequest from '!!raw-loader!@site/docs/API-Reference/curl-examples/api-openai-responses/example-request.sh';
|
||||
import exampleApiOpenaiResponsesExampleStreamingRequest from '!!raw-loader!@site/docs/API-Reference/curl-examples/api-openai-responses/example-streaming-request.sh';
|
||||
import resultApiOpenaiResponsesResultExampleStreamingRequest from '!!raw-loader!@site/docs/API-Reference/curl-examples/api-openai-responses/result-example-streaming-request.json';
|
||||
import exampleApiOpenaiResponsesContinueConversationsWithResponseAndSessionIds from '!!raw-loader!@site/docs/API-Reference/curl-examples/api-openai-responses/continue-conversations-with-response-and-session-ids.sh';
|
||||
import resultApiOpenaiResponsesResultContinueConversationsWithResponseAndSessionIds from '!!raw-loader!@site/docs/API-Reference/curl-examples/api-openai-responses/result-continue-conversations-with-response-and-session-ids.json';
|
||||
import exampleApiOpenaiResponsesContinueConversationsWithResponseAndSessionIds2 from '!!raw-loader!@site/docs/API-Reference/curl-examples/api-openai-responses/continue-conversations-with-response-and-session-ids-2.sh';
|
||||
import resultApiOpenaiResponsesResultContinueConversationsWithResponseAndSessionIds2 from '!!raw-loader!@site/docs/API-Reference/curl-examples/api-openai-responses/result-continue-conversations-with-response-and-session-ids-2.json';
|
||||
import exampleApiOpenaiResponsesContinueConversationsWithResponseAndSessionIds3 from '!!raw-loader!@site/docs/API-Reference/curl-examples/api-openai-responses/continue-conversations-with-response-and-session-ids-3.sh';
|
||||
import exampleApiOpenaiResponsesRetrieveToolCallResults from '!!raw-loader!@site/docs/API-Reference/curl-examples/api-openai-responses/retrieve-tool-call-results.sh';
|
||||
import resultApiOpenaiResponsesResultRetrieveToolCallResults from '!!raw-loader!@site/docs/API-Reference/curl-examples/api-openai-responses/result-retrieve-tool-call-results.json';
|
||||
import exampleApiOpenaiResponsesPassGlobalVariablesToYourFlowsInHeaders from '!!raw-loader!@site/docs/API-Reference/curl-examples/api-openai-responses/pass-global-variables-to-your-flows-in-headers.sh';
|
||||
import exampleApiOpenaiResponsesTokenUsageTracking from '!!raw-loader!@site/docs/API-Reference/curl-examples/api-openai-responses/token-usage-tracking.sh';
|
||||
import examplePythonApiOpenaiResponsesAdditionalConfigurationForOpenaiClientLibraries from '!!raw-loader!@site/docs/API-Reference/python-examples/api-openai-responses/additional-configuration-for-openai-client-libraries.py';
|
||||
import exampleJavascriptApiOpenaiResponsesAdditionalConfigurationForOpenaiClientLibraries from '!!raw-loader!@site/docs/API-Reference/javascript-examples/api-openai-responses/additional-configuration-for-openai-client-libraries.ts';
|
||||
import examplePythonApiOpenaiResponsesTokenUsageTracking from '!!raw-loader!@site/docs/API-Reference/python-examples/api-openai-responses/token-usage-tracking.py';
|
||||
import examplePythonApiOpenaiResponsesExampleRequest from '!!raw-loader!@site/docs/API-Reference/python-examples/api-openai-responses/example-request.py';
|
||||
import exampleJavascriptApiOpenaiResponsesExampleRequest from '!!raw-loader!@site/docs/API-Reference/javascript-examples/api-openai-responses/example-request.js';
|
||||
import examplePythonApiOpenaiResponsesExampleStreamingRequest from '!!raw-loader!@site/docs/API-Reference/python-examples/api-openai-responses/example-streaming-request.py';
|
||||
import exampleJavascriptApiOpenaiResponsesExampleStreamingRequest from '!!raw-loader!@site/docs/API-Reference/javascript-examples/api-openai-responses/example-streaming-request.js';
|
||||
import examplePythonApiOpenaiResponsesContinueConversationsWithResponseAndSessionIds from '!!raw-loader!@site/docs/API-Reference/python-examples/api-openai-responses/continue-conversations-with-response-and-session-ids.py';
|
||||
import exampleJavascriptApiOpenaiResponsesContinueConversationsWithResponseAndSessionIds from '!!raw-loader!@site/docs/API-Reference/javascript-examples/api-openai-responses/continue-conversations-with-response-and-session-ids.js';
|
||||
import examplePythonApiOpenaiResponsesContinueConversationsWithResponseAndSessionIds2 from '!!raw-loader!@site/docs/API-Reference/python-examples/api-openai-responses/continue-conversations-with-response-and-session-ids-2.py';
|
||||
import exampleJavascriptApiOpenaiResponsesContinueConversationsWithResponseAndSessionIds2 from '!!raw-loader!@site/docs/API-Reference/javascript-examples/api-openai-responses/continue-conversations-with-response-and-session-ids-2.js';
|
||||
import examplePythonApiOpenaiResponsesContinueConversationsWithResponseAndSessionIds3 from '!!raw-loader!@site/docs/API-Reference/python-examples/api-openai-responses/continue-conversations-with-response-and-session-ids-3.py';
|
||||
import exampleJavascriptApiOpenaiResponsesContinueConversationsWithResponseAndSessionIds3 from '!!raw-loader!@site/docs/API-Reference/javascript-examples/api-openai-responses/continue-conversations-with-response-and-session-ids-3.js';
|
||||
import examplePythonApiOpenaiResponsesRetrieveToolCallResults from '!!raw-loader!@site/docs/API-Reference/python-examples/api-openai-responses/retrieve-tool-call-results.py';
|
||||
import exampleJavascriptApiOpenaiResponsesRetrieveToolCallResults from '!!raw-loader!@site/docs/API-Reference/javascript-examples/api-openai-responses/retrieve-tool-call-results.js';
|
||||
import examplePythonApiOpenaiResponsesPassGlobalVariablesToYourFlowsInHeaders from '!!raw-loader!@site/docs/API-Reference/python-examples/api-openai-responses/pass-global-variables-to-your-flows-in-headers.py';
|
||||
import exampleJavascriptApiOpenaiResponsesPassGlobalVariablesToYourFlowsInHeaders from '!!raw-loader!@site/docs/API-Reference/javascript-examples/api-openai-responses/pass-global-variables-to-your-flows-in-headers.js';
|
||||
import exampleJavascriptApiOpenaiResponsesTokenUsageTracking from '!!raw-loader!@site/docs/API-Reference/javascript-examples/api-openai-responses/token-usage-tracking.js';
|
||||
|
||||
|
||||
|
||||
|
||||
import Tabs from '@theme/Tabs';
|
||||
import TabItem from '@theme/TabItem';
|
||||
|
||||
Langflow includes an endpoint that is compatible with the [OpenAI Responses API](https://platform.openai.com/docs/api-reference/responses).
|
||||
It is available at `POST /api/v1/responses`.
|
||||
|
||||
This endpoint allows you to use existing OpenAI client libraries with minimal code changes.
|
||||
You only need to replace the `model` name, such as `gpt-4`, with your `flow_id`.
|
||||
You can find Flow IDs in the code snippets on the [**API access** pane](/concepts-publish#api-access) or in a flow's URL.
|
||||
|
||||
## Prerequisites
|
||||
|
||||
To be compatible with Langflow's OpenAI Responses API endpoint, your flow and request must adhere to the following requirements:
|
||||
|
||||
- **Chat Input**: Your flow must contain a **Chat Input** component.
|
||||
Flows without this component return an error when passed to this endpoint.
|
||||
The component types `ChatInput` and `Chat Input` are recognized as chat inputs.
|
||||
- **Tools**: The `tools` parameter isn't supported, and returns an error if provided.
|
||||
- **Model Names**: In your request, the `model` field must contain a valid flow ID or endpoint name.
|
||||
- **Authentication**: All requests require an API key passed in the `x-api-key` header.
|
||||
For more information, see [API keys and authentication](/api-keys-and-authentication).
|
||||
|
||||
### Additional configuration for OpenAI client libraries
|
||||
|
||||
This endpoint is compatible with OpenAI's API, but requires special configuration when using OpenAI client libraries.
|
||||
Langflow uses `x-api-key` headers for authentication, while OpenAI uses `Authorization: Bearer` headers.
|
||||
When sending requests to Langflow with OpenAI client libraries, you must configure custom headers and include an `api_key` configuration.
|
||||
The `api_key` parameter can have any value, such as `"dummy-api-key"` in the client examples, as the actual authentication is handled through the `default_headers` configuration.
|
||||
|
||||
In the following examples, replace the values for `LANGFLOW_SERVER_URL`, `LANGFLOW_API_KEY`, and `FLOW_ID` with values from your deployment.
|
||||
<Tabs groupId="client">
|
||||
<TabItem value="Python" label="OpenAI Python Client" default>
|
||||
|
||||
<CodeSnippet source={examplePythonApiOpenaiResponsesAdditionalConfigurationForOpenaiClientLibraries} language="python" />
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="JavaScript" label="OpenAI TypeScript Client">
|
||||
|
||||
<CodeSnippet source={exampleJavascriptApiOpenaiResponsesAdditionalConfigurationForOpenaiClientLibraries} language="javascript" />
|
||||
|
||||
</TabItem>
|
||||
</Tabs>
|
||||
|
||||
<details closed>
|
||||
<summary>Response</summary>
|
||||
```text
|
||||
Here are the event dates for the second Wednesday of each month in 2026:
|
||||
- January 14, 2026
|
||||
- February 11, 2026
|
||||
- March 11, 2026
|
||||
- April 8, 2026
|
||||
- May 13, 2026
|
||||
- June 10, 2026
|
||||
- July 8, 2026
|
||||
- August 12, 2026
|
||||
- September 9, 2026
|
||||
- October 14, 2026
|
||||
- November 11, 2026
|
||||
- December 9, 2026
|
||||
If you need these in a different format or want a downloadable calendar, let me know!
|
||||
```
|
||||
</details>
|
||||
|
||||
## Example request
|
||||
|
||||
<Tabs>
|
||||
<TabItem value="Python" label="Python" default>
|
||||
|
||||
<CodeSnippet source={examplePythonApiOpenaiResponsesExampleRequest} language="python" />
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="JavaScript" label="JavaScript">
|
||||
|
||||
<CodeSnippet source={exampleJavascriptApiOpenaiResponsesExampleRequest} language="javascript" />
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="curl" label="curl">
|
||||
|
||||
<CodeSnippet source={exampleApiOpenaiResponsesExampleRequest} language="bash" />
|
||||
|
||||
</TabItem>
|
||||
</Tabs>
|
||||
|
||||
### Headers
|
||||
|
||||
| Header | Required | Description | Example |
|
||||
|--------|----------|-------------|---------|
|
||||
| `x-api-key` | Yes | Your Langflow API key for authentication | `"sk-..."` |
|
||||
| `Content-Type` | Yes | Specifies the JSON format | `"application/json"` |
|
||||
| `X-LANGFLOW-GLOBAL-VAR-*` | No | Global variables for the flow | `"X-LANGFLOW-GLOBAL-VAR-API_KEY: sk-..."` For more, see [Pass global variables to your flows in headers](#global-var). |
|
||||
|
||||
### Request body
|
||||
|
||||
| Field | Type | Required | Default | Description |
|
||||
|-------|------|----------|---------|-------------|
|
||||
| `model` | `string` | Yes | - | The flow ID or endpoint name to execute. |
|
||||
| `input` | `string` | Yes | - | The input text to process. |
|
||||
| `stream` | `boolean` | No | `false` | Whether to stream the response. |
|
||||
| `background` | `boolean` | No | `false` | Whether to process in background. |
|
||||
| `tools` | `list[Any]` | No | `null` | Tools are not supported yet. |
|
||||
| `previous_response_id` | `string` | No | `null` | ID of previous response to continue conversation. For more, see [Continue conversations with response and session IDs](#response-id). |
|
||||
| `include` | `list[string]` | No | `null` | Additional response data to include, such as `['tool_call.results']`. For more, see [Retrieve tool call results](#tool-call-results). |
|
||||
|
||||
## Example response
|
||||
|
||||
```json
|
||||
{
|
||||
"id": "e5e8ef8a-7efd-4090-a110-6aca082bceb7",
|
||||
"object": "response",
|
||||
"created_at": 1756837941,
|
||||
"status": "completed",
|
||||
"model": "ced2ec91-f325-4bf0-8754-f3198c2b1563",
|
||||
"output": [
|
||||
{
|
||||
"type": "message",
|
||||
"id": "msg_e5e8ef8a-7efd-4090-a110-6aca082bceb7",
|
||||
"status": "completed",
|
||||
"role": "assistant",
|
||||
"content": [
|
||||
{
|
||||
"type": "output_text",
|
||||
"text": "Hello! I'm here and ready to help. How can I assist you today?",
|
||||
"annotations": []
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"parallel_tool_calls": true,
|
||||
"previous_response_id": null,
|
||||
"reasoning": {"effort": null, "summary": null},
|
||||
"store": true,
|
||||
"temperature": 1.0,
|
||||
"text": {"format": {"type": "text"}},
|
||||
"tool_choice": "auto",
|
||||
"tools": [],
|
||||
"top_p": 1.0,
|
||||
"truncation": "disabled",
|
||||
"usage": null,
|
||||
"user": null,
|
||||
"metadata": {}
|
||||
}
|
||||
```
|
||||
|
||||
### Response body
|
||||
|
||||
The response contains fields that Langflow sets dynamically and fields that use OpenAI-compatible defaults.
|
||||
|
||||
The OpenAI-compatible default values shown above are currently fixed and cannot be modified via the request.
|
||||
They are included to maintain API compatibility and provide a consistent response format.
|
||||
|
||||
For your requests, you will only be setting the dynamic fields.
|
||||
The default values are documented here for completeness and to show the full response structure.
|
||||
|
||||
Fields set dynamically by Langflow:
|
||||
|
||||
| Field | Type | Description |
|
||||
|-------|------|-------------|
|
||||
| `id` | `string` | Unique response identifier. |
|
||||
| `created_at` | `int` | Unix timestamp of response creation. |
|
||||
| `model` | `string` | The flow ID that was executed. |
|
||||
| `output` | `list[dict]` | Array of output items (messages, tool calls, etc.). |
|
||||
| `previous_response_id` | `string` | ID of previous response if continuing conversation. |
|
||||
| `usage` | `dict` | Token usage statistics if the `usage` field is available. Contains `prompt_tokens`, `completion_tokens`, and `total_tokens`. |
|
||||
|
||||
<details>
|
||||
<summary>Fields with OpenAI-compatible default values</summary>
|
||||
|
||||
| Field | Type | Default Value | Description |
|
||||
|-------|------|---------------|-------------|
|
||||
| `object` | `string` | `"response"` | Always `"response"`. |
|
||||
| `status` | `string` | `"completed"` | Response status: `"completed"`, `"in_progress"`, or `"failed"`. |
|
||||
| `error` | `dict` | `null` | Error details (if any). |
|
||||
| `incomplete_details` | `dict` | `null` | Incomplete response details (if any). |
|
||||
| `instructions` | `string` | `null` | Response instructions (if any). |
|
||||
| `max_output_tokens` | `int` | `null` | Maximum output tokens (if any). |
|
||||
| `parallel_tool_calls` | `boolean` | `true` | Whether parallel tool calls are enabled. |
|
||||
| `reasoning` | `dict` | `{"effort": null, "summary": null}` | Reasoning information with effort and summary. |
|
||||
| `store` | `boolean` | `true` | Whether response is stored. |
|
||||
| `temperature` | `float` | `1.0` | Temperature setting. |
|
||||
| `text` | `dict` | `{"format": {"type": "text"}}` | Text format configuration. |
|
||||
| `tool_choice` | `string` | `"auto"` | Tool choice setting. |
|
||||
| `tools` | `list[dict]` | `[]` | Available tools. |
|
||||
| `top_p` | `float` | `1.0` | Top-p setting. |
|
||||
| `truncation` | `string` | `"disabled"` | Truncation setting. |
|
||||
| `usage` | `dict` | `null` | Token usage statistics. Set dynamically when available from flow components, otherwise `null`. See [Token usage tracking](#token-usage-tracking). |
|
||||
| `user` | `string` | `null` | User identifier (if any). |
|
||||
| `metadata` | `dict` | `{}` | Additional metadata. |
|
||||
|
||||
</details>
|
||||
|
||||
## Example streaming request
|
||||
|
||||
When you set `"stream": true` with your request, the API returns a stream where each chunk contains a small piece of the response as it's generated. This provides a real-time experience where users can see the AI's output appear word by word, similar to ChatGPT's typing effect.
|
||||
|
||||
<Tabs>
|
||||
<TabItem value="Python" label="Python" default>
|
||||
|
||||
<CodeSnippet source={examplePythonApiOpenaiResponsesExampleStreamingRequest} language="python" />
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="JavaScript" label="JavaScript">
|
||||
|
||||
<CodeSnippet source={exampleJavascriptApiOpenaiResponsesExampleStreamingRequest} language="javascript" />
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="curl" label="curl">
|
||||
|
||||
<CodeSnippet source={exampleApiOpenaiResponsesExampleStreamingRequest} language="bash" />
|
||||
|
||||
</TabItem>
|
||||
</Tabs>
|
||||
|
||||
<details>
|
||||
<summary>Result</summary>
|
||||
|
||||
<CodeSnippet source={resultApiOpenaiResponsesResultExampleStreamingRequest} language="json" />
|
||||
|
||||
</details>
|
||||
|
||||
### Streaming response body
|
||||
|
||||
| Field | Type | Description |
|
||||
|-------|------|-------------|
|
||||
| `id` | `string` | Unique response identifier. |
|
||||
| `object` | `string` | Always `"response.chunk"`. |
|
||||
| `created` | `int` | Unix timestamp of chunk creation. |
|
||||
| `model` | `string` | The flow ID that was executed. |
|
||||
| `delta` | `dict` | The new content chunk. |
|
||||
| `status` | `string` | Response status: `"completed"`, `"in_progress"`, or `"failed"` (optional). |
|
||||
|
||||
The stream continues until a final chunk with `"status": "completed"` indicates the response is finished.
|
||||
|
||||
<details>
|
||||
<summary>Final completion chunk</summary>
|
||||
|
||||
```
|
||||
{
|
||||
"id": "f7fcea36-f128-41c4-9ac1-e683137375d5",
|
||||
"object": "response.chunk",
|
||||
"created": 1756838094,
|
||||
"model": "ced2ec91-f325-4bf0-8754-f3198c2b1563",
|
||||
"delta": {},
|
||||
"status": "completed"
|
||||
}
|
||||
```
|
||||
</details>
|
||||
|
||||
## Continue conversations with response and session IDs {#response-id}
|
||||
|
||||
Conversation continuity allows you to maintain context across multiple API calls, enabling multi-turn conversations with your flows. This is essential for building chat applications where users can have ongoing conversations.
|
||||
|
||||
When you make a request, the API returns a response with an `id` field. You can use this `id` as the `previous_response_id` in your next request to continue the conversation from where it left off.
|
||||
|
||||
First Message:
|
||||
|
||||
<Tabs>
|
||||
<TabItem value="Python" label="Python" default>
|
||||
|
||||
<CodeSnippet source={examplePythonApiOpenaiResponsesContinueConversationsWithResponseAndSessionIds} language="python" />
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="JavaScript" label="JavaScript">
|
||||
|
||||
<CodeSnippet source={exampleJavascriptApiOpenaiResponsesContinueConversationsWithResponseAndSessionIds} language="javascript" />
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="curl" label="curl">
|
||||
|
||||
<CodeSnippet source={exampleApiOpenaiResponsesContinueConversationsWithResponseAndSessionIds} language="bash" />
|
||||
|
||||
</TabItem>
|
||||
</Tabs>
|
||||
|
||||
<details>
|
||||
<summary>Result</summary>
|
||||
|
||||
<CodeSnippet source={resultApiOpenaiResponsesResultContinueConversationsWithResponseAndSessionIds} language="json" />
|
||||
|
||||
</details>
|
||||
|
||||
Follow-up message:
|
||||
|
||||
<Tabs>
|
||||
<TabItem value="Python" label="Python" default>
|
||||
|
||||
<CodeSnippet source={examplePythonApiOpenaiResponsesContinueConversationsWithResponseAndSessionIds2} language="python" />
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="JavaScript" label="JavaScript">
|
||||
|
||||
<CodeSnippet source={exampleJavascriptApiOpenaiResponsesContinueConversationsWithResponseAndSessionIds2} language="javascript" />
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="curl" label="curl">
|
||||
|
||||
<CodeSnippet source={exampleApiOpenaiResponsesContinueConversationsWithResponseAndSessionIds2} language="bash" />
|
||||
|
||||
</TabItem>
|
||||
</Tabs>
|
||||
|
||||
<details>
|
||||
<summary>Result</summary>
|
||||
|
||||
<CodeSnippet source={resultApiOpenaiResponsesResultContinueConversationsWithResponseAndSessionIds2} language="json" />
|
||||
|
||||
</details>
|
||||
|
||||
Optionally, you can use your own session ID values for the `previous_response_id`:
|
||||
|
||||
<Tabs>
|
||||
<TabItem value="Python" label="Python" default>
|
||||
|
||||
<CodeSnippet source={examplePythonApiOpenaiResponsesContinueConversationsWithResponseAndSessionIds3} language="python" />
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="JavaScript" label="JavaScript">
|
||||
|
||||
<CodeSnippet source={exampleJavascriptApiOpenaiResponsesContinueConversationsWithResponseAndSessionIds3} language="javascript" />
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="curl" label="curl">
|
||||
|
||||
<CodeSnippet source={exampleApiOpenaiResponsesContinueConversationsWithResponseAndSessionIds3} language="bash" />
|
||||
|
||||
</TabItem>
|
||||
</Tabs>
|
||||
|
||||
<details>
|
||||
<summary>Result</summary>
|
||||
|
||||
This example uses the same flow as the other `previous_response_id` examples, but the LLM had not yet been introduced to Alice in the specified session:
|
||||
|
||||
```json
|
||||
{
|
||||
"id": "session-alice-1756839048",
|
||||
"object": "response",
|
||||
"created_at": 1756839048,
|
||||
"status": "completed",
|
||||
"model": "ced2ec91-f325-4bf0-8754-f3198c2b1563",
|
||||
"output": [
|
||||
{
|
||||
"type": "message",
|
||||
"id": "msg_session-alice-1756839048",
|
||||
"status": "completed",
|
||||
"role": "assistant",
|
||||
"content": [
|
||||
{
|
||||
"type": "output_text",
|
||||
"text": "I don't have access to your name unless you tell me. If you'd like, you can share your name, and I'll remember it for this conversation!",
|
||||
"annotations": []
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"previous_response_id": "session-alice-1756839048"
|
||||
}
|
||||
```
|
||||
|
||||
</details>
|
||||
|
||||
## Retrieve tool call results {#tool-call-results}
|
||||
|
||||
When you send a request to the `/api/v1/responses` endpoint to run a flow that includes tools or function calls, you can retrieve the raw tool execution details by adding `"include": ["tool_call.results"]` to the request payload.
|
||||
|
||||
Without the `include` parameter, tool calls return basic function call information, but not the raw tool results.
|
||||
For example:
|
||||
|
||||
```json
|
||||
{
|
||||
"id": "fc_1",
|
||||
"type": "function_call",
|
||||
"status": "completed",
|
||||
"name": "evaluate_expression",
|
||||
"arguments": "{\"expression\": \"15*23\"}"
|
||||
},
|
||||
```
|
||||
|
||||
To get the raw `results` of each tool execution, add `include: ["tool_call.results"]` to the request payload:
|
||||
|
||||
<Tabs>
|
||||
<TabItem value="Python" label="Python" default>
|
||||
|
||||
<CodeSnippet source={examplePythonApiOpenaiResponsesRetrieveToolCallResults} language="python" />
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="JavaScript" label="JavaScript">
|
||||
|
||||
<CodeSnippet source={exampleJavascriptApiOpenaiResponsesRetrieveToolCallResults} language="javascript" />
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="curl" label="curl">
|
||||
|
||||
<CodeSnippet source={exampleApiOpenaiResponsesRetrieveToolCallResults} language="bash" />
|
||||
|
||||
</TabItem>
|
||||
</Tabs>
|
||||
|
||||
The response now includes the tool call's results.
|
||||
For example:
|
||||
|
||||
```json
|
||||
{
|
||||
"id": "evaluate_expression_1",
|
||||
"type": "tool_call",
|
||||
"tool_name": "evaluate_expression",
|
||||
"queries": ["15*23"],
|
||||
"results": {"result": "345"}
|
||||
}
|
||||
```
|
||||
|
||||
<details>
|
||||
<summary>Result</summary>
|
||||
|
||||
<CodeSnippet source={resultApiOpenaiResponsesResultRetrieveToolCallResults} language="json" />
|
||||
|
||||
</details>
|
||||
|
||||
Variables passed with `X-LANGFLOW-GLOBAL-VAR-{VARIABLE_NAME}` are always available to your flow, regardless of whether they exist in the database.
|
||||
|
||||
If your flow components reference variables that aren't provided in headers or your Langflow database, the flow fails by default.
|
||||
|
||||
To avoid this, you can set the `FALLBACK_TO_ENV_VARS` environment variable is `true`, which allows the flow to use values from the `.env` file if they aren't otherwise specified.
|
||||
|
||||
In the above example, `OPENAI_API_KEY` will fall back to the database variable if not provided in the header.
|
||||
`USER_ID` and `ENVIRONMENT` will fall back to environment variables if `FALLBACK_TO_ENV_VARS` is enabled.
|
||||
Otherwise, the flow fails.
|
||||
|
||||
## Token usage tracking {#token-usage-tracking}
|
||||
|
||||
The OpenAI Responses API endpoint tracks token usage when your flow uses language model components that provide token usage information. The `usage` field in the response contains statistics about the number of tokens used for the request and response.
|
||||
|
||||
Token usage is automatically extracted from the flow execution results when the `usage` field is available.
|
||||
The `usage` field follows OpenAI's format with `prompt_tokens`, `completion_tokens`, and `total_tokens` fields.
|
||||
If token usage information is not available from the flow components, the `usage` field is `null`.
|
||||
|
||||
The `usage` field is always present in the response, either with token counts or as `null`. The conditional checks shown in the examples below are optional defensive programming to handle cases where usage might not be available.
|
||||
|
||||
<Tabs groupId="token-usage">
|
||||
<TabItem value="Python" label="Python" default>
|
||||
|
||||
<CodeSnippet source={examplePythonApiOpenaiResponsesTokenUsageTracking} language="python" />
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="JavaScript" label="JavaScript">
|
||||
|
||||
<CodeSnippet source={exampleJavascriptApiOpenaiResponsesTokenUsageTracking} language="javascript" />
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="curl" label="curl">
|
||||
|
||||
<CodeSnippet source={exampleApiOpenaiResponsesTokenUsageTracking} language="bash" />
|
||||
|
||||
<details>
|
||||
<summary>Response with token usage</summary>
|
||||
|
||||
```json
|
||||
{
|
||||
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
|
||||
"object": "response",
|
||||
"created_at": 1756837941,
|
||||
"status": "completed",
|
||||
"model": "ced2ec91-f325-4bf0-8754-f3198c2b1563",
|
||||
"output": [
|
||||
{
|
||||
"type": "message",
|
||||
"id": "msg_a1b2c3d4-e5f6-7890-abcd-ef1234567890",
|
||||
"status": "completed",
|
||||
"role": "assistant",
|
||||
"content": [
|
||||
{
|
||||
"type": "output_text",
|
||||
"text": "Quantum computing is a type of computing that uses quantum mechanical phenomena...",
|
||||
"annotations": []
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"usage": {
|
||||
"prompt_tokens": 12,
|
||||
"completion_tokens": 145,
|
||||
"total_tokens": 157
|
||||
},
|
||||
"previous_response_id": null
|
||||
}
|
||||
```
|
||||
|
||||
</details>
|
||||
|
||||
</TabItem>
|
||||
</Tabs>
|
||||
259
docs/versioned_docs/version-1.9.0/API-Reference/api-projects.mdx
Normal file
259
docs/versioned_docs/version-1.9.0/API-Reference/api-projects.mdx
Normal file
@ -0,0 +1,259 @@
|
||||
---
|
||||
title: Projects endpoints
|
||||
slug: /api-projects
|
||||
---
|
||||
import CodeSnippet from '@site/src/components/CodeSnippet';
|
||||
import exampleApiProjectsReadProjects from '!!raw-loader!@site/docs/API-Reference/curl-examples/api-projects/read-projects.sh';
|
||||
import resultApiProjectsResultReadProjects from '!!raw-loader!@site/docs/API-Reference/curl-examples/api-projects/result-read-projects.json';
|
||||
import exampleApiProjectsCreateProject from '!!raw-loader!@site/docs/API-Reference/curl-examples/api-projects/create-project.sh';
|
||||
import resultApiProjectsResultCreateProject from '!!raw-loader!@site/docs/API-Reference/curl-examples/api-projects/result-create-project.json';
|
||||
import exampleApiProjectsCreateProject2 from '!!raw-loader!@site/docs/API-Reference/curl-examples/api-projects/create-project-2.sh';
|
||||
import exampleApiProjectsReadProject from '!!raw-loader!@site/docs/API-Reference/curl-examples/api-projects/read-project.sh';
|
||||
import resultApiProjectsResultReadProject from '!!raw-loader!@site/docs/API-Reference/curl-examples/api-projects/result-read-project.json';
|
||||
import exampleApiProjectsUpdateProject from '!!raw-loader!@site/docs/API-Reference/curl-examples/api-projects/update-project.sh';
|
||||
import resultApiProjectsResultUpdateProject from '!!raw-loader!@site/docs/API-Reference/curl-examples/api-projects/result-update-project.json';
|
||||
import exampleApiProjectsDeleteProject from '!!raw-loader!@site/docs/API-Reference/curl-examples/api-projects/delete-project.sh';
|
||||
import resultApiProjectsResultDeleteProject from '!!raw-loader!@site/docs/API-Reference/curl-examples/api-projects/result-delete-project.txt';
|
||||
import exampleApiProjectsExportAProject from '!!raw-loader!@site/docs/API-Reference/curl-examples/api-projects/export-a-project.sh';
|
||||
import exampleApiProjectsImportAProject from '!!raw-loader!@site/docs/API-Reference/curl-examples/api-projects/import-a-project.sh';
|
||||
import Tabs from '@theme/Tabs';
|
||||
import TabItem from '@theme/TabItem';
|
||||
import examplePythonApiProjectsReadProjects from '!!raw-loader!@site/docs/API-Reference/python-examples/api-projects/read-projects.py';
|
||||
import exampleJavascriptApiProjectsReadProjects from '!!raw-loader!@site/docs/API-Reference/javascript-examples/api-projects/read-projects.js';
|
||||
import examplePythonApiProjectsCreateProject from '!!raw-loader!@site/docs/API-Reference/python-examples/api-projects/create-project.py';
|
||||
import exampleJavascriptApiProjectsCreateProject from '!!raw-loader!@site/docs/API-Reference/javascript-examples/api-projects/create-project.js';
|
||||
import examplePythonApiProjectsCreateProject2 from '!!raw-loader!@site/docs/API-Reference/python-examples/api-projects/create-project-2.py';
|
||||
import exampleJavascriptApiProjectsCreateProject2 from '!!raw-loader!@site/docs/API-Reference/javascript-examples/api-projects/create-project-2.js';
|
||||
import examplePythonApiProjectsReadProject from '!!raw-loader!@site/docs/API-Reference/python-examples/api-projects/read-project.py';
|
||||
import exampleJavascriptApiProjectsReadProject from '!!raw-loader!@site/docs/API-Reference/javascript-examples/api-projects/read-project.js';
|
||||
import examplePythonApiProjectsUpdateProject from '!!raw-loader!@site/docs/API-Reference/python-examples/api-projects/update-project.py';
|
||||
import exampleJavascriptApiProjectsUpdateProject from '!!raw-loader!@site/docs/API-Reference/javascript-examples/api-projects/update-project.js';
|
||||
import examplePythonApiProjectsDeleteProject from '!!raw-loader!@site/docs/API-Reference/python-examples/api-projects/delete-project.py';
|
||||
import exampleJavascriptApiProjectsDeleteProject from '!!raw-loader!@site/docs/API-Reference/javascript-examples/api-projects/delete-project.js';
|
||||
import examplePythonApiProjectsExportAProject from '!!raw-loader!@site/docs/API-Reference/python-examples/api-projects/export-a-project.py';
|
||||
import exampleJavascriptApiProjectsExportAProject from '!!raw-loader!@site/docs/API-Reference/javascript-examples/api-projects/export-a-project.js';
|
||||
import examplePythonApiProjectsImportAProject from '!!raw-loader!@site/docs/API-Reference/python-examples/api-projects/import-a-project.py';
|
||||
import exampleJavascriptApiProjectsImportAProject from '!!raw-loader!@site/docs/API-Reference/javascript-examples/api-projects/import-a-project.js';
|
||||
|
||||
|
||||
|
||||
Use the `/projects` endpoint to create, read, update, and delete [Langflow projects](/concepts-flows#projects).
|
||||
|
||||
## Read projects
|
||||
|
||||
Get a list of Langflow projects, including project IDs, names, and descriptions.
|
||||
|
||||
<Tabs>
|
||||
<TabItem value="Python" label="Python" default>
|
||||
|
||||
<CodeSnippet source={examplePythonApiProjectsReadProjects} language="python" />
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="JavaScript" label="JavaScript">
|
||||
|
||||
<CodeSnippet source={exampleJavascriptApiProjectsReadProjects} language="javascript" />
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="curl" label="curl">
|
||||
|
||||
<CodeSnippet source={exampleApiProjectsReadProjects} language="bash" />
|
||||
|
||||
</TabItem>
|
||||
</Tabs>
|
||||
|
||||
<details>
|
||||
<summary>Result</summary>
|
||||
|
||||
<CodeSnippet source={resultApiProjectsResultReadProjects} language="json" />
|
||||
|
||||
</details>
|
||||
|
||||
## Create project
|
||||
|
||||
Create a new project.
|
||||
|
||||
<Tabs>
|
||||
<TabItem value="Python" label="Python" default>
|
||||
|
||||
<CodeSnippet source={examplePythonApiProjectsCreateProject} language="python" />
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="JavaScript" label="JavaScript">
|
||||
|
||||
<CodeSnippet source={exampleJavascriptApiProjectsCreateProject} language="javascript" />
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="curl" label="curl">
|
||||
|
||||
<CodeSnippet source={exampleApiProjectsCreateProject} language="bash" />
|
||||
|
||||
</TabItem>
|
||||
</Tabs>
|
||||
|
||||
<details>
|
||||
<summary>Result</summary>
|
||||
|
||||
<CodeSnippet source={resultApiProjectsResultCreateProject} language="json" />
|
||||
|
||||
</details>
|
||||
|
||||
To add flows and components at project creation, retrieve the `components_list` and `flows_list` values from the [`/all`](/api-reference-api-examples#get-all-components) and [/flows/read](/api-flows#read-flows) endpoints and add them to the request body.
|
||||
|
||||
Adding a flow to a project moves the flow from its previous location. The flow isn't copied.
|
||||
|
||||
<Tabs>
|
||||
<TabItem value="Python" label="Python" default>
|
||||
|
||||
<CodeSnippet source={examplePythonApiProjectsCreateProject2} language="python" />
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="JavaScript" label="JavaScript">
|
||||
|
||||
<CodeSnippet source={exampleJavascriptApiProjectsCreateProject2} language="javascript" />
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="curl" label="curl">
|
||||
|
||||
<CodeSnippet source={exampleApiProjectsCreateProject2} language="bash" />
|
||||
|
||||
</TabItem>
|
||||
</Tabs>
|
||||
|
||||
## Read project
|
||||
|
||||
Retrieve details of a specific project.
|
||||
|
||||
To find the UUID of your project, call the [read projects](#read-projects) endpoint.
|
||||
|
||||
<Tabs>
|
||||
<TabItem value="Python" label="Python" default>
|
||||
|
||||
<CodeSnippet source={examplePythonApiProjectsReadProject} language="python" />
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="JavaScript" label="JavaScript">
|
||||
|
||||
<CodeSnippet source={exampleJavascriptApiProjectsReadProject} language="javascript" />
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="curl" label="curl">
|
||||
|
||||
<CodeSnippet source={exampleApiProjectsReadProject} language="bash" />
|
||||
|
||||
</TabItem>
|
||||
</Tabs>
|
||||
|
||||
<details>
|
||||
<summary>Result</summary>
|
||||
|
||||
<CodeSnippet source={resultApiProjectsResultReadProject} language="json" />
|
||||
|
||||
</details>
|
||||
|
||||
## Update project
|
||||
|
||||
Update the information of a specific project with a `PATCH` request.
|
||||
|
||||
Each PATCH request updates the project with the values you send.
|
||||
Only the fields you include in your request are updated.
|
||||
If you send the same values multiple times, the update is still processed, even if the values are unchanged.
|
||||
|
||||
<Tabs>
|
||||
<TabItem value="Python" label="Python" default>
|
||||
|
||||
<CodeSnippet source={examplePythonApiProjectsUpdateProject} language="python" />
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="JavaScript" label="JavaScript">
|
||||
|
||||
<CodeSnippet source={exampleJavascriptApiProjectsUpdateProject} language="javascript" />
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="curl" label="curl">
|
||||
|
||||
<CodeSnippet source={exampleApiProjectsUpdateProject} language="bash" />
|
||||
|
||||
</TabItem>
|
||||
</Tabs>
|
||||
|
||||
<details>
|
||||
<summary>Result</summary>
|
||||
|
||||
<CodeSnippet source={resultApiProjectsResultUpdateProject} language="json" />
|
||||
|
||||
</details>
|
||||
|
||||
## Delete project
|
||||
|
||||
Delete a specific project.
|
||||
|
||||
<Tabs>
|
||||
<TabItem value="Python" label="Python" default>
|
||||
|
||||
<CodeSnippet source={examplePythonApiProjectsDeleteProject} language="python" />
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="JavaScript" label="JavaScript">
|
||||
|
||||
<CodeSnippet source={exampleJavascriptApiProjectsDeleteProject} language="javascript" />
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="curl" label="curl">
|
||||
|
||||
<CodeSnippet source={exampleApiProjectsDeleteProject} language="bash" />
|
||||
|
||||
</TabItem>
|
||||
</Tabs>
|
||||
|
||||
<details>
|
||||
<summary>Result</summary>
|
||||
|
||||
<CodeSnippet source={resultApiProjectsResultDeleteProject} language="text" />
|
||||
|
||||
</details>
|
||||
|
||||
## Export a project
|
||||
|
||||
Download all flows from a project as a zip file.
|
||||
|
||||
The `--output` flag is optional.
|
||||
|
||||
<Tabs>
|
||||
<TabItem value="Python" label="Python" default>
|
||||
|
||||
<CodeSnippet source={examplePythonApiProjectsExportAProject} language="python" />
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="JavaScript" label="JavaScript">
|
||||
|
||||
<CodeSnippet source={exampleJavascriptApiProjectsExportAProject} language="javascript" />
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="curl" label="curl">
|
||||
|
||||
<CodeSnippet source={exampleApiProjectsExportAProject} language="bash" />
|
||||
|
||||
</TabItem>
|
||||
</Tabs>
|
||||
|
||||
## Import a project
|
||||
|
||||
Import a project and its flows by uploading a Langflow project zip file:
|
||||
|
||||
<Tabs>
|
||||
<TabItem value="Python" label="Python" default>
|
||||
|
||||
<CodeSnippet source={examplePythonApiProjectsImportAProject} language="python" />
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="JavaScript" label="JavaScript">
|
||||
|
||||
<CodeSnippet source={exampleJavascriptApiProjectsImportAProject} language="javascript" />
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="curl" label="curl">
|
||||
|
||||
<CodeSnippet source={exampleApiProjectsImportAProject} language="bash" />
|
||||
|
||||
</TabItem>
|
||||
</Tabs>
|
||||
@ -0,0 +1,440 @@
|
||||
---
|
||||
title: Get started with the Langflow API
|
||||
slug: /api-reference-api-examples
|
||||
---
|
||||
import CodeSnippet from '@site/src/components/CodeSnippet';
|
||||
import exampleApiReferenceApiExamplesFormLangflowApiRequests from '!!raw-loader!@site/docs/API-Reference/curl-examples/api-reference-api-examples/form-langflow-api-requests.sh';
|
||||
import exampleApiReferenceApiExamplesSetEnvironmentVariables from '!!raw-loader!@site/docs/API-Reference/curl-examples/api-reference-api-examples/set-environment-variables.sh';
|
||||
import exampleApiReferenceApiExamplesHealthCheck from '!!raw-loader!@site/docs/API-Reference/curl-examples/api-reference-api-examples/health-check.sh';
|
||||
import resultApiReferenceApiExamplesResultHealthCheck from '!!raw-loader!@site/docs/API-Reference/curl-examples/api-reference-api-examples/result-health-check.json';
|
||||
import exampleApiReferenceApiExamplesGetVersion from '!!raw-loader!@site/docs/API-Reference/curl-examples/api-reference-api-examples/get-version.sh';
|
||||
import resultApiReferenceApiExamplesResultGetVersion from '!!raw-loader!@site/docs/API-Reference/curl-examples/api-reference-api-examples/result-get-version.txt';
|
||||
import exampleApiReferenceApiExamplesGetConfiguration from '!!raw-loader!@site/docs/API-Reference/curl-examples/api-reference-api-examples/get-configuration.sh';
|
||||
import resultApiReferenceApiExamplesResultGetConfiguration from '!!raw-loader!@site/docs/API-Reference/curl-examples/api-reference-api-examples/result-get-configuration.json';
|
||||
import exampleApiReferenceApiExamplesGetAllComponents from '!!raw-loader!@site/docs/API-Reference/curl-examples/api-reference-api-examples/get-all-components.sh';
|
||||
import examplePythonApiReferenceApiExamplesFormLangflowApiRequests from '!!raw-loader!@site/docs/API-Reference/python-examples/api-reference-api-examples/form-langflow-api-requests.py';
|
||||
import exampleJavascriptApiReferenceApiExamplesFormLangflowApiRequests from '!!raw-loader!@site/docs/API-Reference/javascript-examples/api-reference-api-examples/form-langflow-api-requests.js';
|
||||
import examplePythonApiReferenceApiExamplesHealthCheck from '!!raw-loader!@site/docs/API-Reference/python-examples/api-reference-api-examples/health-check.py';
|
||||
import exampleJavascriptApiReferenceApiExamplesHealthCheck from '!!raw-loader!@site/docs/API-Reference/javascript-examples/api-reference-api-examples/health-check.js';
|
||||
import examplePythonApiReferenceApiExamplesGetVersion from '!!raw-loader!@site/docs/API-Reference/python-examples/api-reference-api-examples/get-version.py';
|
||||
import exampleJavascriptApiReferenceApiExamplesGetVersion from '!!raw-loader!@site/docs/API-Reference/javascript-examples/api-reference-api-examples/get-version.js';
|
||||
import examplePythonApiReferenceApiExamplesGetConfiguration from '!!raw-loader!@site/docs/API-Reference/python-examples/api-reference-api-examples/get-configuration.py';
|
||||
import exampleJavascriptApiReferenceApiExamplesGetConfiguration from '!!raw-loader!@site/docs/API-Reference/javascript-examples/api-reference-api-examples/get-configuration.js';
|
||||
import examplePythonApiReferenceApiExamplesGetAllComponents from '!!raw-loader!@site/docs/API-Reference/python-examples/api-reference-api-examples/get-all-components.py';
|
||||
import exampleJavascriptApiReferenceApiExamplesGetAllComponents from '!!raw-loader!@site/docs/API-Reference/javascript-examples/api-reference-api-examples/get-all-components.js';
|
||||
|
||||
|
||||
|
||||
import Tabs from '@theme/Tabs';
|
||||
import TabItem from '@theme/TabItem';
|
||||
|
||||
You can use the Langflow API for programmatic interactions with Langflow, such as the following:
|
||||
|
||||
* Create and edit flows, including file management for flows.
|
||||
* Develop applications that use your flows.
|
||||
* Develop custom components.
|
||||
* Build Langflow as a dependency of a larger application, codebase, or service.
|
||||
* Contribute to the overall Langflow codebase.
|
||||
|
||||
To view and test all available endpoints, you can access the Langflow API's OpenAPI specification at your Langflow deployment's `/docs` endpoint, such as `http://localhost:7860/docs`.
|
||||
|
||||
:::tip Try it
|
||||
For an example of the Langflow API in a script, see the [Langflow quickstart](/get-started-quickstart).
|
||||
|
||||
The quickstart demonstrates how to get automatically generated code snippets for your flows, use a script to run a flow, and extract data from the Langfow API response.
|
||||
:::
|
||||
|
||||
## Form Langflow API requests
|
||||
|
||||
While individual options vary by endpoint, all Langflow API requests share some commonalities, like a URL, method, parameters, and authentication.
|
||||
|
||||
As an example of a Langflow API request, the following curl command calls the `/v1/run` endpoint, and it passes a runtime override (`tweaks`) to the flow's **Chat Output** component:
|
||||
|
||||
<Tabs>
|
||||
<TabItem value="Python" label="Python" default>
|
||||
|
||||
<CodeSnippet source={examplePythonApiReferenceApiExamplesFormLangflowApiRequests} language="python" />
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="JavaScript" label="JavaScript">
|
||||
|
||||
<CodeSnippet source={exampleJavascriptApiReferenceApiExamplesFormLangflowApiRequests} language="javascript" />
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="curl" label="curl">
|
||||
|
||||
<CodeSnippet source={exampleApiReferenceApiExamplesFormLangflowApiRequests} language="bash" />
|
||||
|
||||
</TabItem>
|
||||
</Tabs>
|
||||
|
||||
### Base URL
|
||||
|
||||
By default, local deployments serve the Langflow API at `http://localhost:7860/api`.
|
||||
|
||||
Remotely hosted Langflow deployments are available at the domain set by the hosting service, such as `http://IP_OR_DNS/api` or `http://IP_OR_DNS:LANGFLOW_PORT/api`.
|
||||
|
||||
You can configure the Langflow port number in the `LANGFLOW_PORT` [environment variable](/environment-variables).
|
||||
|
||||
* `https://UUID.ngrok.app/api`
|
||||
* `http://IP_OR_DNS/api`
|
||||
* `http://IP_OR_DNS:LANGFLOW_PORT/api`
|
||||
|
||||
### Authentication
|
||||
|
||||
In Langflow versions 1.5 and later, most API endpoints require authentication with a Langflow API key in either an `x-api-key` header or query parameter.
|
||||
For more information, see [API keys and authentication](/api-keys-and-authentication).
|
||||
|
||||
As with any API, follow industry best practices for storing and referencing sensitive credentials.
|
||||
For example, you can [set environment variables](#set-environment-variables) for your API keys, and then reference those environment variables in your API requests.
|
||||
|
||||
### Methods, paths, and parameters
|
||||
|
||||
Langflow API requests use various methods, paths, path parameters, query parameters, and body parameters.
|
||||
The specific requirements and options depend on the endpoint that you want to call.
|
||||
|
||||
For example, to create a flow, you pass a JSON-formatted flow definition to `POST /v1/flows`.
|
||||
Then, to run your flow, you call `POST /v1/run/$FLOW_ID` with optional run parameters in the request body.
|
||||
|
||||
### API versions
|
||||
|
||||
The Langflow API serves `/v1` and `/v2` endpoints.
|
||||
|
||||
Some endpoints only exist under a single version and some exist under both the `/v1` and `/v2` versions.
|
||||
|
||||
If a request fails or has an unexpected result, make sure your endpoint path has the correct version.
|
||||
|
||||
## Set environment variables
|
||||
|
||||
You can store commonly used values in environment variables to facilitate reuse, simplify token rotation, and securely reference sensitive values.
|
||||
|
||||
You can use any method you prefer to set environment variables, such as `export`, `.env`, `zshrc`, or `.curlrc`.
|
||||
Then, reference those environment variables in your API requests.
|
||||
For example:
|
||||
|
||||
<CodeSnippet source={exampleApiReferenceApiExamplesSetEnvironmentVariables} language="bash" />
|
||||
|
||||
Commonly used values in Langflow API requests include your [Langflow server URL](#base-url), [Langflow API keys](#authentication), flow IDs, and [project IDs](/api-projects#read-projects).
|
||||
|
||||
You can retrieve flow IDs from the [**API access** pane](/concepts-publish#api-access), in a flow's URL, and with [`GET /flows`](/api-flows#read-flows).
|
||||
|
||||
## Try some Langflow API requests
|
||||
|
||||
Once you have your Langflow server URL, try calling these endpoints that return Langflow metadata.
|
||||
|
||||
### Health check
|
||||
|
||||
Returns the health status of the Langflow database and chat services:
|
||||
|
||||
<Tabs>
|
||||
<TabItem value="Python" label="Python" default>
|
||||
|
||||
<CodeSnippet source={examplePythonApiReferenceApiExamplesHealthCheck} language="python" />
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="JavaScript" label="JavaScript">
|
||||
|
||||
<CodeSnippet source={exampleJavascriptApiReferenceApiExamplesHealthCheck} language="javascript" />
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="curl" label="curl">
|
||||
|
||||
<CodeSnippet source={exampleApiReferenceApiExamplesHealthCheck} language="bash" />
|
||||
|
||||
</TabItem>
|
||||
</Tabs>
|
||||
|
||||
<details>
|
||||
<summary>Result</summary>
|
||||
|
||||
<CodeSnippet source={resultApiReferenceApiExamplesResultHealthCheck} language="json" />
|
||||
|
||||
</details>
|
||||
|
||||
Langflow provides an additional `GET /health` endpoint.
|
||||
This endpoint is served by uvicorn before Langflow is fully initialized, so it's not reliable for checking Langflow service health.
|
||||
|
||||
### Get version
|
||||
|
||||
Returns the current Langflow API version:
|
||||
|
||||
<Tabs>
|
||||
<TabItem value="Python" label="Python" default>
|
||||
|
||||
<CodeSnippet source={examplePythonApiReferenceApiExamplesGetVersion} language="python" />
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="JavaScript" label="JavaScript">
|
||||
|
||||
<CodeSnippet source={exampleJavascriptApiReferenceApiExamplesGetVersion} language="javascript" />
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="curl" label="curl">
|
||||
|
||||
<CodeSnippet source={exampleApiReferenceApiExamplesGetVersion} language="bash" />
|
||||
|
||||
</TabItem>
|
||||
</Tabs>
|
||||
|
||||
<details>
|
||||
<summary>Result</summary>
|
||||
|
||||
<CodeSnippet source={resultApiReferenceApiExamplesResultGetVersion} language="text" />
|
||||
|
||||
</details>
|
||||
|
||||
### Get configuration
|
||||
|
||||
Returns configuration details for your Langflow deployment.
|
||||
Requires a [Langflow API key](/api-keys-and-authentication).
|
||||
|
||||
<Tabs>
|
||||
<TabItem value="Python" label="Python" default>
|
||||
|
||||
<CodeSnippet source={examplePythonApiReferenceApiExamplesGetConfiguration} language="python" />
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="JavaScript" label="JavaScript">
|
||||
|
||||
<CodeSnippet source={exampleJavascriptApiReferenceApiExamplesGetConfiguration} language="javascript" />
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="curl" label="curl">
|
||||
|
||||
<CodeSnippet source={exampleApiReferenceApiExamplesGetConfiguration} language="bash" />
|
||||
|
||||
</TabItem>
|
||||
</Tabs>
|
||||
|
||||
<details>
|
||||
<summary>Result</summary>
|
||||
|
||||
<CodeSnippet source={resultApiReferenceApiExamplesResultGetConfiguration} language="json" />
|
||||
|
||||
</details>
|
||||
|
||||
### Get all components
|
||||
|
||||
Returns a dictionary of all Langflow components.
|
||||
Requires a [Langflow API key](/api-keys-and-authentication).
|
||||
|
||||
<Tabs>
|
||||
<TabItem value="Python" label="Python" default>
|
||||
|
||||
<CodeSnippet source={examplePythonApiReferenceApiExamplesGetAllComponents} language="python" />
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="JavaScript" label="JavaScript">
|
||||
|
||||
<CodeSnippet source={exampleJavascriptApiReferenceApiExamplesGetAllComponents} language="javascript" />
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="curl" label="curl">
|
||||
|
||||
<CodeSnippet source={exampleApiReferenceApiExamplesGetAllComponents} language="bash" />
|
||||
|
||||
</TabItem>
|
||||
</Tabs>
|
||||
|
||||
## Available endpoints
|
||||
|
||||
Because you can run Langflow as either an IDE (frontend and backend) or a runtime (headless, backend-only), it serves endpoints that support frontend and backend operations.
|
||||
Many endpoints are for orchestration between the frontend and backend, reading and writing to the Langflow database, or enabling frontend functionality, like the **Playground**.
|
||||
Unless you are contributing to the Langflow codebase, you won't directly call most of the Langflow endpoints.
|
||||
|
||||
For application development, the most commonly used endpoints are the `/run` and `/webhook` [flow trigger endpoints](/api-flows-run).
|
||||
For some use cases, you might use some other endpoints, such as the `/files` endpoints to use files in flows.
|
||||
|
||||
To help you explore the available endpoints, the following lists are sorted by primary use case, although some endpoints might support multiple use cases.
|
||||
|
||||
<Tabs>
|
||||
<TabItem value="Application development" label="Application development" default>
|
||||
|
||||
The following endpoints are useful for developing applications with Langflow and administering Langflow deployments with one or more users.
|
||||
You will most often use the flow trigger endpoints.
|
||||
Other endpoints are helpful for specific use cases, such as administration and flow management in runtime deployments that don't have a visual editor.
|
||||
|
||||
* [Flow trigger endpoints](/api-flows-run):
|
||||
* POST `/v1/run/{flow_id_or_name}`: Run a flow.
|
||||
* POST `/v1/run/advanced/{flow_id}`: Advanced run with explicit `inputs`, `outputs`, `tweaks`, and optional `session_id`.
|
||||
* POST `/v1/webhook/{flow_id_or_name}`: Trigger a flow via webhook payload.
|
||||
|
||||
* [OpenAI Responses API](/api-openai-responses):
|
||||
* POST `/v1/responses`: Execute flows using an OpenAI-compatible request format.
|
||||
|
||||
* Deployment details:
|
||||
* GET `/v1/version`: Return Langflow version. See [Get version](/api-reference-api-examples#get-version).
|
||||
* GET `/v1/config`: Return deployment configuration. See [Get configuration](/api-reference-api-examples#get-configuration).
|
||||
* GET `/health_check`: Health check endpoint that validates database and chat service connectivity. Returns 500 status if any service is unavailable.
|
||||
|
||||
* [Projects endpoints](/api-projects):
|
||||
* POST `/v1/projects/`: Create a project.
|
||||
* GET `/v1/projects/`: List projects.
|
||||
* GET `/v1/projects/{project_id}`: Read a project (with paginated flows support).
|
||||
* PATCH `/v1/projects/{project_id}`: Update project info and membership.
|
||||
* DELETE `/v1/projects/{project_id}`: Delete a project.
|
||||
* GET `/v1/projects/download/{project_id}`: Export all flows in a project as ZIP.
|
||||
* POST `/v1/projects/upload/`: Import a project ZIP (creates project and flows).
|
||||
* GET `/v1/starter-projects/`: Return a list of templates.
|
||||
|
||||
* [Files endpoints](/api-files):
|
||||
* Files (v1)
|
||||
* POST `/v1/files/upload/{flow_id}`: Upload a file to a specific flow.
|
||||
* GET `/v1/files/download/{flow_id}/{file_name}`: Download a file from a flow.
|
||||
* GET `/v1/files/images/{flow_id}/{file_name}`: Stream an image from a flow.
|
||||
* GET `/v1/files/profile_pictures/{folder_name}/{file_name}`: Get a profile picture asset.
|
||||
* GET `/v1/files/profile_pictures/list`: List available profile picture assets.
|
||||
* GET `/v1/files/list/{flow_id}`: List files for a flow.
|
||||
* DELETE `/v1/files/delete/{flow_id}/{file_name}`: Delete a file from a flow.
|
||||
* Files (v2)
|
||||
* POST `/v2/files` (alias `/v2/files/`): Upload a file owned by the current user.
|
||||
* GET `/v2/files` (alias `/v2/files/`): List files owned by the current user.
|
||||
* DELETE `/v2/files/batch/`: Delete multiple files by IDs.
|
||||
* POST `/v2/files/batch/`: Download multiple files as a ZIP by IDs.
|
||||
* GET `/v2/files/{file_id}`: Download a file by ID (or return raw content internally).
|
||||
* PUT `/v2/files/{file_id}`: Edit a file name by ID.
|
||||
* DELETE `/v2/files/{file_id}`: Delete a file by ID.
|
||||
* DELETE `/v2/files` (alias `/v2/files/`): Delete all files for the current user.
|
||||
|
||||
* [API keys and authentication](/api-keys-and-authentication):
|
||||
* GET `/v1/api_key/`: List API keys for the current user.
|
||||
* POST `/v1/api_key/`: Create a new API key.
|
||||
* DELETE `/v1/api_key/{api_key_id}`: Delete an API key.
|
||||
* POST `/v1/api_key/store`: Save an encrypted Store API key (cookie set).
|
||||
|
||||
* [Flow management endpoints](/api-flows):
|
||||
* POST `/v1/flows/`: Create a flow.
|
||||
* GET `/v1/flows/`: List flows (supports pagination and filters).
|
||||
* GET `/v1/flows/{flow_id}`: Read a flow by ID.
|
||||
* GET `/v1/flows/public_flow/{flow_id}`: Read a public flow by ID.
|
||||
* PATCH `/v1/flows/{flow_id}`: Update a flow.
|
||||
* DELETE `/v1/flows/{flow_id}`: Delete a flow.
|
||||
* POST `/v1/flows/batch/`: Create multiple flows.
|
||||
* POST `/v1/flows/upload/`: Import flows from a JSON file.
|
||||
* DELETE `/v1/flows/`: Delete multiple flows by IDs.
|
||||
* POST `/v1/flows/download/`: Export flows to a ZIP file.
|
||||
* GET `/v1/flows/basic_examples/`: List basic example flows.
|
||||
|
||||
* [Users endpoints](/api-users):
|
||||
* POST `/v1/users/`: Add a user (superuser required when auth enabled).
|
||||
* GET `/v1/users/whoami`: Return the current authenticated user.
|
||||
* GET `/v1/users/`: List all users (superuser required).
|
||||
* PATCH `/v1/users/{user_id}`: Update a user (with role checks).
|
||||
* PATCH `/v1/users/{user_id}/reset-password`: Reset own password.
|
||||
* DELETE `/v1/users/{user_id}`: Delete a user (cannot delete yourself).
|
||||
|
||||
* Custom components: You might use these endpoints when developing custom Langflow components for your own use or to share with the Langflow community:
|
||||
* GET `/v1/all`: Return all available Langflow component types. See [Get all components](/api-reference-api-examples#get-all-components).
|
||||
* POST `/v1/custom_component`: Build a custom component from code and return its node.
|
||||
* POST `/v1/custom_component/update`: Update an existing custom component's build config and outputs.
|
||||
* POST `/v1/validate/code`: Validate a Python code snippet for a custom component.
|
||||
* POST `/v1/validate/prompt`: Validate a prompt payload.
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="Codebase contribution" label="Codebase development">
|
||||
|
||||
The following endpoints are most often used when contributing to the Langflow codebase, and you need to understand or call endpoints that support frontend-to-backend orchestration or other internal functionality.
|
||||
|
||||
* Base (metadata):
|
||||
* GET `/v1/all`: Return all available Langflow component types. See [Get all components](/api-reference-api-examples#get-all-components).
|
||||
* GET `/v1/version`: Return Langflow version. See [Get version](/api-reference-api-examples#get-version).
|
||||
* GET `/v1/config`: Return deployment configuration. See [Get configuration](/api-reference-api-examples#get-configuration).
|
||||
* GET `/v1/starter-projects/`: Return a list of templates.
|
||||
|
||||
* [Build endpoints](/api-build) (internal editor support):
|
||||
* POST `/v1/build/{flow_id}/flow`: Start a flow build and return a job ID.
|
||||
* GET `/v1/build/{job_id}/events`: Stream or fetch build events.
|
||||
* POST `/v1/build/{job_id}/cancel`: Cancel a build job.
|
||||
* POST `/v1/build_public_tmp/{flow_id}/flow`: Build a public flow without auth.
|
||||
* POST `/v1/validate/prompt`: Validate a prompt payload.
|
||||
|
||||
* [API keys and authentication](/api-keys-and-authentication):
|
||||
* POST `/v1/login`: Login and set tokens as cookies.
|
||||
* GET `/v1/auto_login`: Auto-login (if enabled) and set tokens.
|
||||
* POST `/v1/refresh`: Refresh tokens using refresh cookie.
|
||||
* POST `/v1/logout`: Logout and clear cookies.
|
||||
|
||||
* [Monitor endpoints](/api-monitor):
|
||||
* GET `/v1/monitor/builds`: Get vertex builds for a flow.
|
||||
* DELETE `/v1/monitor/builds`: Delete vertex builds for a flow.
|
||||
* GET `/v1/monitor/messages/sessions`: List message session IDs (auth required).
|
||||
* GET `/v1/monitor/messages`: List messages with optional filters.
|
||||
* DELETE `/v1/monitor/messages`: Delete messages by IDs (auth required).
|
||||
* PUT `/v1/monitor/messages/{message_id}`: Update a message.
|
||||
* PATCH `/v1/monitor/messages/session/{old_session_id}`: Change a session ID for all messages in that session.
|
||||
* DELETE `/v1/monitor/messages/session/{session_id}`: Delete messages by session.
|
||||
* GET `/v1/monitor/transactions`: List transactions for a flow (paginated).
|
||||
|
||||
* Variables:
|
||||
* POST `/v1/variables/`: Create a variable, such as an API key, for the user.
|
||||
* GET `/v1/variables/`: List variables for the user.
|
||||
* PATCH `/v1/variables/{variable_id}`: Update a variable.
|
||||
* DELETE `/v1/variables/{variable_id}`: Delete a variable.
|
||||
|
||||
* [Use voice mode](/concepts-voice-mode):
|
||||
* WS `/v1/voice/ws/flow_as_tool/{flow_id}`: Bi-directional voice session exposing the flow as a tool.
|
||||
* WS `/v1/voice/ws/flow_as_tool/{flow_id}/{session_id}`: Same as above with explicit session ID.
|
||||
* WS `/v1/voice/ws/flow_tts/{flow_id}`: Voice-to-text session that runs a flow and returns TTS.
|
||||
* WS `/v1/voice/ws/flow_tts/{flow_id}/{session_id}`: Same as above with explicit session ID.
|
||||
* GET `/v1/voice/elevenlabs/voice_ids`: List available ElevenLabs voice IDs for the user.
|
||||
|
||||
* MCP servers: The following endpoints are for managing Langflow MCP servers and MCP server connections.
|
||||
They aren't typically called directly; instead, they are used to drive internal functionality in the Langflow frontend and when running flows that call MCP servers.
|
||||
Langflow MCP servers support both streamable HTTP and SSE transport.
|
||||
* HEAD `/v1/mcp/streamable`: Health check for streamable HTTP MCP.
|
||||
* GET `/v1/mcp/streamable`: Open streamable HTTP connection for MCP server.
|
||||
* POST `/v1/mcp/streamable`: Post messages to the MCP server via streamable HTTP.
|
||||
* DELETE `/v1/mcp/streamable`: Close streamable HTTP connection.
|
||||
* HEAD `/v1/mcp/sse` (LEGACY): Health check for MCP SSE.
|
||||
* GET `/v1/mcp/sse` (LEGACY): Open SSE stream for MCP server events.
|
||||
* POST `/v1/mcp/` (LEGACY): Post messages to the MCP server.
|
||||
* GET `/v1/mcp/project/{project_id}`: List MCP-enabled tools and project auth settings.
|
||||
* HEAD `/v1/mcp/project/{project_id}/streamable`: Health check for project streamable HTTP MCP.
|
||||
* GET `/v1/mcp/project/{project_id}/streamable`: Open project-scoped streamable HTTP connection.
|
||||
* POST `/v1/mcp/project/{project_id}/streamable`: Post messages to project MCP server via streamable HTTP.
|
||||
* DELETE `/v1/mcp/project/{project_id}/streamable`: Close project streamable HTTP connection.
|
||||
* HEAD `/v1/mcp/project/{project_id}/sse` (LEGACY): Health check for project SSE.
|
||||
* GET `/v1/mcp/project/{project_id}/sse` (LEGACY): Open project-scoped MCP SSE.
|
||||
* POST `/v1/mcp/project/{project_id}` (LEGACY): Post messages to project MCP server.
|
||||
* PATCH `/v1/mcp/project/{project_id}`: Update MCP settings for flows and project auth settings.
|
||||
* POST `/v1/mcp/project/{project_id}/install`: Install MCP client config for Cursor/Windsurf/Claude (local only).
|
||||
* GET `/v1/mcp/project/{project_id}/installed`: Check which clients have MCP config installed.
|
||||
|
||||
* Custom components: You might use these endpoints when developing custom Langflow components for your own use or to share with the Langflow community:
|
||||
* GET `/v1/all`: Return all available Langflow component types. See [Get all components](/api-reference-api-examples#get-all-components).
|
||||
* POST `/v1/custom_component`: Build a custom component from code and return its node.
|
||||
* POST `/v1/custom_component/update`: Update an existing custom component's build config and outputs.
|
||||
* POST `/v1/validate/code`: Validate a Python code snippet for a custom component.
|
||||
* POST `/v1/validate/prompt`: Validate a prompt payload.
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="Deprecated" label="Deprecated">
|
||||
|
||||
The following endpoints are deprecated:
|
||||
|
||||
* POST `/v1/predict/{flow_id}`: Use [`/v1/run/{flow_id}`](/api-flows-run) instead.
|
||||
* POST `/v1/process/{flow_id}`: Use [`/v1/run/{flow_id}`](/api-flows-run) instead.
|
||||
* GET `/v1/task/{task_id}`: Deprecated functionality.
|
||||
* POST `/v1/upload/{flow_id}`: Use [`/files`](/api-files) instead.
|
||||
* POST `/v1/build/{flow_id}/vertices`: Replaced by [`/monitor/builds`](/api-monitor).
|
||||
* POST `/v1/build/{flow_id}/vertices/{vertex_id}`: Replaced by [`/monitor/builds`](/api-monitor).
|
||||
* GET `/v1/build/{flow_id}/{vertex_id}/stream`: Replaced by [`/monitor/builds`](/api-monitor).
|
||||
* GET `/v1/store/check/`: Return whether the Store feature is enabled.
|
||||
* GET `/v1/store/check/api_key`: Check if a Store API key exists and is valid.
|
||||
* POST `/v1/store/components/`: Share a component to the Store.
|
||||
* PATCH `/v1/store/components/{component_id}`: Update a shared component.
|
||||
* GET `/v1/store/components/`: List available Store components (filters supported).
|
||||
* GET `/v1/store/components/{component_id}`: Download a component from the Store.
|
||||
* GET `/v1/store/tags`: List Store tags.
|
||||
* GET `/v1/store/users/likes`: List components liked by the current user.
|
||||
* POST `/v1/store/users/likes/{component_id}`: Like a component.
|
||||
|
||||
</TabItem>
|
||||
</Tabs>
|
||||
|
||||
## Next steps
|
||||
|
||||
* Use the Langflow API to [run a flow](/api-flows-run).
|
||||
* Use the Langflow API to [upload files](/api-files).
|
||||
* Use the Langflow API to [get flow logs](/api-logs).
|
||||
* Explore all endpoints in the [Langflow API specification](/api).
|
||||
225
docs/versioned_docs/version-1.9.0/API-Reference/api-users.mdx
Normal file
225
docs/versioned_docs/version-1.9.0/API-Reference/api-users.mdx
Normal file
@ -0,0 +1,225 @@
|
||||
---
|
||||
title: Users endpoints
|
||||
slug: /api-users
|
||||
---
|
||||
import CodeSnippet from '@site/src/components/CodeSnippet';
|
||||
import exampleApiUsersAddUser from '!!raw-loader!@site/docs/API-Reference/curl-examples/api-users/add-user.sh';
|
||||
import resultApiUsersResultAddUser from '!!raw-loader!@site/docs/API-Reference/curl-examples/api-users/result-add-user.json';
|
||||
import exampleApiUsersGetCurrentUser from '!!raw-loader!@site/docs/API-Reference/curl-examples/api-users/get-current-user.sh';
|
||||
import resultApiUsersResultGetCurrentUser from '!!raw-loader!@site/docs/API-Reference/curl-examples/api-users/result-get-current-user.json';
|
||||
import exampleApiUsersListAllUsers from '!!raw-loader!@site/docs/API-Reference/curl-examples/api-users/list-all-users.sh';
|
||||
import resultApiUsersResultListAllUsers from '!!raw-loader!@site/docs/API-Reference/curl-examples/api-users/result-list-all-users.json';
|
||||
import exampleApiUsersUpdateUser from '!!raw-loader!@site/docs/API-Reference/curl-examples/api-users/update-user.sh';
|
||||
import resultApiUsersResultUpdateUser from '!!raw-loader!@site/docs/API-Reference/curl-examples/api-users/result-update-user.json';
|
||||
import exampleApiUsersResetPassword from '!!raw-loader!@site/docs/API-Reference/curl-examples/api-users/reset-password.sh';
|
||||
import resultApiUsersResultResetPassword from '!!raw-loader!@site/docs/API-Reference/curl-examples/api-users/result-reset-password.json';
|
||||
import exampleApiUsersDeleteUser from '!!raw-loader!@site/docs/API-Reference/curl-examples/api-users/delete-user.sh';
|
||||
import resultApiUsersResultDeleteUser from '!!raw-loader!@site/docs/API-Reference/curl-examples/api-users/result-delete-user.json';
|
||||
import Tabs from '@theme/Tabs';
|
||||
import TabItem from '@theme/TabItem';
|
||||
import examplePythonApiUsersAddUser from '!!raw-loader!@site/docs/API-Reference/python-examples/api-users/add-user.py';
|
||||
import exampleJavascriptApiUsersAddUser from '!!raw-loader!@site/docs/API-Reference/javascript-examples/api-users/add-user.js';
|
||||
import examplePythonApiUsersGetCurrentUser from '!!raw-loader!@site/docs/API-Reference/python-examples/api-users/get-current-user.py';
|
||||
import exampleJavascriptApiUsersGetCurrentUser from '!!raw-loader!@site/docs/API-Reference/javascript-examples/api-users/get-current-user.js';
|
||||
import examplePythonApiUsersListAllUsers from '!!raw-loader!@site/docs/API-Reference/python-examples/api-users/list-all-users.py';
|
||||
import exampleJavascriptApiUsersListAllUsers from '!!raw-loader!@site/docs/API-Reference/javascript-examples/api-users/list-all-users.js';
|
||||
import examplePythonApiUsersUpdateUser from '!!raw-loader!@site/docs/API-Reference/python-examples/api-users/update-user.py';
|
||||
import exampleJavascriptApiUsersUpdateUser from '!!raw-loader!@site/docs/API-Reference/javascript-examples/api-users/update-user.js';
|
||||
import examplePythonApiUsersResetPassword from '!!raw-loader!@site/docs/API-Reference/python-examples/api-users/reset-password.py';
|
||||
import exampleJavascriptApiUsersResetPassword from '!!raw-loader!@site/docs/API-Reference/javascript-examples/api-users/reset-password.js';
|
||||
import examplePythonApiUsersDeleteUser from '!!raw-loader!@site/docs/API-Reference/python-examples/api-users/delete-user.py';
|
||||
import exampleJavascriptApiUsersDeleteUser from '!!raw-loader!@site/docs/API-Reference/javascript-examples/api-users/delete-user.js';
|
||||
|
||||
|
||||
|
||||
Use the `/users` endpoint to manage user accounts in Langflow.
|
||||
|
||||
## Add user
|
||||
|
||||
Create a new user account with a given username and password.
|
||||
|
||||
Requires authentication as a superuser if the Langflow server has authentication enabled.
|
||||
|
||||
<Tabs>
|
||||
<TabItem value="Python" label="Python" default>
|
||||
|
||||
<CodeSnippet source={examplePythonApiUsersAddUser} language="python" />
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="JavaScript" label="JavaScript">
|
||||
|
||||
<CodeSnippet source={exampleJavascriptApiUsersAddUser} language="javascript" />
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="curl" label="curl">
|
||||
|
||||
<CodeSnippet source={exampleApiUsersAddUser} language="bash" />
|
||||
|
||||
</TabItem>
|
||||
</Tabs>
|
||||
|
||||
The request returns an object describing the new user.
|
||||
The user's UUID is stored in `user_id` in the Langflow database, and returned as `id` in the `/users` API response.
|
||||
This `user_id` key is specifically for Langflow user management.
|
||||
|
||||
<details>
|
||||
<summary>Result</summary>
|
||||
|
||||
<CodeSnippet source={resultApiUsersResultAddUser} language="json" />
|
||||
|
||||
</details>
|
||||
|
||||
## Get current user
|
||||
|
||||
Retrieve information about the authenticated user.
|
||||
|
||||
<Tabs>
|
||||
<TabItem value="Python" label="Python" default>
|
||||
|
||||
<CodeSnippet source={examplePythonApiUsersGetCurrentUser} language="python" />
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="JavaScript" label="JavaScript">
|
||||
|
||||
<CodeSnippet source={exampleJavascriptApiUsersGetCurrentUser} language="javascript" />
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="curl" label="curl">
|
||||
|
||||
<CodeSnippet source={exampleApiUsersGetCurrentUser} language="bash" />
|
||||
|
||||
</TabItem>
|
||||
</Tabs>
|
||||
|
||||
<details>
|
||||
<summary>Result</summary>
|
||||
|
||||
<CodeSnippet source={resultApiUsersResultGetCurrentUser} language="json" />
|
||||
|
||||
</details>
|
||||
|
||||
## List all users
|
||||
|
||||
Get a paginated list of all users in the system.
|
||||
|
||||
Requires authentication as a superuser if the Langflow server has authentication enabled.
|
||||
|
||||
<Tabs>
|
||||
<TabItem value="Python" label="Python" default>
|
||||
|
||||
<CodeSnippet source={examplePythonApiUsersListAllUsers} language="python" />
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="JavaScript" label="JavaScript">
|
||||
|
||||
<CodeSnippet source={exampleJavascriptApiUsersListAllUsers} language="javascript" />
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="curl" label="curl">
|
||||
|
||||
<CodeSnippet source={exampleApiUsersListAllUsers} language="bash" />
|
||||
|
||||
</TabItem>
|
||||
</Tabs>
|
||||
|
||||
<details>
|
||||
<summary>Result</summary>
|
||||
|
||||
<CodeSnippet source={resultApiUsersResultListAllUsers} language="json" />
|
||||
|
||||
</details>
|
||||
|
||||
## Update user
|
||||
|
||||
Modify an existing user's information with a PATCH request.
|
||||
|
||||
Requires authentication as a superuser if the Langflow server has authentication enabled.
|
||||
|
||||
This example activates the specified user's account and makes them a superuser:
|
||||
|
||||
<Tabs>
|
||||
<TabItem value="Python" label="Python" default>
|
||||
|
||||
<CodeSnippet source={examplePythonApiUsersUpdateUser} language="python" />
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="JavaScript" label="JavaScript">
|
||||
|
||||
<CodeSnippet source={exampleJavascriptApiUsersUpdateUser} language="javascript" />
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="curl" label="curl">
|
||||
|
||||
<CodeSnippet source={exampleApiUsersUpdateUser} language="bash" />
|
||||
|
||||
</TabItem>
|
||||
</Tabs>
|
||||
|
||||
<details>
|
||||
<summary>Result</summary>
|
||||
|
||||
<CodeSnippet source={resultApiUsersResultUpdateUser} language="json" />
|
||||
|
||||
</details>
|
||||
|
||||
## Reset password
|
||||
|
||||
Change the specified user's password to a new secure value.
|
||||
|
||||
Requires authentication as the target user.
|
||||
|
||||
<Tabs>
|
||||
<TabItem value="Python" label="Python" default>
|
||||
|
||||
<CodeSnippet source={examplePythonApiUsersResetPassword} language="python" />
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="JavaScript" label="JavaScript">
|
||||
|
||||
<CodeSnippet source={exampleJavascriptApiUsersResetPassword} language="javascript" />
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="curl" label="curl">
|
||||
|
||||
<CodeSnippet source={exampleApiUsersResetPassword} language="bash" />
|
||||
|
||||
</TabItem>
|
||||
</Tabs>
|
||||
|
||||
<details>
|
||||
<summary>Result</summary>
|
||||
|
||||
<CodeSnippet source={resultApiUsersResultResetPassword} language="json" />
|
||||
|
||||
</details>
|
||||
|
||||
## Delete user
|
||||
|
||||
Remove a user account from the system.
|
||||
|
||||
Requires authentication as a superuser if the Langflow server has authentication enabled.
|
||||
|
||||
<Tabs>
|
||||
<TabItem value="Python" label="Python" default>
|
||||
|
||||
<CodeSnippet source={examplePythonApiUsersDeleteUser} language="python" />
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="JavaScript" label="JavaScript">
|
||||
|
||||
<CodeSnippet source={exampleJavascriptApiUsersDeleteUser} language="javascript" />
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="curl" label="curl">
|
||||
|
||||
<CodeSnippet source={exampleApiUsersDeleteUser} language="bash" />
|
||||
|
||||
</TabItem>
|
||||
</Tabs>
|
||||
|
||||
<details>
|
||||
<summary>Result</summary>
|
||||
|
||||
<CodeSnippet source={resultApiUsersResultDeleteUser} language="json" />
|
||||
|
||||
</details>
|
||||
@ -0,0 +1,4 @@
|
||||
curl -X GET \
|
||||
"$LANGFLOW_URL/api/v1/build/123e4567-e89b-12d3-a456-426614174000/events" \
|
||||
-H "accept: application/json" \
|
||||
-H "x-api-key: $LANGFLOW_API_KEY"
|
||||
@ -0,0 +1,4 @@
|
||||
curl -X GET \
|
||||
"$LANGFLOW_URL/api/v1/build/123e4567-e89b-12d3-a456-426614174000/events?stream=false" \
|
||||
-H "accept: application/json" \
|
||||
-H "x-api-key: $LANGFLOW_API_KEY"
|
||||
@ -0,0 +1,10 @@
|
||||
curl -X POST \
|
||||
"$LANGFLOW_URL/api/v1/build/$FLOW_ID/flow" \
|
||||
-H "accept: application/json" \
|
||||
-H "Content-Type: application/json" \
|
||||
-H "x-api-key: $LANGFLOW_API_KEY" \
|
||||
-d '{
|
||||
"inputs": {
|
||||
"input_value": "Tell me a story"
|
||||
}
|
||||
}'
|
||||
@ -0,0 +1,15 @@
|
||||
curl -X POST \
|
||||
"$LANGFLOW_URL/api/v1/build/$FLOW_ID/flow" \
|
||||
-H "accept: application/json" \
|
||||
-H "Content-Type: application/json" \
|
||||
-H "x-api-key: $LANGFLOW_API_KEY" \
|
||||
-d '{
|
||||
"data": {
|
||||
"nodes": [],
|
||||
"edges": []
|
||||
},
|
||||
"inputs": {
|
||||
"input_value": "Your custom input here",
|
||||
"session": "session_id"
|
||||
}
|
||||
}'
|
||||
@ -0,0 +1,7 @@
|
||||
{"event": "vertices_sorted", "data": {"ids": ["ChatInput-XtBLx"], "to_run": ["Prompt-x74Ze", "ChatOutput-ylMzN", "ChatInput-XtBLx", "OpenAIModel-d1wOZ"]}}
|
||||
|
||||
{"event": "add_message", "data": {"timestamp": "2025-03-03T17:42:23", "sender": "User", "sender_name": "User", "session_id": "d2bbd92b-187e-4c84-b2d4-5df365704201", "text": "Tell me a story", "files": [], "error": false, "edit": false, "properties": {"text_color": "", "background_color": "", "edited": false, "source": {"id": null, "display_name": null, "source": null}, "icon": "", "allow_markdown": false, "positive_feedback": null, "state": "complete", "targets": []}, "category": "message", "content_blocks": [], "id": "28879bd8-6a68-4dd5-b658-74d643a4dd92", "flow_id": "d2bbd92b-187e-4c84-b2d4-5df365704201"}}
|
||||
|
||||
// ... Additional events as the flow executes ...
|
||||
|
||||
{"event": "end", "data": {}}
|
||||
@ -0,0 +1,3 @@
|
||||
{
|
||||
"job_id": "123e4567-e89b-12d3-a456-426614174000"
|
||||
}
|
||||
@ -0,0 +1 @@
|
||||
{ "job_id": "0bcc7f23-40b4-4bfa-9b8a-a44181fd1175" }
|
||||
@ -0,0 +1,6 @@
|
||||
curl -X POST \
|
||||
"$LANGFLOW_URL/api/v1/build/$FLOW_ID/flow" \
|
||||
-H "accept: application/json" \
|
||||
-H "Content-Type: application/json" \
|
||||
-H "x-api-key: $LANGFLOW_API_KEY" \
|
||||
-d '{"stop_component_id": "OpenAIModel-Uksag"}'
|
||||
@ -0,0 +1,4 @@
|
||||
curl -X DELETE \
|
||||
"$LANGFLOW_URL/api/v2/files" \
|
||||
-H "accept: application/json" \
|
||||
-H "x-api-key: $LANGFLOW_API_KEY"
|
||||
@ -0,0 +1,4 @@
|
||||
curl -X DELETE \
|
||||
"$LANGFLOW_URL/api/v1/files/delete/$FLOW_ID/2024-12-30_15-19-43_your_file.txt" \
|
||||
-H "accept: application/json" \
|
||||
-H "x-api-key: $LANGFLOW_API_KEY"
|
||||
@ -0,0 +1,4 @@
|
||||
curl -X DELETE \
|
||||
"$LANGFLOW_URL/api/v2/files/$FILE_ID" \
|
||||
-H "accept: application/json" \
|
||||
-H "x-api-key: $LANGFLOW_API_KEY"
|
||||
@ -0,0 +1,5 @@
|
||||
curl -X GET \
|
||||
"$LANGFLOW_URL/api/v1/files/download/$FLOW_ID/2024-12-30_15-19-43_your_file.txt" \
|
||||
-H "accept: application/json" \
|
||||
-H "x-api-key: $LANGFLOW_API_KEY" \
|
||||
--output downloaded_file.txt
|
||||
@ -0,0 +1,5 @@
|
||||
curl -X GET \
|
||||
"$LANGFLOW_URL/api/v2/files/c7b22c4c-d5e0-4ec9-af97-5d85b7657a34" \
|
||||
-H "accept: application/json" \
|
||||
-H "x-api-key: $LANGFLOW_API_KEY" \
|
||||
--output downloaded_file.txt
|
||||
@ -0,0 +1,4 @@
|
||||
curl -X PUT \
|
||||
"$LANGFLOW_URL/api/v2/files/$FILE_ID?name=new_file_name" \
|
||||
-H "accept: application/json" \
|
||||
-H "x-api-key: $LANGFLOW_API_KEY"
|
||||
@ -0,0 +1,4 @@
|
||||
curl -X GET \
|
||||
"$LANGFLOW_URL/api/v1/files/list/$FLOW_ID" \
|
||||
-H "accept: application/json" \
|
||||
-H "x-api-key: $LANGFLOW_API_KEY"
|
||||
@ -0,0 +1,4 @@
|
||||
curl -X GET \
|
||||
"$LANGFLOW_URL/api/v2/files" \
|
||||
-H "accept: application/json" \
|
||||
-H "x-api-key: $LANGFLOW_API_KEY"
|
||||
@ -0,0 +1,3 @@
|
||||
{
|
||||
"message": "All files deleted successfully"
|
||||
}
|
||||
@ -0,0 +1,3 @@
|
||||
{
|
||||
"message": "File 2024-12-30_15-19-43_your_file.txt deleted successfully"
|
||||
}
|
||||
@ -0,0 +1,3 @@
|
||||
{
|
||||
"message": "File deleted successfully"
|
||||
}
|
||||
@ -0,0 +1 @@
|
||||
File contents downloaded to downloaded_file.txt
|
||||
@ -0,0 +1 @@
|
||||
File contents downloaded to downloaded_file.txt
|
||||
@ -0,0 +1,7 @@
|
||||
{
|
||||
"id": "76543e40-f388-4cb3-b0ee-a1e870aca3d3",
|
||||
"name": "new_file_name",
|
||||
"path": "6f17a73e-97d7-4519-a8d9-8e4c0be411bb/76543e40-f388-4cb3-b0ee-a1e870aca3d3.png",
|
||||
"size": 2728251,
|
||||
"provider": null
|
||||
}
|
||||
@ -0,0 +1,3 @@
|
||||
{
|
||||
"files": ["2024-12-30_15-19-43_your_file.txt"]
|
||||
}
|
||||
@ -0,0 +1,9 @@
|
||||
[
|
||||
{
|
||||
"id": "c7b22c4c-d5e0-4ec9-af97-5d85b7657a34",
|
||||
"name": "your_file",
|
||||
"path": "6f17a73e-97d7-4519-a8d9-8e4c0be411bb/c7b22c4c-d5e0-4ec9-af97-5d85b7657a34.txt",
|
||||
"size": 1234,
|
||||
"provider": null
|
||||
}
|
||||
]
|
||||
@ -0,0 +1,4 @@
|
||||
{
|
||||
"flowId": "92f9a4c5-cfc8-4656-ae63-1f0881163c28",
|
||||
"file_path": "92f9a4c5-cfc8-4656-ae63-1f0881163c28/2024-12-30_15-19-43_your_file.txt"
|
||||
}
|
||||
@ -0,0 +1 @@
|
||||
{"id":"07e5b864-e367-4f52-b647-a48035ae7e5e","username":"langflow","profile_image":null,"store_api_key":null,"is_active":true,"is_superuser":true,"create_at":"2025-05-08T17:59:07.855965","updated_at":"2025-05-28T19:00:42.556460","last_login_at":"2025-05-28T19:00:42.554338","optins":{"github_starred":false,"dialog_dismissed":true,"discord_clicked":false,"mcp_dialog_dismissed":true}}
|
||||
@ -0,0 +1,16 @@
|
||||
curl --request POST \
|
||||
--url "$LANGFLOW_URL/api/v1/run/$FLOW_ID" \
|
||||
--header "Content-Type: application/json" \
|
||||
--header "x-api-key: $LANGFLOW_API_KEY" \
|
||||
--data '{
|
||||
"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"
|
||||
]
|
||||
}
|
||||
}
|
||||
}'
|
||||
@ -0,0 +1,10 @@
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
DEFAULT_UPLOAD_FILE="$SCRIPT_DIR/../../fixtures/sample-upload.txt"
|
||||
UPLOAD_FILE="${SAMPLE_UPLOAD_FILE:-$DEFAULT_UPLOAD_FILE}"
|
||||
|
||||
curl -X POST \
|
||||
"$LANGFLOW_URL/api/v2/files" \
|
||||
-H "accept: application/json" \
|
||||
-H "Content-Type: multipart/form-data" \
|
||||
-H "x-api-key: $LANGFLOW_API_KEY" \
|
||||
-F "file=@${UPLOAD_FILE}"
|
||||
@ -0,0 +1,10 @@
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
DEFAULT_UPLOAD_FILE="$SCRIPT_DIR/../../fixtures/sample-upload.txt"
|
||||
UPLOAD_FILE="${SAMPLE_UPLOAD_FILE:-$DEFAULT_UPLOAD_FILE}"
|
||||
|
||||
curl -X POST \
|
||||
"$LANGFLOW_URL/api/v1/files/upload/$FLOW_ID" \
|
||||
-H "accept: application/json" \
|
||||
-H "Content-Type: multipart/form-data" \
|
||||
-H "x-api-key: $LANGFLOW_API_KEY" \
|
||||
-F "file=@${UPLOAD_FILE}"
|
||||
@ -0,0 +1,10 @@
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
DEFAULT_UPLOAD_FILE="$SCRIPT_DIR/../../fixtures/sample-upload.txt"
|
||||
UPLOAD_FILE="${SAMPLE_UPLOAD_FILE:-$DEFAULT_UPLOAD_FILE}"
|
||||
|
||||
curl -X POST \
|
||||
"$LANGFLOW_URL/api/v2/files" \
|
||||
-H "accept: application/json" \
|
||||
-H "Content-Type: multipart/form-data" \
|
||||
-H "x-api-key: $LANGFLOW_API_KEY" \
|
||||
-F "file=@${UPLOAD_FILE}"
|
||||
@ -0,0 +1,4 @@
|
||||
curl -X GET \
|
||||
"$LANGFLOW_URL/api/v1/users/whoami" \
|
||||
-H "accept: application/json" \
|
||||
-H "x-api-key: $LANGFLOW_API_KEY"
|
||||
@ -0,0 +1,14 @@
|
||||
curl -X POST \
|
||||
"$LANGFLOW_URL/api/v1/run/a430cc57-06bb-4c11-be39-d3d4de68d2c4?stream=false" \
|
||||
-H "Content-Type: application/json" \
|
||||
-H "x-api-key: $LANGFLOW_API_KEY" \
|
||||
-d '{
|
||||
"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"
|
||||
}
|
||||
}
|
||||
}'
|
||||
@ -0,0 +1,8 @@
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
DEFAULT_IMAGE_FILE="$SCRIPT_DIR/../../fixtures/sample-upload.png"
|
||||
IMAGE_FILE="${SAMPLE_IMAGE_FILE:-$DEFAULT_IMAGE_FILE}"
|
||||
|
||||
curl -X POST "$LANGFLOW_URL/api/v1/files/upload/$FLOW_ID" \
|
||||
-H "Content-Type: multipart/form-data" \
|
||||
-H "x-api-key: $LANGFLOW_API_KEY" \
|
||||
-F "file=@${IMAGE_FILE}"
|
||||
@ -0,0 +1,12 @@
|
||||
curl -X POST \
|
||||
"$LANGFLOW_SERVER_URL/api/v1/run/$FLOW_ID" \
|
||||
-H "Content-Type: application/json" \
|
||||
-H "x-api-key: $LANGFLOW_API_KEY" \
|
||||
-H "X-LANGFLOW-GLOBAL-VAR-OPENAI_API_KEY: sk-..." \
|
||||
-H "X-LANGFLOW-GLOBAL-VAR-USER_ID: user123" \
|
||||
-H "X-LANGFLOW-GLOBAL-VAR-ENVIRONMENT: production" \
|
||||
-d '{
|
||||
"input_value": "Tell me about something interesting!",
|
||||
"input_type": "chat",
|
||||
"output_type": "chat"
|
||||
}'
|
||||
@ -0,0 +1,17 @@
|
||||
curl -X POST \
|
||||
"$LANGFLOW_SERVER_URL/api/v1/run/$FLOW_ID?stream=true" \
|
||||
-H "Content-Type: application/json" \
|
||||
-H "accept: application/json" \
|
||||
-H "x-api-key: $LANGFLOW_API_KEY" \
|
||||
-d '{
|
||||
"input_value": "Tell me a story",
|
||||
"input_type": "chat",
|
||||
"output_type": "chat",
|
||||
"output_component": "chat_output",
|
||||
"session_id": "chat-123",
|
||||
"tweaks": {
|
||||
"component_id": {
|
||||
"parameter_name": "value"
|
||||
}
|
||||
}
|
||||
}'
|
||||
@ -0,0 +1,4 @@
|
||||
{
|
||||
"message": "Task started in the background",
|
||||
"status": "in progress"
|
||||
}
|
||||
@ -0,0 +1,11 @@
|
||||
curl -X POST \
|
||||
"$LANGFLOW_SERVER_URL/api/v1/run/$FLOW_ID" \
|
||||
-H "Content-Type: application/json" \
|
||||
-H "x-api-key: $LANGFLOW_API_KEY" \
|
||||
-d '{
|
||||
"input_value": "Tell me about something interesting!",
|
||||
"session_id": "chat-123",
|
||||
"input_type": "chat",
|
||||
"output_type": "chat",
|
||||
"output_component": ""
|
||||
}'
|
||||
@ -0,0 +1,9 @@
|
||||
curl -X POST \
|
||||
"$LANGFLOW_SERVER_URL/api/v1/run/$FLOW_ID?stream=true" \
|
||||
-H "accept: application/json" \
|
||||
-H "Content-Type: application/json" \
|
||||
-H "x-api-key: $LANGFLOW_API_KEY" \
|
||||
-d '{
|
||||
"message": "Tell me something interesting!",
|
||||
"session_id": "chat-123"
|
||||
}'
|
||||
@ -0,0 +1,5 @@
|
||||
curl -X POST \
|
||||
"$LANGFLOW_SERVER_URL/api/v1/webhook/$FLOW_ID" \
|
||||
-H "Content-Type: application/json" \
|
||||
-H "x-api-key: $LANGFLOW_API_KEY" \
|
||||
-d '{"data": "example-data"}'
|
||||
@ -0,0 +1,20 @@
|
||||
curl -X POST \
|
||||
"$LANGFLOW_URL/api/v1/flows/" \
|
||||
-H "accept: application/json" \
|
||||
-H "Content-Type: application/json" \
|
||||
-H "x-api-key: $LANGFLOW_API_KEY" \
|
||||
-d '{
|
||||
"name": "string2",
|
||||
"description": "string",
|
||||
"icon": "string",
|
||||
"icon_bg_color": "#FF0000",
|
||||
"gradient": "string",
|
||||
"data": {},
|
||||
"is_component": false,
|
||||
"updated_at": "2024-12-30T15:48:01.519Z",
|
||||
"webhook": false,
|
||||
"endpoint_name": "string",
|
||||
"tags": [
|
||||
"string"
|
||||
]
|
||||
}'
|
||||
@ -0,0 +1,45 @@
|
||||
curl -X POST \
|
||||
"$LANGFLOW_URL/api/v1/flows/batch/" \
|
||||
-H "accept: application/json" \
|
||||
-H "Content-Type: application/json" \
|
||||
-H "x-api-key: $LANGFLOW_API_KEY" \
|
||||
-d '{
|
||||
"flows": [
|
||||
{
|
||||
"name": "string",
|
||||
"description": "string",
|
||||
"icon": "string",
|
||||
"icon_bg_color": "string",
|
||||
"gradient": "string",
|
||||
"data": {},
|
||||
"is_component": false,
|
||||
"updated_at": "2024-12-30T18:36:02.737Z",
|
||||
"webhook": false,
|
||||
"endpoint_name": "string",
|
||||
"tags": [
|
||||
"string"
|
||||
],
|
||||
"locked": false,
|
||||
"user_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
|
||||
"project_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
|
||||
},
|
||||
{
|
||||
"name": "string",
|
||||
"description": "string",
|
||||
"icon": "string",
|
||||
"icon_bg_color": "string",
|
||||
"gradient": "string",
|
||||
"data": {},
|
||||
"is_component": false,
|
||||
"updated_at": "2024-12-30T18:36:02.737Z",
|
||||
"webhook": false,
|
||||
"endpoint_name": "string",
|
||||
"tags": [
|
||||
"string"
|
||||
],
|
||||
"locked": false,
|
||||
"user_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
|
||||
"project_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
|
||||
}
|
||||
]
|
||||
}'
|
||||
@ -0,0 +1,4 @@
|
||||
curl -X DELETE \
|
||||
"$LANGFLOW_URL/api/v1/flows/$FLOW_ID" \
|
||||
-H "accept: application/json" \
|
||||
-H "x-api-key: $LANGFLOW_API_KEY"
|
||||
@ -0,0 +1,10 @@
|
||||
curl -X POST \
|
||||
"$LANGFLOW_URL/api/v1/flows/download/" \
|
||||
-H "accept: application/json" \
|
||||
-H "Content-Type: application/json" \
|
||||
-H "x-api-key: $LANGFLOW_API_KEY" \
|
||||
-d '[
|
||||
"e1e40c77-0541-41a9-88ab-ddb3419398b5",
|
||||
"92f9a4c5-cfc8-4656-ae63-1f0881163c28"
|
||||
]' \
|
||||
--output langflow-flows.zip
|
||||
@ -0,0 +1,10 @@
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
DEFAULT_FLOW_IMPORT_FILE="$SCRIPT_DIR/../../fixtures/flow-import.json"
|
||||
FLOW_IMPORT_FILE="${FLOW_IMPORT_FILE:-$DEFAULT_FLOW_IMPORT_FILE}"
|
||||
|
||||
curl -X POST \
|
||||
"$LANGFLOW_URL/api/v1/flows/upload/?folder_id=$FOLDER_ID" \
|
||||
-H "accept: application/json" \
|
||||
-H "Content-Type: multipart/form-data" \
|
||||
-H "x-api-key: $LANGFLOW_API_KEY" \
|
||||
-F "file=@${FLOW_IMPORT_FILE};type=application/json"
|
||||
@ -0,0 +1,4 @@
|
||||
curl -X GET \
|
||||
"$LANGFLOW_URL/api/v1/flows/$FLOW_ID" \
|
||||
-H "accept: application/json" \
|
||||
-H "x-api-key: $LANGFLOW_API_KEY"
|
||||
@ -0,0 +1,4 @@
|
||||
curl -X GET \
|
||||
"$LANGFLOW_URL/api/v1/flows/?remove_example_flows=true&components_only=false&get_all=false&project_id=$PROJECT_ID&header_flows=false&page=1&size=1" \
|
||||
-H "accept: application/json" \
|
||||
-H "x-api-key: $LANGFLOW_API_KEY"
|
||||
@ -0,0 +1,4 @@
|
||||
curl -X GET \
|
||||
"$LANGFLOW_URL/api/v1/flows/?remove_example_flows=false&components_only=false&get_all=true&header_flows=false&page=1&size=50" \
|
||||
-H "accept: application/json" \
|
||||
-H "x-api-key: $LANGFLOW_API_KEY"
|
||||
@ -0,0 +1,4 @@
|
||||
curl -X GET \
|
||||
"$LANGFLOW_URL/api/v1/flows/basic_examples/" \
|
||||
-H "accept: application/json" \
|
||||
-H "x-api-key: $LANGFLOW_API_KEY"
|
||||
@ -0,0 +1,17 @@
|
||||
{
|
||||
"name": "string2",
|
||||
"description": "string",
|
||||
"icon": "string",
|
||||
"icon_bg_color": "#FF0000",
|
||||
"gradient": "string",
|
||||
"data": {},
|
||||
"is_component": false,
|
||||
"updated_at": "2025-02-04T21:07:36+00:00",
|
||||
"webhook": false,
|
||||
"endpoint_name": "string",
|
||||
"tags": ["string"],
|
||||
"locked": false,
|
||||
"id": "e8d81c37-714b-49ae-ba82-e61141f020ee",
|
||||
"user_id": "f58396d4-a387-4bb8-b749-f40825c3d9f3",
|
||||
"project_id": "1415de42-8f01-4f36-bf34-539f23e47466"
|
||||
}
|
||||
@ -0,0 +1,3 @@
|
||||
{
|
||||
"message": "Flow deleted successfully"
|
||||
}
|
||||
@ -0,0 +1,3 @@
|
||||
% Total % Received % Xferd Average Speed Time Time Time Current
|
||||
Dload Upload Total Spent Left Speed
|
||||
100 76437 0 76353 100 84 4516k 5088 --:--:-- --:--:-- --:--:-- 4665k
|
||||
@ -0,0 +1,12 @@
|
||||
{
|
||||
"name": "Basic Prompting",
|
||||
"description": "Perform basic prompting with an OpenAI model.",
|
||||
"icon": "Braces",
|
||||
"icon_bg_color": null,
|
||||
"gradient": "2",
|
||||
"data": {
|
||||
"nodes": [
|
||||
...
|
||||
]
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,17 @@
|
||||
{
|
||||
"name": "string",
|
||||
"description": "string",
|
||||
"icon": "Braces",
|
||||
"icon_bg_color": null,
|
||||
"gradient": "2",
|
||||
"data": {},
|
||||
"is_component": false,
|
||||
"updated_at": "2024-12-30T18:30:22+00:00",
|
||||
"webhook": false,
|
||||
"endpoint_name": "my_new_endpoint_name",
|
||||
"tags": null,
|
||||
"locked": true,
|
||||
"id": "01ce083d-748b-4b8d-97b6-33adbb6a528a",
|
||||
"user_id": "f58396d4-a387-4bb8-b749-f40825c3d9f3",
|
||||
"project_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
|
||||
}
|
||||
@ -0,0 +1,13 @@
|
||||
curl -X PATCH \
|
||||
"$LANGFLOW_URL/api/v1/flows/$FLOW_ID" \
|
||||
-H "accept: application/json" \
|
||||
-H "Content-Type: application/json" \
|
||||
-H "x-api-key: $LANGFLOW_API_KEY" \
|
||||
-d '{
|
||||
"name": "string",
|
||||
"description": "string",
|
||||
"data": {},
|
||||
"project_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
|
||||
"endpoint_name": "my_new_endpoint_name",
|
||||
"locked": true
|
||||
}'
|
||||
@ -0,0 +1,12 @@
|
||||
{
|
||||
"1736354770500": "2025-01-08T11:46:10.500363-0500 DEBUG Creating starter project Document Q&A\n",
|
||||
"1736354770511": "2025-01-08T11:46:10.511146-0500 DEBUG Creating starter project Image Sentiment Analysis\n",
|
||||
"1736354770521": "2025-01-08T11:46:10.521018-0500 DEBUG Creating starter project SEO Keyword Generator\n",
|
||||
"1736354770532": "2025-01-08T11:46:10.532677-0500 DEBUG Creating starter project Sequential Tasks Agents\n",
|
||||
"1736354770544": "2025-01-08T11:46:10.544010-0500 DEBUG Creating starter project Custom Component Generator\n",
|
||||
"1736354770555": "2025-01-08T11:46:10.555513-0500 DEBUG Creating starter project Prompt Chaining\n",
|
||||
"1736354770588": "2025-01-08T11:46:10.588105-0500 DEBUG Create service ServiceType.CHAT_SERVICE\n",
|
||||
"1736354771021": "2025-01-08T11:46:11.021817-0500 DEBUG Telemetry data sent successfully.\n",
|
||||
"1736354775619": "2025-01-08T11:46:15.619545-0500 DEBUG Create service ServiceType.STORE_SERVICE\n",
|
||||
"1736354775699": "2025-01-08T11:46:15.699661-0500 DEBUG File 046-rocket.svg retrieved successfully from flow /Users/USER/Library/Caches/langflow/profile_pictures/Space.\n"
|
||||
}
|
||||
@ -0,0 +1,17 @@
|
||||
keepalive
|
||||
|
||||
{"1736355791151": "2025-01-08T12:03:11.151218-0500 DEBUG Building Chat Input\n"}
|
||||
|
||||
{"1736355791485": "2025-01-08T12:03:11.485380-0500 DEBUG consumed event add_message-153bcd5d-ef4d-4ece-8cc0-47c6b6a9ef92 (time in queue, 0.0000, client 0.0001)\n"}
|
||||
|
||||
{"1736355791499": "2025-01-08T12:03:11.499704-0500 DEBUG consumed event end_vertex-3d7125cd-7b8a-44eb-9113-ed5b785e3cf3 (time in queue, 0.0056, client 0.0047)\n"}
|
||||
|
||||
{"1736355791502": "2025-01-08T12:03:11.502510-0500 DEBUG consumed event end-40d0b363-5618-4a23-bbae-487cd0b9594d (time in queue, 0.0001, client 0.0004)\n"}
|
||||
|
||||
{"1736355791513": "2025-01-08T12:03:11.513097-0500 DEBUG Logged vertex build: 729ff2f8-6b01-48c8-9ad0-3743c2af9e8a\n"}
|
||||
|
||||
{"1736355791834": "2025-01-08T12:03:11.834982-0500 DEBUG Telemetry data sent successfully.\n"}
|
||||
|
||||
{"1736355791941": "2025-01-08T12:03:11.941840-0500 DEBUG Telemetry data sent successfully.\n"}
|
||||
|
||||
keepalive
|
||||
@ -0,0 +1,4 @@
|
||||
curl -X GET \
|
||||
"$LANGFLOW_URL/logs?lines_before=0&lines_after=0×tamp=0" \
|
||||
-H "accept: application/json" \
|
||||
-H "x-api-key: $LANGFLOW_API_KEY"
|
||||
@ -0,0 +1,4 @@
|
||||
curl -X GET \
|
||||
"$LANGFLOW_URL/logs-stream" \
|
||||
-H "accept: text/event-stream" \
|
||||
-H "x-api-key: $LANGFLOW_API_KEY"
|
||||
@ -0,0 +1,4 @@
|
||||
curl -X DELETE \
|
||||
"$LANGFLOW_URL/api/v1/monitor/messages/session/different_session_id_2" \
|
||||
-H "accept: */*" \
|
||||
-H "x-api-key: $LANGFLOW_API_KEY"
|
||||
@ -0,0 +1,6 @@
|
||||
curl -v -X DELETE \
|
||||
"$LANGFLOW_URL/api/v1/monitor/messages" \
|
||||
-H "accept: */*" \
|
||||
-H "Content-Type: application/json" \
|
||||
-H "x-api-key: $LANGFLOW_API_KEY" \
|
||||
-d '["MESSAGE_ID_1", "MESSAGE_ID_2"]'
|
||||
@ -0,0 +1,4 @@
|
||||
curl -X DELETE \
|
||||
"$LANGFLOW_URL/api/v1/monitor/builds?flow_id=$FLOW_ID" \
|
||||
-H "accept: */*" \
|
||||
-H "x-api-key: $LANGFLOW_API_KEY"
|
||||
@ -0,0 +1,8 @@
|
||||
export LANGFLOW_SERVER_URL="http://localhost:7860"
|
||||
export LANGFLOW_API_KEY="YOUR_LANGFLOW_API_KEY"
|
||||
export FLOW_ID="YOUR_FLOW_ID"
|
||||
|
||||
curl -s "$LANGFLOW_SERVER_URL/api/v1/monitor/traces?flow_id=$FLOW_ID&page=1&size=50" \
|
||||
-H "accept: application/json" \
|
||||
-H "x-api-key: $LANGFLOW_API_KEY" \
|
||||
| jq .
|
||||
@ -0,0 +1,4 @@
|
||||
curl -X GET \
|
||||
"$LANGFLOW_URL/api/v1/monitor/messages?flow_id=$FLOW_ID&session_id=01ce083d-748b-4b8d-97b6-33adbb6a528a&sender=Machine&sender_name=AI&order_by=timestamp" \
|
||||
-H "accept: application/json" \
|
||||
-H "x-api-key: $LANGFLOW_API_KEY"
|
||||
@ -0,0 +1,4 @@
|
||||
curl -X GET \
|
||||
"$LANGFLOW_URL/api/v1/monitor/messages" \
|
||||
-H "accept: application/json" \
|
||||
-H "x-api-key: $LANGFLOW_API_KEY"
|
||||
@ -0,0 +1,4 @@
|
||||
curl -X GET \
|
||||
"$LANGFLOW_URL/api/v1/monitor/transactions?flow_id=$FLOW_ID&page=1&size=50" \
|
||||
-H "accept: application/json" \
|
||||
-H "x-api-key: $LANGFLOW_API_KEY"
|
||||
@ -0,0 +1,4 @@
|
||||
curl -X GET \
|
||||
"$LANGFLOW_URL/api/v1/monitor/builds?flow_id=$FLOW_ID" \
|
||||
-H "accept: application/json" \
|
||||
-H "x-api-key: $LANGFLOW_API_KEY"
|
||||
@ -0,0 +1 @@
|
||||
HTTP/1.1 204 No Content
|
||||
@ -0,0 +1 @@
|
||||
204 No Content
|
||||
@ -0,0 +1 @@
|
||||
204 No Content
|
||||
@ -0,0 +1,30 @@
|
||||
[
|
||||
{
|
||||
"id": "1c1d6134-9b8b-4079-931c-84dcaddf19ba",
|
||||
"flow_id": "01ce083d-748b-4b8d-97b6-33adbb6a528a",
|
||||
"timestamp": "2024-12-23 19:20:11 UTC",
|
||||
"sender": "Machine",
|
||||
"sender_name": "AI",
|
||||
"session_id": "01ce083d-748b-4b8d-97b6-33adbb6a528a",
|
||||
"text": "Hello! It's great to see you here! What exciting project or idea are you thinking about diving into today? Whether it's something fresh and innovative or a classic concept with a twist, I'm here to help you get started! Let's brainstorm together!",
|
||||
"files": "[]",
|
||||
"edit": false,
|
||||
"properties": {
|
||||
"text_color": "",
|
||||
"background_color": "",
|
||||
"edited": false,
|
||||
"source": {
|
||||
"id": "OpenAIModel-7AjrN",
|
||||
"display_name": "OpenAI",
|
||||
"source": "gpt-4o-mini"
|
||||
},
|
||||
"icon": "OpenAI",
|
||||
"allow_markdown": false,
|
||||
"positive_feedback": null,
|
||||
"state": "complete",
|
||||
"targets": []
|
||||
},
|
||||
"category": "message",
|
||||
"content_blocks": []
|
||||
}
|
||||
]
|
||||
@ -0,0 +1,19 @@
|
||||
{
|
||||
"items": [
|
||||
{
|
||||
"timestamp": "2024-12-23T20:05:01.061Z",
|
||||
"vertex_id": "string",
|
||||
"target_id": "string",
|
||||
"inputs": {},
|
||||
"outputs": {},
|
||||
"status": "string",
|
||||
"error": "string",
|
||||
"flow_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
|
||||
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
|
||||
}
|
||||
],
|
||||
"total": 0,
|
||||
"page": 1,
|
||||
"size": 1,
|
||||
"pages": 0
|
||||
}
|
||||
@ -0,0 +1,357 @@
|
||||
{
|
||||
"vertex_builds": {
|
||||
"ChatInput-NCmix": [
|
||||
{
|
||||
"data": {
|
||||
"results": {
|
||||
"message": {
|
||||
"text_key": "text",
|
||||
"data": {
|
||||
"timestamp": "2024-12-23 19:10:57",
|
||||
"sender": "User",
|
||||
"sender_name": "User",
|
||||
"session_id": "01ce083d-748b-4b8d-97b6-33adbb6a528a",
|
||||
"text": "Hello",
|
||||
"files": [],
|
||||
"error": "False",
|
||||
"edit": "False",
|
||||
"properties": {
|
||||
"text_color": "",
|
||||
"background_color": "",
|
||||
"edited": "False",
|
||||
"source": {
|
||||
"id": "None",
|
||||
"display_name": "None",
|
||||
"source": "None"
|
||||
},
|
||||
"icon": "",
|
||||
"allow_markdown": "False",
|
||||
"positive_feedback": "None",
|
||||
"state": "complete",
|
||||
"targets": []
|
||||
},
|
||||
"category": "message",
|
||||
"content_blocks": [],
|
||||
"id": "c95bed34-f906-4aa6-84e4-68553f6db772",
|
||||
"flow_id": "01ce083d-748b-4b8d-97b6-33adbb6a528a"
|
||||
},
|
||||
"default_value": "",
|
||||
"text": "Hello",
|
||||
"sender": "User",
|
||||
"sender_name": "User",
|
||||
"files": [],
|
||||
"session_id": "01ce083d-748b-4b8d-97b6-33adbb6a528a",
|
||||
"timestamp": "2024-12-23 19:10:57+00:00",
|
||||
"flow_id": "01ce083d-748b-4b8d-97b6-33adbb6a528a",
|
||||
"error": "False",
|
||||
"edit": "False",
|
||||
"properties": {
|
||||
"text_color": "",
|
||||
"background_color": "",
|
||||
"edited": "False",
|
||||
"source": {
|
||||
"id": "None",
|
||||
"display_name": "None",
|
||||
"source": "None"
|
||||
},
|
||||
"icon": "",
|
||||
"allow_markdown": "False",
|
||||
"positive_feedback": "None",
|
||||
"state": "complete",
|
||||
"targets": []
|
||||
},
|
||||
"category": "message",
|
||||
"content_blocks": []
|
||||
}
|
||||
},
|
||||
"outputs": {
|
||||
"message": {
|
||||
"message": {
|
||||
"timestamp": "2024-12-23T19:10:57",
|
||||
"sender": "User",
|
||||
"sender_name": "User",
|
||||
"session_id": "01ce083d-748b-4b8d-97b6-33adbb6a528a",
|
||||
"text": "Hello",
|
||||
"files": [],
|
||||
"error": false,
|
||||
"edit": false,
|
||||
"properties": {
|
||||
"text_color": "",
|
||||
"background_color": "",
|
||||
"edited": false,
|
||||
"source": {
|
||||
"id": null,
|
||||
"display_name": null,
|
||||
"source": null
|
||||
},
|
||||
"icon": "",
|
||||
"allow_markdown": false,
|
||||
"positive_feedback": null,
|
||||
"state": "complete",
|
||||
"targets": []
|
||||
},
|
||||
"category": "message",
|
||||
"content_blocks": [],
|
||||
"id": "c95bed34-f906-4aa6-84e4-68553f6db772",
|
||||
"flow_id": "01ce083d-748b-4b8d-97b6-33adbb6a528a"
|
||||
},
|
||||
"type": "object"
|
||||
}
|
||||
},
|
||||
"logs": { "message": [] },
|
||||
"message": {
|
||||
"message": "Hello",
|
||||
"sender": "User",
|
||||
"sender_name": "User",
|
||||
"files": [],
|
||||
"type": "object"
|
||||
},
|
||||
"artifacts": {
|
||||
"message": "Hello",
|
||||
"sender": "User",
|
||||
"sender_name": "User",
|
||||
"files": [],
|
||||
"type": "object"
|
||||
},
|
||||
"timedelta": 0.015060124918818474,
|
||||
"duration": "15 ms",
|
||||
"used_frozen_result": false
|
||||
},
|
||||
"artifacts": {
|
||||
"message": "Hello",
|
||||
"sender": "User",
|
||||
"sender_name": "User",
|
||||
"files": [],
|
||||
"type": "object"
|
||||
},
|
||||
"params": "- Files: []\n Message: Hello\n Sender: User\n Sender Name: User\n Type: object\n",
|
||||
"valid": true,
|
||||
"build_id": "40aa200e-74db-4651-b698-f80301d2b26b",
|
||||
"id": "ChatInput-NCmix",
|
||||
"timestamp": "2024-12-23T19:10:58.772766Z",
|
||||
"flow_id": "01ce083d-748b-4b8d-97b6-33adbb6a528a"
|
||||
}
|
||||
],
|
||||
"Prompt-BEn9c": [
|
||||
{
|
||||
"data": {
|
||||
"results": {},
|
||||
"outputs": {
|
||||
"prompt": {
|
||||
"message": "Answer the user as if you were a GenAI expert, enthusiastic about helping them get started building something fresh.",
|
||||
"type": "text"
|
||||
}
|
||||
},
|
||||
"logs": { "prompt": [] },
|
||||
"message": {
|
||||
"prompt": {
|
||||
"repr": "Answer the user as if you were a GenAI expert, enthusiastic about helping them get started building something fresh.",
|
||||
"raw": "Answer the user as if you were a GenAI expert, enthusiastic about helping them get started building something fresh.",
|
||||
"type": "text"
|
||||
}
|
||||
},
|
||||
"artifacts": {
|
||||
"prompt": {
|
||||
"repr": "Answer the user as if you were a GenAI expert, enthusiastic about helping them get started building something fresh.",
|
||||
"raw": "Answer the user as if you were a GenAI expert, enthusiastic about helping them get started building something fresh.",
|
||||
"type": "text"
|
||||
}
|
||||
},
|
||||
"timedelta": 0.0057758750626817346,
|
||||
"duration": "6 ms",
|
||||
"used_frozen_result": false
|
||||
},
|
||||
"artifacts": {
|
||||
"prompt": {
|
||||
"repr": "Answer the user as if you were a GenAI expert, enthusiastic about helping them get started building something fresh.",
|
||||
"raw": "Answer the user as if you were a GenAI expert, enthusiastic about helping them get started building something fresh.",
|
||||
"type": "text"
|
||||
}
|
||||
},
|
||||
"params": "None",
|
||||
"valid": true,
|
||||
"build_id": "39bbbfde-97fd-42a5-a9ed-d42a5c5d532b",
|
||||
"id": "Prompt-BEn9c",
|
||||
"timestamp": "2024-12-23T19:10:58.781019Z",
|
||||
"flow_id": "01ce083d-748b-4b8d-97b6-33adbb6a528a"
|
||||
}
|
||||
],
|
||||
"OpenAIModel-7AjrN": [
|
||||
{
|
||||
"data": {
|
||||
"results": {},
|
||||
"outputs": {
|
||||
"text_output": {
|
||||
"message": "Hello! 🌟 I'm excited to help you get started on your journey to building something fresh! What do you have in mind? Whether it's a project, an idea, or a concept, let's dive in and make it happen!",
|
||||
"type": "text"
|
||||
},
|
||||
"model_output": { "message": "", "type": "unknown" }
|
||||
},
|
||||
"logs": { "text_output": [] },
|
||||
"message": {
|
||||
"text_output": {
|
||||
"repr": "Hello! 🌟 I'm excited to help you get started on your journey to building something fresh! What do you have in mind? Whether it's a project, an idea, or a concept, let's dive in and make it happen!",
|
||||
"raw": "Hello! 🌟 I'm excited to help you get started on your journey to building something fresh! What do you have in mind? Whether it's a project, an idea, or a concept, let's dive in and make it happen!",
|
||||
"type": "text"
|
||||
}
|
||||
},
|
||||
"artifacts": {
|
||||
"text_output": {
|
||||
"repr": "Hello! 🌟 I'm excited to help you get started on your journey to building something fresh! What do you have in mind? Whether it's a project, an idea, or a concept, let's dive in and make it happen!",
|
||||
"raw": "Hello! 🌟 I'm excited to help you get started on your journey to building something fresh! What do you have in mind? Whether it's a project, an idea, or a concept, let's dive in and make it happen!",
|
||||
"type": "text"
|
||||
}
|
||||
},
|
||||
"timedelta": 1.034765167045407,
|
||||
"duration": "1.03 seconds",
|
||||
"used_frozen_result": false
|
||||
},
|
||||
"artifacts": {
|
||||
"text_output": {
|
||||
"repr": "Hello! 🌟 I'm excited to help you get started on your journey to building something fresh! What do you have in mind? Whether it's a project, an idea, or a concept, let's dive in and make it happen!",
|
||||
"raw": "Hello! 🌟 I'm excited to help you get started on your journey to building something fresh! What do you have in mind? Whether it's a project, an idea, or a concept, let's dive in and make it happen!",
|
||||
"type": "text"
|
||||
}
|
||||
},
|
||||
"params": "None",
|
||||
"valid": true,
|
||||
"build_id": "4f0ae730-a266-4d35-b89f-7b825c620a0f",
|
||||
"id": "OpenAIModel-7AjrN",
|
||||
"timestamp": "2024-12-23T19:10:58.790484Z",
|
||||
"flow_id": "01ce083d-748b-4b8d-97b6-33adbb6a528a"
|
||||
}
|
||||
],
|
||||
"ChatOutput-sfUhT": [
|
||||
{
|
||||
"data": {
|
||||
"results": {
|
||||
"message": {
|
||||
"text_key": "text",
|
||||
"data": {
|
||||
"timestamp": "2024-12-23 19:10:58",
|
||||
"sender": "Machine",
|
||||
"sender_name": "AI",
|
||||
"session_id": "01ce083d-748b-4b8d-97b6-33adbb6a528a",
|
||||
"text": "Hello! 🌟 I'm excited to help you get started on your journey to building something fresh! What do you have in mind? Whether it's a project, an idea, or a concept, let's dive in and make it happen!",
|
||||
"files": [],
|
||||
"error": "False",
|
||||
"edit": "False",
|
||||
"properties": {
|
||||
"text_color": "",
|
||||
"background_color": "",
|
||||
"edited": "False",
|
||||
"source": {
|
||||
"id": "OpenAIModel-7AjrN",
|
||||
"display_name": "OpenAI",
|
||||
"source": "gpt-4o-mini"
|
||||
},
|
||||
"icon": "OpenAI",
|
||||
"allow_markdown": "False",
|
||||
"positive_feedback": "None",
|
||||
"state": "complete",
|
||||
"targets": []
|
||||
},
|
||||
"category": "message",
|
||||
"content_blocks": [],
|
||||
"id": "5688356d-9f30-40ca-9907-79a7a2fc16fd",
|
||||
"flow_id": "01ce083d-748b-4b8d-97b6-33adbb6a528a"
|
||||
},
|
||||
"default_value": "",
|
||||
"text": "Hello! 🌟 I'm excited to help you get started on your journey to building something fresh! What do you have in mind? Whether it's a project, an idea, or a concept, let's dive in and make it happen!",
|
||||
"sender": "Machine",
|
||||
"sender_name": "AI",
|
||||
"files": [],
|
||||
"session_id": "01ce083d-748b-4b8d-97b6-33adbb6a528a",
|
||||
"timestamp": "2024-12-23 19:10:58+00:00",
|
||||
"flow_id": "01ce083d-748b-4b8d-97b6-33adbb6a528a",
|
||||
"error": "False",
|
||||
"edit": "False",
|
||||
"properties": {
|
||||
"text_color": "",
|
||||
"background_color": "",
|
||||
"edited": "False",
|
||||
"source": {
|
||||
"id": "OpenAIModel-7AjrN",
|
||||
"display_name": "OpenAI",
|
||||
"source": "gpt-4o-mini"
|
||||
},
|
||||
"icon": "OpenAI",
|
||||
"allow_markdown": "False",
|
||||
"positive_feedback": "None",
|
||||
"state": "complete",
|
||||
"targets": []
|
||||
},
|
||||
"category": "message",
|
||||
"content_blocks": []
|
||||
}
|
||||
},
|
||||
"outputs": {
|
||||
"message": {
|
||||
"message": {
|
||||
"timestamp": "2024-12-23T19:10:58",
|
||||
"sender": "Machine",
|
||||
"sender_name": "AI",
|
||||
"session_id": "01ce083d-748b-4b8d-97b6-33adbb6a528a",
|
||||
"text": "Hello! 🌟 I'm excited to help you get started on your journey to building something fresh! What do you have in mind? Whether it's a project, an idea, or a concept, let's dive in and make it happen!",
|
||||
"files": [],
|
||||
"error": false,
|
||||
"edit": false,
|
||||
"properties": {
|
||||
"text_color": "",
|
||||
"background_color": "",
|
||||
"edited": false,
|
||||
"source": {
|
||||
"id": "OpenAIModel-7AjrN",
|
||||
"display_name": "OpenAI",
|
||||
"source": "gpt-4o-mini"
|
||||
},
|
||||
"icon": "OpenAI",
|
||||
"allow_markdown": false,
|
||||
"positive_feedback": null,
|
||||
"state": "complete",
|
||||
"targets": []
|
||||
},
|
||||
"category": "message",
|
||||
"content_blocks": [],
|
||||
"id": "5688356d-9f30-40ca-9907-79a7a2fc16fd",
|
||||
"flow_id": "01ce083d-748b-4b8d-97b6-33adbb6a528a"
|
||||
},
|
||||
"type": "object"
|
||||
}
|
||||
},
|
||||
"logs": { "message": [] },
|
||||
"message": {
|
||||
"message": "Hello! 🌟 I'm excited to help you get started on your journey to building something fresh! What do you have in mind? Whether it's a project, an idea, or a concept, let's dive in and make it happen!",
|
||||
"sender": "Machine",
|
||||
"sender_name": "AI",
|
||||
"files": [],
|
||||
"type": "object"
|
||||
},
|
||||
"artifacts": {
|
||||
"message": "Hello! 🌟 I'm excited to help you get started on your journey to building something fresh! What do you have in mind? Whether it's a project, an idea, or a concept, let's dive in and make it happen!",
|
||||
"sender": "Machine",
|
||||
"sender_name": "AI",
|
||||
"files": [],
|
||||
"type": "object"
|
||||
},
|
||||
"timedelta": 0.017838125000707805,
|
||||
"duration": "18 ms",
|
||||
"used_frozen_result": false
|
||||
},
|
||||
"artifacts": {
|
||||
"message": "Hello! 🌟 I'm excited to help you get started on your journey to building something fresh! What do you have in mind? Whether it's a project, an idea, or a concept, let's dive in and make it happen!",
|
||||
"sender": "Machine",
|
||||
"sender_name": "AI",
|
||||
"files": [],
|
||||
"type": "object"
|
||||
},
|
||||
"params": "- Files: []\n Message: Hello! 🌟 I'm excited to help you get started on your journey to building\n something fresh! What do you have in mind? Whether it's a project, an idea, or\n a concept, let's dive in and make it happen!\n Sender: Machine\n Sender Name: AI\n Type: object\n",
|
||||
"valid": true,
|
||||
"build_id": "1e8b908b-aba7-403b-9e9b-eca92bb78668",
|
||||
"id": "ChatOutput-sfUhT",
|
||||
"timestamp": "2024-12-23T19:10:58.813268Z",
|
||||
"flow_id": "01ce083d-748b-4b8d-97b6-33adbb6a528a"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,25 @@
|
||||
{
|
||||
"timestamp": "2024-12-23T18:49:06",
|
||||
"sender": "string",
|
||||
"sender_name": "string",
|
||||
"session_id": "01ce083d-748b-4b8d-97b6-33adbb6a528a",
|
||||
"text": "testing 1234",
|
||||
"files": ["string"],
|
||||
"error": true,
|
||||
"edit": true,
|
||||
"properties": {
|
||||
"text_color": "string",
|
||||
"background_color": "string",
|
||||
"edited": false,
|
||||
"source": { "id": "string", "display_name": "string", "source": "string" },
|
||||
"icon": "string",
|
||||
"allow_markdown": false,
|
||||
"positive_feedback": true,
|
||||
"state": "complete",
|
||||
"targets": []
|
||||
},
|
||||
"category": "message",
|
||||
"content_blocks": [],
|
||||
"id": "3ab66cc6-c048-48f8-ab07-570f5af7b160",
|
||||
"flow_id": "01ce083d-748b-4b8d-97b6-33adbb6a528a"
|
||||
}
|
||||
@ -0,0 +1,30 @@
|
||||
[
|
||||
{
|
||||
"id": "8dd7f064-e63a-4773-b472-ca0475249dfd",
|
||||
"flow_id": "01ce083d-748b-4b8d-97b6-33adbb6a528a",
|
||||
"timestamp": "2024-12-23 18:49:55 UTC",
|
||||
"sender": "User",
|
||||
"sender_name": "User",
|
||||
"session_id": "different_session_id",
|
||||
"text": "message",
|
||||
"files": "[]",
|
||||
"edit": false,
|
||||
"properties": {
|
||||
"text_color": "",
|
||||
"background_color": "",
|
||||
"edited": false,
|
||||
"source": {
|
||||
"id": null,
|
||||
"display_name": null,
|
||||
"source": null
|
||||
},
|
||||
"icon": "",
|
||||
"allow_markdown": false,
|
||||
"positive_feedback": null,
|
||||
"state": "complete",
|
||||
"targets": []
|
||||
},
|
||||
"category": "message",
|
||||
"content_blocks": []
|
||||
}
|
||||
]
|
||||
@ -0,0 +1,8 @@
|
||||
curl -X PUT \
|
||||
"$LANGFLOW_URL/api/v1/monitor/messages/3ab66cc6-c048-48f8-ab07-570f5af7b160" \
|
||||
-H "accept: application/json" \
|
||||
-H "Content-Type: application/json" \
|
||||
-H "x-api-key: $LANGFLOW_API_KEY" \
|
||||
-d '{
|
||||
"text": "testing 1234"
|
||||
}'
|
||||
@ -0,0 +1,4 @@
|
||||
curl -X PATCH \
|
||||
"$LANGFLOW_URL/api/v1/monitor/messages/session/01ce083d-748b-4b8d-97b6-33adbb6a528a?new_session_id=different_session_id" \
|
||||
-H "accept: application/json" \
|
||||
-H "x-api-key: $LANGFLOW_API_KEY"
|
||||
@ -0,0 +1,13 @@
|
||||
BASE_URL="${LANGFLOW_SERVER_URL:-$LANGFLOW_URL}"
|
||||
|
||||
curl -X POST \
|
||||
"$BASE_URL/api/v1/responses" \
|
||||
-H "x-api-key: $LANGFLOW_API_KEY" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d @- <<EOF
|
||||
{
|
||||
"model": "$FLOW_ID",
|
||||
"input": "What's my name?",
|
||||
"previous_response_id": "c45f4ac8-772b-4675-8551-c560b1afd590"
|
||||
}
|
||||
EOF
|
||||
@ -0,0 +1,13 @@
|
||||
BASE_URL="${LANGFLOW_SERVER_URL:-$LANGFLOW_URL}"
|
||||
|
||||
curl -X POST \
|
||||
"$BASE_URL/api/v1/responses" \
|
||||
-H "x-api-key: $LANGFLOW_API_KEY" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d @- <<EOF
|
||||
{
|
||||
"model": "$FLOW_ID",
|
||||
"input": "What's my name?",
|
||||
"previous_response_id": "session-alice-1756839048"
|
||||
}
|
||||
EOF
|
||||
@ -0,0 +1,12 @@
|
||||
BASE_URL="${LANGFLOW_SERVER_URL:-$LANGFLOW_URL}"
|
||||
|
||||
curl -X POST \
|
||||
"$BASE_URL/api/v1/responses" \
|
||||
-H "x-api-key: $LANGFLOW_API_KEY" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d @- <<EOF
|
||||
{
|
||||
"model": "$FLOW_ID",
|
||||
"input": "Hello, my name is Alice"
|
||||
}
|
||||
EOF
|
||||
@ -0,0 +1,9 @@
|
||||
curl -X POST \
|
||||
"$LANGFLOW_SERVER_URL/api/v1/responses" \
|
||||
-H "x-api-key: $LANGFLOW_API_KEY" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{
|
||||
"model": "$YOUR_FLOW_ID",
|
||||
"input": "Hello, how are you?",
|
||||
"stream": false
|
||||
}'
|
||||
@ -0,0 +1,9 @@
|
||||
curl -X POST \
|
||||
"$LANGFLOW_SERVER_URL/api/v1/responses" \
|
||||
-H "x-api-key: $LANGFLOW_API_KEY" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{
|
||||
"model": "$FLOW_ID",
|
||||
"input": "Tell me a story about a robot",
|
||||
"stream": true
|
||||
}'
|
||||
@ -0,0 +1,11 @@
|
||||
curl -X POST \
|
||||
"$LANGFLOW_SERVER_URL/api/v1/responses" \
|
||||
-H "x-api-key: $LANGFLOW_API_KEY" \
|
||||
-H "Content-Type: application/json" \
|
||||
-H "X-LANGFLOW-GLOBAL-VAR-OPENAI_API_KEY: sk-..." \
|
||||
-H "X-LANGFLOW-GLOBAL-VAR-USER_ID: user123" \
|
||||
-H "X-LANGFLOW-GLOBAL-VAR-ENVIRONMENT: production" \
|
||||
-d '{
|
||||
"model": "your-flow-id",
|
||||
"input": "Hello"
|
||||
}'
|
||||
@ -0,0 +1,23 @@
|
||||
{
|
||||
"id": "c45f4ac8-772b-4675-8551-c560b1afd590",
|
||||
"object": "response",
|
||||
"created_at": 1756839043,
|
||||
"status": "completed",
|
||||
"model": "ced2ec91-f325-4bf0-8754-f3198c2b1563",
|
||||
"output": [
|
||||
{
|
||||
"type": "message",
|
||||
"id": "msg_c45f4ac8-772b-4675-8551-c560b1afd590",
|
||||
"status": "completed",
|
||||
"role": "assistant",
|
||||
"content": [
|
||||
{
|
||||
"type": "output_text",
|
||||
"text": "Your name is Alice. How can I help you today?",
|
||||
"annotations": []
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"previous_response_id": "c45f4ac8-772b-4675-8551-c560b1afd590"
|
||||
}
|
||||
@ -0,0 +1,23 @@
|
||||
{
|
||||
"id": "c45f4ac8-772b-4675-8551-c560b1afd590",
|
||||
"object": "response",
|
||||
"created_at": 1756839042,
|
||||
"status": "completed",
|
||||
"model": "ced2ec91-f325-4bf0-8754-f3198c2b1563",
|
||||
"output": [
|
||||
{
|
||||
"type": "message",
|
||||
"id": "msg_c45f4ac8-772b-4675-8551-c560b1afd590",
|
||||
"status": "completed",
|
||||
"role": "assistant",
|
||||
"content": [
|
||||
{
|
||||
"type": "output_text",
|
||||
"text": "Hello, Alice! How can I assist you today?",
|
||||
"annotations": []
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"previous_response_id": null
|
||||
}
|
||||
@ -0,0 +1,10 @@
|
||||
{
|
||||
"id": "f7fcea36-f128-41c4-9ac1-e683137375d5",
|
||||
"object": "response.chunk",
|
||||
"created": 1756838094,
|
||||
"model": "ced2ec91-f325-4bf0-8754-f3198c2b1563",
|
||||
"delta": {
|
||||
"content": "Once"
|
||||
},
|
||||
"status": null
|
||||
}
|
||||
@ -0,0 +1,58 @@
|
||||
{
|
||||
"id": "a6e5511e-71f8-457a-88d2-7d8c6ea34e36",
|
||||
"object": "response",
|
||||
"created_at": 1756835379,
|
||||
"status": "completed",
|
||||
"error": null,
|
||||
"incomplete_details": null,
|
||||
"instructions": null,
|
||||
"max_output_tokens": null,
|
||||
"model": "ced2ec91-f325-4bf0-8754-f3198c2b1563",
|
||||
"output": [
|
||||
{
|
||||
"id": "evaluate_expression_1",
|
||||
"queries": [
|
||||
"15*23"
|
||||
],
|
||||
"status": "completed",
|
||||
"tool_name": "evaluate_expression",
|
||||
"type": "tool_call",
|
||||
"results": {
|
||||
"result": "345"
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "message",
|
||||
"id": "msg_a6e5511e-71f8-457a-88d2-7d8c6ea34e36",
|
||||
"status": "completed",
|
||||
"role": "assistant",
|
||||
"content": [
|
||||
{
|
||||
"type": "output_text",
|
||||
"text": "The result of 23 * 15 is 345.",
|
||||
"annotations": []
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"parallel_tool_calls": true,
|
||||
"previous_response_id": null,
|
||||
"reasoning": {
|
||||
"effort": null,
|
||||
"summary": null
|
||||
},
|
||||
"store": true,
|
||||
"temperature": 1.0,
|
||||
"text": {
|
||||
"format": {
|
||||
"type": "text"
|
||||
}
|
||||
},
|
||||
"tool_choice": "auto",
|
||||
"tools": [],
|
||||
"top_p": 1.0,
|
||||
"truncation": "disabled",
|
||||
"usage": null,
|
||||
"user": null,
|
||||
"metadata": {}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user