From a7825e14c99d5c5d0fd8b2a4e0806fbab8acb862 Mon Sep 17 00:00:00 2001 From: Mendon Kissling <59585235+mendonk@users.noreply.github.com> Date: Fri, 26 Sep 2025 10:05:06 -0400 Subject: [PATCH] docs: 1.6 feature branch (#9521) * docs: update file size limit to 1024 mb (#9397) * update-file-size-limit-to-1024-mb * docs: clarify available API endpoints and their use cases (#9382) * available-endpoints * asterisk * structure-into-tabs-and-confirm-login-endpoint * reorg and clarify some usage --------- Co-authored-by: April M --------- Co-authored-by: April M * add-lfx-kb-agent-struct-out * update-release-notes * docs: docling integration into file component (#9481) * init * ui-package-manager * more-content * components-page * dependency-included-for-1.6 * remove-package-management-feature * Apply suggestions from code review Co-authored-by: April I. Murphy <36110273+aimurphy@users.noreply.github.com> * clarify-file-extension-behavior * config-dir-not-in-1.6 * clarify-outputs * add-links-andupdate-parameters * more-params * clarify-supported-filetypes * installation-in-bundle * Apply suggestions from code review Co-authored-by: April I. Murphy <36110273+aimurphy@users.noreply.github.com> * Apply suggestions from code review --------- Co-authored-by: April I. Murphy <36110273+aimurphy@users.noreply.github.com> * docs: Traceloop SDK integration documentation (#9514) * Added documentation file for langflow-traceloop-instana integration * updated sidebar.js * Updated documentation with metrics integration instructions * Update docs/docs/Integrations/integrations-instana-traceloop.mdx Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * Update docs/docs/Integrations/integrations-instana-traceloop.mdx Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * update doc * Format correction * Formatting correction * Updated Slug title * style-edit * Split configure environment variables into steps * Formatted as per Google developer style guide * Update docs/docs/Integrations/integrations-instana-traceloop.mdx Co-authored-by: Edwin Jose * More context added on OTLP security * Added screenshots of Instana dashboards * Updated as per the review comments * Update docs/docs/Integrations/integrations-instana-traceloop.mdx Co-authored-by: Mendon Kissling <59585235+mendonk@users.noreply.github.com> * Update docs/docs/Integrations/integrations-instana-traceloop.mdx Co-authored-by: Mendon Kissling <59585235+mendonk@users.noreply.github.com> * Update docs/docs/Integrations/integrations-instana-traceloop.mdx Co-authored-by: Mendon Kissling <59585235+mendonk@users.noreply.github.com> * Update docs/docs/Integrations/integrations-instana-traceloop.mdx Co-authored-by: Mendon Kissling <59585235+mendonk@users.noreply.github.com> * updated refer documentation links --------- Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Co-authored-by: Mendon Kissling <59585235+mendonk@users.noreply.github.com> Co-authored-by: Edwin Jose * docling-and-traceloop-links-for-release-notes-remove-duplicates * traceloop-touchup * add-component-release-notes * docs: 1.6 knowledge base feature (#9381) * sidebars-and-content * add-kb-components * completed-basic-outline * updates-and-new-names * kb-tutorial-content * Apply suggestions from code review Co-authored-by: April I. Murphy <36110273+aimurphy@users.noreply.github.com> * move-component-docs-to-main-page * code-review * reorganize-content * add-link-to-agents * fix links, create components-kb * move and revise kb content * missing import --------- Co-authored-by: April I. Murphy <36110273+aimurphy@users.noreply.github.com> Co-authored-by: April M * docs: Component documentation updates for 1.6.0 (#9627) * bundles icon * component menu and bundle icons * mcp icon extension * more bundle icon * workspace gestures and locking * mcp server stuff * fix typo and move serper component * g-assist edit * simplify hidden param text and update cohere * amazon components * nvidia system assist * use partial for hidden param text * fix import, add partial for agent summary * style changes to prep for separating vector page * rework llm and embedding model pages * handle legacy components * remove memories page * tools page * applied partials to vector stores before moving * move redis and ds, fix links * astra db component updates * c vector stores * traceloop copyedits * advanced parsing * elastic page and ocr engine edit * q-w vector stores * rest of vector stores * fix build errors * Revert "mcp icon extension" This reverts commit 4d1582793a9e0f0b3043f03b3d6892218177aabf. * unused imports and build errors * build errors * better icon reference * tip edits * fixing after preview * more touchup * small style edits for ts client page * replicate pr 9676 * fix style * KB comments * Update docs/docs/Components/bundles-mongodb.mdx Co-authored-by: Mendon Kissling <59585235+mendonk@users.noreply.github.com> --------- Co-authored-by: Mendon Kissling <59585235+mendonk@users.noreply.github.com> * add deprecated component to release notes * knowledge and message history * wording * legacy components * capitalization * docs: OpenAI responses endpoint (#9539) * init * more-content-and-examples * cleanup * add-response-tabs-and-streaming-example * Apply suggestions from code review Co-authored-by: April I. Murphy <36110273+aimurphy@users.noreply.github.com> * requires-agent-component-to-emit-message * [autofix.ci] apply automated fixes * test-and-explain-more * global-var-and-fallback * bash-not-curl-codeblock * tighten-up-intro-para * add-entry-to-concepts-publish-page * Apply suggestions from code review Co-authored-by: April I. Murphy <36110273+aimurphy@users.noreply.github.com> * fix-merge-mistake * flow-id-or-endpoint-name * reformat * Apply suggestions from code review Co-authored-by: April I. Murphy <36110273+aimurphy@users.noreply.github.com> * standardize-table-codefont --------- Co-authored-by: April I. Murphy <36110273+aimurphy@users.noreply.github.com> Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> * fix build * code rabbit comments * docs: remove knowledge base content from 1.6 (#9784) * remove-kb-content * broken links * random change to restart build --------- Co-authored-by: April I. Murphy <36110273+aimurphy@users.noreply.github.com> Co-authored-by: April M * docs: update composio bundle page (#9442) * update-composio-integrations * update-doc-to-be-general * trailing-space * add-tool-script * Apply suggestions from code review Co-authored-by: April I. Murphy <36110273+aimurphy@users.noreply.github.com> * global-variable * Apply suggestions from code review Co-authored-by: April I. Murphy <36110273+aimurphy@users.noreply.github.com> * Apply suggestions from code review Co-authored-by: April I. Murphy <36110273+aimurphy@users.noreply.github.com> * reorder-steps-and-move-script * clarify-connection * [autofix.ci] apply automated fixes * [autofix.ci] apply automated fixes (attempt 2/3) * [autofix.ci] apply automated fixes (attempt 3/3) * tools slug/name * test composio steps * remove unnecessary import * Apply suggestions from code review Co-authored-by: April I. Murphy <36110273+aimurphy@users.noreply.github.com> --------- Co-authored-by: April I. Murphy <36110273+aimurphy@users.noreply.github.com> Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> Co-authored-by: April M * chore: small misses and sync with 9-Sep-25 release build (#9792) * io page * fix slug * custom models and canvas controls * message history * composio slack * move a flow * vlm option for docling * docs: add oauth for mcp (#9626) * oauth-and-none-options * mcp-composer-for-server * updates-from-testing * Apply suggestions from code review Co-authored-by: April I. Murphy <36110273+aimurphy@users.noreply.github.com> * clarify-client-update * Apply suggestions from code review Co-authored-by: April I. Murphy <36110273+aimurphy@users.noreply.github.com> * code-review * clarify-oauth-values * Apply suggestions from code review Co-authored-by: April I. Murphy <36110273+aimurphy@users.noreply.github.com> * code-review * double-words --------- Co-authored-by: April I. Murphy <36110273+aimurphy@users.noreply.github.com> * docs: include guidance for openai client dummy key (#9871) * test-client-calls * less-prose * clearer-intro * Apply suggestions from code review Co-authored-by: April I. Murphy <36110273+aimurphy@users.noreply.github.com> * remove-indentation-and-correct-example-key-value * comment-syntax --------- Co-authored-by: April I. Murphy <36110273+aimurphy@users.noreply.github.com> * docs: mcp tools troubleshooting (#9866) * move-mcp-troubleshooting-from-server-page-and-add-issue * Apply suggestions from code review Co-authored-by: April I. Murphy <36110273+aimurphy@users.noreply.github.com> * Apply suggestions from code review * Apply suggestions from code review Co-authored-by: Lucas Oliveira <62335616+lucaseduoli@users.noreply.github.com> --------- Co-authored-by: April I. Murphy <36110273+aimurphy@users.noreply.github.com> Co-authored-by: Lucas Oliveira <62335616+lucaseduoli@users.noreply.github.com> * docs: auth changes (#9731) * initial-content * Apply suggestions from code review Co-authored-by: April I. Murphy <36110273+aimurphy@users.noreply.github.com> * Apply suggestions from code review Co-authored-by: April I. Murphy <36110273+aimurphy@users.noreply.github.com> * code-review * Apply suggestions from code review --------- Co-authored-by: April I. Murphy <36110273+aimurphy@users.noreply.github.com> * docs: CORS configuration (#9773) * initial-content * title * clarify-default * cleanup * cors-defaults-with-warning-for-1.7 * docs-and-code-review * clarify-cors-in-future-release * code-review * developer mode for docling * auto login * cors * auth variables * environment variables pt 1 * env var pt 2 * env var pt 3 * env var pt 5 * align CLI page with env var * autologin * docs: clarify log format behavior (#9945) clarify-log-format-behavior * docling dependency exceptions --------- Co-authored-by: April M Co-authored-by: April I. Murphy <36110273+aimurphy@users.noreply.github.com> Co-authored-by: Sandesh R <115570766+2getsandesh@users.noreply.github.com> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Co-authored-by: Edwin Jose Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> Co-authored-by: Lucas Oliveira <62335616+lucaseduoli@users.noreply.github.com> --- docs/docs/API-Reference/api-files.mdx | 4 +- docs/docs/API-Reference/api-logs.mdx | 24 +- .../API-Reference/api-openai-responses.mdx | 599 +++++++++++ .../api-reference-api-examples.mdx | 80 +- docs/docs/Agents/agents-tools.mdx | 54 +- docs/docs/Agents/agents.mdx | 6 +- docs/docs/Components/bundles-aiml.mdx | 9 +- docs/docs/Components/bundles-amazon.mdx | 32 +- docs/docs/Components/bundles-anthropic.mdx | 4 +- docs/docs/Components/bundles-arxiv.mdx | 2 +- docs/docs/Components/bundles-azure.mdx | 6 +- docs/docs/Components/bundles-baidu.mdx | 6 +- docs/docs/Components/bundles-bing.mdx | 2 +- docs/docs/Components/bundles-cassandra.mdx | 118 +++ docs/docs/Components/bundles-chroma.mdx | 80 ++ docs/docs/Components/bundles-clickhouse.mdx | 61 ++ docs/docs/Components/bundles-cloudflare.mdx | 4 +- docs/docs/Components/bundles-cohere.mdx | 26 +- docs/docs/Components/bundles-couchbase.mdx | 56 + docs/docs/Components/bundles-datastax.mdx | 372 ++++++- docs/docs/Components/bundles-deepseek.mdx | 4 +- docs/docs/Components/bundles-duckduckgo.mdx | 2 +- docs/docs/Components/bundles-elastic.mdx | 106 ++ docs/docs/Components/bundles-exa.mdx | 2 +- docs/docs/Components/bundles-faiss.mdx | 47 + docs/docs/Components/bundles-glean.mdx | 2 +- docs/docs/Components/bundles-google.mdx | 29 +- docs/docs/Components/bundles-groq.mdx | 4 +- docs/docs/Components/bundles-huggingface.mdx | 10 +- docs/docs/Components/bundles-ibm.mdx | 6 +- .../Components/bundles-icosacomputing.mdx | 2 +- docs/docs/Components/bundles-langchain.mdx | 9 +- docs/docs/Components/bundles-lmstudio.mdx | 6 +- docs/docs/Components/bundles-maritalk.mdx | 4 +- docs/docs/Components/bundles-mem0.mdx | 2 +- docs/docs/Components/bundles-milvus.mdx | 60 ++ docs/docs/Components/bundles-mistralai.mdx | 6 +- docs/docs/Components/bundles-mongodb.mdx | 54 + docs/docs/Components/bundles-novita.mdx | 4 +- docs/docs/Components/bundles-nvidia.mdx | 4 +- docs/docs/Components/bundles-ollama.mdx | 6 +- docs/docs/Components/bundles-openai.mdx | 6 +- docs/docs/Components/bundles-openrouter.mdx | 4 +- docs/docs/Components/bundles-perplexity.mdx | 4 +- docs/docs/Components/bundles-pgvector.mdx | 50 + docs/docs/Components/bundles-pinecone.mdx | 53 + docs/docs/Components/bundles-qdrant.mdx | 60 ++ docs/docs/Components/bundles-redis.mdx | 44 +- docs/docs/Components/bundles-sambanova.mdx | 4 +- docs/docs/Components/bundles-searchapi.mdx | 3 +- docs/docs/Components/bundles-serper.mdx | 33 + docs/docs/Components/bundles-supabase.mdx | 52 + docs/docs/Components/bundles-upstash.mdx | 53 + docs/docs/Components/bundles-vectara.mdx | 60 ++ docs/docs/Components/bundles-vertexai.mdx | 6 +- docs/docs/Components/bundles-weaviate.mdx | 53 + docs/docs/Components/bundles-wikipedia.mdx | 2 +- docs/docs/Components/bundles-xai.mdx | 4 +- docs/docs/Components/components-agents.mdx | 107 -- docs/docs/Components/components-bundles.mdx | 207 +++- .../components-custom-components.mdx | 2 +- docs/docs/Components/components-data.mdx | 137 ++- .../components-embedding-models.mdx | 74 +- docs/docs/Components/components-helpers.mdx | 145 ++- docs/docs/Components/components-io.mdx | 32 +- docs/docs/Components/components-logic.mdx | 16 +- docs/docs/Components/components-memories.mdx | 55 - docs/docs/Components/components-models.mdx | 127 ++- .../docs/Components/components-processing.mdx | 72 +- docs/docs/Components/components-prompts.mdx | 2 +- docs/docs/Components/components-tools.mdx | 83 +- .../Components/components-vector-stores.mdx | 983 ------------------ docs/docs/Components/mcp-client.mdx | 19 +- docs/docs/Concepts/concepts-components.mdx | 29 +- .../Concepts/concepts-file-management.mdx | 50 +- docs/docs/Concepts/concepts-flows-import.mdx | 24 +- docs/docs/Concepts/concepts-flows.mdx | 33 +- docs/docs/Concepts/concepts-overview.mdx | 20 +- docs/docs/Concepts/concepts-playground.mdx | 2 +- docs/docs/Concepts/concepts-publish.mdx | 7 + docs/docs/Concepts/data-types.mdx | 18 +- docs/docs/Concepts/mcp-server.mdx | 296 +++--- .../api-keys-and-authentication.mdx | 102 +- docs/docs/Configuration/configuration-cli.mdx | 25 +- .../configuration-custom-database.mdx | 9 +- .../configuration-global-variables.mdx | 118 ++- .../Configuration/environment-variables.mdx | 300 +++--- .../Contributing/contributing-bundles.mdx | 12 +- .../Contributing/contributing-templates.mdx | 8 +- docs/docs/Deployment/deployment-caddyfile.mdx | 59 +- .../deployment-prod-best-practices.mdx | 8 +- .../Develop/Clients/typescript-client.mdx | 1 - docs/docs/Develop/develop-application.mdx | 39 +- .../Develop/install-custom-dependencies.mdx | 5 +- docs/docs/Develop/logging.mdx | 98 +- docs/docs/Develop/memory.mdx | 112 +- docs/docs/Develop/webhook.mdx | 5 + .../Get-Started/get-started-quickstart.mdx | 6 +- .../Integrations/Arize/integrations-arize.mdx | 2 +- .../Composio/integrations-composio.mdx | 148 ++- .../Docling/integrations-docling.mdx | 39 +- .../Google/integrations-google-big-query.mdx | 5 +- .../Nvidia/integrations-nvidia-ingest.mdx | 4 +- .../integrations-instana-traceloop.mdx | 106 ++ docs/docs/Support/release-notes.mdx | 81 +- docs/docs/Support/troubleshooting.mdx | 72 +- docs/docs/Tutorials/chat-with-files.mdx | 2 +- docs/docs/Tutorials/chat-with-rag.mdx | 4 +- docs/docs/Tutorials/mcp-tutorial.mdx | 5 + docs/docs/_partial-conditional-params.mdx | 2 + docs/docs/_partial-config-dir-paths.mdx | 9 - docs/docs/_partial-db-dir-paths.mdx | 6 - docs/docs/_partial-dev-mode-windows.mdx | 4 + docs/docs/_partial-env-global-vars.mdx | 10 - docs/docs/_partial-legacy.mdx | 17 + docs/docs/_partial-vector-rag-blurb.mdx | 11 + docs/docs/_partial-vector-rag-flow.mdx | 75 ++ docs/docs/_partial-vector-search-results.mdx | 2 + docs/docs/_partial-vector-store-instance.mdx | 8 + docs/docusaurus.config.js | 16 +- docs/sidebars.js | 24 +- .../img/composio/composio-create-flow.png | Bin 372147 -> 321382 bytes docs/static/img/instana-metrics-dashboard.png | Bin 0 -> 361789 bytes docs/static/img/instana-traces-dashboard.png | Bin 0 -> 810218 bytes docs/static/logos/mcp-icon.svg | 11 + 125 files changed, 4017 insertions(+), 2498 deletions(-) create mode 100644 docs/docs/API-Reference/api-openai-responses.mdx create mode 100644 docs/docs/Components/bundles-cassandra.mdx create mode 100644 docs/docs/Components/bundles-chroma.mdx create mode 100644 docs/docs/Components/bundles-clickhouse.mdx create mode 100644 docs/docs/Components/bundles-couchbase.mdx create mode 100644 docs/docs/Components/bundles-elastic.mdx create mode 100644 docs/docs/Components/bundles-faiss.mdx create mode 100644 docs/docs/Components/bundles-milvus.mdx create mode 100644 docs/docs/Components/bundles-mongodb.mdx create mode 100644 docs/docs/Components/bundles-pgvector.mdx create mode 100644 docs/docs/Components/bundles-pinecone.mdx create mode 100644 docs/docs/Components/bundles-qdrant.mdx create mode 100644 docs/docs/Components/bundles-serper.mdx create mode 100644 docs/docs/Components/bundles-supabase.mdx create mode 100644 docs/docs/Components/bundles-upstash.mdx create mode 100644 docs/docs/Components/bundles-vectara.mdx create mode 100644 docs/docs/Components/bundles-weaviate.mdx delete mode 100644 docs/docs/Components/components-memories.mdx delete mode 100644 docs/docs/Components/components-vector-stores.mdx create mode 100644 docs/docs/Integrations/integrations-instana-traceloop.mdx create mode 100644 docs/docs/_partial-conditional-params.mdx delete mode 100644 docs/docs/_partial-config-dir-paths.mdx delete mode 100644 docs/docs/_partial-db-dir-paths.mdx create mode 100644 docs/docs/_partial-dev-mode-windows.mdx delete mode 100644 docs/docs/_partial-env-global-vars.mdx create mode 100644 docs/docs/_partial-legacy.mdx create mode 100644 docs/docs/_partial-vector-rag-blurb.mdx create mode 100644 docs/docs/_partial-vector-rag-flow.mdx create mode 100644 docs/docs/_partial-vector-search-results.mdx create mode 100644 docs/docs/_partial-vector-store-instance.mdx create mode 100644 docs/static/img/instana-metrics-dashboard.png create mode 100644 docs/static/img/instana-traces-dashboard.png create mode 100644 docs/static/logos/mcp-icon.svg diff --git a/docs/docs/API-Reference/api-files.mdx b/docs/docs/API-Reference/api-files.mdx index fc7897db6e..128364d513 100644 --- a/docs/docs/API-Reference/api-files.mdx +++ b/docs/docs/API-Reference/api-files.mdx @@ -58,7 +58,7 @@ Not all file types are supported. Send image files to Langflow to use them in flows. -The default file limit is 100 MB. +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: @@ -237,7 +237,7 @@ To send image files to your flows through the API, see [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 [**File** component](/components-data#file). -The default file limit is 100 MB. To configure this value, change the `LANGFLOW_MAX_FILE_SIZE_UPLOAD` [environment variable](/environment-variables). +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. diff --git a/docs/docs/API-Reference/api-logs.mdx b/docs/docs/API-Reference/api-logs.mdx index 659495d650..9bce8b56e5 100644 --- a/docs/docs/API-Reference/api-logs.mdx +++ b/docs/docs/API-Reference/api-logs.mdx @@ -3,31 +3,23 @@ title: Logs endpoints slug: /api-logs --- -Retrieve logs for your Langflow flow. +Retrieve logs for your Langflow flows and server. ## Enable log retrieval The `/logs` endpoint requires log retrieval to be enabled in your Langflow instance. -1. To enable log retrieval, include these values in your `.env` file: +To enable log retrieval, include 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 - LANGFLOW_LOG_LEVEL=DEBUG - ``` - - Log retrieval requires that `LANGFLOW_LOG_RETRIEVER_BUFFER_SIZE` is greater than 0. The default value is `10000`. - -2. Start Langflow with the updated `.env`: - - ```text - 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). +Stream logs in real-time using Server Sent Events (SSE): ```bash curl -X GET \ diff --git a/docs/docs/API-Reference/api-openai-responses.mdx b/docs/docs/API-Reference/api-openai-responses.mdx new file mode 100644 index 0000000000..5ffb828cb9 --- /dev/null +++ b/docs/docs/API-Reference/api-openai-responses.mdx @@ -0,0 +1,599 @@ +--- +title: OpenAI Responses API +slug: /api-openai-responses +--- + +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. + + + +```python +from openai import OpenAI + +client = OpenAI( + base_url="LANGFLOW_SERVER_URL/api/v1/", + default_headers={"x-api-key": "LANGFLOW_API_KEY"}, + api_key="dummy-api-key" # Required by OpenAI SDK but not used by Langflow +) + +response = client.responses.create( + model="FLOW_ID", + input="There is an event that happens on the second wednesday of every month. What are the event dates in 2026?", +) + +print(response.output_text) +``` + + + + +```typescript +import OpenAI from "openai"; + +const client = new OpenAI({ + baseURL: "LANGFLOW_SERVER_URL/api/v1/", + defaultHeaders: { + "x-api-key": "LANGFLOW_API_KEY" + }, + apiKey: "dummy-api-key" // Required by OpenAI SDK but not used by Langflow +}); + +const response = await client.responses.create({ + model: "FLOW_ID", + input: "There is an event that happens on the second wednesday of every month. What are the event dates in 2026?" +}); + +console.log(response.output_text); +``` + + + + +
+Response +```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! +``` +
+ +## Example request + +```bash +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 + }' +``` + +### 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. | + +
+Fields with OpenAI-compatible default values + +| 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` | Usage statistics (if any). | +| `user` | `string` | `null` | User identifier (if any). | +| `metadata` | `dict` | `{}` | Additional metadata. | + +
+ +## 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. + +```bash +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 + }' +``` + +
+Result + +```json +{ + "id": "f7fcea36-f128-41c4-9ac1-e683137375d5", + "object": "response.chunk", + "created": 1756838094, + "model": "ced2ec91-f325-4bf0-8754-f3198c2b1563", + "delta": { + "content": "Once" + }, + "status": null +} +``` + +
+ +### 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. + +
+Final completion chunk + +``` +{ + "id": "f7fcea36-f128-41c4-9ac1-e683137375d5", + "object": "response.chunk", + "created": 1756838094, + "model": "ced2ec91-f325-4bf0-8754-f3198c2b1563", + "delta": {}, + "status": "completed" +} +``` +
+ +## 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: + +```bash +curl -X POST \ + "http://$LANGFLOW_SERVER_URL/api/v1/responses" \ + -H "x-api-key: $LANGFLOW_API_KEY" \ + -H "Content-Type: application/json" \ + -d '{ + "model": "$FLOW_ID", + "input": "Hello, my name is Alice" + }' +``` + +
+Result + +```json +{ + "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 +} +``` + +
+ +Follow-up message: + +```bash +curl -X POST \ + "http://$LANGFLOW_SERVER_URL/api/v1/responses" \ + -H "x-api-key: $LANGFLOW_API_KEY" \ + -H "Content-Type: application/json" \ + -d '{ + "model": "ced2ec91-f325-4bf0-8754-f3198c2b1563", + "input": "What's my name?", + "previous_response_id": "c45f4ac8-772b-4675-8551-c560b1afd590" + }' +``` + +
+Result + +```json +{ + "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" +} +``` + +
+ +Optionally, you can use your own session ID values for the `previous_response_id`: + +```bash +curl -X POST \ + "http://$LANGFLOW_SERVER_URL/api/v1/responses" \ + -H "x-api-key: $LANGFLOW_API_KEY" \ + -H "Content-Type: application/json" \ + -d '{ + "model": "ced2ec91-f325-4bf0-8754-f3198c2b1563", + "input": "What's my name?", + "previous_response_id": "session-alice-1756839048" + }' +``` + +
+Result + +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" +} +``` + +
+ +## 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: + +```bash +curl -X POST \ + "http://$LANGFLOW_SERVER_URL/api/v1/responses" \ + -H "Content-Type: application/json" \ + -H "x-api-key: $LANGFLOW_API_KEY" \ + -d '{ + "model": "FLOW_ID", + "input": "Calculate 23 * 15 and show me the result", + "stream": false, + "include": ["tool_call.results"] + }' +``` + + +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"} +} +``` + +
+Result + +```json +{ + "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": {} +} +``` +
+ +## Pass global variables to your flows in headers {#global-var} + +Global variables allow you to pass dynamic values to your flows that can be used by components within that flow run. +This is useful for passing API keys, user IDs, or any other configuration that might change between requests. + +The `/responses` endpoint accepts global variables as custom HTTP headers with the format `X-LANGFLOW-GLOBAL-VAR-{VARIABLE_NAME}`. +Variables are only available during this specific request execution and aren't persisted. +Variable names are automatically converted to uppercase. + +This example demonstrates passing an `OPENAI_API_KEY` variable, which is a variable Langflow automatically detects from environment variables, with two custom variables for `USER_ID` and `ENVIRONMENT`. The variables don't have to be created in Langflow's Global Variables section - you can pass any variable name in the `X-LANGFLOW-GLOBAL-VAR-{VARIABLE_NAME}` header format. + +```bash +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" + }' +``` + +
+Result + +```json +{ + "id": "4a4d2f24-bb45-4a55-a499-0191305264be", + "object": "response", + "created_at": 1756839935, + "status": "completed", + "model": "ced2ec91-f325-4bf0-8754-f3198c2b1563", + "output": [ + { + "type": "message", + "id": "msg_4a4d2f24-bb45-4a55-a499-0191305264be", + "status": "completed", + "role": "assistant", + "content": [ + { + "type": "output_text", + "text": "Hello! How can I assist you today?", + "annotations": [] + } + ] + } + ], + "previous_response_id": null +} +``` + +
+ +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. \ No newline at end of file diff --git a/docs/docs/API-Reference/api-reference-api-examples.mdx b/docs/docs/API-Reference/api-reference-api-examples.mdx index a6290f2c16..60f954e97e 100644 --- a/docs/docs/API-Reference/api-reference-api-examples.mdx +++ b/docs/docs/API-Reference/api-reference-api-examples.mdx @@ -169,7 +169,7 @@ curl -X GET \ "auto_saving": true, "auto_saving_interval": 1000, "health_check_max_retries": 5, - "max_file_size_upload": 100 + "max_file_size_upload": 1024 } ``` @@ -209,6 +209,9 @@ Other endpoints are helpful for specific use cases, such as administration and f * 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). @@ -269,47 +272,11 @@ Other endpoints are helpful for specific use cases, such as administration and f * PATCH `/v1/users/{user_id}/reset-password`: Reset own password. * DELETE `/v1/users/{user_id}`: Delete a user (cannot delete yourself). - - - -You might use these endpoints when developing custom Langflow components for your own use or to share with the Langflow community: - -* Develop custom components: - * 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. - -* Langflow Store: - * 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. - - - - -The following endpoints are for managing Langflow MCP servers, both Langflow-hosted MCP servers and external MCP server connections: - -* **MCP (global)**: - * HEAD `/v1/mcp/sse`: Health check for MCP SSE. - * GET `/v1/mcp/sse`: Open SSE stream for MCP server events. - * POST `/v1/mcp/`: Post messages to the MCP server. - -* **MCP (project-specific)**: - * GET `/v1/mcp/project/{project_id}`: List MCP-enabled tools and project auth settings. - * HEAD `/v1/mcp/project/{project_id}/sse`: Health check for project SSE. - * GET `/v1/mcp/project/{project_id}/sse`: Open project-scoped MCP SSE. - * POST `/v1/mcp/project/{project_id}`: Post messages to project MCP server. - * POST `/v1/mcp/project/{project_id}/` (trailing slash): Same as above. - * 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. @@ -359,6 +326,26 @@ The following endpoints are most often used when contributing to the Langflow co * 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. + * HEAD `/v1/mcp/sse`: Health check for MCP SSE. + * GET `/v1/mcp/sse`: Open SSE stream for MCP server events. + * POST `/v1/mcp/`: 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}/sse`: Health check for project SSE. + * GET `/v1/mcp/project/{project_id}/sse`: Open project-scoped MCP SSE. + * POST `/v1/mcp/project/{project_id}`: Post messages to project MCP server. + * POST `/v1/mcp/project/{project_id}/` (trailing slash): Same as above. + * 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. + @@ -371,6 +358,15 @@ The following endpoints are deprecated: * 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. diff --git a/docs/docs/Agents/agents-tools.mdx b/docs/docs/Agents/agents-tools.mdx index c5a1a2ea92..7007acd120 100644 --- a/docs/docs/Agents/agents-tools.mdx +++ b/docs/docs/Agents/agents-tools.mdx @@ -5,17 +5,32 @@ slug: /agents-tools import Icon from "@site/src/components/icon"; -Configure tools connected to agents to extend their capabilities. +By default, [Langflow agents](/agents) only include the functionality built-in to their base LLM. -## Edit a tool's actions {#edit-a-tools-actions} +You can attach tools to agents to provide access to additional, targeted functionality. +For example, tools can be used to create domain-specific agents, such as a customer support agent that can access a company's knowledge base, a financial agent that can retrieve stock prices, or a math tutor agent that can use advanced math functions to solve complex equations. -When you set any component to **Tool Mode** or **Tool** output, an agent can use the actions (functions) provided by that component. -Available actions are listed in the tool component's **Actions** list. +## Attach tools + +To attach a tool to an agent, you connect any component's **Tool** output to the **Agent** component's **Tools** input. + +Some components emit **Tool** output by default. +For all other components, you must enable **Tool Mode** in the [component's header menu](/concepts-components#component-menus). +Then, you can connect the tool to the agent. + +You can connect multiple tools to one agent, and each tool can have multiple actions (functions) that the agent can call. + +When you run your flow, the agent decides when to call on certain tools, if it determines that a tool can help it respond to the user's prompt. + +### Edit a tool's actions {#edit-a-tools-actions} + +When you attach components to an agent as tools, each tool can have multiple actions (functions) that the agent can call. +Available actions are listed in each tool component's **Actions** list. You can change each action's labels, descriptions, and availability to help the agent understand how to use the tool and prevent it from using irrelevant or undesired actions. :::tip -If an agent seems to be using a tool incorrectly, try editing the action metadata to clarify the tool's purpose and disable unnecessary actions. +If an agent seems to be using a tool incorrectly, try editing the actions metadata to clarify the tool's purpose and disable unnecessary actions. You can also try using a **Prompt Template** component to pass additional instructions or examples to the agent. ::: @@ -25,26 +40,22 @@ To view and edit a tool's actions, click **Edit Tool Actions** to [edit the tool's actions](#edit-a-tools-actions). - For this example, change the action **Slug** to `Agent-gpt-41` and set the description to `Use the gpt-4.1 model for complex problem solving`. + For this example, change the action's slug to `Agent-gpt-41`, and set the description to `Use the gpt-4.1 model for complex problem solving`. This lets the primary agent know that this tool uses the `gpt-4.1` model, which could be helpful for tasks requiring a larger context window, such as large scrape and search tasks. As another example, you could attach several specialized models to a primary agent, such as agents that are trained on certain tasks or domains, and then the primary agent would call each specialized agent as needed to respond to queries. @@ -73,7 +84,7 @@ To try this for yourself, add an additional agent to the **Simple Agent** templa An agent can use [custom components](/components-custom-components) as tools. -1. To add a custom component to an agent flow, click **New Custom Component** in the **Components** menu. +1. To add a custom component to an agent flow, click **New Custom Component** in the