From cfa60d0106d89a6f9c1a092baf7d89a2df46da4b Mon Sep 17 00:00:00 2001 From: ogabrielluiz Date: Mon, 9 Dec 2024 23:52:15 +0000 Subject: [PATCH] deploy: 6f5b984a223a140a51fc0177a4d70df97c5f48a0 --- 404.html | 2 +- Components/components-memories.html | 2 +- Components/components-tools.html | 2 +- .../configuration-custom-database.html | 2 +- agents-overview.html | 2 +- agents-tool-calling-agent-component.html | 2 +- api.html | 2 +- api/add-user.html | 2 +- api/auto-login.html | 2 +- api/build-flow.html | 2 +- api/build-vertex-stream.html | 2 +- api/build-vertex.html | 2 +- api/check-if-store-has-api-key.html | 2 +- api/check-if-store-is-enabled.html | 2 +- api/create-api-key-route.html | 2 +- api/create-flow.html | 2 +- api/create-flows.html | 2 +- api/create-folder.html | 2 +- api/create-upload-file.html | 2 +- api/create-variable.html | 2 +- api/custom-component-update.html | 2 +- api/custom-component.html | 2 +- api/delete-api-key-route.html | 2 +- api/delete-file.html | 2 +- api/delete-flow.html | 2 +- api/delete-folder.html | 2 +- api/delete-messages-session.html | 2 +- api/delete-messages.html | 2 +- api/delete-multiple-flows.html | 2 +- api/delete-user.html | 2 +- api/delete-variable.html | 2 +- api/delete-vertex-builds.html | 2 +- api/download-component.html | 2 +- api/download-file-1.html | 2 +- api/download-file.html | 2 +- api/download-image.html | 2 +- api/download-multiple-file.html | 2 +- api/download-profile-picture.html | 2 +- api/experimental-run-flow.html | 2 +- api/get-all.html | 2 +- api/get-api-keys-route.html | 2 +- api/get-components.html | 2 +- api/get-config.html | 2 +- api/get-list-of-components-liked-by-user.html | 2 +- api/get-messages.html | 2 +- api/get-starter-projects.html | 2 +- api/get-tags.html | 2 +- api/get-task-status.html | 2 +- api/get-transactions.html | 2 +- api/get-version.html | 2 +- api/get-vertex-builds.html | 2 +- api/health-check.html | 2 +- api/health.html | 2 +- api/like-component.html | 2 +- api/list-files.html | 2 +- api/list-profile-pictures.html | 2 +- api/login-to-get-access-token.html | 2 +- api/logout.html | 2 +- api/logs.html | 2 +- api/patch-user.html | 2 +- api/post-validate-code.html | 2 +- api/post-validate-prompt.html | 2 +- api/process-1.html | 2 +- api/process.html | 2 +- api/read-all-users.html | 2 +- api/read-basic-examples.html | 2 +- api/read-current-user.html | 2 +- api/read-flow.html | 2 +- api/read-flows.html | 2 +- api/read-folder.html | 2 +- api/read-folders.html | 2 +- api/read-variables.html | 2 +- api/refresh-token.html | 2 +- api/reset-password.html | 2 +- api/retrieve-vertices-order.html | 2 +- api/save-store-api-key.html | 2 +- api/share-component.html | 2 +- api/simplified-run-flow.html | 2 +- api/stream-logs.html | 2 +- api/update-flow.html | 2 +- api/update-folder.html | 2 +- api/update-message.html | 2 +- api/update-session-id.html | 2 +- api/update-shared-component.html | 2 +- api/update-variable.html | 2 +- api/upload-file-1.html | 2 +- api/upload-file-2.html | 2 +- api/upload-file.html | 2 +- api/webhook-run-flow.html | 2 +- ...gent-5aa96d840d4d38fe4b064400d06ac109.json | 1 - ...gent-7d8e27bbde8676e7772af60972898335.json | 3137 +++++++++++++ ...gent-3bf013ee192aba15c84d74cc91079a4a.json | 1 - ...gent-b29188c0cb70736d19dd52965db5f352.json | 4150 +++++++++++++++++ ...3809a.30699dc9.js => 18f3809a.41f624bc.js} | 2 +- ...beaac.87f20d44.js => 6a2beaac.3dbd74ae.js} | 2 +- ...n.637dbf6f.js => runtime~main.a7e2cfe2.js} | 2 +- components-agents.html | 2 +- components-custom-components.html | 2 +- components-data.html | 2 +- components-embedding-models.html | 2 +- components-helpers.html | 2 +- components-io.html | 2 +- components-loaders.html | 2 +- components-logic.html | 2 +- components-models.html | 2 +- components-overview.html | 2 +- components-prompts.html | 2 +- components-rag.html | 2 +- components-vector-stores.html | 2 +- configuration-api-keys.html | 2 +- configuration-authentication.html | 2 +- configuration-auto-save.html | 2 +- configuration-backend-only.html | 2 +- configuration-cli.html | 2 +- configuration-global-variables.html | 2 +- configuration-security-best-practices.html | 2 +- contributing-community.html | 2 +- contributing-components.html | 2 +- contributing-github-discussions.html | 2 +- contributing-github-issues.html | 2 +- contributing-how-to-contribute.html | 2 +- contributing-telemetry.html | 2 +- deployment-docker.html | 2 +- deployment-gcp.html | 2 +- deployment-hugging-face-spaces.html | 2 +- deployment-kubernetes.html | 2 +- deployment-railway.html | 2 +- deployment-render.html | 2 +- environment-variables.html | 2 +- ...oogle_Drive_Docs_Translations_Example.json | 1581 ++++++- get-started-installation.html | 2 +- get-started-quickstart.html | 2 +- guides-chat-memory.html | 2 +- guides-data-message.html | 2 +- guides-new-to-llms.html | 2 +- index.html | 2 +- integrations-assemblyai.html | 2 +- integrations-langfuse.html | 2 +- integrations-langsmith.html | 2 +- integrations-langwatch.html | 2 +- ...setup-google-cloud-vertex-ai-langflow.html | 2 +- integrations-setup-google-oauth-langflow.html | 2 +- .../notion/notion-agent-conversational.html | 6 +- .../notion/notion-agent-meeting-notes.html | 6 +- integrations/notion/setup.html | 2 +- sitemap.xml | 2 +- starter-projects-basic-prompting.html | 2 +- starter-projects-blog-writer.html | 2 +- starter-projects-document-qa.html | 2 +- starter-projects-memory-chatbot.html | 2 +- starter-projects-sequential-agent.html | 2 +- starter-projects-simple-agent.html | 2 +- starter-projects-travel-planning-agent.html | 2 +- starter-projects-vector-store-rag.html | 2 +- workspace-api.html | 2 +- workspace-logs.html | 2 +- workspace-overview.html | 2 +- workspace-playground.html | 2 +- 158 files changed, 9024 insertions(+), 160 deletions(-) delete mode 100644 assets/files/Conversational_Notion_Agent-5aa96d840d4d38fe4b064400d06ac109.json create mode 100644 assets/files/Conversational_Notion_Agent-7d8e27bbde8676e7772af60972898335.json delete mode 100644 assets/files/Meeting_Notes_Agent-3bf013ee192aba15c84d74cc91079a4a.json create mode 100644 assets/files/Meeting_Notes_Agent-b29188c0cb70736d19dd52965db5f352.json rename assets/js/{18f3809a.30699dc9.js => 18f3809a.41f624bc.js} (99%) rename assets/js/{6a2beaac.87f20d44.js => 6a2beaac.3dbd74ae.js} (99%) rename assets/js/{runtime~main.637dbf6f.js => runtime~main.a7e2cfe2.js} (98%) diff --git a/404.html b/404.html index d6dc080b25..a4f6c10879 100644 --- a/404.html +++ b/404.html @@ -10,7 +10,7 @@ - + diff --git a/Components/components-memories.html b/Components/components-memories.html index 8c534ac292..4ee2ab3eaa 100644 --- a/Components/components-memories.html +++ b/Components/components-memories.html @@ -10,7 +10,7 @@ - + diff --git a/Components/components-tools.html b/Components/components-tools.html index 6a79aec74f..c9b191685e 100644 --- a/Components/components-tools.html +++ b/Components/components-tools.html @@ -10,7 +10,7 @@ - + diff --git a/Configuration/configuration-custom-database.html b/Configuration/configuration-custom-database.html index 557c923f08..a787ba0395 100644 --- a/Configuration/configuration-custom-database.html +++ b/Configuration/configuration-custom-database.html @@ -10,7 +10,7 @@ - + diff --git a/agents-overview.html b/agents-overview.html index 10eaf8cf19..6eae4d084a 100644 --- a/agents-overview.html +++ b/agents-overview.html @@ -10,7 +10,7 @@ - + diff --git a/agents-tool-calling-agent-component.html b/agents-tool-calling-agent-component.html index 4ff4286507..308c4ef72a 100644 --- a/agents-tool-calling-agent-component.html +++ b/agents-tool-calling-agent-component.html @@ -10,7 +10,7 @@ - + diff --git a/api.html b/api.html index 7739092f7d..3bfb947972 100644 --- a/api.html +++ b/api.html @@ -10,7 +10,7 @@ - + diff --git a/api/add-user.html b/api/add-user.html index 77b6801ab4..235d2a0ebe 100644 --- a/api/add-user.html +++ b/api/add-user.html @@ -10,7 +10,7 @@ - + diff --git a/api/auto-login.html b/api/auto-login.html index 678e6c66ba..eb983345bb 100644 --- a/api/auto-login.html +++ b/api/auto-login.html @@ -10,7 +10,7 @@ - + diff --git a/api/build-flow.html b/api/build-flow.html index db8ce88dbc..977959b6e2 100644 --- a/api/build-flow.html +++ b/api/build-flow.html @@ -10,7 +10,7 @@ - + diff --git a/api/build-vertex-stream.html b/api/build-vertex-stream.html index ee7171969b..a52cd55143 100644 --- a/api/build-vertex-stream.html +++ b/api/build-vertex-stream.html @@ -10,7 +10,7 @@ - + diff --git a/api/build-vertex.html b/api/build-vertex.html index 961af1cba7..f86ff809dc 100644 --- a/api/build-vertex.html +++ b/api/build-vertex.html @@ -10,7 +10,7 @@ - + diff --git a/api/check-if-store-has-api-key.html b/api/check-if-store-has-api-key.html index b2f4774500..83022acfbd 100644 --- a/api/check-if-store-has-api-key.html +++ b/api/check-if-store-has-api-key.html @@ -10,7 +10,7 @@ - + diff --git a/api/check-if-store-is-enabled.html b/api/check-if-store-is-enabled.html index 0a3e84b90b..ba0c813ee6 100644 --- a/api/check-if-store-is-enabled.html +++ b/api/check-if-store-is-enabled.html @@ -10,7 +10,7 @@ - + diff --git a/api/create-api-key-route.html b/api/create-api-key-route.html index 138f67bd4f..ac5e2bd31f 100644 --- a/api/create-api-key-route.html +++ b/api/create-api-key-route.html @@ -10,7 +10,7 @@ - + diff --git a/api/create-flow.html b/api/create-flow.html index 50fc78dd0a..e1bd02fa59 100644 --- a/api/create-flow.html +++ b/api/create-flow.html @@ -10,7 +10,7 @@ - + diff --git a/api/create-flows.html b/api/create-flows.html index 3e64973c5c..06a8e6f46f 100644 --- a/api/create-flows.html +++ b/api/create-flows.html @@ -10,7 +10,7 @@ - + diff --git a/api/create-folder.html b/api/create-folder.html index 8552b5927b..3643ee1206 100644 --- a/api/create-folder.html +++ b/api/create-folder.html @@ -10,7 +10,7 @@ - + diff --git a/api/create-upload-file.html b/api/create-upload-file.html index e8d9e40419..1467997612 100644 --- a/api/create-upload-file.html +++ b/api/create-upload-file.html @@ -10,7 +10,7 @@ - + diff --git a/api/create-variable.html b/api/create-variable.html index 03db553c8d..e2ce550881 100644 --- a/api/create-variable.html +++ b/api/create-variable.html @@ -10,7 +10,7 @@ - + diff --git a/api/custom-component-update.html b/api/custom-component-update.html index 00ad8ad3af..9ecc0a74f2 100644 --- a/api/custom-component-update.html +++ b/api/custom-component-update.html @@ -10,7 +10,7 @@ - + diff --git a/api/custom-component.html b/api/custom-component.html index 9f82202ead..7af5b33534 100644 --- a/api/custom-component.html +++ b/api/custom-component.html @@ -10,7 +10,7 @@ - + diff --git a/api/delete-api-key-route.html b/api/delete-api-key-route.html index 94564b85f3..5515f601c8 100644 --- a/api/delete-api-key-route.html +++ b/api/delete-api-key-route.html @@ -10,7 +10,7 @@ - + diff --git a/api/delete-file.html b/api/delete-file.html index c70a5cf9ff..888300bc5d 100644 --- a/api/delete-file.html +++ b/api/delete-file.html @@ -10,7 +10,7 @@ - + diff --git a/api/delete-flow.html b/api/delete-flow.html index 9e0dd0d399..745a10613b 100644 --- a/api/delete-flow.html +++ b/api/delete-flow.html @@ -10,7 +10,7 @@ - + diff --git a/api/delete-folder.html b/api/delete-folder.html index 6a4ed436c2..77ceb1bd8a 100644 --- a/api/delete-folder.html +++ b/api/delete-folder.html @@ -10,7 +10,7 @@ - + diff --git a/api/delete-messages-session.html b/api/delete-messages-session.html index 6d6aff0aec..648cd26605 100644 --- a/api/delete-messages-session.html +++ b/api/delete-messages-session.html @@ -10,7 +10,7 @@ - + diff --git a/api/delete-messages.html b/api/delete-messages.html index dca8e0b9b9..1da874d013 100644 --- a/api/delete-messages.html +++ b/api/delete-messages.html @@ -10,7 +10,7 @@ - + diff --git a/api/delete-multiple-flows.html b/api/delete-multiple-flows.html index e8a0bc8457..c84a38359c 100644 --- a/api/delete-multiple-flows.html +++ b/api/delete-multiple-flows.html @@ -10,7 +10,7 @@ - + diff --git a/api/delete-user.html b/api/delete-user.html index 44c670ebf8..3719bcc00c 100644 --- a/api/delete-user.html +++ b/api/delete-user.html @@ -10,7 +10,7 @@ - + diff --git a/api/delete-variable.html b/api/delete-variable.html index ae5f2eb195..e0fb20cf2d 100644 --- a/api/delete-variable.html +++ b/api/delete-variable.html @@ -10,7 +10,7 @@ - + diff --git a/api/delete-vertex-builds.html b/api/delete-vertex-builds.html index 754a8b6681..48eefd2cbf 100644 --- a/api/delete-vertex-builds.html +++ b/api/delete-vertex-builds.html @@ -10,7 +10,7 @@ - + diff --git a/api/download-component.html b/api/download-component.html index 3d160d6405..e6e12f554d 100644 --- a/api/download-component.html +++ b/api/download-component.html @@ -10,7 +10,7 @@ - + diff --git a/api/download-file-1.html b/api/download-file-1.html index 6ee7ef43de..b8bd0e8cb7 100644 --- a/api/download-file-1.html +++ b/api/download-file-1.html @@ -10,7 +10,7 @@ - + diff --git a/api/download-file.html b/api/download-file.html index 98adfdfa66..5d846b2d9d 100644 --- a/api/download-file.html +++ b/api/download-file.html @@ -10,7 +10,7 @@ - + diff --git a/api/download-image.html b/api/download-image.html index 2f6a1fb3f5..1d05942c24 100644 --- a/api/download-image.html +++ b/api/download-image.html @@ -10,7 +10,7 @@ - + diff --git a/api/download-multiple-file.html b/api/download-multiple-file.html index a8ce50db50..d2530fd6d9 100644 --- a/api/download-multiple-file.html +++ b/api/download-multiple-file.html @@ -10,7 +10,7 @@ - + diff --git a/api/download-profile-picture.html b/api/download-profile-picture.html index a5d3563271..b8e90c98b1 100644 --- a/api/download-profile-picture.html +++ b/api/download-profile-picture.html @@ -10,7 +10,7 @@ - + diff --git a/api/experimental-run-flow.html b/api/experimental-run-flow.html index 14273bee69..77c44ee80b 100644 --- a/api/experimental-run-flow.html +++ b/api/experimental-run-flow.html @@ -10,7 +10,7 @@ - + diff --git a/api/get-all.html b/api/get-all.html index 13c55a96a1..e2b27696cf 100644 --- a/api/get-all.html +++ b/api/get-all.html @@ -10,7 +10,7 @@ - + diff --git a/api/get-api-keys-route.html b/api/get-api-keys-route.html index e98bac4eaa..30ddde89b2 100644 --- a/api/get-api-keys-route.html +++ b/api/get-api-keys-route.html @@ -10,7 +10,7 @@ - + diff --git a/api/get-components.html b/api/get-components.html index df7a4eac89..1ac19992a7 100644 --- a/api/get-components.html +++ b/api/get-components.html @@ -10,7 +10,7 @@ - + diff --git a/api/get-config.html b/api/get-config.html index 1161f82833..1b7415753c 100644 --- a/api/get-config.html +++ b/api/get-config.html @@ -10,7 +10,7 @@ - + diff --git a/api/get-list-of-components-liked-by-user.html b/api/get-list-of-components-liked-by-user.html index 2c2fa83d9c..56100feb55 100644 --- a/api/get-list-of-components-liked-by-user.html +++ b/api/get-list-of-components-liked-by-user.html @@ -10,7 +10,7 @@ - + diff --git a/api/get-messages.html b/api/get-messages.html index 531dce4e6e..f4c5501e5c 100644 --- a/api/get-messages.html +++ b/api/get-messages.html @@ -10,7 +10,7 @@ - + diff --git a/api/get-starter-projects.html b/api/get-starter-projects.html index 698090903a..534a15ecdb 100644 --- a/api/get-starter-projects.html +++ b/api/get-starter-projects.html @@ -10,7 +10,7 @@ - + diff --git a/api/get-tags.html b/api/get-tags.html index 3794a6a319..828d6461e0 100644 --- a/api/get-tags.html +++ b/api/get-tags.html @@ -10,7 +10,7 @@ - + diff --git a/api/get-task-status.html b/api/get-task-status.html index f56893b2be..2a9e09d25b 100644 --- a/api/get-task-status.html +++ b/api/get-task-status.html @@ -10,7 +10,7 @@ - + diff --git a/api/get-transactions.html b/api/get-transactions.html index 89810c88cd..9fc37095e4 100644 --- a/api/get-transactions.html +++ b/api/get-transactions.html @@ -10,7 +10,7 @@ - + diff --git a/api/get-version.html b/api/get-version.html index 3c9ec87d79..09335c0921 100644 --- a/api/get-version.html +++ b/api/get-version.html @@ -10,7 +10,7 @@ - + diff --git a/api/get-vertex-builds.html b/api/get-vertex-builds.html index 2ce3316cae..0e0caf4991 100644 --- a/api/get-vertex-builds.html +++ b/api/get-vertex-builds.html @@ -10,7 +10,7 @@ - + diff --git a/api/health-check.html b/api/health-check.html index fa5c14df09..2568f64283 100644 --- a/api/health-check.html +++ b/api/health-check.html @@ -10,7 +10,7 @@ - + diff --git a/api/health.html b/api/health.html index 5735635541..b12f0e09a5 100644 --- a/api/health.html +++ b/api/health.html @@ -10,7 +10,7 @@ - + diff --git a/api/like-component.html b/api/like-component.html index 8138c2be11..419a128e5d 100644 --- a/api/like-component.html +++ b/api/like-component.html @@ -10,7 +10,7 @@ - + diff --git a/api/list-files.html b/api/list-files.html index 9b5c2107a3..69a0810d67 100644 --- a/api/list-files.html +++ b/api/list-files.html @@ -10,7 +10,7 @@ - + diff --git a/api/list-profile-pictures.html b/api/list-profile-pictures.html index 2f31139dc5..499a263b35 100644 --- a/api/list-profile-pictures.html +++ b/api/list-profile-pictures.html @@ -10,7 +10,7 @@ - + diff --git a/api/login-to-get-access-token.html b/api/login-to-get-access-token.html index a60de49537..327182d89d 100644 --- a/api/login-to-get-access-token.html +++ b/api/login-to-get-access-token.html @@ -10,7 +10,7 @@ - + diff --git a/api/logout.html b/api/logout.html index 34a4643517..8613814b4e 100644 --- a/api/logout.html +++ b/api/logout.html @@ -10,7 +10,7 @@ - + diff --git a/api/logs.html b/api/logs.html index d179c1c4f3..e0082e766e 100644 --- a/api/logs.html +++ b/api/logs.html @@ -10,7 +10,7 @@ - + diff --git a/api/patch-user.html b/api/patch-user.html index 804c1da0cf..19713dd7df 100644 --- a/api/patch-user.html +++ b/api/patch-user.html @@ -10,7 +10,7 @@ - + diff --git a/api/post-validate-code.html b/api/post-validate-code.html index b468ddc5f5..a2aa4ea238 100644 --- a/api/post-validate-code.html +++ b/api/post-validate-code.html @@ -10,7 +10,7 @@ - + diff --git a/api/post-validate-prompt.html b/api/post-validate-prompt.html index fcb276fed9..dbd1ff1531 100644 --- a/api/post-validate-prompt.html +++ b/api/post-validate-prompt.html @@ -10,7 +10,7 @@ - + diff --git a/api/process-1.html b/api/process-1.html index fe4fbcdfff..6224e58bfa 100644 --- a/api/process-1.html +++ b/api/process-1.html @@ -10,7 +10,7 @@ - + diff --git a/api/process.html b/api/process.html index aafb687cd6..0fcde7b93c 100644 --- a/api/process.html +++ b/api/process.html @@ -10,7 +10,7 @@ - + diff --git a/api/read-all-users.html b/api/read-all-users.html index a9c9df02b6..83eafa29ea 100644 --- a/api/read-all-users.html +++ b/api/read-all-users.html @@ -10,7 +10,7 @@ - + diff --git a/api/read-basic-examples.html b/api/read-basic-examples.html index 24978f3256..6ae7229e18 100644 --- a/api/read-basic-examples.html +++ b/api/read-basic-examples.html @@ -10,7 +10,7 @@ - + diff --git a/api/read-current-user.html b/api/read-current-user.html index a18dc25633..dfa2f76f56 100644 --- a/api/read-current-user.html +++ b/api/read-current-user.html @@ -10,7 +10,7 @@ - + diff --git a/api/read-flow.html b/api/read-flow.html index a2dd4281fc..a96e649d21 100644 --- a/api/read-flow.html +++ b/api/read-flow.html @@ -10,7 +10,7 @@ - + diff --git a/api/read-flows.html b/api/read-flows.html index 1e92e98459..11791b9653 100644 --- a/api/read-flows.html +++ b/api/read-flows.html @@ -10,7 +10,7 @@ - + diff --git a/api/read-folder.html b/api/read-folder.html index 50291ef81b..fde5b9ecf7 100644 --- a/api/read-folder.html +++ b/api/read-folder.html @@ -10,7 +10,7 @@ - + diff --git a/api/read-folders.html b/api/read-folders.html index 86004d4e38..e832d2ed84 100644 --- a/api/read-folders.html +++ b/api/read-folders.html @@ -10,7 +10,7 @@ - + diff --git a/api/read-variables.html b/api/read-variables.html index 90a35ad3c1..cfdc034a2f 100644 --- a/api/read-variables.html +++ b/api/read-variables.html @@ -10,7 +10,7 @@ - + diff --git a/api/refresh-token.html b/api/refresh-token.html index 0d03e780d8..319e41a97d 100644 --- a/api/refresh-token.html +++ b/api/refresh-token.html @@ -10,7 +10,7 @@ - + diff --git a/api/reset-password.html b/api/reset-password.html index 945c10382a..82ae1e407a 100644 --- a/api/reset-password.html +++ b/api/reset-password.html @@ -10,7 +10,7 @@ - + diff --git a/api/retrieve-vertices-order.html b/api/retrieve-vertices-order.html index fc1eb6cf59..07e2bde3fb 100644 --- a/api/retrieve-vertices-order.html +++ b/api/retrieve-vertices-order.html @@ -10,7 +10,7 @@ - + diff --git a/api/save-store-api-key.html b/api/save-store-api-key.html index 9c48d5f9f2..01e5ab5a47 100644 --- a/api/save-store-api-key.html +++ b/api/save-store-api-key.html @@ -10,7 +10,7 @@ - + diff --git a/api/share-component.html b/api/share-component.html index 80a24f12ab..a1feaacc28 100644 --- a/api/share-component.html +++ b/api/share-component.html @@ -10,7 +10,7 @@ - + diff --git a/api/simplified-run-flow.html b/api/simplified-run-flow.html index 334ff926cd..f27b3d4843 100644 --- a/api/simplified-run-flow.html +++ b/api/simplified-run-flow.html @@ -10,7 +10,7 @@ - + diff --git a/api/stream-logs.html b/api/stream-logs.html index e025d7b3e8..75f0bbe3f4 100644 --- a/api/stream-logs.html +++ b/api/stream-logs.html @@ -10,7 +10,7 @@ - + diff --git a/api/update-flow.html b/api/update-flow.html index f435131083..cae4a88f1c 100644 --- a/api/update-flow.html +++ b/api/update-flow.html @@ -10,7 +10,7 @@ - + diff --git a/api/update-folder.html b/api/update-folder.html index ce08080c38..a5159fa40d 100644 --- a/api/update-folder.html +++ b/api/update-folder.html @@ -10,7 +10,7 @@ - + diff --git a/api/update-message.html b/api/update-message.html index eee71ee284..41e3810261 100644 --- a/api/update-message.html +++ b/api/update-message.html @@ -10,7 +10,7 @@ - + diff --git a/api/update-session-id.html b/api/update-session-id.html index d8f832dd34..aeb8827d79 100644 --- a/api/update-session-id.html +++ b/api/update-session-id.html @@ -10,7 +10,7 @@ - + diff --git a/api/update-shared-component.html b/api/update-shared-component.html index 508b5887f7..456b8725c9 100644 --- a/api/update-shared-component.html +++ b/api/update-shared-component.html @@ -10,7 +10,7 @@ - + diff --git a/api/update-variable.html b/api/update-variable.html index 1cf0de72ef..e754746b30 100644 --- a/api/update-variable.html +++ b/api/update-variable.html @@ -10,7 +10,7 @@ - + diff --git a/api/upload-file-1.html b/api/upload-file-1.html index 3856f355df..2d0008e125 100644 --- a/api/upload-file-1.html +++ b/api/upload-file-1.html @@ -10,7 +10,7 @@ - + diff --git a/api/upload-file-2.html b/api/upload-file-2.html index 0e2ba1bf65..a826ba6701 100644 --- a/api/upload-file-2.html +++ b/api/upload-file-2.html @@ -10,7 +10,7 @@ - + diff --git a/api/upload-file.html b/api/upload-file.html index 8f58fefd84..b52bef6a85 100644 --- a/api/upload-file.html +++ b/api/upload-file.html @@ -10,7 +10,7 @@ - + diff --git a/api/webhook-run-flow.html b/api/webhook-run-flow.html index ff1dcb9f79..b0441a73cc 100644 --- a/api/webhook-run-flow.html +++ b/api/webhook-run-flow.html @@ -10,7 +10,7 @@ - + diff --git a/assets/files/Conversational_Notion_Agent-5aa96d840d4d38fe4b064400d06ac109.json b/assets/files/Conversational_Notion_Agent-5aa96d840d4d38fe4b064400d06ac109.json deleted file mode 100644 index 2b8b4063d8..0000000000 --- a/assets/files/Conversational_Notion_Agent-5aa96d840d4d38fe4b064400d06ac109.json +++ /dev/null @@ -1 +0,0 @@ -{"id":"e070f0be-edc4-4512-bb0f-e53307062a26","data":{"nodes":[{"id":"AddContentToPage-ZezUn","type":"genericNode","position":{"x":1416.217259177943,"y":1709.6205867919527},"data":{"type":"AddContentToPage","node":{"template":{"_type":"Component","block_id":{"trace_as_metadata":true,"load_from_db":false,"list":false,"required":false,"placeholder":"","show":true,"name":"block_id","value":"","display_name":"Page/Block ID","advanced":true,"dynamic":false,"info":"The ID of the page/block to add the content.","title_case":false,"type":"str","_input_type":"StrInput"},"code":{"type":"code","required":true,"placeholder":"","list":false,"show":true,"multiline":true,"value":"import json\nfrom typing import Dict, Any, Union\nfrom markdown import markdown\nfrom bs4 import BeautifulSoup\nimport requests\nfrom langflow.io import Output\nfrom langflow.base.langchain_utilities.model import LCToolComponent\nfrom langflow.inputs import SecretStrInput, StrInput, MultilineInput\nfrom langflow.schema import Data\nfrom langflow.field_typing import Tool\nfrom langchain.tools import StructuredTool\nfrom pydantic import BaseModel, Field\n\n\nclass AddContentToPage(LCToolComponent):\n display_name: str = \"Add Content to Page \"\n description: str = \"Convert markdown text to Notion blocks and append them to a Notion page.\"\n documentation: str = \"https://developers.notion.com/reference/patch-block-children\"\n icon = \"NotionDirectoryLoader\"\n\n inputs = [\n MultilineInput(\n name=\"markdown_text\",\n display_name=\"Markdown Text\",\n info=\"The markdown text to convert to Notion blocks.\",\n ),\n StrInput(\n name=\"block_id\",\n display_name=\"Page/Block ID\",\n info=\"The ID of the page/block to add the content.\",\n ),\n SecretStrInput(\n name=\"notion_secret\",\n display_name=\"Notion Secret\",\n info=\"The Notion integration token.\",\n required=True,\n ),\n ]\n outputs = [\n Output(name=\"example_output\", display_name=\"Data\", method=\"run_model\"),\n Output(name=\"example_tool_output\", display_name=\"Tool\", method=\"build_tool\"),\n ]\n\n class AddContentToPageSchema(BaseModel):\n markdown_text: str = Field(..., description=\"The markdown text to convert to Notion blocks.\")\n block_id: str = Field(..., description=\"The ID of the page/block to add the content.\")\n\n def run_model(self) -> Data:\n result = self._add_content_to_page(self.markdown_text, self.block_id)\n return Data(data=result, text=json.dumps(result))\n\n def build_tool(self) -> Tool:\n return StructuredTool.from_function(\n name=\"add_content_to_notion_page\",\n description=\"Convert markdown text to Notion blocks and append them to a Notion page.\",\n func=self._add_content_to_page,\n args_schema=self.AddContentToPageSchema,\n )\n\n def _add_content_to_page(self, markdown_text: str, block_id: str) -> Union[Dict[str, Any], str]:\n try:\n html_text = markdown(markdown_text)\n soup = BeautifulSoup(html_text, \"html.parser\")\n blocks = self.process_node(soup)\n\n url = f\"https://api.notion.com/v1/blocks/{block_id}/children\"\n headers = {\n \"Authorization\": f\"Bearer {self.notion_secret}\",\n \"Content-Type\": \"application/json\",\n \"Notion-Version\": \"2022-06-28\",\n }\n\n data = {\n \"children\": blocks,\n }\n\n response = requests.patch(url, headers=headers, json=data)\n response.raise_for_status()\n\n return response.json()\n except requests.exceptions.RequestException as e:\n error_message = f\"Error: Failed to add content to Notion page. {str(e)}\"\n if hasattr(e, \"response\") and e.response is not None:\n error_message += f\" Status code: {e.response.status_code}, Response: {e.response.text}\"\n return error_message\n except Exception as e:\n return f\"Error: An unexpected error occurred while adding content to Notion page. {str(e)}\"\n\n def process_node(self, node):\n blocks = []\n if isinstance(node, str):\n text = node.strip()\n if text:\n if text.startswith(\"#\"):\n heading_level = text.count(\"#\", 0, 6)\n heading_text = text[heading_level:].strip()\n if heading_level == 1:\n blocks.append(self.create_block(\"heading_1\", heading_text))\n elif heading_level == 2:\n blocks.append(self.create_block(\"heading_2\", heading_text))\n elif heading_level == 3:\n blocks.append(self.create_block(\"heading_3\", heading_text))\n else:\n blocks.append(self.create_block(\"paragraph\", text))\n elif node.name == \"h1\":\n blocks.append(self.create_block(\"heading_1\", node.get_text(strip=True)))\n elif node.name == \"h2\":\n blocks.append(self.create_block(\"heading_2\", node.get_text(strip=True)))\n elif node.name == \"h3\":\n blocks.append(self.create_block(\"heading_3\", node.get_text(strip=True)))\n elif node.name == \"p\":\n code_node = node.find(\"code\")\n if code_node:\n code_text = code_node.get_text()\n language, code = self.extract_language_and_code(code_text)\n blocks.append(self.create_block(\"code\", code, language=language))\n elif self.is_table(str(node)):\n blocks.extend(self.process_table(node))\n else:\n blocks.append(self.create_block(\"paragraph\", node.get_text(strip=True)))\n elif node.name == \"ul\":\n blocks.extend(self.process_list(node, \"bulleted_list_item\"))\n elif node.name == \"ol\":\n blocks.extend(self.process_list(node, \"numbered_list_item\"))\n elif node.name == \"blockquote\":\n blocks.append(self.create_block(\"quote\", node.get_text(strip=True)))\n elif node.name == \"hr\":\n blocks.append(self.create_block(\"divider\", \"\"))\n elif node.name == \"img\":\n blocks.append(self.create_block(\"image\", \"\", image_url=node.get(\"src\")))\n elif node.name == \"a\":\n blocks.append(self.create_block(\"bookmark\", node.get_text(strip=True), link_url=node.get(\"href\")))\n elif node.name == \"table\":\n blocks.extend(self.process_table(node))\n\n for child in node.children:\n if isinstance(child, str):\n continue\n blocks.extend(self.process_node(child))\n\n return blocks\n\n def extract_language_and_code(self, code_text):\n lines = code_text.split(\"\\n\")\n language = lines[0].strip()\n code = \"\\n\".join(lines[1:]).strip()\n return language, code\n\n def is_code_block(self, text):\n return text.startswith(\"```\")\n\n def extract_code_block(self, text):\n lines = text.split(\"\\n\")\n language = lines[0].strip(\"`\").strip()\n code = \"\\n\".join(lines[1:]).strip(\"`\").strip()\n return language, code\n\n def is_table(self, text):\n rows = text.split(\"\\n\")\n if len(rows) < 2:\n return False\n\n has_separator = False\n for i, row in enumerate(rows):\n if \"|\" in row:\n cells = [cell.strip() for cell in row.split(\"|\")]\n cells = [cell for cell in cells if cell] # Remove empty cells\n if i == 1 and all(set(cell) <= set(\"-|\") for cell in cells):\n has_separator = True\n elif not cells:\n return False\n\n return has_separator and len(rows) >= 3\n\n def process_list(self, node, list_type):\n blocks = []\n for item in node.find_all(\"li\"):\n item_text = item.get_text(strip=True)\n checked = item_text.startswith(\"[x]\")\n is_checklist = item_text.startswith(\"[ ]\") or checked\n\n if is_checklist:\n item_text = item_text.replace(\"[x]\", \"\").replace(\"[ ]\", \"\").strip()\n blocks.append(self.create_block(\"to_do\", item_text, checked=checked))\n else:\n blocks.append(self.create_block(list_type, item_text))\n return blocks\n\n def process_table(self, node):\n blocks = []\n header_row = node.find(\"thead\").find(\"tr\") if node.find(\"thead\") else None\n body_rows = node.find(\"tbody\").find_all(\"tr\") if node.find(\"tbody\") else []\n\n if header_row or body_rows:\n table_width = max(\n len(header_row.find_all([\"th\", \"td\"])) if header_row else 0,\n max(len(row.find_all([\"th\", \"td\"])) for row in body_rows),\n )\n\n table_block = self.create_block(\"table\", \"\", table_width=table_width, has_column_header=bool(header_row))\n blocks.append(table_block)\n\n if header_row:\n header_cells = [cell.get_text(strip=True) for cell in header_row.find_all([\"th\", \"td\"])]\n header_row_block = self.create_block(\"table_row\", header_cells)\n blocks.append(header_row_block)\n\n for row in body_rows:\n cells = [cell.get_text(strip=True) for cell in row.find_all([\"th\", \"td\"])]\n row_block = self.create_block(\"table_row\", cells)\n blocks.append(row_block)\n\n return blocks\n\n def create_block(self, block_type: str, content: str, **kwargs) -> Dict[str, Any]:\n block: dict[str, Any] = {\n \"object\": \"block\",\n \"type\": block_type,\n block_type: {},\n }\n\n if block_type in [\n \"paragraph\",\n \"heading_1\",\n \"heading_2\",\n \"heading_3\",\n \"bulleted_list_item\",\n \"numbered_list_item\",\n \"quote\",\n ]:\n block[block_type][\"rich_text\"] = [\n {\n \"type\": \"text\",\n \"text\": {\n \"content\": content,\n },\n }\n ]\n elif block_type == \"to_do\":\n block[block_type][\"rich_text\"] = [\n {\n \"type\": \"text\",\n \"text\": {\n \"content\": content,\n },\n }\n ]\n block[block_type][\"checked\"] = kwargs.get(\"checked\", False)\n elif block_type == \"code\":\n block[block_type][\"rich_text\"] = [\n {\n \"type\": \"text\",\n \"text\": {\n \"content\": content,\n },\n }\n ]\n block[block_type][\"language\"] = kwargs.get(\"language\", \"plain text\")\n elif block_type == \"image\":\n block[block_type] = {\"type\": \"external\", \"external\": {\"url\": kwargs.get(\"image_url\", \"\")}}\n elif block_type == \"divider\":\n pass\n elif block_type == \"bookmark\":\n block[block_type][\"url\"] = kwargs.get(\"link_url\", \"\")\n elif block_type == \"table\":\n block[block_type][\"table_width\"] = kwargs.get(\"table_width\", 0)\n block[block_type][\"has_column_header\"] = kwargs.get(\"has_column_header\", False)\n block[block_type][\"has_row_header\"] = kwargs.get(\"has_row_header\", False)\n elif block_type == \"table_row\":\n block[block_type][\"cells\"] = [[{\"type\": \"text\", \"text\": {\"content\": cell}} for cell in content]]\n\n return block\n","fileTypes":[],"file_path":"","password":false,"name":"code","advanced":true,"dynamic":true,"info":"","load_from_db":false,"title_case":false},"markdown_text":{"trace_as_input":true,"multiline":true,"trace_as_metadata":true,"load_from_db":false,"list":false,"required":false,"placeholder":"","show":true,"name":"markdown_text","value":"","display_name":"Markdown Text","advanced":true,"input_types":["Message"],"dynamic":false,"info":"The markdown text to convert to Notion blocks.","title_case":false,"type":"str","_input_type":"MultilineInput"},"notion_secret":{"load_from_db":true,"required":true,"placeholder":"","show":true,"name":"notion_secret","value":"","display_name":"Notion Secret","advanced":false,"input_types":["Message"],"dynamic":false,"info":"The Notion integration token.","title_case":false,"password":true,"type":"str","_input_type":"SecretStrInput"}},"description":"Convert markdown text to Notion blocks and append them to a Notion page.","icon":"NotionDirectoryLoader","base_classes":["Data","Tool"],"display_name":"Add Content to Page ","documentation":"https://developers.notion.com/reference/patch-block-children","custom_fields":{},"output_types":[],"pinned":false,"conditional_paths":[],"frozen":false,"outputs":[{"types":["Data"],"selected":"Data","name":"example_output","display_name":"Data","method":"run_model","value":"__UNDEFINED__","cache":true,"hidden":true},{"types":["Tool"],"selected":"Tool","name":"example_tool_output","display_name":"Tool","method":"build_tool","value":"__UNDEFINED__","cache":true}],"field_order":["markdown_text","block_id","notion_secret"],"beta":false,"edited":true,"lf_version":"1.0.17"},"id":"AddContentToPage-ZezUn","description":"Convert markdown text to Notion blocks and append them to a Notion page.","display_name":"Add Content to Page "},"selected":false,"width":384,"height":330,"dragging":false,"positionAbsolute":{"x":1416.217259177943,"y":1709.6205867919527}},{"id":"NotionPageCreator-6SCB5","type":"genericNode","position":{"x":1413.9782390799146,"y":2051.645785494985},"data":{"type":"NotionPageCreator","node":{"template":{"_type":"Component","code":{"type":"code","required":true,"placeholder":"","list":false,"show":true,"multiline":true,"value":"import json\nfrom typing import Dict, Any, Union\nimport requests\nfrom pydantic import BaseModel, Field\nfrom langflow.base.langchain_utilities.model import LCToolComponent\nfrom langflow.inputs import SecretStrInput, StrInput, MultilineInput\nfrom langflow.schema import Data\nfrom langflow.field_typing import Tool\nfrom langchain.tools import StructuredTool\nfrom langflow.io import Output\n\nclass NotionPageCreator(LCToolComponent):\n display_name: str = \"Create Page \"\n description: str = \"A component for creating Notion pages.\"\n documentation: str = \"https://docs.langflow.org/integrations/notion/page-create\"\n icon = \"NotionDirectoryLoader\"\n\n inputs = [\n StrInput(\n name=\"database_id\",\n display_name=\"Database ID\",\n info=\"The ID of the Notion database.\",\n ),\n SecretStrInput(\n name=\"notion_secret\",\n display_name=\"Notion Secret\",\n info=\"The Notion integration token.\",\n required=True,\n ),\n MultilineInput(\n name=\"properties_json\",\n display_name=\"Properties (JSON)\",\n info=\"The properties of the new page as a JSON string.\",\n ),\n ]\n outputs = [\n Output(name=\"example_output\", display_name=\"Data\", method=\"run_model\"),\n Output(name=\"example_tool_output\", display_name=\"Tool\", method=\"build_tool\"),\n ]\n\n class NotionPageCreatorSchema(BaseModel):\n database_id: str = Field(..., description=\"The ID of the Notion database.\")\n properties_json: str = Field(..., description=\"The properties of the new page as a JSON string.\")\n\n def run_model(self) -> Data:\n result = self._create_notion_page(self.database_id, self.properties_json)\n if isinstance(result, str):\n # An error occurred, return it as text\n return Data(text=result)\n else:\n # Success, return the created page data\n output = \"Created page properties:\\n\"\n for prop_name, prop_value in result.get(\"properties\", {}).items():\n output += f\"{prop_name}: {prop_value}\\n\"\n return Data(text=output, data=result)\n\n def build_tool(self) -> Tool:\n return StructuredTool.from_function(\n name=\"create_notion_page\",\n description=\"Create a new page in a Notion database. IMPORTANT: Use the tool to check the Database properties for more details before using this tool.\",\n func=self._create_notion_page,\n args_schema=self.NotionPageCreatorSchema,\n )\n\n def _create_notion_page(self, database_id: str, properties_json: str) -> Union[Dict[str, Any], str]:\n if not database_id or not properties_json:\n return \"Invalid input. Please provide 'database_id' and 'properties_json'.\"\n\n try:\n properties = json.loads(properties_json)\n except json.JSONDecodeError as e:\n return f\"Invalid properties format. Please provide a valid JSON string. Error: {str(e)}\"\n\n headers = {\n \"Authorization\": f\"Bearer {self.notion_secret}\",\n \"Content-Type\": \"application/json\",\n \"Notion-Version\": \"2022-06-28\",\n }\n\n data = {\n \"parent\": {\"database_id\": database_id},\n \"properties\": properties,\n }\n\n try:\n response = requests.post(\"https://api.notion.com/v1/pages\", headers=headers, json=data)\n response.raise_for_status()\n result = response.json()\n return result\n except requests.exceptions.RequestException as e:\n error_message = f\"Failed to create Notion page. Error: {str(e)}\"\n if hasattr(e, \"response\") and e.response is not None:\n error_message += f\" Status code: {e.response.status_code}, Response: {e.response.text}\"\n return error_message\n\n def __call__(self, *args, **kwargs):\n return self._create_notion_page(*args, **kwargs)\n","fileTypes":[],"file_path":"","password":false,"name":"code","advanced":true,"dynamic":true,"info":"","load_from_db":false,"title_case":false},"database_id":{"trace_as_metadata":true,"load_from_db":false,"list":false,"required":false,"placeholder":"","show":true,"name":"database_id","value":"","display_name":"Database ID","advanced":true,"dynamic":false,"info":"The ID of the Notion database.","title_case":false,"type":"str","_input_type":"StrInput"},"notion_secret":{"load_from_db":true,"required":true,"placeholder":"","show":true,"name":"notion_secret","value":"","display_name":"Notion Secret","advanced":false,"input_types":["Message"],"dynamic":false,"info":"The Notion integration token.","title_case":false,"password":true,"type":"str","_input_type":"SecretStrInput"},"properties_json":{"trace_as_input":true,"multiline":true,"trace_as_metadata":true,"load_from_db":false,"list":false,"required":false,"placeholder":"","show":true,"name":"properties_json","value":"","display_name":"Properties (JSON)","advanced":true,"input_types":["Message"],"dynamic":false,"info":"The properties of the new page as a JSON string.","title_case":false,"type":"str","_input_type":"MultilineInput"}},"description":"A component for creating Notion pages.","icon":"NotionDirectoryLoader","base_classes":["Data","Tool"],"display_name":"Create Page ","documentation":"https://docs.langflow.org/integrations/notion/page-create","custom_fields":{},"output_types":[],"pinned":false,"conditional_paths":[],"frozen":false,"outputs":[{"types":["Data"],"selected":"Data","name":"example_output","display_name":"Data","method":"run_model","value":"__UNDEFINED__","cache":true,"hidden":true},{"types":["Tool"],"selected":"Tool","name":"example_tool_output","display_name":"Tool","method":"build_tool","value":"__UNDEFINED__","cache":true}],"field_order":["database_id","notion_secret","properties_json"],"beta":false,"edited":true,"lf_version":"1.0.17"},"id":"NotionPageCreator-6SCB5","description":"A component for creating Notion pages.","display_name":"Create Page "},"selected":false,"width":384,"height":302,"dragging":false,"positionAbsolute":{"x":1413.9782390799146,"y":2051.645785494985}},{"id":"NotionDatabaseProperties-aeWil","type":"genericNode","position":{"x":1004.5753613670959,"y":1713.914531491452},"data":{"type":"NotionDatabaseProperties","node":{"template":{"_type":"Component","code":{"type":"code","required":true,"placeholder":"","list":false,"show":true,"multiline":true,"value":"import requests\nfrom typing import Dict, Union\nfrom pydantic import BaseModel, Field\nfrom langflow.base.langchain_utilities.model import LCToolComponent\nfrom langflow.inputs import SecretStrInput, StrInput\nfrom langflow.schema import Data\nfrom langflow.field_typing import Tool\nfrom langchain.tools import StructuredTool\nfrom langflow.io import Output\n\nclass NotionDatabaseProperties(LCToolComponent):\n display_name: str = \"List Database Properties \"\n description: str = \"Retrieve properties of a Notion database.\"\n documentation: str = \"https://docs.langflow.org/integrations/notion/list-database-properties\"\n icon = \"NotionDirectoryLoader\"\n\n inputs = [\n StrInput(\n name=\"database_id\",\n display_name=\"Database ID\",\n info=\"The ID of the Notion database.\",\n ),\n SecretStrInput(\n name=\"notion_secret\",\n display_name=\"Notion Secret\",\n info=\"The Notion integration token.\",\n required=True,\n ),\n ]\n outputs = [\n Output(name=\"example_output\", display_name=\"Data\", method=\"run_model\"),\n Output(name=\"example_tool_output\", display_name=\"Tool\", method=\"build_tool\"),\n ]\n\n class NotionDatabasePropertiesSchema(BaseModel):\n database_id: str = Field(..., description=\"The ID of the Notion database.\")\n\n def run_model(self) -> Data:\n result = self._fetch_database_properties(self.database_id)\n if isinstance(result, str):\n # An error occurred, return it as text\n return Data(text=result)\n else:\n # Success, return the properties\n return Data(text=str(result), data=result)\n\n def build_tool(self) -> Tool:\n return StructuredTool.from_function(\n name=\"notion_database_properties\",\n description=\"Retrieve properties of a Notion database. Input should include the database ID.\",\n func=self._fetch_database_properties,\n args_schema=self.NotionDatabasePropertiesSchema,\n )\n\n def _fetch_database_properties(self, database_id: str) -> Union[Dict, str]:\n url = f\"https://api.notion.com/v1/databases/{database_id}\"\n headers = {\n \"Authorization\": f\"Bearer {self.notion_secret}\",\n \"Notion-Version\": \"2022-06-28\", # Use the latest supported version\n }\n try:\n response = requests.get(url, headers=headers)\n response.raise_for_status()\n data = response.json()\n properties = data.get(\"properties\", {})\n return properties\n except requests.exceptions.RequestException as e:\n return f\"Error fetching Notion database properties: {str(e)}\"\n except ValueError as e:\n return f\"Error parsing Notion API response: {str(e)}\"\n except Exception as e:\n return f\"An unexpected error occurred: {str(e)}\"\n","fileTypes":[],"file_path":"","password":false,"name":"code","advanced":true,"dynamic":true,"info":"","load_from_db":false,"title_case":false},"database_id":{"trace_as_metadata":true,"load_from_db":false,"list":false,"required":false,"placeholder":"","show":true,"name":"database_id","value":"","display_name":"Database ID","advanced":true,"dynamic":false,"info":"The ID of the Notion database.","title_case":false,"type":"str","_input_type":"StrInput"},"notion_secret":{"load_from_db":true,"required":true,"placeholder":"","show":true,"name":"notion_secret","value":"","display_name":"Notion Secret","advanced":false,"input_types":["Message"],"dynamic":false,"info":"The Notion integration token.","title_case":false,"password":true,"type":"str","_input_type":"SecretStrInput"}},"description":"Retrieve properties of a Notion database.","icon":"NotionDirectoryLoader","base_classes":["Data","Tool"],"display_name":"List Database Properties ","documentation":"https://docs.langflow.org/integrations/notion/list-database-properties","custom_fields":{},"output_types":[],"pinned":false,"conditional_paths":[],"frozen":false,"outputs":[{"types":["Data"],"selected":"Data","name":"example_output","display_name":"Data","method":"run_model","value":"__UNDEFINED__","cache":true,"hidden":true},{"types":["Tool"],"selected":"Tool","name":"example_tool_output","display_name":"Tool","method":"build_tool","value":"__UNDEFINED__","cache":true}],"field_order":["database_id","notion_secret"],"beta":false,"edited":true,"lf_version":"1.0.17"},"id":"NotionDatabaseProperties-aeWil","description":"Retrieve properties of a Notion database.","display_name":"List Database Properties "},"selected":false,"width":384,"height":302,"dragging":false,"positionAbsolute":{"x":1004.5753613670959,"y":1713.914531491452}},{"id":"NotionListPages-znA3w","type":"genericNode","position":{"x":1006.1848442547046,"y":2022.7880909242833},"data":{"type":"NotionListPages","node":{"template":{"_type":"Component","code":{"type":"code","required":true,"placeholder":"","list":false,"show":true,"multiline":true,"value":"import requests\nimport json\nfrom typing import Dict, Any, List, Optional\nfrom pydantic import BaseModel, Field\nfrom langflow.io import Output\nfrom langflow.base.langchain_utilities.model import LCToolComponent\nfrom langflow.inputs import SecretStrInput, StrInput, MultilineInput\nfrom langflow.schema import Data\nfrom langflow.field_typing import Tool\nfrom langchain.tools import StructuredTool\n\n\nclass NotionListPages(LCToolComponent):\n display_name: str = \"List Pages \"\n description: str = (\n \"Query a Notion database with filtering and sorting. \"\n \"The input should be a JSON string containing the 'filter' and 'sorts' objects. \"\n \"Example input:\\n\"\n '{\"filter\": {\"property\": \"Status\", \"select\": {\"equals\": \"Done\"}}, \"sorts\": [{\"timestamp\": \"created_time\", \"direction\": \"descending\"}]}'\n )\n documentation: str = \"https://docs.langflow.org/integrations/notion/list-pages\"\n icon = \"NotionDirectoryLoader\"\n\n inputs = [\n SecretStrInput(\n name=\"notion_secret\",\n display_name=\"Notion Secret\",\n info=\"The Notion integration token.\",\n required=True,\n ),\n StrInput(\n name=\"database_id\",\n display_name=\"Database ID\",\n info=\"The ID of the Notion database to query.\",\n ),\n MultilineInput(\n name=\"query_json\",\n display_name=\"Database query (JSON)\",\n info=\"A JSON string containing the filters and sorts that will be used for querying the database. Leave empty for no filters or sorts.\",\n ),\n ]\n outputs = [\n Output(name=\"example_output\", display_name=\"Data\", method=\"run_model\"),\n Output(name=\"example_tool_output\", display_name=\"Tool\", method=\"build_tool\"),\n ]\n class NotionListPagesSchema(BaseModel):\n database_id: str = Field(..., description=\"The ID of the Notion database to query.\")\n query_json: Optional[str] = Field(\n default=\"\",\n description=\"A JSON string containing the filters and sorts for querying the database. Leave empty for no filters or sorts.\",\n )\n\n def run_model(self) -> List[Data]:\n result = self._query_notion_database(self.database_id, self.query_json)\n\n if isinstance(result, str):\n # An error occurred, return it as a single record\n return [Data(text=result)]\n\n records = []\n combined_text = f\"Pages found: {len(result)}\\n\\n\"\n\n for page in result:\n page_data = {\n \"id\": page[\"id\"],\n \"url\": page[\"url\"],\n \"created_time\": page[\"created_time\"],\n \"last_edited_time\": page[\"last_edited_time\"],\n \"properties\": page[\"properties\"],\n }\n\n text = (\n f\"id: {page['id']}\\n\"\n f\"url: {page['url']}\\n\"\n f\"created_time: {page['created_time']}\\n\"\n f\"last_edited_time: {page['last_edited_time']}\\n\"\n f\"properties: {json.dumps(page['properties'], indent=2)}\\n\\n\"\n )\n\n combined_text += text\n records.append(Data(text=text, **page_data))\n\n self.status = records\n return records\n\n def build_tool(self) -> Tool:\n return StructuredTool.from_function(\n name=\"notion_list_pages\",\n description=self.description,\n func=self._query_notion_database,\n args_schema=self.NotionListPagesSchema,\n )\n\n def _query_notion_database(self, database_id: str, query_json: Optional[str] = None) -> List[Dict[str, Any]] | str:\n url = f\"https://api.notion.com/v1/databases/{database_id}/query\"\n headers = {\n \"Authorization\": f\"Bearer {self.notion_secret}\",\n \"Content-Type\": \"application/json\",\n \"Notion-Version\": \"2022-06-28\",\n }\n\n query_payload = {}\n if query_json and query_json.strip():\n try:\n query_payload = json.loads(query_json)\n except json.JSONDecodeError as e:\n return f\"Invalid JSON format for query: {str(e)}\"\n\n try:\n response = requests.post(url, headers=headers, json=query_payload)\n response.raise_for_status()\n results = response.json()\n return results[\"results\"]\n except requests.exceptions.RequestException as e:\n return f\"Error querying Notion database: {str(e)}\"\n except KeyError:\n return \"Unexpected response format from Notion API\"\n except Exception as e:\n return f\"An unexpected error occurred: {str(e)}\"\n","fileTypes":[],"file_path":"","password":false,"name":"code","advanced":true,"dynamic":true,"info":"","load_from_db":false,"title_case":false},"database_id":{"trace_as_metadata":true,"load_from_db":false,"list":false,"required":false,"placeholder":"","show":true,"name":"database_id","value":"","display_name":"Database ID","advanced":true,"dynamic":false,"info":"The ID of the Notion database to query.","title_case":false,"type":"str","_input_type":"StrInput"},"notion_secret":{"load_from_db":true,"required":true,"placeholder":"","show":true,"name":"notion_secret","value":"","display_name":"Notion Secret","advanced":false,"input_types":["Message"],"dynamic":false,"info":"The Notion integration token.","title_case":false,"password":true,"type":"str","_input_type":"SecretStrInput"},"query_json":{"trace_as_input":true,"multiline":true,"trace_as_metadata":true,"load_from_db":false,"list":false,"required":false,"placeholder":"","show":true,"name":"query_json","value":"","display_name":"Database query (JSON)","advanced":true,"input_types":["Message"],"dynamic":false,"info":"A JSON string containing the filters and sorts that will be used for querying the database. Leave empty for no filters or sorts.","title_case":false,"type":"str","_input_type":"MultilineInput"}},"description":"Query a Notion database with filtering and sorting. The input should be a JSON string containing the 'filter' and 'sorts' objects. Example input:\n{\"filter\": {\"property\": \"Status\", \"select\": {\"equals\": \"Done\"}}, \"sorts\": [{\"timestamp\": \"created_time\", \"direction\": \"descending\"}]}","icon":"NotionDirectoryLoader","base_classes":["Data","Tool"],"display_name":"List Pages ","documentation":"https://docs.langflow.org/integrations/notion/list-pages","custom_fields":{},"output_types":[],"pinned":false,"conditional_paths":[],"frozen":false,"outputs":[{"types":["Data"],"selected":"Data","name":"example_output","display_name":"Data","method":"run_model","value":"__UNDEFINED__","cache":true,"hidden":true},{"types":["Tool"],"selected":"Tool","name":"example_tool_output","display_name":"Tool","method":"build_tool","value":"__UNDEFINED__","cache":true}],"field_order":["notion_secret","database_id","query_json"],"beta":false,"edited":true,"lf_version":"1.0.17"},"id":"NotionListPages-znA3w","description":"Query a Notion database with filtering and sorting. The input should be a JSON string containing the 'filter' and 'sorts' objects. Example input:\n{\"filter\": {\"property\": \"Status\", \"select\": {\"equals\": \"Done\"}}, \"sorts\": [{\"timestamp\": \"created_time\", \"direction\": \"descending\"}]}","display_name":"List Pages "},"selected":false,"width":384,"height":470,"dragging":false,"positionAbsolute":{"x":1006.1848442547046,"y":2022.7880909242833}},{"id":"NotionUserList-C3eGn","type":"genericNode","position":{"x":2260.15497405973,"y":1717.4551881467207},"data":{"type":"NotionUserList","node":{"template":{"_type":"Component","code":{"type":"code","required":true,"placeholder":"","list":false,"show":true,"multiline":true,"value":"import requests\nfrom typing import List, Dict\nfrom pydantic import BaseModel\nfrom langflow.io import Output\nfrom langflow.base.langchain_utilities.model import LCToolComponent\nfrom langflow.inputs import SecretStrInput\nfrom langflow.schema import Data\nfrom langflow.field_typing import Tool\nfrom langchain.tools import StructuredTool\n\n\nclass NotionUserList(LCToolComponent):\n display_name = \"List Users \"\n description = \"Retrieve users from Notion.\"\n documentation = \"https://docs.langflow.org/integrations/notion/list-users\"\n icon = \"NotionDirectoryLoader\"\n\n inputs = [\n SecretStrInput(\n name=\"notion_secret\",\n display_name=\"Notion Secret\",\n info=\"The Notion integration token.\",\n required=True,\n ),\n ]\n outputs = [\n Output(name=\"example_output\", display_name=\"Data\", method=\"run_model\"),\n Output(name=\"example_tool_output\", display_name=\"Tool\", method=\"build_tool\"),\n ]\n\n class NotionUserListSchema(BaseModel):\n pass\n\n def run_model(self) -> List[Data]:\n users = self._list_users()\n records = []\n combined_text = \"\"\n\n for user in users:\n output = \"User:\\n\"\n for key, value in user.items():\n output += f\"{key.replace('_', ' ').title()}: {value}\\n\"\n output += \"________________________\\n\"\n\n combined_text += output\n records.append(Data(text=output, data=user))\n\n self.status = records\n return records\n\n def build_tool(self) -> Tool:\n return StructuredTool.from_function(\n name=\"notion_list_users\",\n description=\"Retrieve users from Notion.\",\n func=self._list_users,\n args_schema=self.NotionUserListSchema,\n )\n\n def _list_users(self) -> List[Dict]:\n url = \"https://api.notion.com/v1/users\"\n headers = {\n \"Authorization\": f\"Bearer {self.notion_secret}\",\n \"Notion-Version\": \"2022-06-28\",\n }\n\n response = requests.get(url, headers=headers)\n response.raise_for_status()\n\n data = response.json()\n results = data[\"results\"]\n\n users = []\n for user in results:\n user_data = {\n \"id\": user[\"id\"],\n \"type\": user[\"type\"],\n \"name\": user.get(\"name\", \"\"),\n \"avatar_url\": user.get(\"avatar_url\", \"\"),\n }\n users.append(user_data)\n\n return users\n","fileTypes":[],"file_path":"","password":false,"name":"code","advanced":true,"dynamic":true,"info":"","load_from_db":false,"title_case":false},"notion_secret":{"load_from_db":true,"required":true,"placeholder":"","show":true,"name":"notion_secret","value":"","display_name":"Notion Secret","advanced":false,"input_types":["Message"],"dynamic":false,"info":"The Notion integration token.","title_case":false,"password":true,"type":"str","_input_type":"SecretStrInput"}},"description":"Retrieve users from Notion.","icon":"NotionDirectoryLoader","base_classes":["Data","Tool"],"display_name":"List Users ","documentation":"https://docs.langflow.org/integrations/notion/list-users","custom_fields":{},"output_types":[],"pinned":false,"conditional_paths":[],"frozen":false,"outputs":[{"types":["Data"],"selected":"Data","name":"example_output","display_name":"Data","method":"run_model","value":"__UNDEFINED__","cache":true,"hidden":true},{"types":["Tool"],"selected":"Tool","name":"example_tool_output","display_name":"Tool","method":"build_tool","value":"__UNDEFINED__","cache":true}],"field_order":["notion_secret"],"beta":false,"edited":true,"lf_version":"1.0.17"},"id":"NotionUserList-C3eGn","description":"Retrieve users from Notion.","display_name":"List Users "},"selected":true,"width":384,"height":302,"dragging":false,"positionAbsolute":{"x":2260.15497405973,"y":1717.4551881467207}},{"id":"NotionPageContent-SlL21","type":"genericNode","position":{"x":1826.4242329724448,"y":1715.6365113286927},"data":{"type":"NotionPageContent","node":{"template":{"_type":"Component","code":{"type":"code","required":true,"placeholder":"","list":false,"show":true,"multiline":true,"value":"import requests\nfrom pydantic import BaseModel, Field\nfrom langflow.base.langchain_utilities.model import LCToolComponent\nfrom langflow.inputs import SecretStrInput, StrInput\nfrom langflow.schema import Data\nfrom langflow.field_typing import Tool\nfrom langchain.tools import StructuredTool\nfrom langflow.io import Output\n\nclass NotionPageContent(LCToolComponent):\n display_name = \"Page Content Viewer \"\n description = \"Retrieve the content of a Notion page as plain text.\"\n documentation = \"https://docs.langflow.org/integrations/notion/page-content-viewer\"\n icon = \"NotionDirectoryLoader\"\n\n inputs = [\n StrInput(\n name=\"page_id\",\n display_name=\"Page ID\",\n info=\"The ID of the Notion page to retrieve.\",\n ),\n SecretStrInput(\n name=\"notion_secret\",\n display_name=\"Notion Secret\",\n info=\"The Notion integration token.\",\n required=True,\n ),\n ]\n outputs = [\n Output(name=\"example_output\", display_name=\"Data\", method=\"run_model\"),\n Output(name=\"example_tool_output\", display_name=\"Tool\", method=\"build_tool\"),\n ]\n\n class NotionPageContentSchema(BaseModel):\n page_id: str = Field(..., description=\"The ID of the Notion page to retrieve.\")\n\n def run_model(self) -> Data:\n result = self._retrieve_page_content(self.page_id)\n if isinstance(result, str) and result.startswith(\"Error:\"):\n # An error occurred, return it as text\n return Data(text=result)\n else:\n # Success, return the content\n return Data(text=result, data={\"content\": result})\n\n def build_tool(self) -> Tool:\n return StructuredTool.from_function(\n name=\"notion_page_content\",\n description=\"Retrieve the content of a Notion page as plain text.\",\n func=self._retrieve_page_content,\n args_schema=self.NotionPageContentSchema,\n )\n\n def _retrieve_page_content(self, page_id: str) -> str:\n blocks_url = f\"https://api.notion.com/v1/blocks/{page_id}/children?page_size=100\"\n headers = {\n \"Authorization\": f\"Bearer {self.notion_secret}\",\n \"Notion-Version\": \"2022-06-28\",\n }\n try:\n blocks_response = requests.get(blocks_url, headers=headers)\n blocks_response.raise_for_status()\n blocks_data = blocks_response.json()\n return self.parse_blocks(blocks_data.get(\"results\", []))\n except requests.exceptions.RequestException as e:\n error_message = f\"Error: Failed to retrieve Notion page content. {str(e)}\"\n if hasattr(e, \"response\") and e.response is not None:\n error_message += f\" Status code: {e.response.status_code}, Response: {e.response.text}\"\n return error_message\n except Exception as e:\n return f\"Error: An unexpected error occurred while retrieving Notion page content. {str(e)}\"\n\n def parse_blocks(self, blocks: list) -> str:\n content = \"\"\n for block in blocks:\n block_type = block.get(\"type\")\n if block_type in [\"paragraph\", \"heading_1\", \"heading_2\", \"heading_3\", \"quote\"]:\n content += self.parse_rich_text(block[block_type].get(\"rich_text\", [])) + \"\\n\\n\"\n elif block_type in [\"bulleted_list_item\", \"numbered_list_item\"]:\n content += self.parse_rich_text(block[block_type].get(\"rich_text\", [])) + \"\\n\"\n elif block_type == \"to_do\":\n content += self.parse_rich_text(block[\"to_do\"].get(\"rich_text\", [])) + \"\\n\"\n elif block_type == \"code\":\n content += self.parse_rich_text(block[\"code\"].get(\"rich_text\", [])) + \"\\n\\n\"\n elif block_type == \"image\":\n content += f\"[Image: {block['image'].get('external', {}).get('url', 'No URL')}]\\n\\n\"\n elif block_type == \"divider\":\n content += \"---\\n\\n\"\n return content.strip()\n\n def parse_rich_text(self, rich_text: list) -> str:\n return \"\".join(segment.get(\"plain_text\", \"\") for segment in rich_text)\n\n def __call__(self, *args, **kwargs):\n return self._retrieve_page_content(*args, **kwargs)\n","fileTypes":[],"file_path":"","password":false,"name":"code","advanced":true,"dynamic":true,"info":"","load_from_db":false,"title_case":false},"notion_secret":{"load_from_db":true,"required":true,"placeholder":"","show":true,"name":"notion_secret","value":"","display_name":"Notion Secret","advanced":false,"input_types":["Message"],"dynamic":false,"info":"The Notion integration token.","title_case":false,"password":true,"type":"str","_input_type":"SecretStrInput"},"page_id":{"trace_as_metadata":true,"load_from_db":false,"list":false,"required":false,"placeholder":"","show":true,"name":"page_id","value":"","display_name":"Page ID","advanced":true,"dynamic":false,"info":"The ID of the Notion page to retrieve.","title_case":false,"type":"str","_input_type":"StrInput"}},"description":"Retrieve the content of a Notion page as plain text.","icon":"NotionDirectoryLoader","base_classes":["Data","Tool"],"display_name":"Page Content Viewer ","documentation":"https://docs.langflow.org/integrations/notion/page-content-viewer","custom_fields":{},"output_types":[],"pinned":false,"conditional_paths":[],"frozen":false,"outputs":[{"types":["Data"],"selected":"Data","name":"example_output","display_name":"Data","method":"run_model","value":"__UNDEFINED__","cache":true,"hidden":true},{"types":["Tool"],"selected":"Tool","name":"example_tool_output","display_name":"Tool","method":"build_tool","value":"__UNDEFINED__","cache":true}],"field_order":["page_id","notion_secret"],"beta":false,"edited":true,"lf_version":"1.0.17"},"id":"NotionPageContent-SlL21","description":"Retrieve the content of a Notion page as plain text.","display_name":"Page Content Viewer "},"selected":false,"width":384,"height":330,"dragging":false,"positionAbsolute":{"x":1826.4242329724448,"y":1715.6365113286927}},{"id":"NotionSearch-VS2mI","type":"genericNode","position":{"x":2258.1166047519732,"y":2034.3959294952945},"data":{"type":"NotionSearch","node":{"template":{"_type":"Component","code":{"type":"code","required":true,"placeholder":"","list":false,"show":true,"multiline":true,"value":"import requests\nfrom typing import Dict, Any, List\nfrom pydantic import BaseModel, Field\nfrom langflow.io import Output\nfrom langflow.base.langchain_utilities.model import LCToolComponent\nfrom langflow.inputs import SecretStrInput, StrInput, DropdownInput\nfrom langflow.schema import Data\nfrom langflow.field_typing import Tool\nfrom langchain.tools import StructuredTool\n\n\nclass NotionSearch(LCToolComponent):\n display_name: str = \"Search \"\n description: str = \"Searches all pages and databases that have been shared with an integration. The search field can be an empty value to show all values from that search\"\n documentation: str = \"https://docs.langflow.org/integrations/notion/search\"\n icon = \"NotionDirectoryLoader\"\n\n inputs = [\n SecretStrInput(\n name=\"notion_secret\",\n display_name=\"Notion Secret\",\n info=\"The Notion integration token.\",\n required=True,\n ),\n StrInput(\n name=\"query\",\n display_name=\"Search Query\",\n info=\"The text that the API compares page and database titles against.\",\n ),\n DropdownInput(\n name=\"filter_value\",\n display_name=\"Filter Type\",\n info=\"Limits the results to either only pages or only databases.\",\n options=[\"page\", \"database\"],\n value=\"page\",\n ),\n DropdownInput(\n name=\"sort_direction\",\n display_name=\"Sort Direction\",\n info=\"The direction to sort the results.\",\n options=[\"ascending\", \"descending\"],\n value=\"descending\",\n ),\n ]\n outputs = [\n Output(name=\"example_output\", display_name=\"Data\", method=\"run_model\"),\n Output(name=\"example_tool_output\", display_name=\"Tool\", method=\"build_tool\"),\n ]\n\n class NotionSearchSchema(BaseModel):\n query: str = Field(..., description=\"The search query text.\")\n filter_value: str = Field(default=\"page\", description=\"Filter type: 'page' or 'database'.\")\n sort_direction: str = Field(default=\"descending\", description=\"Sort direction: 'ascending' or 'descending'.\")\n\n def run_model(self) -> List[Data]:\n results = self._search_notion(self.query, self.filter_value, self.sort_direction)\n records = []\n combined_text = f\"Results found: {len(results)}\\n\\n\"\n\n for result in results:\n result_data = {\n \"id\": result[\"id\"],\n \"type\": result[\"object\"],\n \"last_edited_time\": result[\"last_edited_time\"],\n }\n\n if result[\"object\"] == \"page\":\n result_data[\"title_or_url\"] = result[\"url\"]\n text = f\"id: {result['id']}\\ntitle_or_url: {result['url']}\\n\"\n elif result[\"object\"] == \"database\":\n if \"title\" in result and isinstance(result[\"title\"], list) and len(result[\"title\"]) > 0:\n result_data[\"title_or_url\"] = result[\"title\"][0][\"plain_text\"]\n text = f\"id: {result['id']}\\ntitle_or_url: {result['title'][0]['plain_text']}\\n\"\n else:\n result_data[\"title_or_url\"] = \"N/A\"\n text = f\"id: {result['id']}\\ntitle_or_url: N/A\\n\"\n\n text += f\"type: {result['object']}\\nlast_edited_time: {result['last_edited_time']}\\n\\n\"\n combined_text += text\n records.append(Data(text=text, data=result_data))\n\n self.status = records\n return records\n\n def build_tool(self) -> Tool:\n return StructuredTool.from_function(\n name=\"notion_search\",\n description=\"Search Notion pages and databases. Input should include the search query and optionally filter type and sort direction.\",\n func=self._search_notion,\n args_schema=self.NotionSearchSchema,\n )\n\n def _search_notion(\n self, query: str, filter_value: str = \"page\", sort_direction: str = \"descending\"\n ) -> List[Dict[str, Any]]:\n url = \"https://api.notion.com/v1/search\"\n headers = {\n \"Authorization\": f\"Bearer {self.notion_secret}\",\n \"Content-Type\": \"application/json\",\n \"Notion-Version\": \"2022-06-28\",\n }\n\n data = {\n \"query\": query,\n \"filter\": {\"value\": filter_value, \"property\": \"object\"},\n \"sort\": {\"direction\": sort_direction, \"timestamp\": \"last_edited_time\"},\n }\n\n response = requests.post(url, headers=headers, json=data)\n response.raise_for_status()\n\n results = response.json()\n return results[\"results\"]\n","fileTypes":[],"file_path":"","password":false,"name":"code","advanced":true,"dynamic":true,"info":"","load_from_db":false,"title_case":false},"filter_value":{"trace_as_metadata":true,"options":["page","database"],"combobox":false,"required":false,"placeholder":"","show":true,"name":"filter_value","value":"page","display_name":"Filter Type","advanced":true,"dynamic":false,"info":"Limits the results to either only pages or only databases.","title_case":false,"type":"str","_input_type":"DropdownInput"},"notion_secret":{"load_from_db":true,"required":true,"placeholder":"","show":true,"name":"notion_secret","value":"","display_name":"Notion Secret","advanced":false,"input_types":["Message"],"dynamic":false,"info":"The Notion integration token.","title_case":false,"password":true,"type":"str","_input_type":"SecretStrInput"},"query":{"trace_as_metadata":true,"load_from_db":false,"list":false,"required":false,"placeholder":"","show":true,"name":"query","value":"","display_name":"Search Query","advanced":true,"dynamic":false,"info":"The text that the API compares page and database titles against.","title_case":false,"type":"str","_input_type":"StrInput"},"sort_direction":{"trace_as_metadata":true,"options":["ascending","descending"],"combobox":false,"required":false,"placeholder":"","show":true,"name":"sort_direction","value":"descending","display_name":"Sort Direction","advanced":true,"dynamic":false,"info":"The direction to sort the results.","title_case":false,"type":"str","_input_type":"DropdownInput"}},"description":"Searches all pages and databases that have been shared with an integration. The search field can be an empty value to show all values from that search","icon":"NotionDirectoryLoader","base_classes":["Data","Tool"],"display_name":"Search ","documentation":"https://docs.langflow.org/integrations/notion/search","custom_fields":{},"output_types":[],"pinned":false,"conditional_paths":[],"frozen":false,"outputs":[{"types":["Data"],"selected":"Data","name":"example_output","display_name":"Data","method":"run_model","value":"__UNDEFINED__","cache":true,"hidden":true},{"types":["Tool"],"selected":"Tool","name":"example_tool_output","display_name":"Tool","method":"build_tool","value":"__UNDEFINED__","cache":true}],"field_order":["notion_secret","query","filter_value","sort_direction"],"beta":false,"edited":true,"lf_version":"1.0.17"},"id":"NotionSearch-VS2mI","description":"Searches all pages and databases that have been shared with an integration.","display_name":"Search "},"selected":false,"width":384,"height":386,"dragging":false,"positionAbsolute":{"x":2258.1166047519732,"y":2034.3959294952945}},{"id":"NotionPageUpdate-6FyYd","type":"genericNode","position":{"x":1827.0574354713603,"y":2055.9948126656136},"data":{"type":"NotionPageUpdate","node":{"template":{"_type":"Component","code":{"type":"code","required":true,"placeholder":"","list":false,"show":true,"multiline":true,"value":"import json\nimport requests\nfrom typing import Dict, Any, Union\nfrom pydantic import BaseModel, Field\nfrom langflow.base.langchain_utilities.model import LCToolComponent\nfrom langflow.inputs import SecretStrInput, StrInput, MultilineInput\nfrom langflow.schema import Data\nfrom langflow.field_typing import Tool\nfrom langchain.tools import StructuredTool\nfrom loguru import logger\nfrom langflow.io import Output\n\nclass NotionPageUpdate(LCToolComponent):\n display_name: str = \"Update Page Property \"\n description: str = \"Update the properties of a Notion page.\"\n documentation: str = \"https://docs.langflow.org/integrations/notion/page-update\"\n icon = \"NotionDirectoryLoader\"\n\n inputs = [\n StrInput(\n name=\"page_id\",\n display_name=\"Page ID\",\n info=\"The ID of the Notion page to update.\",\n ),\n MultilineInput(\n name=\"properties\",\n display_name=\"Properties\",\n info=\"The properties to update on the page (as a JSON string or a dictionary).\",\n ),\n SecretStrInput(\n name=\"notion_secret\",\n display_name=\"Notion Secret\",\n info=\"The Notion integration token.\",\n required=True,\n ),\n ]\n outputs = [\n Output(name=\"example_output\", display_name=\"Data\", method=\"run_model\"),\n Output(name=\"example_tool_output\", display_name=\"Tool\", method=\"build_tool\"),\n ]\n\n class NotionPageUpdateSchema(BaseModel):\n page_id: str = Field(..., description=\"The ID of the Notion page to update.\")\n properties: Union[str, Dict[str, Any]] = Field(\n ..., description=\"The properties to update on the page (as a JSON string or a dictionary).\"\n )\n\n def run_model(self) -> Data:\n result = self._update_notion_page(self.page_id, self.properties)\n if isinstance(result, str):\n # An error occurred, return it as text\n return Data(text=result)\n else:\n # Success, return the updated page data\n output = \"Updated page properties:\\n\"\n for prop_name, prop_value in result.get(\"properties\", {}).items():\n output += f\"{prop_name}: {prop_value}\\n\"\n return Data(text=output, data=result)\n\n def build_tool(self) -> Tool:\n return StructuredTool.from_function(\n name=\"update_notion_page\",\n description=\"Update the properties of a Notion page. IMPORTANT: Use the tool to check the Database properties for more details before using this tool.\",\n func=self._update_notion_page,\n args_schema=self.NotionPageUpdateSchema,\n )\n\n def _update_notion_page(self, page_id: str, properties: Union[str, Dict[str, Any]]) -> Union[Dict[str, Any], str]:\n url = f\"https://api.notion.com/v1/pages/{page_id}\"\n headers = {\n \"Authorization\": f\"Bearer {self.notion_secret}\",\n \"Content-Type\": \"application/json\",\n \"Notion-Version\": \"2022-06-28\", # Use the latest supported version\n }\n\n # Parse properties if it's a string\n if isinstance(properties, str):\n try:\n parsed_properties = json.loads(properties)\n except json.JSONDecodeError as e:\n error_message = f\"Invalid JSON format for properties: {str(e)}\"\n logger.error(error_message)\n return error_message\n\n else:\n parsed_properties = properties\n\n data = {\"properties\": parsed_properties}\n\n try:\n logger.info(f\"Sending request to Notion API: URL: {url}, Data: {json.dumps(data)}\")\n response = requests.patch(url, headers=headers, json=data)\n response.raise_for_status()\n updated_page = response.json()\n\n logger.info(f\"Successfully updated Notion page. Response: {json.dumps(updated_page)}\")\n return updated_page\n except requests.exceptions.HTTPError as e:\n error_message = f\"HTTP Error occurred: {str(e)}\"\n if e.response is not None:\n error_message += f\"\\nStatus code: {e.response.status_code}\"\n error_message += f\"\\nResponse body: {e.response.text}\"\n logger.error(error_message)\n return error_message\n except requests.exceptions.RequestException as e:\n error_message = f\"An error occurred while making the request: {str(e)}\"\n logger.error(error_message)\n return error_message\n except Exception as e:\n error_message = f\"An unexpected error occurred: {str(e)}\"\n logger.error(error_message)\n return error_message\n\n def __call__(self, *args, **kwargs):\n return self._update_notion_page(*args, **kwargs)\n","fileTypes":[],"file_path":"","password":false,"name":"code","advanced":true,"dynamic":true,"info":"","load_from_db":false,"title_case":false},"notion_secret":{"load_from_db":true,"required":true,"placeholder":"","show":true,"name":"notion_secret","value":"","display_name":"Notion Secret","advanced":false,"input_types":["Message"],"dynamic":false,"info":"The Notion integration token.","title_case":false,"password":true,"type":"str","_input_type":"SecretStrInput"},"page_id":{"trace_as_metadata":true,"load_from_db":false,"list":false,"required":false,"placeholder":"","show":true,"name":"page_id","value":"","display_name":"Page ID","advanced":true,"dynamic":false,"info":"The ID of the Notion page to update.","title_case":false,"type":"str","_input_type":"StrInput"},"properties":{"trace_as_input":true,"multiline":true,"trace_as_metadata":true,"load_from_db":false,"list":false,"required":false,"placeholder":"","show":true,"name":"properties","value":"","display_name":"Properties","advanced":true,"input_types":["Message"],"dynamic":false,"info":"The properties to update on the page (as a JSON string or a dictionary).","title_case":false,"type":"str","_input_type":"MultilineInput"}},"description":"Update the properties of a Notion page.","icon":"NotionDirectoryLoader","base_classes":["Data","Tool"],"display_name":"Update Page Property ","documentation":"https://docs.langflow.org/integrations/notion/page-update","custom_fields":{},"output_types":[],"pinned":false,"conditional_paths":[],"frozen":false,"outputs":[{"types":["Data"],"selected":"Data","name":"example_output","display_name":"Data","method":"run_model","value":"__UNDEFINED__","cache":true,"hidden":true},{"types":["Tool"],"selected":"Tool","name":"example_tool_output","display_name":"Tool","method":"build_tool","value":"__UNDEFINED__","cache":true}],"field_order":["page_id","properties","notion_secret"],"beta":false,"edited":true,"lf_version":"1.0.17"},"id":"NotionPageUpdate-6FyYd","description":"Update the properties of a Notion page.","display_name":"Update Page Property "},"selected":false,"width":384,"height":302,"dragging":false,"positionAbsolute":{"x":1827.0574354713603,"y":2055.9948126656136}},{"id":"ToolCallingAgent-50Gcd","type":"genericNode","position":{"x":2186.0530739759893,"y":612.1744804997304},"data":{"type":"ToolCallingAgent","node":{"template":{"_type":"Component","chat_history":{"trace_as_metadata":true,"list":true,"trace_as_input":true,"required":false,"placeholder":"","show":true,"name":"chat_history","value":"","display_name":"Chat History","advanced":false,"input_types":["Data"],"dynamic":false,"info":"","title_case":false,"type":"other","_input_type":"DataInput"},"llm":{"trace_as_metadata":true,"list":false,"required":true,"placeholder":"","show":true,"name":"llm","value":"","display_name":"Language Model","advanced":false,"input_types":["LanguageModel"],"dynamic":false,"info":"","title_case":false,"type":"other","_input_type":"HandleInput"},"tools":{"trace_as_metadata":true,"list":true,"required":false,"placeholder":"","show":true,"name":"tools","value":"","display_name":"Tools","advanced":false,"input_types":["Tool","BaseTool"],"dynamic":false,"info":"","title_case":false,"type":"other","_input_type":"HandleInput"},"code":{"type":"code","required":true,"placeholder":"","list":false,"show":true,"multiline":true,"value":"from typing import Optional, List\n\nfrom langchain.agents import create_tool_calling_agent\nfrom langchain_core.prompts import ChatPromptTemplate, PromptTemplate, HumanMessagePromptTemplate\nfrom langflow.base.agents.agent import LCToolsAgentComponent\nfrom langflow.inputs import MultilineInput\nfrom langflow.inputs.inputs import HandleInput, DataInput\nfrom langflow.schema import Data\n\n\nclass ToolCallingAgentComponent(LCToolsAgentComponent):\n display_name: str = \"Tool Calling Agent\"\n description: str = \"Agent that uses tools\"\n icon = \"LangChain\"\n beta = True\n name = \"ToolCallingAgent\"\n\n inputs = LCToolsAgentComponent._base_inputs + [\n HandleInput(name=\"llm\", display_name=\"Language Model\", input_types=[\"LanguageModel\"], required=True),\n MultilineInput(\n name=\"system_prompt\",\n display_name=\"System Prompt\",\n info=\"System prompt for the agent.\",\n value=\"You are a helpful assistant\",\n ),\n MultilineInput(\n name=\"user_prompt\", display_name=\"Prompt\", info=\"This prompt must contain 'input' key.\", value=\"{input}\"\n ),\n DataInput(name=\"chat_history\", display_name=\"Chat History\", is_list=True, advanced=True),\n ]\n\n def get_chat_history_data(self) -> Optional[List[Data]]:\n return self.chat_history\n\n def create_agent_runnable(self):\n if \"input\" not in self.user_prompt:\n raise ValueError(\"Prompt must contain 'input' key.\")\n messages = [\n (\"system\", self.system_prompt),\n (\"placeholder\", \"{chat_history}\"),\n HumanMessagePromptTemplate(prompt=PromptTemplate(input_variables=[\"input\"], template=self.user_prompt)),\n (\"placeholder\", \"{agent_scratchpad}\"),\n ]\n prompt = ChatPromptTemplate.from_messages(messages)\n return create_tool_calling_agent(self.llm, self.tools, prompt)\n","fileTypes":[],"file_path":"","password":false,"name":"code","advanced":true,"dynamic":true,"info":"","load_from_db":false,"title_case":false},"handle_parsing_errors":{"trace_as_metadata":true,"list":false,"required":false,"placeholder":"","show":true,"name":"handle_parsing_errors","value":true,"display_name":"Handle Parse Errors","advanced":true,"dynamic":false,"info":"","title_case":false,"type":"bool","_input_type":"BoolInput"},"input_value":{"trace_as_input":true,"trace_as_metadata":true,"load_from_db":false,"list":false,"required":false,"placeholder":"","show":true,"name":"input_value","value":"","display_name":"Input","advanced":false,"input_types":["Message"],"dynamic":false,"info":"","title_case":false,"type":"str","_input_type":"MessageTextInput"},"max_iterations":{"trace_as_metadata":true,"list":false,"required":false,"placeholder":"","show":true,"name":"max_iterations","value":15,"display_name":"Max Iterations","advanced":true,"dynamic":false,"info":"","title_case":false,"type":"int","_input_type":"IntInput"},"system_prompt":{"trace_as_input":true,"multiline":true,"trace_as_metadata":true,"load_from_db":false,"list":false,"required":false,"placeholder":"","show":true,"name":"system_prompt","value":"","display_name":"System Prompt","advanced":false,"input_types":["Message"],"dynamic":false,"info":"System prompt for the agent.","title_case":false,"type":"str","_input_type":"MultilineInput"},"user_prompt":{"trace_as_input":true,"multiline":true,"trace_as_metadata":true,"load_from_db":false,"list":false,"required":false,"placeholder":"","show":true,"name":"user_prompt","value":"{input}","display_name":"Prompt","advanced":true,"input_types":["Message"],"dynamic":false,"info":"This prompt must contain 'input' key.","title_case":false,"type":"str","_input_type":"MultilineInput"},"verbose":{"trace_as_metadata":true,"list":false,"required":false,"placeholder":"","show":true,"name":"verbose","value":true,"display_name":"Verbose","advanced":true,"dynamic":false,"info":"","title_case":false,"type":"bool","_input_type":"BoolInput"}},"description":"Agent that uses tools","icon":"LangChain","base_classes":["AgentExecutor","Message"],"display_name":"Tool Calling Agent","documentation":"","custom_fields":{},"output_types":[],"pinned":false,"conditional_paths":[],"frozen":false,"outputs":[{"types":["AgentExecutor"],"selected":"AgentExecutor","name":"agent","display_name":"Agent","method":"build_agent","value":"__UNDEFINED__","cache":true,"hidden":true},{"types":["Message"],"selected":"Message","name":"response","display_name":"Response","method":"message_response","value":"__UNDEFINED__","cache":true}],"field_order":["input_value","handle_parsing_errors","verbose","max_iterations","tools","llm","system_prompt","user_prompt","chat_history"],"beta":true,"edited":false,"lf_version":"1.0.17"},"id":"ToolCallingAgent-50Gcd"},"selected":false,"width":384,"height":532,"dragging":false,"positionAbsolute":{"x":2186.0530739759893,"y":612.1744804997304}},{"id":"ChatOutput-TSCup","type":"genericNode","position":{"x":2649.190603849412,"y":841.0466487848925},"data":{"type":"ChatOutput","node":{"template":{"_type":"Component","code":{"type":"code","required":true,"placeholder":"","list":false,"show":true,"multiline":true,"value":"from langflow.base.io.chat import ChatComponent\nfrom langflow.inputs import BoolInput\nfrom langflow.io import DropdownInput, MessageTextInput, Output\nfrom langflow.memory import store_message\nfrom langflow.schema.message import Message\nfrom langflow.utils.constants import MESSAGE_SENDER_AI, MESSAGE_SENDER_NAME_AI, MESSAGE_SENDER_USER\n\n\nclass ChatOutput(ChatComponent):\n display_name = \"Chat Output\"\n description = \"Display a chat message in the Playground.\"\n icon = \"ChatOutput\"\n name = \"ChatOutput\"\n\n inputs = [\n MessageTextInput(\n name=\"input_value\",\n display_name=\"Text\",\n info=\"Message to be passed as output.\",\n ),\n BoolInput(\n name=\"should_store_message\",\n display_name=\"Store Messages\",\n info=\"Store the message in the history.\",\n value=True,\n advanced=True,\n ),\n DropdownInput(\n name=\"sender\",\n display_name=\"Sender Type\",\n options=[MESSAGE_SENDER_AI, MESSAGE_SENDER_USER],\n value=MESSAGE_SENDER_AI,\n advanced=True,\n info=\"Type of sender.\",\n ),\n MessageTextInput(\n name=\"sender_name\",\n display_name=\"Sender Name\",\n info=\"Name of the sender.\",\n value=MESSAGE_SENDER_NAME_AI,\n advanced=True,\n ),\n MessageTextInput(\n name=\"session_id\",\n display_name=\"Session ID\",\n info=\"The session ID of the chat. If empty, the current session ID parameter will be used.\",\n advanced=True,\n ),\n MessageTextInput(\n name=\"data_template\",\n display_name=\"Data Template\",\n value=\"{text}\",\n advanced=True,\n info=\"Template to convert Data to Text. If left empty, it will be dynamically set to the Data's text key.\",\n ),\n ]\n outputs = [\n Output(display_name=\"Message\", name=\"message\", method=\"message_response\"),\n ]\n\n def message_response(self) -> Message:\n message = Message(\n text=self.input_value,\n sender=self.sender,\n sender_name=self.sender_name,\n session_id=self.session_id,\n )\n if (\n self.session_id\n and isinstance(message, Message)\n and isinstance(message.text, str)\n and self.should_store_message\n ):\n store_message(\n message,\n flow_id=self.graph.flow_id,\n )\n self.message.value = message\n\n self.status = message\n return message\n","fileTypes":[],"file_path":"","password":false,"name":"code","advanced":true,"dynamic":true,"info":"","load_from_db":false,"title_case":false},"data_template":{"trace_as_input":true,"trace_as_metadata":true,"load_from_db":false,"list":false,"required":false,"placeholder":"","show":true,"name":"data_template","value":"{text}","display_name":"Data Template","advanced":true,"input_types":["Message"],"dynamic":false,"info":"Template to convert Data to Text. If left empty, it will be dynamically set to the Data's text key.","title_case":false,"type":"str","_input_type":"MessageTextInput"},"input_value":{"trace_as_input":true,"trace_as_metadata":true,"load_from_db":false,"list":false,"required":false,"placeholder":"","show":true,"name":"input_value","value":"","display_name":"Text","advanced":false,"input_types":["Message"],"dynamic":false,"info":"Message to be passed as output.","title_case":false,"type":"str","_input_type":"MessageTextInput"},"sender":{"trace_as_metadata":true,"options":["Machine","User"],"combobox":false,"required":false,"placeholder":"","show":true,"name":"sender","value":"Machine","display_name":"Sender Type","advanced":true,"dynamic":false,"info":"Type of sender.","title_case":false,"type":"str","_input_type":"DropdownInput"},"sender_name":{"trace_as_input":true,"trace_as_metadata":true,"load_from_db":false,"list":false,"required":false,"placeholder":"","show":true,"name":"sender_name","value":"AI","display_name":"Sender Name","advanced":true,"input_types":["Message"],"dynamic":false,"info":"Name of the sender.","title_case":false,"type":"str","_input_type":"MessageTextInput"},"session_id":{"trace_as_input":true,"trace_as_metadata":true,"load_from_db":false,"list":false,"required":false,"placeholder":"","show":true,"name":"session_id","value":"","display_name":"Session ID","advanced":true,"input_types":["Message"],"dynamic":false,"info":"The session ID of the chat. If empty, the current session ID parameter will be used.","title_case":false,"type":"str","_input_type":"MessageTextInput"},"should_store_message":{"trace_as_metadata":true,"list":false,"required":false,"placeholder":"","show":true,"name":"should_store_message","value":true,"display_name":"Store Messages","advanced":true,"dynamic":false,"info":"Store the message in the history.","title_case":false,"type":"bool","_input_type":"BoolInput"}},"description":"Display a chat message in the Playground.","icon":"ChatOutput","base_classes":["Message"],"display_name":"Chat Output","documentation":"","custom_fields":{},"output_types":[],"pinned":false,"conditional_paths":[],"frozen":false,"outputs":[{"types":["Message"],"selected":"Message","name":"message","display_name":"Message","method":"message_response","value":"__UNDEFINED__","cache":true}],"field_order":["input_value","should_store_message","sender","sender_name","session_id","data_template"],"beta":false,"edited":false,"lf_version":"1.0.17"},"id":"ChatOutput-TSCup"},"selected":false,"width":384,"height":302,"positionAbsolute":{"x":2649.190603849412,"y":841.0466487848925},"dragging":false},{"id":"ChatInput-bcq6D","type":"genericNode","position":{"x":557.6262725075026,"y":724.8518930903978},"data":{"type":"ChatInput","node":{"template":{"_type":"Component","files":{"trace_as_metadata":true,"file_path":"","fileTypes":["txt","md","mdx","csv","json","yaml","yml","xml","html","htm","pdf","docx","py","sh","sql","js","ts","tsx","jpg","jpeg","png","bmp","image"],"list":true,"required":false,"placeholder":"","show":true,"name":"files","value":"","display_name":"Files","advanced":true,"dynamic":false,"info":"Files to be sent with the message.","title_case":false,"type":"file","_input_type":"FileInput"},"code":{"type":"code","required":true,"placeholder":"","list":false,"show":true,"multiline":true,"value":"from langflow.base.data.utils import IMG_FILE_TYPES, TEXT_FILE_TYPES\nfrom langflow.base.io.chat import ChatComponent\nfrom langflow.inputs import BoolInput\nfrom langflow.io import DropdownInput, FileInput, MessageTextInput, MultilineInput, Output\nfrom langflow.memory import store_message\nfrom langflow.schema.message import Message\nfrom langflow.utils.constants import MESSAGE_SENDER_AI, MESSAGE_SENDER_USER, MESSAGE_SENDER_NAME_USER\n\n\nclass ChatInput(ChatComponent):\n display_name = \"Chat Input\"\n description = \"Get chat inputs from the Playground.\"\n icon = \"ChatInput\"\n name = \"ChatInput\"\n\n inputs = [\n MultilineInput(\n name=\"input_value\",\n display_name=\"Text\",\n value=\"\",\n info=\"Message to be passed as input.\",\n ),\n BoolInput(\n name=\"should_store_message\",\n display_name=\"Store Messages\",\n info=\"Store the message in the history.\",\n value=True,\n advanced=True,\n ),\n DropdownInput(\n name=\"sender\",\n display_name=\"Sender Type\",\n options=[MESSAGE_SENDER_AI, MESSAGE_SENDER_USER],\n value=MESSAGE_SENDER_USER,\n info=\"Type of sender.\",\n advanced=True,\n ),\n MessageTextInput(\n name=\"sender_name\",\n display_name=\"Sender Name\",\n info=\"Name of the sender.\",\n value=MESSAGE_SENDER_NAME_USER,\n advanced=True,\n ),\n MessageTextInput(\n name=\"session_id\",\n display_name=\"Session ID\",\n info=\"The session ID of the chat. If empty, the current session ID parameter will be used.\",\n advanced=True,\n ),\n FileInput(\n name=\"files\",\n display_name=\"Files\",\n file_types=TEXT_FILE_TYPES + IMG_FILE_TYPES,\n info=\"Files to be sent with the message.\",\n advanced=True,\n is_list=True,\n ),\n ]\n outputs = [\n Output(display_name=\"Message\", name=\"message\", method=\"message_response\"),\n ]\n\n def message_response(self) -> Message:\n message = Message(\n text=self.input_value,\n sender=self.sender,\n sender_name=self.sender_name,\n session_id=self.session_id,\n files=self.files,\n )\n\n if (\n self.session_id\n and isinstance(message, Message)\n and isinstance(message.text, str)\n and self.should_store_message\n ):\n store_message(\n message,\n flow_id=self.graph.flow_id,\n )\n self.message.value = message\n\n self.status = message\n return message\n","fileTypes":[],"file_path":"","password":false,"name":"code","advanced":true,"dynamic":true,"info":"","load_from_db":false,"title_case":false},"input_value":{"trace_as_input":true,"multiline":true,"trace_as_metadata":true,"load_from_db":false,"list":false,"required":false,"placeholder":"","show":true,"name":"input_value","value":"list users","display_name":"Text","advanced":false,"input_types":["Message"],"dynamic":false,"info":"Message to be passed as input.","title_case":false,"type":"str","_input_type":"MultilineInput"},"sender":{"trace_as_metadata":true,"options":["Machine","User"],"combobox":false,"required":false,"placeholder":"","show":true,"name":"sender","value":"User","display_name":"Sender Type","advanced":true,"dynamic":false,"info":"Type of sender.","title_case":false,"type":"str","_input_type":"DropdownInput"},"sender_name":{"trace_as_input":true,"trace_as_metadata":true,"load_from_db":false,"list":false,"required":false,"placeholder":"","show":true,"name":"sender_name","value":"User","display_name":"Sender Name","advanced":true,"input_types":["Message"],"dynamic":false,"info":"Name of the sender.","title_case":false,"type":"str","_input_type":"MessageTextInput"},"session_id":{"trace_as_input":true,"trace_as_metadata":true,"load_from_db":false,"list":false,"required":false,"placeholder":"","show":true,"name":"session_id","value":"","display_name":"Session ID","advanced":true,"input_types":["Message"],"dynamic":false,"info":"The session ID of the chat. If empty, the current session ID parameter will be used.","title_case":false,"type":"str","_input_type":"MessageTextInput"},"should_store_message":{"trace_as_metadata":true,"list":false,"required":false,"placeholder":"","show":true,"name":"should_store_message","value":true,"display_name":"Store Messages","advanced":true,"dynamic":false,"info":"Store the message in the history.","title_case":false,"type":"bool","_input_type":"BoolInput"}},"description":"Get chat inputs from the Playground.","icon":"ChatInput","base_classes":["Message"],"display_name":"Chat Input","documentation":"","custom_fields":{},"output_types":[],"pinned":false,"conditional_paths":[],"frozen":false,"outputs":[{"types":["Message"],"selected":"Message","name":"message","display_name":"Message","method":"message_response","value":"__UNDEFINED__","cache":true}],"field_order":["input_value","should_store_message","sender","sender_name","session_id","files"],"beta":false,"edited":false,"lf_version":"1.0.17"},"id":"ChatInput-bcq6D"},"selected":false,"width":384,"height":302,"positionAbsolute":{"x":557.6262725075026,"y":724.8518930903978},"dragging":false},{"id":"ToolkitComponent-2lNG0","type":"genericNode","position":{"x":1731.8884789245508,"y":1378.7846304343796},"data":{"type":"ToolkitComponent","node":{"template":{"_type":"Component","tools":{"trace_as_metadata":true,"list":true,"required":false,"placeholder":"","show":true,"name":"tools","value":"","display_name":"Tools","advanced":false,"input_types":["Tool"],"dynamic":false,"info":"List of tools to combine.","title_case":false,"type":"other","_input_type":"HandleInput"},"code":{"type":"code","required":true,"placeholder":"","list":false,"show":true,"multiline":true,"value":"from typing import List\r\nfrom langflow.custom import Component\r\nfrom langflow.inputs import HandleInput, MessageTextInput\r\nfrom langflow.template import Output\r\nfrom langflow.field_typing import Tool, Embeddings\r\nfrom langchain.tools.base import BaseTool, StructuredTool\r\nfrom langflow.schema import Data\r\n\r\nclass ToolkitComponent(Component):\r\n display_name = \"Toolkit\"\r\n description = \"Combines multiple tools into a single list of tools.\"\r\n icon = \"pocket-knife\"\r\n\r\n inputs = [\r\n HandleInput(\r\n name=\"tools\",\r\n display_name=\"Tools\",\r\n input_types=[\"Tool\"],\r\n info=\"List of tools to combine.\",\r\n is_list=True,\r\n ),\r\n ]\r\n\r\n outputs = [\r\n Output(display_name=\"Tools\", name=\"generated_tools\", method=\"generate_toolkit\"),\r\n Output(display_name=\"Tool Data\", name=\"tool_data\", method=\"generate_tool_data\"),\r\n ]\r\n\r\n def generate_toolkit(self) -> List[BaseTool]:\r\n combined_tools = []\r\n name_count = {}\r\n for index, tool in enumerate(self.tools):\r\n self.log(f\"Processing tool {index}: {type(tool)}\")\r\n if isinstance(tool, (BaseTool, StructuredTool)):\r\n processed_tool = tool\r\n elif hasattr(tool, 'build_tool'):\r\n processed_tool = tool.build_tool()\r\n else:\r\n self.log(f\"Unsupported tool type: {type(tool)}. Attempting to process anyway.\")\r\n processed_tool = tool\r\n\r\n original_name = getattr(processed_tool, 'name', f\"UnnamedTool_{index}\")\r\n self.log(f\"Original tool name: {original_name}\")\r\n\r\n if original_name not in name_count:\r\n name_count[original_name] = 0\r\n final_name = original_name\r\n else:\r\n name_count[original_name] += 1\r\n final_name = f\"{original_name}_{name_count[original_name]}\"\r\n\r\n if hasattr(processed_tool, 'name'):\r\n processed_tool.name = final_name\r\n\r\n self.log(f\"Final tool name: {final_name}\")\r\n\r\n if isinstance(processed_tool, StructuredTool) and hasattr(processed_tool, 'args_schema'):\r\n processed_tool.args_schema.name = f\"{final_name}_Schema\"\r\n\r\n combined_tools.append(processed_tool)\r\n\r\n debug_info = \"\\n\".join([f\"Tool {i}: {getattr(tool, 'name', f'UnnamedTool_{i}')} (Original: {getattr(tool, '_original_name', 'N/A')}) - Type: {type(tool)}\" for i, tool in enumerate(combined_tools)])\r\n self.log(\"Final toolkit composition:\")\r\n self.log(debug_info)\r\n\r\n\r\n self.status = combined_tools\r\n return combined_tools\r\n\r\n def generate_tool_data(self) -> List[Data]:\r\n tool_data = []\r\n for tool in self.generate_toolkit():\r\n tool_data.append(Data(\r\n data={\r\n \"name\": getattr(tool, 'name', 'Unnamed Tool'),\r\n \"description\": getattr(tool, 'description', 'No description available')\r\n }\r\n ))\r\n return tool_data","fileTypes":[],"file_path":"","password":false,"name":"code","advanced":true,"dynamic":true,"info":"","load_from_db":false,"title_case":false}},"description":"Combines multiple tools into a single list of tools.","icon":"pocket-knife","base_classes":["BaseTool","Data"],"display_name":"Toolkit","documentation":"","custom_fields":{},"output_types":[],"pinned":false,"conditional_paths":[],"frozen":false,"outputs":[{"types":["BaseTool"],"selected":"BaseTool","name":"generated_tools","display_name":"Tools","method":"generate_toolkit","value":"__UNDEFINED__","cache":true},{"types":["Data"],"selected":"Data","name":"tool_data","display_name":"Tool Data","method":"generate_tool_data","value":"__UNDEFINED__","cache":true,"hidden":true}],"field_order":["tools"],"beta":false,"edited":true,"lf_version":"1.0.17"},"id":"ToolkitComponent-2lNG0"},"selected":false,"width":384,"height":292,"dragging":false,"positionAbsolute":{"x":1731.8884789245508,"y":1378.7846304343796}},{"id":"OpenAIModel-BJWIg","type":"genericNode","position":{"x":1718.9773974162958,"y":603.4642741725065},"data":{"type":"OpenAIModel","node":{"template":{"_type":"Component","api_key":{"load_from_db":true,"required":false,"placeholder":"","show":true,"name":"api_key","value":"","display_name":"OpenAI API Key","advanced":false,"input_types":["Message"],"dynamic":false,"info":"The OpenAI API Key to use for the OpenAI model.","title_case":false,"password":true,"type":"str","_input_type":"SecretStrInput"},"code":{"type":"code","required":true,"placeholder":"","list":false,"show":true,"multiline":true,"value":"import operator\nfrom functools import reduce\n\nfrom langflow.field_typing.range_spec import RangeSpec\nfrom langchain_openai import ChatOpenAI\nfrom pydantic.v1 import SecretStr\n\nfrom langflow.base.models.model import LCModelComponent\nfrom langflow.base.models.openai_constants import OPENAI_MODEL_NAMES\nfrom langflow.field_typing import LanguageModel\nfrom langflow.inputs import (\n BoolInput,\n DictInput,\n DropdownInput,\n FloatInput,\n IntInput,\n SecretStrInput,\n StrInput,\n)\n\n\nclass OpenAIModelComponent(LCModelComponent):\n display_name = \"OpenAI\"\n description = \"Generates text using OpenAI LLMs.\"\n icon = \"OpenAI\"\n name = \"OpenAIModel\"\n\n inputs = LCModelComponent._base_inputs + [\n IntInput(\n name=\"max_tokens\",\n display_name=\"Max Tokens\",\n advanced=True,\n info=\"The maximum number of tokens to generate. Set to 0 for unlimited tokens.\",\n range_spec=RangeSpec(min=0, max=128000),\n ),\n DictInput(name=\"model_kwargs\", display_name=\"Model Kwargs\", advanced=True),\n BoolInput(\n name=\"json_mode\",\n display_name=\"JSON Mode\",\n advanced=True,\n info=\"If True, it will output JSON regardless of passing a schema.\",\n ),\n DictInput(\n name=\"output_schema\",\n is_list=True,\n display_name=\"Schema\",\n advanced=True,\n info=\"The schema for the Output of the model. You must pass the word JSON in the prompt. If left blank, JSON mode will be disabled.\",\n ),\n DropdownInput(\n name=\"model_name\",\n display_name=\"Model Name\",\n advanced=False,\n options=OPENAI_MODEL_NAMES,\n value=OPENAI_MODEL_NAMES[0],\n ),\n StrInput(\n name=\"openai_api_base\",\n display_name=\"OpenAI API Base\",\n advanced=True,\n info=\"The base URL of the OpenAI API. Defaults to https://api.openai.com/v1. You can change this to use other APIs like JinaChat, LocalAI and Prem.\",\n ),\n SecretStrInput(\n name=\"api_key\",\n display_name=\"OpenAI API Key\",\n info=\"The OpenAI API Key to use for the OpenAI model.\",\n advanced=False,\n value=\"OPENAI_API_KEY\",\n ),\n FloatInput(name=\"temperature\", display_name=\"Temperature\", value=0.1),\n IntInput(\n name=\"seed\",\n display_name=\"Seed\",\n info=\"The seed controls the reproducibility of the job.\",\n advanced=True,\n value=1,\n ),\n ]\n\n def build_model(self) -> LanguageModel: # type: ignore[type-var]\n # self.output_schema is a list of dictionaries\n # let's convert it to a dictionary\n output_schema_dict: dict[str, str] = reduce(operator.ior, self.output_schema or {}, {})\n openai_api_key = self.api_key\n temperature = self.temperature\n model_name: str = self.model_name\n max_tokens = self.max_tokens\n model_kwargs = self.model_kwargs or {}\n openai_api_base = self.openai_api_base or \"https://api.openai.com/v1\"\n json_mode = bool(output_schema_dict) or self.json_mode\n seed = self.seed\n\n if openai_api_key:\n api_key = SecretStr(openai_api_key)\n else:\n api_key = None\n output = ChatOpenAI(\n max_tokens=max_tokens or None,\n model_kwargs=model_kwargs,\n model=model_name,\n base_url=openai_api_base,\n api_key=api_key,\n temperature=temperature if temperature is not None else 0.1,\n seed=seed,\n )\n if json_mode:\n if output_schema_dict:\n output = output.with_structured_output(schema=output_schema_dict, method=\"json_mode\") # type: ignore\n else:\n output = output.bind(response_format={\"type\": \"json_object\"}) # type: ignore\n\n return output # type: ignore\n\n def _get_exception_message(self, e: Exception):\n \"\"\"\n Get a message from an OpenAI exception.\n\n Args:\n exception (Exception): The exception to get the message from.\n\n Returns:\n str: The message from the exception.\n \"\"\"\n\n try:\n from openai import BadRequestError\n except ImportError:\n return\n if isinstance(e, BadRequestError):\n message = e.body.get(\"message\") # type: ignore\n if message:\n return message\n return\n","fileTypes":[],"file_path":"","password":false,"name":"code","advanced":true,"dynamic":true,"info":"","load_from_db":false,"title_case":false},"input_value":{"trace_as_input":true,"trace_as_metadata":true,"load_from_db":false,"list":false,"required":false,"placeholder":"","show":true,"name":"input_value","value":"","display_name":"Input","advanced":true,"input_types":["Message"],"dynamic":false,"info":"","title_case":false,"type":"str","_input_type":"MessageInput"},"json_mode":{"trace_as_metadata":true,"list":false,"required":false,"placeholder":"","show":true,"name":"json_mode","value":false,"display_name":"JSON Mode","advanced":true,"dynamic":false,"info":"If True, it will output JSON regardless of passing a schema.","title_case":false,"type":"bool","_input_type":"BoolInput"},"max_tokens":{"trace_as_metadata":true,"range_spec":{"step_type":"float","min":0,"max":128000,"step":0.1},"list":false,"required":false,"placeholder":"","show":true,"name":"max_tokens","value":"","display_name":"Max Tokens","advanced":true,"dynamic":false,"info":"The maximum number of tokens to generate. Set to 0 for unlimited tokens.","title_case":false,"type":"int","_input_type":"IntInput"},"model_kwargs":{"trace_as_input":true,"list":false,"required":false,"placeholder":"","show":true,"name":"model_kwargs","value":{},"display_name":"Model Kwargs","advanced":true,"dynamic":false,"info":"","title_case":false,"type":"dict","_input_type":"DictInput"},"model_name":{"trace_as_metadata":true,"options":["gpt-4o-mini","gpt-4o","gpt-4-turbo","gpt-4-turbo-preview","gpt-4","gpt-3.5-turbo","gpt-3.5-turbo-0125"],"combobox":false,"required":false,"placeholder":"","show":true,"name":"model_name","value":"gpt-4o","display_name":"Model Name","advanced":false,"dynamic":false,"info":"","title_case":false,"type":"str","_input_type":"DropdownInput"},"openai_api_base":{"trace_as_metadata":true,"load_from_db":false,"list":false,"required":false,"placeholder":"","show":true,"name":"openai_api_base","value":"","display_name":"OpenAI API Base","advanced":true,"dynamic":false,"info":"The base URL of the OpenAI API. Defaults to https://api.openai.com/v1. You can change this to use other APIs like JinaChat, LocalAI and Prem.","title_case":false,"type":"str","_input_type":"StrInput"},"output_schema":{"trace_as_input":true,"list":true,"required":false,"placeholder":"","show":true,"name":"output_schema","value":{},"display_name":"Schema","advanced":true,"dynamic":false,"info":"The schema for the Output of the model. You must pass the word JSON in the prompt. If left blank, JSON mode will be disabled.","title_case":false,"type":"dict","_input_type":"DictInput"},"seed":{"trace_as_metadata":true,"list":false,"required":false,"placeholder":"","show":true,"name":"seed","value":1,"display_name":"Seed","advanced":true,"dynamic":false,"info":"The seed controls the reproducibility of the job.","title_case":false,"type":"int","_input_type":"IntInput"},"stream":{"trace_as_metadata":true,"list":false,"required":false,"placeholder":"","show":true,"name":"stream","value":false,"display_name":"Stream","advanced":true,"dynamic":false,"info":"Stream the response from the model. Streaming works only in Chat.","title_case":false,"type":"bool","_input_type":"BoolInput"},"system_message":{"trace_as_input":true,"trace_as_metadata":true,"load_from_db":false,"list":false,"required":false,"placeholder":"","show":true,"name":"system_message","value":"","display_name":"System Message","advanced":true,"input_types":["Message"],"dynamic":false,"info":"System message to pass to the model.","title_case":false,"type":"str","_input_type":"MessageTextInput"},"temperature":{"trace_as_metadata":true,"list":false,"required":false,"placeholder":"","show":true,"name":"temperature","value":"0.2","display_name":"Temperature","advanced":true,"dynamic":false,"info":"","title_case":false,"type":"float","_input_type":"FloatInput"}},"description":"Generates text using OpenAI LLMs.","icon":"OpenAI","base_classes":["LanguageModel","Message"],"display_name":"OpenAI","documentation":"","custom_fields":{},"output_types":[],"pinned":false,"conditional_paths":[],"frozen":false,"outputs":[{"types":["Message"],"selected":"Message","name":"text_output","display_name":"Text","method":"text_response","value":"__UNDEFINED__","cache":true},{"types":["LanguageModel"],"selected":"LanguageModel","name":"model_output","display_name":"Language Model","method":"build_model","value":"__UNDEFINED__","cache":true}],"field_order":["input_value","system_message","stream","max_tokens","model_kwargs","json_mode","output_schema","model_name","openai_api_base","api_key","temperature","seed"],"beta":false,"edited":false,"lf_version":"1.0.17"},"id":"OpenAIModel-BJWIg"},"selected":false,"width":384,"height":433,"positionAbsolute":{"x":1718.9773974162958,"y":603.4642741725065},"dragging":false},{"id":"Memory-CTQWu","type":"genericNode","position":{"x":1240.7186213296432,"y":1059.5754404393747},"data":{"type":"Memory","node":{"template":{"_type":"Component","memory":{"trace_as_metadata":true,"list":false,"required":false,"placeholder":"","show":true,"name":"memory","value":"","display_name":"External Memory","advanced":true,"input_types":["BaseChatMessageHistory"],"dynamic":false,"info":"Retrieve messages from an external memory. If empty, it will use the Langflow tables.","title_case":false,"type":"other","_input_type":"HandleInput"},"code":{"type":"code","required":true,"placeholder":"","list":false,"show":true,"multiline":true,"value":"from langchain.memory import ConversationBufferMemory\n\nfrom langflow.custom import Component\nfrom langflow.field_typing import BaseChatMemory\nfrom langflow.helpers.data import data_to_text\nfrom langflow.inputs import HandleInput\nfrom langflow.io import DropdownInput, IntInput, MessageTextInput, MultilineInput, Output\nfrom langflow.memory import LCBuiltinChatMemory, get_messages\nfrom langflow.schema import Data\nfrom langflow.schema.message import Message\nfrom langflow.utils.constants import MESSAGE_SENDER_AI, MESSAGE_SENDER_USER\n\n\nclass MemoryComponent(Component):\n display_name = \"Chat Memory\"\n description = \"Retrieves stored chat messages from Langflow tables or an external memory.\"\n icon = \"message-square-more\"\n name = \"Memory\"\n\n inputs = [\n HandleInput(\n name=\"memory\",\n display_name=\"External Memory\",\n input_types=[\"BaseChatMessageHistory\"],\n info=\"Retrieve messages from an external memory. If empty, it will use the Langflow tables.\",\n ),\n DropdownInput(\n name=\"sender\",\n display_name=\"Sender Type\",\n options=[MESSAGE_SENDER_AI, MESSAGE_SENDER_USER, \"Machine and User\"],\n value=\"Machine and User\",\n info=\"Filter by sender type.\",\n advanced=True,\n ),\n MessageTextInput(\n name=\"sender_name\",\n display_name=\"Sender Name\",\n info=\"Filter by sender name.\",\n advanced=True,\n ),\n IntInput(\n name=\"n_messages\",\n display_name=\"Number of Messages\",\n value=100,\n info=\"Number of messages to retrieve.\",\n advanced=True,\n ),\n MessageTextInput(\n name=\"session_id\",\n display_name=\"Session ID\",\n info=\"The session ID of the chat. If empty, the current session ID parameter will be used.\",\n advanced=True,\n ),\n DropdownInput(\n name=\"order\",\n display_name=\"Order\",\n options=[\"Ascending\", \"Descending\"],\n value=\"Ascending\",\n info=\"Order of the messages.\",\n advanced=True,\n ),\n MultilineInput(\n name=\"template\",\n display_name=\"Template\",\n info=\"The template to use for formatting the data. It can contain the keys {text}, {sender} or any other key in the message data.\",\n value=\"{sender_name}: {text}\",\n advanced=True,\n ),\n ]\n\n outputs = [\n Output(display_name=\"Messages (Data)\", name=\"messages\", method=\"retrieve_messages\"),\n Output(display_name=\"Messages (Text)\", name=\"messages_text\", method=\"retrieve_messages_as_text\"),\n Output(display_name=\"Memory\", name=\"lc_memory\", method=\"build_lc_memory\"),\n ]\n\n def retrieve_messages(self) -> Data:\n sender = self.sender\n sender_name = self.sender_name\n session_id = self.session_id\n n_messages = self.n_messages\n order = \"DESC\" if self.order == \"Descending\" else \"ASC\"\n\n if sender == \"Machine and User\":\n sender = None\n\n if self.memory:\n # override session_id\n self.memory.session_id = session_id\n\n stored = self.memory.messages\n # langchain memories are supposed to return messages in ascending order\n if order == \"DESC\":\n stored = stored[::-1]\n if n_messages:\n stored = stored[:n_messages]\n stored = [Message.from_lc_message(m) for m in stored]\n if sender:\n expected_type = MESSAGE_SENDER_AI if sender == MESSAGE_SENDER_AI else MESSAGE_SENDER_USER\n stored = [m for m in stored if m.type == expected_type]\n else:\n stored = get_messages(\n sender=sender,\n sender_name=sender_name,\n session_id=session_id,\n limit=n_messages,\n order=order,\n )\n self.status = stored\n return stored\n\n def retrieve_messages_as_text(self) -> Message:\n stored_text = data_to_text(self.template, self.retrieve_messages())\n self.status = stored_text\n return Message(text=stored_text)\n\n def build_lc_memory(self) -> BaseChatMemory:\n if self.memory:\n chat_memory = self.memory\n else:\n chat_memory = LCBuiltinChatMemory(flow_id=self.flow_id, session_id=self.session_id)\n return ConversationBufferMemory(chat_memory=chat_memory)\n","fileTypes":[],"file_path":"","password":false,"name":"code","advanced":true,"dynamic":true,"info":"","load_from_db":false,"title_case":false},"n_messages":{"trace_as_metadata":true,"list":false,"required":false,"placeholder":"","show":true,"name":"n_messages","value":100,"display_name":"Number of Messages","advanced":true,"dynamic":false,"info":"Number of messages to retrieve.","title_case":false,"type":"int","_input_type":"IntInput"},"order":{"trace_as_metadata":true,"options":["Ascending","Descending"],"combobox":false,"required":false,"placeholder":"","show":true,"name":"order","value":"Ascending","display_name":"Order","advanced":true,"dynamic":false,"info":"Order of the messages.","title_case":false,"type":"str","_input_type":"DropdownInput"},"sender":{"trace_as_metadata":true,"options":["Machine","User","Machine and User"],"combobox":false,"required":false,"placeholder":"","show":true,"name":"sender","value":"Machine and User","display_name":"Sender Type","advanced":true,"dynamic":false,"info":"Filter by sender type.","title_case":false,"type":"str","_input_type":"DropdownInput"},"sender_name":{"trace_as_input":true,"trace_as_metadata":true,"load_from_db":false,"list":false,"required":false,"placeholder":"","show":true,"name":"sender_name","value":"","display_name":"Sender Name","advanced":true,"input_types":["Message"],"dynamic":false,"info":"Filter by sender name.","title_case":false,"type":"str","_input_type":"MessageTextInput"},"session_id":{"trace_as_input":true,"trace_as_metadata":true,"load_from_db":false,"list":false,"required":false,"placeholder":"","show":true,"name":"session_id","value":"","display_name":"Session ID","advanced":true,"input_types":["Message"],"dynamic":false,"info":"The session ID of the chat. If empty, the current session ID parameter will be used.","title_case":false,"type":"str","_input_type":"MessageTextInput"},"template":{"trace_as_input":true,"multiline":true,"trace_as_metadata":true,"load_from_db":false,"list":false,"required":false,"placeholder":"","show":true,"name":"template","value":"{sender_name}: {text}","display_name":"Template","advanced":true,"input_types":["Message"],"dynamic":false,"info":"The template to use for formatting the data. It can contain the keys {text}, {sender} or any other key in the message data.","title_case":false,"type":"str","_input_type":"MultilineInput"}},"description":"Retrieves stored chat messages from Langflow tables or an external memory.","icon":"message-square-more","base_classes":["BaseChatMemory","Data","Message"],"display_name":"Chat Memory","documentation":"","custom_fields":{},"output_types":[],"pinned":false,"conditional_paths":[],"frozen":false,"outputs":[{"types":["Data"],"selected":"Data","name":"messages","display_name":"Messages (Data)","method":"retrieve_messages","value":"__UNDEFINED__","cache":true},{"types":["Message"],"selected":"Message","name":"messages_text","display_name":"Messages (Text)","method":"retrieve_messages_as_text","value":"__UNDEFINED__","cache":true,"hidden":true},{"types":["BaseChatMemory"],"selected":"BaseChatMemory","name":"lc_memory","display_name":"Memory","method":"build_lc_memory","value":"__UNDEFINED__","cache":true,"hidden":true}],"field_order":["memory","sender","sender_name","n_messages","session_id","order","template"],"beta":false,"edited":false,"lf_version":"1.0.17"},"id":"Memory-CTQWu"},"selected":false,"width":384,"height":244,"dragging":false,"positionAbsolute":{"x":1240.7186213296432,"y":1059.5754404393747}},{"id":"Prompt-0dWZu","type":"genericNode","position":{"x":1227.4862876736101,"y":616.3826667128244},"data":{"type":"Prompt","node":{"template":{"_type":"Component","code":{"type":"code","required":true,"placeholder":"","list":false,"show":true,"multiline":true,"value":"from langflow.base.prompts.api_utils import process_prompt_template\nfrom langflow.custom import Component\nfrom langflow.inputs.inputs import DefaultPromptField\nfrom langflow.io import Output, PromptInput\nfrom langflow.schema.message import Message\nfrom langflow.template.utils import update_template_values\n\n\nclass PromptComponent(Component):\n display_name: str = \"Prompt\"\n description: str = \"Create a prompt template with dynamic variables.\"\n icon = \"prompts\"\n trace_type = \"prompt\"\n name = \"Prompt\"\n\n inputs = [\n PromptInput(name=\"template\", display_name=\"Template\"),\n ]\n\n outputs = [\n Output(display_name=\"Prompt Message\", name=\"prompt\", method=\"build_prompt\"),\n ]\n\n async def build_prompt(\n self,\n ) -> Message:\n prompt = Message.from_template_and_variables(**self._attributes)\n self.status = prompt.text\n return prompt\n\n def _update_template(self, frontend_node: dict):\n prompt_template = frontend_node[\"template\"][\"template\"][\"value\"]\n custom_fields = frontend_node[\"custom_fields\"]\n frontend_node_template = frontend_node[\"template\"]\n _ = process_prompt_template(\n template=prompt_template,\n name=\"template\",\n custom_fields=custom_fields,\n frontend_node_template=frontend_node_template,\n )\n return frontend_node\n\n def post_code_processing(self, new_frontend_node: dict, current_frontend_node: dict):\n \"\"\"\n This function is called after the code validation is done.\n \"\"\"\n frontend_node = super().post_code_processing(new_frontend_node, current_frontend_node)\n template = frontend_node[\"template\"][\"template\"][\"value\"]\n # Kept it duplicated for backwards compatibility\n _ = process_prompt_template(\n template=template,\n name=\"template\",\n custom_fields=frontend_node[\"custom_fields\"],\n frontend_node_template=frontend_node[\"template\"],\n )\n # Now that template is updated, we need to grab any values that were set in the current_frontend_node\n # and update the frontend_node with those values\n update_template_values(new_template=frontend_node, previous_template=current_frontend_node[\"template\"])\n return frontend_node\n\n def _get_fallback_input(self, **kwargs):\n return DefaultPromptField(**kwargs)\n","fileTypes":[],"file_path":"","password":false,"name":"code","advanced":true,"dynamic":true,"info":"","load_from_db":false,"title_case":false},"template":{"trace_as_input":true,"list":false,"required":false,"placeholder":"","show":true,"name":"template","value":"\nYou are a Notion Agent, an AI assistant designed to help users interact with their Notion workspace. Your role is to understand user requests, utilize the appropriate Notion tools to fulfill these requests, and communicate clearly with the user throughout the process.\n\nGeneral Guidelines:\n\n1. Carefully analyze each user request to determine which tool(s) you need to use.\n\n2. Before using any tool, ensure you have all the necessary information. If you need more details, ask the user clear and concise questions.\n\n3. When using a tool, provide a brief explanation to the user about what you're doing and why.\n\n4. After using a tool, interpret the results for the user in a clear, concise manner.\n\n5. If a task requires multiple steps, outline your plan to the user before proceeding.\n\n6. If you encounter an error or limitation, explain it to the user and suggest possible solutions or alternative approaches.\n\n7. Always maintain a helpful and professional tone in your interactions.\n\n8. Be proactive in offering suggestions or alternatives if the user's initial request can't be fulfilled exactly as stated.\n\n9. When providing information or results, focus on relevance and clarity. Summarize when necessary, but provide details when they're important.\n\n10. If a user's request is unclear or could be interpreted in multiple ways, ask for clarification before proceeding.\n\n11. After completing a task, summarize what was accomplished and suggest any relevant next steps or additional actions the user might want to take.\n\n12. If a user asks about capabilities you don't have or tools you can't access, clearly explain your limitations and suggest alternative ways to assist if possible.\n\nRemember, your primary goal is to assist the user effectively with their Notion-related tasks using the provided tools. Always strive for clarity, accuracy, and helpfulness in your interactions. Adapt your communication style to the user's level of technical understanding and familiarity with Notion.\n\nNow, you're ready to assist the user\n\nToday is: {CURRENT_DATE}\n","display_name":"Template","advanced":false,"dynamic":false,"info":"","title_case":false,"type":"prompt","_input_type":"PromptInput"},"CURRENT_DATE":{"field_type":"str","required":false,"placeholder":"","list":false,"show":true,"multiline":true,"value":"","fileTypes":[],"file_path":"","password":false,"name":"CURRENT_DATE","display_name":"CURRENT_DATE","advanced":false,"input_types":["Message","Text"],"dynamic":false,"info":"","load_from_db":false,"title_case":false,"type":"str"}},"description":"Create a prompt template with dynamic variables.","icon":"prompts","is_input":null,"is_output":null,"is_composition":null,"base_classes":["Message"],"name":"","display_name":"Prompt","documentation":"","custom_fields":{"template":["CURRENT_DATE"]},"output_types":[],"full_path":null,"pinned":false,"conditional_paths":[],"frozen":false,"outputs":[{"types":["Message"],"selected":"Message","name":"prompt","hidden":null,"display_name":"Prompt Message","method":"build_prompt","value":"__UNDEFINED__","cache":true}],"field_order":["template"],"beta":false,"error":null,"edited":false,"lf_version":"1.0.17"},"id":"Prompt-0dWZu"},"selected":false,"width":384,"height":416,"positionAbsolute":{"x":1227.4862876736101,"y":616.3826667128244},"dragging":false},{"id":"CurrentDateComponent-NSNQ8","type":"genericNode","position":{"x":1092.5108512311297,"y":868.3249850335523},"data":{"type":"CurrentDateComponent","node":{"template":{"_type":"Component","code":{"type":"code","required":true,"placeholder":"","list":false,"show":true,"multiline":true,"value":"from datetime import datetime\r\nfrom zoneinfo import ZoneInfo\r\nfrom typing import List\r\n\r\nfrom langflow.custom import Component\r\nfrom langflow.io import DropdownInput, Output\r\nfrom langflow.schema.message import Message\r\n\r\nclass CurrentDateComponent(Component):\r\n display_name = \"Current Date 🕰️\"\r\n description = \"Returns the current date and time in the selected timezone.\"\r\n icon = \"clock\"\r\n\r\n inputs = [\r\n DropdownInput(\r\n name=\"timezone\",\r\n display_name=\"Timezone\",\r\n options=[\r\n \"UTC\",\r\n \"US/Eastern\",\r\n \"US/Central\",\r\n \"US/Mountain\",\r\n \"US/Pacific\",\r\n \"Europe/London\",\r\n \"Europe/Paris\",\r\n \"Asia/Tokyo\",\r\n \"Australia/Sydney\",\r\n \"America/Sao_Paulo\",\r\n \"America/Cuiaba\",\r\n ],\r\n value=\"UTC\",\r\n info=\"Select the timezone for the current date and time.\",\r\n ),\r\n ]\r\n\r\n outputs = [\r\n Output(display_name=\"Current Date\", name=\"current_date\", method=\"get_current_date\"),\r\n ]\r\n\r\n def get_current_date(self) -> Message:\r\n try:\r\n tz = ZoneInfo(self.timezone)\r\n current_date = datetime.now(tz).strftime(\"%Y-%m-%d %H:%M:%S %Z\")\r\n result = f\"Current date and time in {self.timezone}: {current_date}\"\r\n self.status = result\r\n return Message(text=result)\r\n except Exception as e:\r\n error_message = f\"Error: {str(e)}\"\r\n self.status = error_message\r\n return Message(text=error_message)","fileTypes":[],"file_path":"","password":false,"name":"code","advanced":true,"dynamic":true,"info":"","load_from_db":false,"title_case":false},"timezone":{"trace_as_metadata":true,"options":["UTC","US/Eastern","US/Central","US/Mountain","US/Pacific","Europe/London","Europe/Paris","Asia/Tokyo","Australia/Sydney","America/Sao_Paulo","America/Cuiaba"],"combobox":false,"required":false,"placeholder":"","show":true,"name":"timezone","value":"UTC","display_name":"Timezone","advanced":false,"dynamic":false,"info":"Select the timezone for the current date and time.","title_case":false,"type":"str","_input_type":"DropdownInput"}},"description":"Returns the current date and time in the selected timezone.","icon":"clock","base_classes":["Message"],"display_name":"Current Date","documentation":"","custom_fields":{},"output_types":[],"pinned":false,"conditional_paths":[],"frozen":false,"outputs":[{"types":["Message"],"selected":"Message","name":"current_date","display_name":"Current Date","method":"get_current_date","value":"__UNDEFINED__","cache":true}],"field_order":["timezone"],"beta":false,"edited":true,"official":false,"lf_version":"1.0.17"},"id":"CurrentDateComponent-NSNQ8","showNode":false},"selected":false,"width":96,"height":96,"dragging":false,"positionAbsolute":{"x":1092.5108512311297,"y":868.3249850335523}}],"edges":[{"source":"ChatInput-bcq6D","target":"ToolCallingAgent-50Gcd","sourceHandle":"{œdataTypeœ:œChatInputœ,œidœ:œChatInput-bcq6Dœ,œnameœ:œmessageœ,œoutput_typesœ:[œMessageœ]}","targetHandle":"{œfieldNameœ:œinput_valueœ,œidœ:œToolCallingAgent-50Gcdœ,œinputTypesœ:[œMessageœ],œtypeœ:œstrœ}","id":"reactflow__edge-ChatInput-bcq6D{œdataTypeœ:œChatInputœ,œidœ:œChatInput-bcq6Dœ,œnameœ:œmessageœ,œoutput_typesœ:[œMessageœ]}-ToolCallingAgent-50Gcd{œfieldNameœ:œinput_valueœ,œidœ:œToolCallingAgent-50Gcdœ,œinputTypesœ:[œMessageœ],œtypeœ:œstrœ}","data":{"targetHandle":{"fieldName":"input_value","id":"ToolCallingAgent-50Gcd","inputTypes":["Message"],"type":"str"},"sourceHandle":{"dataType":"ChatInput","id":"ChatInput-bcq6D","name":"message","output_types":["Message"]}},"selected":false,"className":""},{"source":"ToolCallingAgent-50Gcd","target":"ChatOutput-TSCup","sourceHandle":"{œdataTypeœ:œToolCallingAgentœ,œidœ:œToolCallingAgent-50Gcdœ,œnameœ:œresponseœ,œoutput_typesœ:[œMessageœ]}","targetHandle":"{œfieldNameœ:œinput_valueœ,œidœ:œChatOutput-TSCupœ,œinputTypesœ:[œMessageœ],œtypeœ:œstrœ}","id":"reactflow__edge-ToolCallingAgent-50Gcd{œdataTypeœ:œToolCallingAgentœ,œidœ:œToolCallingAgent-50Gcdœ,œnameœ:œresponseœ,œoutput_typesœ:[œMessageœ]}-ChatOutput-TSCup{œfieldNameœ:œinput_valueœ,œidœ:œChatOutput-TSCupœ,œinputTypesœ:[œMessageœ],œtypeœ:œstrœ}","data":{"targetHandle":{"fieldName":"input_value","id":"ChatOutput-TSCup","inputTypes":["Message"],"type":"str"},"sourceHandle":{"dataType":"ToolCallingAgent","id":"ToolCallingAgent-50Gcd","name":"response","output_types":["Message"]}},"selected":false,"className":""},{"source":"ToolkitComponent-2lNG0","target":"ToolCallingAgent-50Gcd","sourceHandle":"{œdataTypeœ:œToolkitComponentœ,œidœ:œToolkitComponent-2lNG0œ,œnameœ:œgenerated_toolsœ,œoutput_typesœ:[œBaseToolœ]}","targetHandle":"{œfieldNameœ:œtoolsœ,œidœ:œToolCallingAgent-50Gcdœ,œinputTypesœ:[œToolœ,œBaseToolœ],œtypeœ:œotherœ}","id":"reactflow__edge-ToolkitComponent-2lNG0{œdataTypeœ:œToolkitComponentœ,œidœ:œToolkitComponent-2lNG0œ,œnameœ:œgenerated_toolsœ,œoutput_typesœ:[œBaseToolœ]}-ToolCallingAgent-50Gcd{œfieldNameœ:œtoolsœ,œidœ:œToolCallingAgent-50Gcdœ,œinputTypesœ:[œToolœ,œBaseToolœ],œtypeœ:œotherœ}","data":{"targetHandle":{"fieldName":"tools","id":"ToolCallingAgent-50Gcd","inputTypes":["Tool","BaseTool"],"type":"other"},"sourceHandle":{"dataType":"ToolkitComponent","id":"ToolkitComponent-2lNG0","name":"generated_tools","output_types":["BaseTool"]}},"selected":false,"className":""},{"source":"NotionPageUpdate-6FyYd","sourceHandle":"{œdataTypeœ:œNotionPageUpdateœ,œidœ:œNotionPageUpdate-6FyYdœ,œnameœ:œexample_tool_outputœ,œoutput_typesœ:[œToolœ]}","target":"ToolkitComponent-2lNG0","targetHandle":"{œfieldNameœ:œtoolsœ,œidœ:œToolkitComponent-2lNG0œ,œinputTypesœ:[œToolœ],œtypeœ:œotherœ}","data":{"targetHandle":{"fieldName":"tools","id":"ToolkitComponent-2lNG0","inputTypes":["Tool"],"type":"other"},"sourceHandle":{"dataType":"NotionPageUpdate","id":"NotionPageUpdate-6FyYd","name":"example_tool_output","output_types":["Tool"]}},"id":"reactflow__edge-NotionPageUpdate-6FyYd{œdataTypeœ:œNotionPageUpdateœ,œidœ:œNotionPageUpdate-6FyYdœ,œnameœ:œexample_tool_outputœ,œoutput_typesœ:[œToolœ]}-ToolkitComponent-2lNG0{œfieldNameœ:œtoolsœ,œidœ:œToolkitComponent-2lNG0œ,œinputTypesœ:[œToolœ],œtypeœ:œotherœ}","className":"","selected":false},{"source":"NotionPageCreator-6SCB5","sourceHandle":"{œdataTypeœ:œNotionPageCreatorœ,œidœ:œNotionPageCreator-6SCB5œ,œnameœ:œexample_tool_outputœ,œoutput_typesœ:[œToolœ]}","target":"ToolkitComponent-2lNG0","targetHandle":"{œfieldNameœ:œtoolsœ,œidœ:œToolkitComponent-2lNG0œ,œinputTypesœ:[œToolœ],œtypeœ:œotherœ}","data":{"targetHandle":{"fieldName":"tools","id":"ToolkitComponent-2lNG0","inputTypes":["Tool"],"type":"other"},"sourceHandle":{"dataType":"NotionPageCreator","id":"NotionPageCreator-6SCB5","name":"example_tool_output","output_types":["Tool"]}},"id":"reactflow__edge-NotionPageCreator-6SCB5{œdataTypeœ:œNotionPageCreatorœ,œidœ:œNotionPageCreator-6SCB5œ,œnameœ:œexample_tool_outputœ,œoutput_typesœ:[œToolœ]}-ToolkitComponent-2lNG0{œfieldNameœ:œtoolsœ,œidœ:œToolkitComponent-2lNG0œ,œinputTypesœ:[œToolœ],œtypeœ:œotherœ}","className":"","selected":false},{"source":"AddContentToPage-ZezUn","sourceHandle":"{œdataTypeœ:œAddContentToPageœ,œidœ:œAddContentToPage-ZezUnœ,œnameœ:œexample_tool_outputœ,œoutput_typesœ:[œToolœ]}","target":"ToolkitComponent-2lNG0","targetHandle":"{œfieldNameœ:œtoolsœ,œidœ:œToolkitComponent-2lNG0œ,œinputTypesœ:[œToolœ],œtypeœ:œotherœ}","data":{"targetHandle":{"fieldName":"tools","id":"ToolkitComponent-2lNG0","inputTypes":["Tool"],"type":"other"},"sourceHandle":{"dataType":"AddContentToPage","id":"AddContentToPage-ZezUn","name":"example_tool_output","output_types":["Tool"]}},"id":"reactflow__edge-AddContentToPage-ZezUn{œdataTypeœ:œAddContentToPageœ,œidœ:œAddContentToPage-ZezUnœ,œnameœ:œexample_tool_outputœ,œoutput_typesœ:[œToolœ]}-ToolkitComponent-2lNG0{œfieldNameœ:œtoolsœ,œidœ:œToolkitComponent-2lNG0œ,œinputTypesœ:[œToolœ],œtypeœ:œotherœ}","className":"","selected":false},{"source":"NotionDatabaseProperties-aeWil","sourceHandle":"{œdataTypeœ:œNotionDatabasePropertiesœ,œidœ:œNotionDatabaseProperties-aeWilœ,œnameœ:œexample_tool_outputœ,œoutput_typesœ:[œToolœ]}","target":"ToolkitComponent-2lNG0","targetHandle":"{œfieldNameœ:œtoolsœ,œidœ:œToolkitComponent-2lNG0œ,œinputTypesœ:[œToolœ],œtypeœ:œotherœ}","data":{"targetHandle":{"fieldName":"tools","id":"ToolkitComponent-2lNG0","inputTypes":["Tool"],"type":"other"},"sourceHandle":{"dataType":"NotionDatabaseProperties","id":"NotionDatabaseProperties-aeWil","name":"example_tool_output","output_types":["Tool"]}},"id":"reactflow__edge-NotionDatabaseProperties-aeWil{œdataTypeœ:œNotionDatabasePropertiesœ,œidœ:œNotionDatabaseProperties-aeWilœ,œnameœ:œexample_tool_outputœ,œoutput_typesœ:[œToolœ]}-ToolkitComponent-2lNG0{œfieldNameœ:œtoolsœ,œidœ:œToolkitComponent-2lNG0œ,œinputTypesœ:[œToolœ],œtypeœ:œotherœ}","className":"","selected":false},{"source":"NotionListPages-znA3w","sourceHandle":"{œdataTypeœ:œNotionListPagesœ,œidœ:œNotionListPages-znA3wœ,œnameœ:œexample_tool_outputœ,œoutput_typesœ:[œToolœ]}","target":"ToolkitComponent-2lNG0","targetHandle":"{œfieldNameœ:œtoolsœ,œidœ:œToolkitComponent-2lNG0œ,œinputTypesœ:[œToolœ],œtypeœ:œotherœ}","data":{"targetHandle":{"fieldName":"tools","id":"ToolkitComponent-2lNG0","inputTypes":["Tool"],"type":"other"},"sourceHandle":{"dataType":"NotionListPages","id":"NotionListPages-znA3w","name":"example_tool_output","output_types":["Tool"]}},"id":"reactflow__edge-NotionListPages-znA3w{œdataTypeœ:œNotionListPagesœ,œidœ:œNotionListPages-znA3wœ,œnameœ:œexample_tool_outputœ,œoutput_typesœ:[œToolœ]}-ToolkitComponent-2lNG0{œfieldNameœ:œtoolsœ,œidœ:œToolkitComponent-2lNG0œ,œinputTypesœ:[œToolœ],œtypeœ:œotherœ}","className":"","selected":false},{"source":"NotionPageContent-SlL21","sourceHandle":"{œdataTypeœ:œNotionPageContentœ,œidœ:œNotionPageContent-SlL21œ,œnameœ:œexample_tool_outputœ,œoutput_typesœ:[œToolœ]}","target":"ToolkitComponent-2lNG0","targetHandle":"{œfieldNameœ:œtoolsœ,œidœ:œToolkitComponent-2lNG0œ,œinputTypesœ:[œToolœ],œtypeœ:œotherœ}","data":{"targetHandle":{"fieldName":"tools","id":"ToolkitComponent-2lNG0","inputTypes":["Tool"],"type":"other"},"sourceHandle":{"dataType":"NotionPageContent","id":"NotionPageContent-SlL21","name":"example_tool_output","output_types":["Tool"]}},"id":"reactflow__edge-NotionPageContent-SlL21{œdataTypeœ:œNotionPageContentœ,œidœ:œNotionPageContent-SlL21œ,œnameœ:œexample_tool_outputœ,œoutput_typesœ:[œToolœ]}-ToolkitComponent-2lNG0{œfieldNameœ:œtoolsœ,œidœ:œToolkitComponent-2lNG0œ,œinputTypesœ:[œToolœ],œtypeœ:œotherœ}","className":"","selected":false},{"source":"NotionUserList-C3eGn","sourceHandle":"{œdataTypeœ:œNotionUserListœ,œidœ:œNotionUserList-C3eGnœ,œnameœ:œexample_tool_outputœ,œoutput_typesœ:[œToolœ]}","target":"ToolkitComponent-2lNG0","targetHandle":"{œfieldNameœ:œtoolsœ,œidœ:œToolkitComponent-2lNG0œ,œinputTypesœ:[œToolœ],œtypeœ:œotherœ}","data":{"targetHandle":{"fieldName":"tools","id":"ToolkitComponent-2lNG0","inputTypes":["Tool"],"type":"other"},"sourceHandle":{"dataType":"NotionUserList","id":"NotionUserList-C3eGn","name":"example_tool_output","output_types":["Tool"]}},"id":"reactflow__edge-NotionUserList-C3eGn{œdataTypeœ:œNotionUserListœ,œidœ:œNotionUserList-C3eGnœ,œnameœ:œexample_tool_outputœ,œoutput_typesœ:[œToolœ]}-ToolkitComponent-2lNG0{œfieldNameœ:œtoolsœ,œidœ:œToolkitComponent-2lNG0œ,œinputTypesœ:[œToolœ],œtypeœ:œotherœ}","className":"","selected":false},{"source":"NotionSearch-VS2mI","sourceHandle":"{œdataTypeœ:œNotionSearchœ,œidœ:œNotionSearch-VS2mIœ,œnameœ:œexample_tool_outputœ,œoutput_typesœ:[œToolœ]}","target":"ToolkitComponent-2lNG0","targetHandle":"{œfieldNameœ:œtoolsœ,œidœ:œToolkitComponent-2lNG0œ,œinputTypesœ:[œToolœ],œtypeœ:œotherœ}","data":{"targetHandle":{"fieldName":"tools","id":"ToolkitComponent-2lNG0","inputTypes":["Tool"],"type":"other"},"sourceHandle":{"dataType":"NotionSearch","id":"NotionSearch-VS2mI","name":"example_tool_output","output_types":["Tool"]}},"id":"reactflow__edge-NotionSearch-VS2mI{œdataTypeœ:œNotionSearchœ,œidœ:œNotionSearch-VS2mIœ,œnameœ:œexample_tool_outputœ,œoutput_typesœ:[œToolœ]}-ToolkitComponent-2lNG0{œfieldNameœ:œtoolsœ,œidœ:œToolkitComponent-2lNG0œ,œinputTypesœ:[œToolœ],œtypeœ:œotherœ}","className":"","selected":false},{"source":"OpenAIModel-BJWIg","sourceHandle":"{œdataTypeœ:œOpenAIModelœ,œidœ:œOpenAIModel-BJWIgœ,œnameœ:œmodel_outputœ,œoutput_typesœ:[œLanguageModelœ]}","target":"ToolCallingAgent-50Gcd","targetHandle":"{œfieldNameœ:œllmœ,œidœ:œToolCallingAgent-50Gcdœ,œinputTypesœ:[œLanguageModelœ],œtypeœ:œotherœ}","data":{"targetHandle":{"fieldName":"llm","id":"ToolCallingAgent-50Gcd","inputTypes":["LanguageModel"],"type":"other"},"sourceHandle":{"dataType":"OpenAIModel","id":"OpenAIModel-BJWIg","name":"model_output","output_types":["LanguageModel"]}},"id":"reactflow__edge-OpenAIModel-BJWIg{œdataTypeœ:œOpenAIModelœ,œidœ:œOpenAIModel-BJWIgœ,œnameœ:œmodel_outputœ,œoutput_typesœ:[œLanguageModelœ]}-ToolCallingAgent-50Gcd{œfieldNameœ:œllmœ,œidœ:œToolCallingAgent-50Gcdœ,œinputTypesœ:[œLanguageModelœ],œtypeœ:œotherœ}","className":"","selected":false},{"source":"Memory-CTQWu","sourceHandle":"{œdataTypeœ:œMemoryœ,œidœ:œMemory-CTQWuœ,œnameœ:œmessagesœ,œoutput_typesœ:[œDataœ]}","target":"ToolCallingAgent-50Gcd","targetHandle":"{œfieldNameœ:œchat_historyœ,œidœ:œToolCallingAgent-50Gcdœ,œinputTypesœ:[œDataœ],œtypeœ:œotherœ}","data":{"targetHandle":{"fieldName":"chat_history","id":"ToolCallingAgent-50Gcd","inputTypes":["Data"],"type":"other"},"sourceHandle":{"dataType":"Memory","id":"Memory-CTQWu","name":"messages","output_types":["Data"]}},"id":"reactflow__edge-Memory-CTQWu{œdataTypeœ:œMemoryœ,œidœ:œMemory-CTQWuœ,œnameœ:œmessagesœ,œoutput_typesœ:[œDataœ]}-ToolCallingAgent-50Gcd{œfieldNameœ:œchat_historyœ,œidœ:œToolCallingAgent-50Gcdœ,œinputTypesœ:[œDataœ],œtypeœ:œotherœ}","className":"","selected":false},{"source":"Prompt-0dWZu","sourceHandle":"{œdataTypeœ:œPromptœ,œidœ:œPrompt-0dWZuœ,œnameœ:œpromptœ,œoutput_typesœ:[œMessageœ]}","target":"ToolCallingAgent-50Gcd","targetHandle":"{œfieldNameœ:œsystem_promptœ,œidœ:œToolCallingAgent-50Gcdœ,œinputTypesœ:[œMessageœ],œtypeœ:œstrœ}","data":{"targetHandle":{"fieldName":"system_prompt","id":"ToolCallingAgent-50Gcd","inputTypes":["Message"],"type":"str"},"sourceHandle":{"dataType":"Prompt","id":"Prompt-0dWZu","name":"prompt","output_types":["Message"]}},"id":"reactflow__edge-Prompt-0dWZu{œdataTypeœ:œPromptœ,œidœ:œPrompt-0dWZuœ,œnameœ:œpromptœ,œoutput_typesœ:[œMessageœ]}-ToolCallingAgent-50Gcd{œfieldNameœ:œsystem_promptœ,œidœ:œToolCallingAgent-50Gcdœ,œinputTypesœ:[œMessageœ],œtypeœ:œstrœ}","className":"","selected":false},{"source":"CurrentDateComponent-NSNQ8","sourceHandle":"{œdataTypeœ:œCurrentDateComponentœ,œidœ:œCurrentDateComponent-NSNQ8œ,œnameœ:œcurrent_dateœ,œoutput_typesœ:[œMessageœ]}","target":"Prompt-0dWZu","targetHandle":"{œfieldNameœ:œCURRENT_DATEœ,œidœ:œPrompt-0dWZuœ,œinputTypesœ:[œMessageœ,œTextœ],œtypeœ:œstrœ}","data":{"targetHandle":{"fieldName":"CURRENT_DATE","id":"Prompt-0dWZu","inputTypes":["Message","Text"],"type":"str"},"sourceHandle":{"dataType":"CurrentDateComponent","id":"CurrentDateComponent-NSNQ8","name":"current_date","output_types":["Message"]}},"id":"reactflow__edge-CurrentDateComponent-NSNQ8{œdataTypeœ:œCurrentDateComponentœ,œidœ:œCurrentDateComponent-NSNQ8œ,œnameœ:œcurrent_dateœ,œoutput_typesœ:[œMessageœ]}-Prompt-0dWZu{œfieldNameœ:œCURRENT_DATEœ,œidœ:œPrompt-0dWZuœ,œinputTypesœ:[œMessageœ,œTextœ],œtypeœ:œstrœ}","className":"","selected":false}],"viewport":{"x":97.72528949998423,"y":-211.85229348429561,"zoom":0.41621432461249197}},"description":"This flow creates an AI assistant that interacts with your Notion workspace. It understands natural language requests, performs actions in Notion (like creating pages or searching for information), and provides helpful responses. To use it, simply start a conversation by asking the agent to perform a Notion-related task, and it will guide you through the process, making it easy to manage your Notion workspace through chat.","name":"Conversational Notion Agent","last_tested_version":"1.0.17","endpoint_name":null,"is_component":false} \ No newline at end of file diff --git a/assets/files/Conversational_Notion_Agent-7d8e27bbde8676e7772af60972898335.json b/assets/files/Conversational_Notion_Agent-7d8e27bbde8676e7772af60972898335.json new file mode 100644 index 0000000000..e977769bc0 --- /dev/null +++ b/assets/files/Conversational_Notion_Agent-7d8e27bbde8676e7772af60972898335.json @@ -0,0 +1,3137 @@ +{ + "id": "e070f0be-edc4-4512-bb0f-e53307062a26", + "data": { + "nodes": [ + { + "id": "AddContentToPage-ZezUn", + "type": "genericNode", + "position": { + "x": 1416.217259177943, + "y": 1709.6205867919527 + }, + "data": { + "type": "AddContentToPage", + "node": { + "template": { + "_type": "Component", + "block_id": { + "trace_as_metadata": true, + "load_from_db": false, + "list": false, + "required": false, + "placeholder": "", + "show": true, + "name": "block_id", + "value": "", + "display_name": "Page/Block ID", + "advanced": true, + "dynamic": false, + "info": "The ID of the page/block to add the content.", + "title_case": false, + "type": "str", + "_input_type": "StrInput" + }, + "code": { + "type": "code", + "required": true, + "placeholder": "", + "list": false, + "show": true, + "multiline": true, + "value": "import json\nfrom typing import Dict, Any, Union\nfrom markdown import markdown\nfrom bs4 import BeautifulSoup\nimport requests\nfrom langflow.io import Output\nfrom langflow.base.langchain_utilities.model import LCToolComponent\nfrom langflow.inputs import SecretStrInput, StrInput, MultilineInput\nfrom langflow.schema import Data\nfrom langflow.field_typing import Tool\nfrom langchain.tools import StructuredTool\nfrom pydantic import BaseModel, Field\n\n\nclass AddContentToPage(LCToolComponent):\n display_name: str = \"Add Content to Page \"\n description: str = \"Convert markdown text to Notion blocks and append them to a Notion page.\"\n documentation: str = \"https://developers.notion.com/reference/patch-block-children\"\n icon = \"NotionDirectoryLoader\"\n\n inputs = [\n MultilineInput(\n name=\"markdown_text\",\n display_name=\"Markdown Text\",\n info=\"The markdown text to convert to Notion blocks.\",\n ),\n StrInput(\n name=\"block_id\",\n display_name=\"Page/Block ID\",\n info=\"The ID of the page/block to add the content.\",\n ),\n SecretStrInput(\n name=\"notion_secret\",\n display_name=\"Notion Secret\",\n info=\"The Notion integration token.\",\n required=True,\n ),\n ]\n outputs = [\n Output(name=\"example_output\", display_name=\"Data\", method=\"run_model\"),\n Output(name=\"example_tool_output\", display_name=\"Tool\", method=\"build_tool\"),\n ]\n\n class AddContentToPageSchema(BaseModel):\n markdown_text: str = Field(..., description=\"The markdown text to convert to Notion blocks.\")\n block_id: str = Field(..., description=\"The ID of the page/block to add the content.\")\n\n def run_model(self) -> Data:\n result = self._add_content_to_page(self.markdown_text, self.block_id)\n return Data(data=result, text=json.dumps(result))\n\n def build_tool(self) -> Tool:\n return StructuredTool.from_function(\n name=\"add_content_to_notion_page\",\n description=\"Convert markdown text to Notion blocks and append them to a Notion page.\",\n func=self._add_content_to_page,\n args_schema=self.AddContentToPageSchema,\n )\n\n def _add_content_to_page(self, markdown_text: str, block_id: str) -> Union[Dict[str, Any], str]:\n try:\n html_text = markdown(markdown_text)\n soup = BeautifulSoup(html_text, \"html.parser\")\n blocks = self.process_node(soup)\n\n url = f\"https://api.notion.com/v1/blocks/{block_id}/children\"\n headers = {\n \"Authorization\": f\"Bearer {self.notion_secret}\",\n \"Content-Type\": \"application/json\",\n \"Notion-Version\": \"2022-06-28\",\n }\n\n data = {\n \"children\": blocks,\n }\n\n response = requests.patch(url, headers=headers, json=data)\n response.raise_for_status()\n\n return response.json()\n except requests.exceptions.RequestException as e:\n error_message = f\"Error: Failed to add content to Notion page. {str(e)}\"\n if hasattr(e, \"response\") and e.response is not None:\n error_message += f\" Status code: {e.response.status_code}, Response: {e.response.text}\"\n return error_message\n except Exception as e:\n return f\"Error: An unexpected error occurred while adding content to Notion page. {str(e)}\"\n\n def process_node(self, node):\n blocks = []\n if isinstance(node, str):\n text = node.strip()\n if text:\n if text.startswith(\"#\"):\n heading_level = text.count(\"#\", 0, 6)\n heading_text = text[heading_level:].strip()\n if heading_level == 1:\n blocks.append(self.create_block(\"heading_1\", heading_text))\n elif heading_level == 2:\n blocks.append(self.create_block(\"heading_2\", heading_text))\n elif heading_level == 3:\n blocks.append(self.create_block(\"heading_3\", heading_text))\n else:\n blocks.append(self.create_block(\"paragraph\", text))\n elif node.name == \"h1\":\n blocks.append(self.create_block(\"heading_1\", node.get_text(strip=True)))\n elif node.name == \"h2\":\n blocks.append(self.create_block(\"heading_2\", node.get_text(strip=True)))\n elif node.name == \"h3\":\n blocks.append(self.create_block(\"heading_3\", node.get_text(strip=True)))\n elif node.name == \"p\":\n code_node = node.find(\"code\")\n if code_node:\n code_text = code_node.get_text()\n language, code = self.extract_language_and_code(code_text)\n blocks.append(self.create_block(\"code\", code, language=language))\n elif self.is_table(str(node)):\n blocks.extend(self.process_table(node))\n else:\n blocks.append(self.create_block(\"paragraph\", node.get_text(strip=True)))\n elif node.name == \"ul\":\n blocks.extend(self.process_list(node, \"bulleted_list_item\"))\n elif node.name == \"ol\":\n blocks.extend(self.process_list(node, \"numbered_list_item\"))\n elif node.name == \"blockquote\":\n blocks.append(self.create_block(\"quote\", node.get_text(strip=True)))\n elif node.name == \"hr\":\n blocks.append(self.create_block(\"divider\", \"\"))\n elif node.name == \"img\":\n blocks.append(self.create_block(\"image\", \"\", image_url=node.get(\"src\")))\n elif node.name == \"a\":\n blocks.append(self.create_block(\"bookmark\", node.get_text(strip=True), link_url=node.get(\"href\")))\n elif node.name == \"table\":\n blocks.extend(self.process_table(node))\n\n for child in node.children:\n if isinstance(child, str):\n continue\n blocks.extend(self.process_node(child))\n\n return blocks\n\n def extract_language_and_code(self, code_text):\n lines = code_text.split(\"\\n\")\n language = lines[0].strip()\n code = \"\\n\".join(lines[1:]).strip()\n return language, code\n\n def is_code_block(self, text):\n return text.startswith(\"```\")\n\n def extract_code_block(self, text):\n lines = text.split(\"\\n\")\n language = lines[0].strip(\"`\").strip()\n code = \"\\n\".join(lines[1:]).strip(\"`\").strip()\n return language, code\n\n def is_table(self, text):\n rows = text.split(\"\\n\")\n if len(rows) < 2:\n return False\n\n has_separator = False\n for i, row in enumerate(rows):\n if \"|\" in row:\n cells = [cell.strip() for cell in row.split(\"|\")]\n cells = [cell for cell in cells if cell] # Remove empty cells\n if i == 1 and all(set(cell) <= set(\"-|\") for cell in cells):\n has_separator = True\n elif not cells:\n return False\n\n return has_separator and len(rows) >= 3\n\n def process_list(self, node, list_type):\n blocks = []\n for item in node.find_all(\"li\"):\n item_text = item.get_text(strip=True)\n checked = item_text.startswith(\"[x]\")\n is_checklist = item_text.startswith(\"[ ]\") or checked\n\n if is_checklist:\n item_text = item_text.replace(\"[x]\", \"\").replace(\"[ ]\", \"\").strip()\n blocks.append(self.create_block(\"to_do\", item_text, checked=checked))\n else:\n blocks.append(self.create_block(list_type, item_text))\n return blocks\n\n def process_table(self, node):\n blocks = []\n header_row = node.find(\"thead\").find(\"tr\") if node.find(\"thead\") else None\n body_rows = node.find(\"tbody\").find_all(\"tr\") if node.find(\"tbody\") else []\n\n if header_row or body_rows:\n table_width = max(\n len(header_row.find_all([\"th\", \"td\"])) if header_row else 0,\n max(len(row.find_all([\"th\", \"td\"])) for row in body_rows),\n )\n\n table_block = self.create_block(\"table\", \"\", table_width=table_width, has_column_header=bool(header_row))\n blocks.append(table_block)\n\n if header_row:\n header_cells = [cell.get_text(strip=True) for cell in header_row.find_all([\"th\", \"td\"])]\n header_row_block = self.create_block(\"table_row\", header_cells)\n blocks.append(header_row_block)\n\n for row in body_rows:\n cells = [cell.get_text(strip=True) for cell in row.find_all([\"th\", \"td\"])]\n row_block = self.create_block(\"table_row\", cells)\n blocks.append(row_block)\n\n return blocks\n\n def create_block(self, block_type: str, content: str, **kwargs) -> Dict[str, Any]:\n block: dict[str, Any] = {\n \"object\": \"block\",\n \"type\": block_type,\n block_type: {},\n }\n\n if block_type in [\n \"paragraph\",\n \"heading_1\",\n \"heading_2\",\n \"heading_3\",\n \"bulleted_list_item\",\n \"numbered_list_item\",\n \"quote\",\n ]:\n block[block_type][\"rich_text\"] = [\n {\n \"type\": \"text\",\n \"text\": {\n \"content\": content,\n },\n }\n ]\n elif block_type == \"to_do\":\n block[block_type][\"rich_text\"] = [\n {\n \"type\": \"text\",\n \"text\": {\n \"content\": content,\n },\n }\n ]\n block[block_type][\"checked\"] = kwargs.get(\"checked\", False)\n elif block_type == \"code\":\n block[block_type][\"rich_text\"] = [\n {\n \"type\": \"text\",\n \"text\": {\n \"content\": content,\n },\n }\n ]\n block[block_type][\"language\"] = kwargs.get(\"language\", \"plain text\")\n elif block_type == \"image\":\n block[block_type] = {\"type\": \"external\", \"external\": {\"url\": kwargs.get(\"image_url\", \"\")}}\n elif block_type == \"divider\":\n pass\n elif block_type == \"bookmark\":\n block[block_type][\"url\"] = kwargs.get(\"link_url\", \"\")\n elif block_type == \"table\":\n block[block_type][\"table_width\"] = kwargs.get(\"table_width\", 0)\n block[block_type][\"has_column_header\"] = kwargs.get(\"has_column_header\", False)\n block[block_type][\"has_row_header\"] = kwargs.get(\"has_row_header\", False)\n elif block_type == \"table_row\":\n block[block_type][\"cells\"] = [[{\"type\": \"text\", \"text\": {\"content\": cell}} for cell in content]]\n\n return block\n", + "fileTypes": [], + "file_path": "", + "password": false, + "name": "code", + "advanced": true, + "dynamic": true, + "info": "", + "load_from_db": false, + "title_case": false + }, + "markdown_text": { + "trace_as_input": true, + "multiline": true, + "trace_as_metadata": true, + "load_from_db": false, + "list": false, + "required": false, + "placeholder": "", + "show": true, + "name": "markdown_text", + "value": "", + "display_name": "Markdown Text", + "advanced": true, + "input_types": [ + "Message" + ], + "dynamic": false, + "info": "The markdown text to convert to Notion blocks.", + "title_case": false, + "type": "str", + "_input_type": "MultilineInput" + }, + "notion_secret": { + "load_from_db": true, + "required": true, + "placeholder": "", + "show": true, + "name": "notion_secret", + "value": "", + "display_name": "Notion Secret", + "advanced": false, + "input_types": [ + "Message" + ], + "dynamic": false, + "info": "The Notion integration token.", + "title_case": false, + "password": true, + "type": "str", + "_input_type": "SecretStrInput" + } + }, + "description": "Convert markdown text to Notion blocks and append them to a Notion page.", + "icon": "NotionDirectoryLoader", + "base_classes": [ + "Data", + "Tool" + ], + "display_name": "Add Content to Page ", + "documentation": "https://developers.notion.com/reference/patch-block-children", + "custom_fields": {}, + "output_types": [], + "pinned": false, + "conditional_paths": [], + "frozen": false, + "outputs": [ + { + "types": [ + "Data" + ], + "selected": "Data", + "name": "example_output", + "display_name": "Data", + "method": "run_model", + "value": "__UNDEFINED__", + "cache": true, + "hidden": true + }, + { + "types": [ + "Tool" + ], + "selected": "Tool", + "name": "example_tool_output", + "display_name": "Tool", + "method": "build_tool", + "value": "__UNDEFINED__", + "cache": true + } + ], + "field_order": [ + "markdown_text", + "block_id", + "notion_secret" + ], + "beta": false, + "edited": true, + "lf_version": "1.0.17" + }, + "id": "AddContentToPage-ZezUn", + "description": "Convert markdown text to Notion blocks and append them to a Notion page.", + "display_name": "Add Content to Page " + }, + "selected": false, + "width": 384, + "height": 330, + "dragging": false, + "positionAbsolute": { + "x": 1416.217259177943, + "y": 1709.6205867919527 + } + }, + { + "id": "NotionPageCreator-6SCB5", + "type": "genericNode", + "position": { + "x": 1413.9782390799146, + "y": 2051.645785494985 + }, + "data": { + "type": "NotionPageCreator", + "node": { + "template": { + "_type": "Component", + "code": { + "type": "code", + "required": true, + "placeholder": "", + "list": false, + "show": true, + "multiline": true, + "value": "import json\nfrom typing import Dict, Any, Union\nimport requests\nfrom pydantic import BaseModel, Field\nfrom langflow.base.langchain_utilities.model import LCToolComponent\nfrom langflow.inputs import SecretStrInput, StrInput, MultilineInput\nfrom langflow.schema import Data\nfrom langflow.field_typing import Tool\nfrom langchain.tools import StructuredTool\nfrom langflow.io import Output\n\nclass NotionPageCreator(LCToolComponent):\n display_name: str = \"Create Page \"\n description: str = \"A component for creating Notion pages.\"\n documentation: str = \"https://docs.langflow.org/integrations/notion/page-create\"\n icon = \"NotionDirectoryLoader\"\n\n inputs = [\n StrInput(\n name=\"database_id\",\n display_name=\"Database ID\",\n info=\"The ID of the Notion database.\",\n ),\n SecretStrInput(\n name=\"notion_secret\",\n display_name=\"Notion Secret\",\n info=\"The Notion integration token.\",\n required=True,\n ),\n MultilineInput(\n name=\"properties_json\",\n display_name=\"Properties (JSON)\",\n info=\"The properties of the new page as a JSON string.\",\n ),\n ]\n outputs = [\n Output(name=\"example_output\", display_name=\"Data\", method=\"run_model\"),\n Output(name=\"example_tool_output\", display_name=\"Tool\", method=\"build_tool\"),\n ]\n\n class NotionPageCreatorSchema(BaseModel):\n database_id: str = Field(..., description=\"The ID of the Notion database.\")\n properties_json: str = Field(..., description=\"The properties of the new page as a JSON string.\")\n\n def run_model(self) -> Data:\n result = self._create_notion_page(self.database_id, self.properties_json)\n if isinstance(result, str):\n # An error occurred, return it as text\n return Data(text=result)\n else:\n # Success, return the created page data\n output = \"Created page properties:\\n\"\n for prop_name, prop_value in result.get(\"properties\", {}).items():\n output += f\"{prop_name}: {prop_value}\\n\"\n return Data(text=output, data=result)\n\n def build_tool(self) -> Tool:\n return StructuredTool.from_function(\n name=\"create_notion_page\",\n description=\"Create a new page in a Notion database. IMPORTANT: Use the tool to check the Database properties for more details before using this tool.\",\n func=self._create_notion_page,\n args_schema=self.NotionPageCreatorSchema,\n )\n\n def _create_notion_page(self, database_id: str, properties_json: str) -> Union[Dict[str, Any], str]:\n if not database_id or not properties_json:\n return \"Invalid input. Please provide 'database_id' and 'properties_json'.\"\n\n try:\n properties = json.loads(properties_json)\n except json.JSONDecodeError as e:\n return f\"Invalid properties format. Please provide a valid JSON string. Error: {str(e)}\"\n\n headers = {\n \"Authorization\": f\"Bearer {self.notion_secret}\",\n \"Content-Type\": \"application/json\",\n \"Notion-Version\": \"2022-06-28\",\n }\n\n data = {\n \"parent\": {\"database_id\": database_id},\n \"properties\": properties,\n }\n\n try:\n response = requests.post(\"https://api.notion.com/v1/pages\", headers=headers, json=data)\n response.raise_for_status()\n result = response.json()\n return result\n except requests.exceptions.RequestException as e:\n error_message = f\"Failed to create Notion page. Error: {str(e)}\"\n if hasattr(e, \"response\") and e.response is not None:\n error_message += f\" Status code: {e.response.status_code}, Response: {e.response.text}\"\n return error_message\n\n def __call__(self, *args, **kwargs):\n return self._create_notion_page(*args, **kwargs)\n", + "fileTypes": [], + "file_path": "", + "password": false, + "name": "code", + "advanced": true, + "dynamic": true, + "info": "", + "load_from_db": false, + "title_case": false + }, + "database_id": { + "trace_as_metadata": true, + "load_from_db": false, + "list": false, + "required": false, + "placeholder": "", + "show": true, + "name": "database_id", + "value": "", + "display_name": "Database ID", + "advanced": true, + "dynamic": false, + "info": "The ID of the Notion database.", + "title_case": false, + "type": "str", + "_input_type": "StrInput" + }, + "notion_secret": { + "load_from_db": true, + "required": true, + "placeholder": "", + "show": true, + "name": "notion_secret", + "value": "", + "display_name": "Notion Secret", + "advanced": false, + "input_types": [ + "Message" + ], + "dynamic": false, + "info": "The Notion integration token.", + "title_case": false, + "password": true, + "type": "str", + "_input_type": "SecretStrInput" + }, + "properties_json": { + "trace_as_input": true, + "multiline": true, + "trace_as_metadata": true, + "load_from_db": false, + "list": false, + "required": false, + "placeholder": "", + "show": true, + "name": "properties_json", + "value": "", + "display_name": "Properties (JSON)", + "advanced": true, + "input_types": [ + "Message" + ], + "dynamic": false, + "info": "The properties of the new page as a JSON string.", + "title_case": false, + "type": "str", + "_input_type": "MultilineInput" + } + }, + "description": "A component for creating Notion pages.", + "icon": "NotionDirectoryLoader", + "base_classes": [ + "Data", + "Tool" + ], + "display_name": "Create Page ", + "documentation": "https://docs.langflow.org/integrations/notion/page-create", + "custom_fields": {}, + "output_types": [], + "pinned": false, + "conditional_paths": [], + "frozen": false, + "outputs": [ + { + "types": [ + "Data" + ], + "selected": "Data", + "name": "example_output", + "display_name": "Data", + "method": "run_model", + "value": "__UNDEFINED__", + "cache": true, + "hidden": true + }, + { + "types": [ + "Tool" + ], + "selected": "Tool", + "name": "example_tool_output", + "display_name": "Tool", + "method": "build_tool", + "value": "__UNDEFINED__", + "cache": true + } + ], + "field_order": [ + "database_id", + "notion_secret", + "properties_json" + ], + "beta": false, + "edited": true, + "lf_version": "1.0.17" + }, + "id": "NotionPageCreator-6SCB5", + "description": "A component for creating Notion pages.", + "display_name": "Create Page " + }, + "selected": false, + "width": 384, + "height": 302, + "dragging": false, + "positionAbsolute": { + "x": 1413.9782390799146, + "y": 2051.645785494985 + } + }, + { + "id": "NotionDatabaseProperties-aeWil", + "type": "genericNode", + "position": { + "x": 1004.5753613670959, + "y": 1713.914531491452 + }, + "data": { + "type": "NotionDatabaseProperties", + "node": { + "template": { + "_type": "Component", + "code": { + "type": "code", + "required": true, + "placeholder": "", + "list": false, + "show": true, + "multiline": true, + "value": "import requests\nfrom typing import Dict, Union\nfrom pydantic import BaseModel, Field\nfrom langflow.base.langchain_utilities.model import LCToolComponent\nfrom langflow.inputs import SecretStrInput, StrInput\nfrom langflow.schema import Data\nfrom langflow.field_typing import Tool\nfrom langchain.tools import StructuredTool\nfrom langflow.io import Output\n\nclass NotionDatabaseProperties(LCToolComponent):\n display_name: str = \"List Database Properties \"\n description: str = \"Retrieve properties of a Notion database.\"\n documentation: str = \"https://docs.langflow.org/integrations/notion/list-database-properties\"\n icon = \"NotionDirectoryLoader\"\n\n inputs = [\n StrInput(\n name=\"database_id\",\n display_name=\"Database ID\",\n info=\"The ID of the Notion database.\",\n ),\n SecretStrInput(\n name=\"notion_secret\",\n display_name=\"Notion Secret\",\n info=\"The Notion integration token.\",\n required=True,\n ),\n ]\n outputs = [\n Output(name=\"example_output\", display_name=\"Data\", method=\"run_model\"),\n Output(name=\"example_tool_output\", display_name=\"Tool\", method=\"build_tool\"),\n ]\n\n class NotionDatabasePropertiesSchema(BaseModel):\n database_id: str = Field(..., description=\"The ID of the Notion database.\")\n\n def run_model(self) -> Data:\n result = self._fetch_database_properties(self.database_id)\n if isinstance(result, str):\n # An error occurred, return it as text\n return Data(text=result)\n else:\n # Success, return the properties\n return Data(text=str(result), data=result)\n\n def build_tool(self) -> Tool:\n return StructuredTool.from_function(\n name=\"notion_database_properties\",\n description=\"Retrieve properties of a Notion database. Input should include the database ID.\",\n func=self._fetch_database_properties,\n args_schema=self.NotionDatabasePropertiesSchema,\n )\n\n def _fetch_database_properties(self, database_id: str) -> Union[Dict, str]:\n url = f\"https://api.notion.com/v1/databases/{database_id}\"\n headers = {\n \"Authorization\": f\"Bearer {self.notion_secret}\",\n \"Notion-Version\": \"2022-06-28\", # Use the latest supported version\n }\n try:\n response = requests.get(url, headers=headers)\n response.raise_for_status()\n data = response.json()\n properties = data.get(\"properties\", {})\n return properties\n except requests.exceptions.RequestException as e:\n return f\"Error fetching Notion database properties: {str(e)}\"\n except ValueError as e:\n return f\"Error parsing Notion API response: {str(e)}\"\n except Exception as e:\n return f\"An unexpected error occurred: {str(e)}\"\n", + "fileTypes": [], + "file_path": "", + "password": false, + "name": "code", + "advanced": true, + "dynamic": true, + "info": "", + "load_from_db": false, + "title_case": false + }, + "database_id": { + "trace_as_metadata": true, + "load_from_db": false, + "list": false, + "required": false, + "placeholder": "", + "show": true, + "name": "database_id", + "value": "", + "display_name": "Database ID", + "advanced": true, + "dynamic": false, + "info": "The ID of the Notion database.", + "title_case": false, + "type": "str", + "_input_type": "StrInput" + }, + "notion_secret": { + "load_from_db": true, + "required": true, + "placeholder": "", + "show": true, + "name": "notion_secret", + "value": "", + "display_name": "Notion Secret", + "advanced": false, + "input_types": [ + "Message" + ], + "dynamic": false, + "info": "The Notion integration token.", + "title_case": false, + "password": true, + "type": "str", + "_input_type": "SecretStrInput" + } + }, + "description": "Retrieve properties of a Notion database.", + "icon": "NotionDirectoryLoader", + "base_classes": [ + "Data", + "Tool" + ], + "display_name": "List Database Properties ", + "documentation": "https://docs.langflow.org/integrations/notion/list-database-properties", + "custom_fields": {}, + "output_types": [], + "pinned": false, + "conditional_paths": [], + "frozen": false, + "outputs": [ + { + "types": [ + "Data" + ], + "selected": "Data", + "name": "example_output", + "display_name": "Data", + "method": "run_model", + "value": "__UNDEFINED__", + "cache": true, + "hidden": true + }, + { + "types": [ + "Tool" + ], + "selected": "Tool", + "name": "example_tool_output", + "display_name": "Tool", + "method": "build_tool", + "value": "__UNDEFINED__", + "cache": true + } + ], + "field_order": [ + "database_id", + "notion_secret" + ], + "beta": false, + "edited": true, + "lf_version": "1.0.17" + }, + "id": "NotionDatabaseProperties-aeWil", + "description": "Retrieve properties of a Notion database.", + "display_name": "List Database Properties " + }, + "selected": false, + "width": 384, + "height": 302, + "dragging": false, + "positionAbsolute": { + "x": 1004.5753613670959, + "y": 1713.914531491452 + } + }, + { + "id": "NotionListPages-znA3w", + "type": "genericNode", + "position": { + "x": 1006.1848442547046, + "y": 2022.7880909242833 + }, + "data": { + "type": "NotionListPages", + "node": { + "template": { + "_type": "Component", + "code": { + "type": "code", + "required": true, + "placeholder": "", + "list": false, + "show": true, + "multiline": true, + "value": "import requests\nimport json\nfrom typing import Dict, Any, List, Optional\nfrom pydantic import BaseModel, Field\nfrom langflow.io import Output\nfrom langflow.base.langchain_utilities.model import LCToolComponent\nfrom langflow.inputs import SecretStrInput, StrInput, MultilineInput\nfrom langflow.schema import Data\nfrom langflow.field_typing import Tool\nfrom langchain.tools import StructuredTool\n\n\nclass NotionListPages(LCToolComponent):\n display_name: str = \"List Pages \"\n description: str = (\n \"Query a Notion database with filtering and sorting. \"\n \"The input should be a JSON string containing the 'filter' and 'sorts' objects. \"\n \"Example input:\\n\"\n '{\"filter\": {\"property\": \"Status\", \"select\": {\"equals\": \"Done\"}}, \"sorts\": [{\"timestamp\": \"created_time\", \"direction\": \"descending\"}]}'\n )\n documentation: str = \"https://docs.langflow.org/integrations/notion/list-pages\"\n icon = \"NotionDirectoryLoader\"\n\n inputs = [\n SecretStrInput(\n name=\"notion_secret\",\n display_name=\"Notion Secret\",\n info=\"The Notion integration token.\",\n required=True,\n ),\n StrInput(\n name=\"database_id\",\n display_name=\"Database ID\",\n info=\"The ID of the Notion database to query.\",\n ),\n MultilineInput(\n name=\"query_json\",\n display_name=\"Database query (JSON)\",\n info=\"A JSON string containing the filters and sorts that will be used for querying the database. Leave empty for no filters or sorts.\",\n ),\n ]\n outputs = [\n Output(name=\"example_output\", display_name=\"Data\", method=\"run_model\"),\n Output(name=\"example_tool_output\", display_name=\"Tool\", method=\"build_tool\"),\n ]\n class NotionListPagesSchema(BaseModel):\n database_id: str = Field(..., description=\"The ID of the Notion database to query.\")\n query_json: Optional[str] = Field(\n default=\"\",\n description=\"A JSON string containing the filters and sorts for querying the database. Leave empty for no filters or sorts.\",\n )\n\n def run_model(self) -> List[Data]:\n result = self._query_notion_database(self.database_id, self.query_json)\n\n if isinstance(result, str):\n # An error occurred, return it as a single record\n return [Data(text=result)]\n\n records = []\n combined_text = f\"Pages found: {len(result)}\\n\\n\"\n\n for page in result:\n page_data = {\n \"id\": page[\"id\"],\n \"url\": page[\"url\"],\n \"created_time\": page[\"created_time\"],\n \"last_edited_time\": page[\"last_edited_time\"],\n \"properties\": page[\"properties\"],\n }\n\n text = (\n f\"id: {page['id']}\\n\"\n f\"url: {page['url']}\\n\"\n f\"created_time: {page['created_time']}\\n\"\n f\"last_edited_time: {page['last_edited_time']}\\n\"\n f\"properties: {json.dumps(page['properties'], indent=2)}\\n\\n\"\n )\n\n combined_text += text\n records.append(Data(text=text, **page_data))\n\n self.status = records\n return records\n\n def build_tool(self) -> Tool:\n return StructuredTool.from_function(\n name=\"notion_list_pages\",\n description=self.description,\n func=self._query_notion_database,\n args_schema=self.NotionListPagesSchema,\n )\n\n def _query_notion_database(self, database_id: str, query_json: Optional[str] = None) -> List[Dict[str, Any]] | str:\n url = f\"https://api.notion.com/v1/databases/{database_id}/query\"\n headers = {\n \"Authorization\": f\"Bearer {self.notion_secret}\",\n \"Content-Type\": \"application/json\",\n \"Notion-Version\": \"2022-06-28\",\n }\n\n query_payload = {}\n if query_json and query_json.strip():\n try:\n query_payload = json.loads(query_json)\n except json.JSONDecodeError as e:\n return f\"Invalid JSON format for query: {str(e)}\"\n\n try:\n response = requests.post(url, headers=headers, json=query_payload)\n response.raise_for_status()\n results = response.json()\n return results[\"results\"]\n except requests.exceptions.RequestException as e:\n return f\"Error querying Notion database: {str(e)}\"\n except KeyError:\n return \"Unexpected response format from Notion API\"\n except Exception as e:\n return f\"An unexpected error occurred: {str(e)}\"\n", + "fileTypes": [], + "file_path": "", + "password": false, + "name": "code", + "advanced": true, + "dynamic": true, + "info": "", + "load_from_db": false, + "title_case": false + }, + "database_id": { + "trace_as_metadata": true, + "load_from_db": false, + "list": false, + "required": false, + "placeholder": "", + "show": true, + "name": "database_id", + "value": "", + "display_name": "Database ID", + "advanced": true, + "dynamic": false, + "info": "The ID of the Notion database to query.", + "title_case": false, + "type": "str", + "_input_type": "StrInput" + }, + "notion_secret": { + "load_from_db": true, + "required": true, + "placeholder": "", + "show": true, + "name": "notion_secret", + "value": "", + "display_name": "Notion Secret", + "advanced": false, + "input_types": [ + "Message" + ], + "dynamic": false, + "info": "The Notion integration token.", + "title_case": false, + "password": true, + "type": "str", + "_input_type": "SecretStrInput" + }, + "query_json": { + "trace_as_input": true, + "multiline": true, + "trace_as_metadata": true, + "load_from_db": false, + "list": false, + "required": false, + "placeholder": "", + "show": true, + "name": "query_json", + "value": "", + "display_name": "Database query (JSON)", + "advanced": true, + "input_types": [ + "Message" + ], + "dynamic": false, + "info": "A JSON string containing the filters and sorts that will be used for querying the database. Leave empty for no filters or sorts.", + "title_case": false, + "type": "str", + "_input_type": "MultilineInput" + } + }, + "description": "Query a Notion database with filtering and sorting. The input should be a JSON string containing the 'filter' and 'sorts' objects. Example input:\n{\"filter\": {\"property\": \"Status\", \"select\": {\"equals\": \"Done\"}}, \"sorts\": [{\"timestamp\": \"created_time\", \"direction\": \"descending\"}]}", + "icon": "NotionDirectoryLoader", + "base_classes": [ + "Data", + "Tool" + ], + "display_name": "List Pages ", + "documentation": "https://docs.langflow.org/integrations/notion/list-pages", + "custom_fields": {}, + "output_types": [], + "pinned": false, + "conditional_paths": [], + "frozen": false, + "outputs": [ + { + "types": [ + "Data" + ], + "selected": "Data", + "name": "example_output", + "display_name": "Data", + "method": "run_model", + "value": "__UNDEFINED__", + "cache": true, + "hidden": true + }, + { + "types": [ + "Tool" + ], + "selected": "Tool", + "name": "example_tool_output", + "display_name": "Tool", + "method": "build_tool", + "value": "__UNDEFINED__", + "cache": true + } + ], + "field_order": [ + "notion_secret", + "database_id", + "query_json" + ], + "beta": false, + "edited": true, + "lf_version": "1.0.17" + }, + "id": "NotionListPages-znA3w", + "description": "Query a Notion database with filtering and sorting. The input should be a JSON string containing the 'filter' and 'sorts' objects. Example input:\n{\"filter\": {\"property\": \"Status\", \"select\": {\"equals\": \"Done\"}}, \"sorts\": [{\"timestamp\": \"created_time\", \"direction\": \"descending\"}]}", + "display_name": "List Pages " + }, + "selected": false, + "width": 384, + "height": 470, + "dragging": false, + "positionAbsolute": { + "x": 1006.1848442547046, + "y": 2022.7880909242833 + } + }, + { + "id": "NotionUserList-C3eGn", + "type": "genericNode", + "position": { + "x": 2260.15497405973, + "y": 1717.4551881467207 + }, + "data": { + "type": "NotionUserList", + "node": { + "template": { + "_type": "Component", + "code": { + "type": "code", + "required": true, + "placeholder": "", + "list": false, + "show": true, + "multiline": true, + "value": "import requests\nfrom typing import List, Dict\nfrom pydantic import BaseModel\nfrom langflow.io import Output\nfrom langflow.base.langchain_utilities.model import LCToolComponent\nfrom langflow.inputs import SecretStrInput\nfrom langflow.schema import Data\nfrom langflow.field_typing import Tool\nfrom langchain.tools import StructuredTool\n\n\nclass NotionUserList(LCToolComponent):\n display_name = \"List Users \"\n description = \"Retrieve users from Notion.\"\n documentation = \"https://docs.langflow.org/integrations/notion/list-users\"\n icon = \"NotionDirectoryLoader\"\n\n inputs = [\n SecretStrInput(\n name=\"notion_secret\",\n display_name=\"Notion Secret\",\n info=\"The Notion integration token.\",\n required=True,\n ),\n ]\n outputs = [\n Output(name=\"example_output\", display_name=\"Data\", method=\"run_model\"),\n Output(name=\"example_tool_output\", display_name=\"Tool\", method=\"build_tool\"),\n ]\n\n class NotionUserListSchema(BaseModel):\n pass\n\n def run_model(self) -> List[Data]:\n users = self._list_users()\n records = []\n combined_text = \"\"\n\n for user in users:\n output = \"User:\\n\"\n for key, value in user.items():\n output += f\"{key.replace('_', ' ').title()}: {value}\\n\"\n output += \"________________________\\n\"\n\n combined_text += output\n records.append(Data(text=output, data=user))\n\n self.status = records\n return records\n\n def build_tool(self) -> Tool:\n return StructuredTool.from_function(\n name=\"notion_list_users\",\n description=\"Retrieve users from Notion.\",\n func=self._list_users,\n args_schema=self.NotionUserListSchema,\n )\n\n def _list_users(self) -> List[Dict]:\n url = \"https://api.notion.com/v1/users\"\n headers = {\n \"Authorization\": f\"Bearer {self.notion_secret}\",\n \"Notion-Version\": \"2022-06-28\",\n }\n\n response = requests.get(url, headers=headers)\n response.raise_for_status()\n\n data = response.json()\n results = data[\"results\"]\n\n users = []\n for user in results:\n user_data = {\n \"id\": user[\"id\"],\n \"type\": user[\"type\"],\n \"name\": user.get(\"name\", \"\"),\n \"avatar_url\": user.get(\"avatar_url\", \"\"),\n }\n users.append(user_data)\n\n return users\n", + "fileTypes": [], + "file_path": "", + "password": false, + "name": "code", + "advanced": true, + "dynamic": true, + "info": "", + "load_from_db": false, + "title_case": false + }, + "notion_secret": { + "load_from_db": true, + "required": true, + "placeholder": "", + "show": true, + "name": "notion_secret", + "value": "", + "display_name": "Notion Secret", + "advanced": false, + "input_types": [ + "Message" + ], + "dynamic": false, + "info": "The Notion integration token.", + "title_case": false, + "password": true, + "type": "str", + "_input_type": "SecretStrInput" + } + }, + "description": "Retrieve users from Notion.", + "icon": "NotionDirectoryLoader", + "base_classes": [ + "Data", + "Tool" + ], + "display_name": "List Users ", + "documentation": "https://docs.langflow.org/integrations/notion/list-users", + "custom_fields": {}, + "output_types": [], + "pinned": false, + "conditional_paths": [], + "frozen": false, + "outputs": [ + { + "types": [ + "Data" + ], + "selected": "Data", + "name": "example_output", + "display_name": "Data", + "method": "run_model", + "value": "__UNDEFINED__", + "cache": true, + "hidden": true + }, + { + "types": [ + "Tool" + ], + "selected": "Tool", + "name": "example_tool_output", + "display_name": "Tool", + "method": "build_tool", + "value": "__UNDEFINED__", + "cache": true + } + ], + "field_order": [ + "notion_secret" + ], + "beta": false, + "edited": true, + "lf_version": "1.0.17" + }, + "id": "NotionUserList-C3eGn", + "description": "Retrieve users from Notion.", + "display_name": "List Users " + }, + "selected": true, + "width": 384, + "height": 302, + "dragging": false, + "positionAbsolute": { + "x": 2260.15497405973, + "y": 1717.4551881467207 + } + }, + { + "id": "NotionPageContent-SlL21", + "type": "genericNode", + "position": { + "x": 1826.4242329724448, + "y": 1715.6365113286927 + }, + "data": { + "type": "NotionPageContent", + "node": { + "template": { + "_type": "Component", + "code": { + "type": "code", + "required": true, + "placeholder": "", + "list": false, + "show": true, + "multiline": true, + "value": "import requests\nfrom pydantic import BaseModel, Field\nfrom langflow.base.langchain_utilities.model import LCToolComponent\nfrom langflow.inputs import SecretStrInput, StrInput\nfrom langflow.schema import Data\nfrom langflow.field_typing import Tool\nfrom langchain.tools import StructuredTool\nfrom langflow.io import Output\n\nclass NotionPageContent(LCToolComponent):\n display_name = \"Page Content Viewer \"\n description = \"Retrieve the content of a Notion page as plain text.\"\n documentation = \"https://docs.langflow.org/integrations/notion/page-content-viewer\"\n icon = \"NotionDirectoryLoader\"\n\n inputs = [\n StrInput(\n name=\"page_id\",\n display_name=\"Page ID\",\n info=\"The ID of the Notion page to retrieve.\",\n ),\n SecretStrInput(\n name=\"notion_secret\",\n display_name=\"Notion Secret\",\n info=\"The Notion integration token.\",\n required=True,\n ),\n ]\n outputs = [\n Output(name=\"example_output\", display_name=\"Data\", method=\"run_model\"),\n Output(name=\"example_tool_output\", display_name=\"Tool\", method=\"build_tool\"),\n ]\n\n class NotionPageContentSchema(BaseModel):\n page_id: str = Field(..., description=\"The ID of the Notion page to retrieve.\")\n\n def run_model(self) -> Data:\n result = self._retrieve_page_content(self.page_id)\n if isinstance(result, str) and result.startswith(\"Error:\"):\n # An error occurred, return it as text\n return Data(text=result)\n else:\n # Success, return the content\n return Data(text=result, data={\"content\": result})\n\n def build_tool(self) -> Tool:\n return StructuredTool.from_function(\n name=\"notion_page_content\",\n description=\"Retrieve the content of a Notion page as plain text.\",\n func=self._retrieve_page_content,\n args_schema=self.NotionPageContentSchema,\n )\n\n def _retrieve_page_content(self, page_id: str) -> str:\n blocks_url = f\"https://api.notion.com/v1/blocks/{page_id}/children?page_size=100\"\n headers = {\n \"Authorization\": f\"Bearer {self.notion_secret}\",\n \"Notion-Version\": \"2022-06-28\",\n }\n try:\n blocks_response = requests.get(blocks_url, headers=headers)\n blocks_response.raise_for_status()\n blocks_data = blocks_response.json()\n return self.parse_blocks(blocks_data.get(\"results\", []))\n except requests.exceptions.RequestException as e:\n error_message = f\"Error: Failed to retrieve Notion page content. {str(e)}\"\n if hasattr(e, \"response\") and e.response is not None:\n error_message += f\" Status code: {e.response.status_code}, Response: {e.response.text}\"\n return error_message\n except Exception as e:\n return f\"Error: An unexpected error occurred while retrieving Notion page content. {str(e)}\"\n\n def parse_blocks(self, blocks: list) -> str:\n content = \"\"\n for block in blocks:\n block_type = block.get(\"type\")\n if block_type in [\"paragraph\", \"heading_1\", \"heading_2\", \"heading_3\", \"quote\"]:\n content += self.parse_rich_text(block[block_type].get(\"rich_text\", [])) + \"\\n\\n\"\n elif block_type in [\"bulleted_list_item\", \"numbered_list_item\"]:\n content += self.parse_rich_text(block[block_type].get(\"rich_text\", [])) + \"\\n\"\n elif block_type == \"to_do\":\n content += self.parse_rich_text(block[\"to_do\"].get(\"rich_text\", [])) + \"\\n\"\n elif block_type == \"code\":\n content += self.parse_rich_text(block[\"code\"].get(\"rich_text\", [])) + \"\\n\\n\"\n elif block_type == \"image\":\n content += f\"[Image: {block['image'].get('external', {}).get('url', 'No URL')}]\\n\\n\"\n elif block_type == \"divider\":\n content += \"---\\n\\n\"\n return content.strip()\n\n def parse_rich_text(self, rich_text: list) -> str:\n return \"\".join(segment.get(\"plain_text\", \"\") for segment in rich_text)\n\n def __call__(self, *args, **kwargs):\n return self._retrieve_page_content(*args, **kwargs)\n", + "fileTypes": [], + "file_path": "", + "password": false, + "name": "code", + "advanced": true, + "dynamic": true, + "info": "", + "load_from_db": false, + "title_case": false + }, + "notion_secret": { + "load_from_db": true, + "required": true, + "placeholder": "", + "show": true, + "name": "notion_secret", + "value": "", + "display_name": "Notion Secret", + "advanced": false, + "input_types": [ + "Message" + ], + "dynamic": false, + "info": "The Notion integration token.", + "title_case": false, + "password": true, + "type": "str", + "_input_type": "SecretStrInput" + }, + "page_id": { + "trace_as_metadata": true, + "load_from_db": false, + "list": false, + "required": false, + "placeholder": "", + "show": true, + "name": "page_id", + "value": "", + "display_name": "Page ID", + "advanced": true, + "dynamic": false, + "info": "The ID of the Notion page to retrieve.", + "title_case": false, + "type": "str", + "_input_type": "StrInput" + } + }, + "description": "Retrieve the content of a Notion page as plain text.", + "icon": "NotionDirectoryLoader", + "base_classes": [ + "Data", + "Tool" + ], + "display_name": "Page Content Viewer ", + "documentation": "https://docs.langflow.org/integrations/notion/page-content-viewer", + "custom_fields": {}, + "output_types": [], + "pinned": false, + "conditional_paths": [], + "frozen": false, + "outputs": [ + { + "types": [ + "Data" + ], + "selected": "Data", + "name": "example_output", + "display_name": "Data", + "method": "run_model", + "value": "__UNDEFINED__", + "cache": true, + "hidden": true + }, + { + "types": [ + "Tool" + ], + "selected": "Tool", + "name": "example_tool_output", + "display_name": "Tool", + "method": "build_tool", + "value": "__UNDEFINED__", + "cache": true + } + ], + "field_order": [ + "page_id", + "notion_secret" + ], + "beta": false, + "edited": true, + "lf_version": "1.0.17" + }, + "id": "NotionPageContent-SlL21", + "description": "Retrieve the content of a Notion page as plain text.", + "display_name": "Page Content Viewer " + }, + "selected": false, + "width": 384, + "height": 330, + "dragging": false, + "positionAbsolute": { + "x": 1826.4242329724448, + "y": 1715.6365113286927 + } + }, + { + "id": "NotionSearch-VS2mI", + "type": "genericNode", + "position": { + "x": 2258.1166047519732, + "y": 2034.3959294952945 + }, + "data": { + "type": "NotionSearch", + "node": { + "template": { + "_type": "Component", + "code": { + "type": "code", + "required": true, + "placeholder": "", + "list": false, + "show": true, + "multiline": true, + "value": "import requests\nfrom typing import Dict, Any, List\nfrom pydantic import BaseModel, Field\nfrom langflow.io import Output\nfrom langflow.base.langchain_utilities.model import LCToolComponent\nfrom langflow.inputs import SecretStrInput, StrInput, DropdownInput\nfrom langflow.schema import Data\nfrom langflow.field_typing import Tool\nfrom langchain.tools import StructuredTool\n\n\nclass NotionSearch(LCToolComponent):\n display_name: str = \"Search \"\n description: str = \"Searches all pages and databases that have been shared with an integration. The search field can be an empty value to show all values from that search\"\n documentation: str = \"https://docs.langflow.org/integrations/notion/search\"\n icon = \"NotionDirectoryLoader\"\n\n inputs = [\n SecretStrInput(\n name=\"notion_secret\",\n display_name=\"Notion Secret\",\n info=\"The Notion integration token.\",\n required=True,\n ),\n StrInput(\n name=\"query\",\n display_name=\"Search Query\",\n info=\"The text that the API compares page and database titles against.\",\n ),\n DropdownInput(\n name=\"filter_value\",\n display_name=\"Filter Type\",\n info=\"Limits the results to either only pages or only databases.\",\n options=[\"page\", \"database\"],\n value=\"page\",\n ),\n DropdownInput(\n name=\"sort_direction\",\n display_name=\"Sort Direction\",\n info=\"The direction to sort the results.\",\n options=[\"ascending\", \"descending\"],\n value=\"descending\",\n ),\n ]\n outputs = [\n Output(name=\"example_output\", display_name=\"Data\", method=\"run_model\"),\n Output(name=\"example_tool_output\", display_name=\"Tool\", method=\"build_tool\"),\n ]\n\n class NotionSearchSchema(BaseModel):\n query: str = Field(..., description=\"The search query text.\")\n filter_value: str = Field(default=\"page\", description=\"Filter type: 'page' or 'database'.\")\n sort_direction: str = Field(default=\"descending\", description=\"Sort direction: 'ascending' or 'descending'.\")\n\n def run_model(self) -> List[Data]:\n results = self._search_notion(self.query, self.filter_value, self.sort_direction)\n records = []\n combined_text = f\"Results found: {len(results)}\\n\\n\"\n\n for result in results:\n result_data = {\n \"id\": result[\"id\"],\n \"type\": result[\"object\"],\n \"last_edited_time\": result[\"last_edited_time\"],\n }\n\n if result[\"object\"] == \"page\":\n result_data[\"title_or_url\"] = result[\"url\"]\n text = f\"id: {result['id']}\\ntitle_or_url: {result['url']}\\n\"\n elif result[\"object\"] == \"database\":\n if \"title\" in result and isinstance(result[\"title\"], list) and len(result[\"title\"]) > 0:\n result_data[\"title_or_url\"] = result[\"title\"][0][\"plain_text\"]\n text = f\"id: {result['id']}\\ntitle_or_url: {result['title'][0]['plain_text']}\\n\"\n else:\n result_data[\"title_or_url\"] = \"N/A\"\n text = f\"id: {result['id']}\\ntitle_or_url: N/A\\n\"\n\n text += f\"type: {result['object']}\\nlast_edited_time: {result['last_edited_time']}\\n\\n\"\n combined_text += text\n records.append(Data(text=text, data=result_data))\n\n self.status = records\n return records\n\n def build_tool(self) -> Tool:\n return StructuredTool.from_function(\n name=\"notion_search\",\n description=\"Search Notion pages and databases. Input should include the search query and optionally filter type and sort direction.\",\n func=self._search_notion,\n args_schema=self.NotionSearchSchema,\n )\n\n def _search_notion(\n self, query: str, filter_value: str = \"page\", sort_direction: str = \"descending\"\n ) -> List[Dict[str, Any]]:\n url = \"https://api.notion.com/v1/search\"\n headers = {\n \"Authorization\": f\"Bearer {self.notion_secret}\",\n \"Content-Type\": \"application/json\",\n \"Notion-Version\": \"2022-06-28\",\n }\n\n data = {\n \"query\": query,\n \"filter\": {\"value\": filter_value, \"property\": \"object\"},\n \"sort\": {\"direction\": sort_direction, \"timestamp\": \"last_edited_time\"},\n }\n\n response = requests.post(url, headers=headers, json=data)\n response.raise_for_status()\n\n results = response.json()\n return results[\"results\"]\n", + "fileTypes": [], + "file_path": "", + "password": false, + "name": "code", + "advanced": true, + "dynamic": true, + "info": "", + "load_from_db": false, + "title_case": false + }, + "filter_value": { + "trace_as_metadata": true, + "options": [ + "page", + "database" + ], + "combobox": false, + "required": false, + "placeholder": "", + "show": true, + "name": "filter_value", + "value": "page", + "display_name": "Filter Type", + "advanced": true, + "dynamic": false, + "info": "Limits the results to either only pages or only databases.", + "title_case": false, + "type": "str", + "_input_type": "DropdownInput" + }, + "notion_secret": { + "load_from_db": true, + "required": true, + "placeholder": "", + "show": true, + "name": "notion_secret", + "value": "", + "display_name": "Notion Secret", + "advanced": false, + "input_types": [ + "Message" + ], + "dynamic": false, + "info": "The Notion integration token.", + "title_case": false, + "password": true, + "type": "str", + "_input_type": "SecretStrInput" + }, + "query": { + "trace_as_metadata": true, + "load_from_db": false, + "list": false, + "required": false, + "placeholder": "", + "show": true, + "name": "query", + "value": "", + "display_name": "Search Query", + "advanced": true, + "dynamic": false, + "info": "The text that the API compares page and database titles against.", + "title_case": false, + "type": "str", + "_input_type": "StrInput" + }, + "sort_direction": { + "trace_as_metadata": true, + "options": [ + "ascending", + "descending" + ], + "combobox": false, + "required": false, + "placeholder": "", + "show": true, + "name": "sort_direction", + "value": "descending", + "display_name": "Sort Direction", + "advanced": true, + "dynamic": false, + "info": "The direction to sort the results.", + "title_case": false, + "type": "str", + "_input_type": "DropdownInput" + } + }, + "description": "Searches all pages and databases that have been shared with an integration. The search field can be an empty value to show all values from that search", + "icon": "NotionDirectoryLoader", + "base_classes": [ + "Data", + "Tool" + ], + "display_name": "Search ", + "documentation": "https://docs.langflow.org/integrations/notion/search", + "custom_fields": {}, + "output_types": [], + "pinned": false, + "conditional_paths": [], + "frozen": false, + "outputs": [ + { + "types": [ + "Data" + ], + "selected": "Data", + "name": "example_output", + "display_name": "Data", + "method": "run_model", + "value": "__UNDEFINED__", + "cache": true, + "hidden": true + }, + { + "types": [ + "Tool" + ], + "selected": "Tool", + "name": "example_tool_output", + "display_name": "Tool", + "method": "build_tool", + "value": "__UNDEFINED__", + "cache": true + } + ], + "field_order": [ + "notion_secret", + "query", + "filter_value", + "sort_direction" + ], + "beta": false, + "edited": true, + "lf_version": "1.0.17" + }, + "id": "NotionSearch-VS2mI", + "description": "Searches all pages and databases that have been shared with an integration.", + "display_name": "Search " + }, + "selected": false, + "width": 384, + "height": 386, + "dragging": false, + "positionAbsolute": { + "x": 2258.1166047519732, + "y": 2034.3959294952945 + } + }, + { + "id": "NotionPageUpdate-6FyYd", + "type": "genericNode", + "position": { + "x": 1827.0574354713603, + "y": 2055.9948126656136 + }, + "data": { + "type": "NotionPageUpdate", + "node": { + "template": { + "_type": "Component", + "code": { + "type": "code", + "required": true, + "placeholder": "", + "list": false, + "show": true, + "multiline": true, + "value": "import json\nimport requests\nfrom typing import Dict, Any, Union\nfrom pydantic import BaseModel, Field\nfrom langflow.base.langchain_utilities.model import LCToolComponent\nfrom langflow.inputs import SecretStrInput, StrInput, MultilineInput\nfrom langflow.schema import Data\nfrom langflow.field_typing import Tool\nfrom langchain.tools import StructuredTool\nfrom loguru import logger\nfrom langflow.io import Output\n\nclass NotionPageUpdate(LCToolComponent):\n display_name: str = \"Update Page Property \"\n description: str = \"Update the properties of a Notion page.\"\n documentation: str = \"https://docs.langflow.org/integrations/notion/page-update\"\n icon = \"NotionDirectoryLoader\"\n\n inputs = [\n StrInput(\n name=\"page_id\",\n display_name=\"Page ID\",\n info=\"The ID of the Notion page to update.\",\n ),\n MultilineInput(\n name=\"properties\",\n display_name=\"Properties\",\n info=\"The properties to update on the page (as a JSON string or a dictionary).\",\n ),\n SecretStrInput(\n name=\"notion_secret\",\n display_name=\"Notion Secret\",\n info=\"The Notion integration token.\",\n required=True,\n ),\n ]\n outputs = [\n Output(name=\"example_output\", display_name=\"Data\", method=\"run_model\"),\n Output(name=\"example_tool_output\", display_name=\"Tool\", method=\"build_tool\"),\n ]\n\n class NotionPageUpdateSchema(BaseModel):\n page_id: str = Field(..., description=\"The ID of the Notion page to update.\")\n properties: Union[str, Dict[str, Any]] = Field(\n ..., description=\"The properties to update on the page (as a JSON string or a dictionary).\"\n )\n\n def run_model(self) -> Data:\n result = self._update_notion_page(self.page_id, self.properties)\n if isinstance(result, str):\n # An error occurred, return it as text\n return Data(text=result)\n else:\n # Success, return the updated page data\n output = \"Updated page properties:\\n\"\n for prop_name, prop_value in result.get(\"properties\", {}).items():\n output += f\"{prop_name}: {prop_value}\\n\"\n return Data(text=output, data=result)\n\n def build_tool(self) -> Tool:\n return StructuredTool.from_function(\n name=\"update_notion_page\",\n description=\"Update the properties of a Notion page. IMPORTANT: Use the tool to check the Database properties for more details before using this tool.\",\n func=self._update_notion_page,\n args_schema=self.NotionPageUpdateSchema,\n )\n\n def _update_notion_page(self, page_id: str, properties: Union[str, Dict[str, Any]]) -> Union[Dict[str, Any], str]:\n url = f\"https://api.notion.com/v1/pages/{page_id}\"\n headers = {\n \"Authorization\": f\"Bearer {self.notion_secret}\",\n \"Content-Type\": \"application/json\",\n \"Notion-Version\": \"2022-06-28\", # Use the latest supported version\n }\n\n # Parse properties if it's a string\n if isinstance(properties, str):\n try:\n parsed_properties = json.loads(properties)\n except json.JSONDecodeError as e:\n error_message = f\"Invalid JSON format for properties: {str(e)}\"\n logger.error(error_message)\n return error_message\n\n else:\n parsed_properties = properties\n\n data = {\"properties\": parsed_properties}\n\n try:\n logger.info(f\"Sending request to Notion API: URL: {url}, Data: {json.dumps(data)}\")\n response = requests.patch(url, headers=headers, json=data)\n response.raise_for_status()\n updated_page = response.json()\n\n logger.info(f\"Successfully updated Notion page. Response: {json.dumps(updated_page)}\")\n return updated_page\n except requests.exceptions.HTTPError as e:\n error_message = f\"HTTP Error occurred: {str(e)}\"\n if e.response is not None:\n error_message += f\"\\nStatus code: {e.response.status_code}\"\n error_message += f\"\\nResponse body: {e.response.text}\"\n logger.error(error_message)\n return error_message\n except requests.exceptions.RequestException as e:\n error_message = f\"An error occurred while making the request: {str(e)}\"\n logger.error(error_message)\n return error_message\n except Exception as e:\n error_message = f\"An unexpected error occurred: {str(e)}\"\n logger.error(error_message)\n return error_message\n\n def __call__(self, *args, **kwargs):\n return self._update_notion_page(*args, **kwargs)\n", + "fileTypes": [], + "file_path": "", + "password": false, + "name": "code", + "advanced": true, + "dynamic": true, + "info": "", + "load_from_db": false, + "title_case": false + }, + "notion_secret": { + "load_from_db": true, + "required": true, + "placeholder": "", + "show": true, + "name": "notion_secret", + "value": "", + "display_name": "Notion Secret", + "advanced": false, + "input_types": [ + "Message" + ], + "dynamic": false, + "info": "The Notion integration token.", + "title_case": false, + "password": true, + "type": "str", + "_input_type": "SecretStrInput" + }, + "page_id": { + "trace_as_metadata": true, + "load_from_db": false, + "list": false, + "required": false, + "placeholder": "", + "show": true, + "name": "page_id", + "value": "", + "display_name": "Page ID", + "advanced": true, + "dynamic": false, + "info": "The ID of the Notion page to update.", + "title_case": false, + "type": "str", + "_input_type": "StrInput" + }, + "properties": { + "trace_as_input": true, + "multiline": true, + "trace_as_metadata": true, + "load_from_db": false, + "list": false, + "required": false, + "placeholder": "", + "show": true, + "name": "properties", + "value": "", + "display_name": "Properties", + "advanced": true, + "input_types": [ + "Message" + ], + "dynamic": false, + "info": "The properties to update on the page (as a JSON string or a dictionary).", + "title_case": false, + "type": "str", + "_input_type": "MultilineInput" + } + }, + "description": "Update the properties of a Notion page.", + "icon": "NotionDirectoryLoader", + "base_classes": [ + "Data", + "Tool" + ], + "display_name": "Update Page Property ", + "documentation": "https://docs.langflow.org/integrations/notion/page-update", + "custom_fields": {}, + "output_types": [], + "pinned": false, + "conditional_paths": [], + "frozen": false, + "outputs": [ + { + "types": [ + "Data" + ], + "selected": "Data", + "name": "example_output", + "display_name": "Data", + "method": "run_model", + "value": "__UNDEFINED__", + "cache": true, + "hidden": true + }, + { + "types": [ + "Tool" + ], + "selected": "Tool", + "name": "example_tool_output", + "display_name": "Tool", + "method": "build_tool", + "value": "__UNDEFINED__", + "cache": true + } + ], + "field_order": [ + "page_id", + "properties", + "notion_secret" + ], + "beta": false, + "edited": true, + "lf_version": "1.0.17" + }, + "id": "NotionPageUpdate-6FyYd", + "description": "Update the properties of a Notion page.", + "display_name": "Update Page Property " + }, + "selected": false, + "width": 384, + "height": 302, + "dragging": false, + "positionAbsolute": { + "x": 1827.0574354713603, + "y": 2055.9948126656136 + } + }, + { + "id": "ToolCallingAgent-50Gcd", + "type": "genericNode", + "position": { + "x": 2186.0530739759893, + "y": 612.1744804997304 + }, + "data": { + "type": "ToolCallingAgent", + "node": { + "template": { + "_type": "Component", + "chat_history": { + "trace_as_metadata": true, + "list": true, + "trace_as_input": true, + "required": false, + "placeholder": "", + "show": true, + "name": "chat_history", + "value": "", + "display_name": "Chat History", + "advanced": false, + "input_types": [ + "Data" + ], + "dynamic": false, + "info": "", + "title_case": false, + "type": "other", + "_input_type": "DataInput" + }, + "llm": { + "trace_as_metadata": true, + "list": false, + "required": true, + "placeholder": "", + "show": true, + "name": "llm", + "value": "", + "display_name": "Language Model", + "advanced": false, + "input_types": [ + "LanguageModel" + ], + "dynamic": false, + "info": "", + "title_case": false, + "type": "other", + "_input_type": "HandleInput" + }, + "tools": { + "trace_as_metadata": true, + "list": true, + "required": false, + "placeholder": "", + "show": true, + "name": "tools", + "value": "", + "display_name": "Tools", + "advanced": false, + "input_types": [ + "Tool", + "BaseTool" + ], + "dynamic": false, + "info": "", + "title_case": false, + "type": "other", + "_input_type": "HandleInput" + }, + "code": { + "type": "code", + "required": true, + "placeholder": "", + "list": false, + "show": true, + "multiline": true, + "value": "from typing import Optional, List\n\nfrom langchain.agents import create_tool_calling_agent\nfrom langchain_core.prompts import ChatPromptTemplate, PromptTemplate, HumanMessagePromptTemplate\nfrom langflow.base.agents.agent import LCToolsAgentComponent\nfrom langflow.inputs import MultilineInput\nfrom langflow.inputs.inputs import HandleInput, DataInput\nfrom langflow.schema import Data\n\n\nclass ToolCallingAgentComponent(LCToolsAgentComponent):\n display_name: str = \"Tool Calling Agent\"\n description: str = \"Agent that uses tools\"\n icon = \"LangChain\"\n beta = True\n name = \"ToolCallingAgent\"\n\n inputs = LCToolsAgentComponent._base_inputs + [\n HandleInput(name=\"llm\", display_name=\"Language Model\", input_types=[\"LanguageModel\"], required=True),\n MultilineInput(\n name=\"system_prompt\",\n display_name=\"System Prompt\",\n info=\"System prompt for the agent.\",\n value=\"You are a helpful assistant\",\n ),\n MultilineInput(\n name=\"user_prompt\", display_name=\"Prompt\", info=\"This prompt must contain 'input' key.\", value=\"{input}\"\n ),\n DataInput(name=\"chat_history\", display_name=\"Chat History\", is_list=True, advanced=True),\n ]\n\n def get_chat_history_data(self) -> Optional[List[Data]]:\n return self.chat_history\n\n def create_agent_runnable(self):\n if \"input\" not in self.user_prompt:\n raise ValueError(\"Prompt must contain 'input' key.\")\n messages = [\n (\"system\", self.system_prompt),\n (\"placeholder\", \"{chat_history}\"),\n HumanMessagePromptTemplate(prompt=PromptTemplate(input_variables=[\"input\"], template=self.user_prompt)),\n (\"placeholder\", \"{agent_scratchpad}\"),\n ]\n prompt = ChatPromptTemplate.from_messages(messages)\n return create_tool_calling_agent(self.llm, self.tools, prompt)\n", + "fileTypes": [], + "file_path": "", + "password": false, + "name": "code", + "advanced": true, + "dynamic": true, + "info": "", + "load_from_db": false, + "title_case": false + }, + "handle_parsing_errors": { + "trace_as_metadata": true, + "list": false, + "required": false, + "placeholder": "", + "show": true, + "name": "handle_parsing_errors", + "value": true, + "display_name": "Handle Parse Errors", + "advanced": true, + "dynamic": false, + "info": "", + "title_case": false, + "type": "bool", + "_input_type": "BoolInput" + }, + "input_value": { + "trace_as_input": true, + "trace_as_metadata": true, + "load_from_db": false, + "list": false, + "required": false, + "placeholder": "", + "show": true, + "name": "input_value", + "value": "", + "display_name": "Input", + "advanced": false, + "input_types": [ + "Message" + ], + "dynamic": false, + "info": "", + "title_case": false, + "type": "str", + "_input_type": "MessageTextInput" + }, + "max_iterations": { + "trace_as_metadata": true, + "list": false, + "required": false, + "placeholder": "", + "show": true, + "name": "max_iterations", + "value": 15, + "display_name": "Max Iterations", + "advanced": true, + "dynamic": false, + "info": "", + "title_case": false, + "type": "int", + "_input_type": "IntInput" + }, + "system_prompt": { + "trace_as_input": true, + "multiline": true, + "trace_as_metadata": true, + "load_from_db": false, + "list": false, + "required": false, + "placeholder": "", + "show": true, + "name": "system_prompt", + "value": "", + "display_name": "System Prompt", + "advanced": false, + "input_types": [ + "Message" + ], + "dynamic": false, + "info": "System prompt for the agent.", + "title_case": false, + "type": "str", + "_input_type": "MultilineInput" + }, + "user_prompt": { + "trace_as_input": true, + "multiline": true, + "trace_as_metadata": true, + "load_from_db": false, + "list": false, + "required": false, + "placeholder": "", + "show": true, + "name": "user_prompt", + "value": "{input}", + "display_name": "Prompt", + "advanced": true, + "input_types": [ + "Message" + ], + "dynamic": false, + "info": "This prompt must contain 'input' key.", + "title_case": false, + "type": "str", + "_input_type": "MultilineInput" + }, + "verbose": { + "trace_as_metadata": true, + "list": false, + "required": false, + "placeholder": "", + "show": true, + "name": "verbose", + "value": true, + "display_name": "Verbose", + "advanced": true, + "dynamic": false, + "info": "", + "title_case": false, + "type": "bool", + "_input_type": "BoolInput" + } + }, + "description": "Agent that uses tools", + "icon": "LangChain", + "base_classes": [ + "AgentExecutor", + "Message" + ], + "display_name": "Tool Calling Agent", + "documentation": "", + "custom_fields": {}, + "output_types": [], + "pinned": false, + "conditional_paths": [], + "frozen": false, + "outputs": [ + { + "types": [ + "AgentExecutor" + ], + "selected": "AgentExecutor", + "name": "agent", + "display_name": "Agent", + "method": "build_agent", + "value": "__UNDEFINED__", + "cache": true, + "hidden": true + }, + { + "types": [ + "Message" + ], + "selected": "Message", + "name": "response", + "display_name": "Response", + "method": "message_response", + "value": "__UNDEFINED__", + "cache": true + } + ], + "field_order": [ + "input_value", + "handle_parsing_errors", + "verbose", + "max_iterations", + "tools", + "llm", + "system_prompt", + "user_prompt", + "chat_history" + ], + "beta": true, + "edited": false, + "lf_version": "1.0.17" + }, + "id": "ToolCallingAgent-50Gcd" + }, + "selected": false, + "width": 384, + "height": 532, + "dragging": false, + "positionAbsolute": { + "x": 2186.0530739759893, + "y": 612.1744804997304 + } + }, + { + "id": "ChatOutput-TSCup", + "type": "genericNode", + "position": { + "x": 2649.190603849412, + "y": 841.0466487848925 + }, + "data": { + "type": "ChatOutput", + "node": { + "template": { + "_type": "Component", + "code": { + "type": "code", + "required": true, + "placeholder": "", + "list": false, + "show": true, + "multiline": true, + "value": "from langflow.base.io.chat import ChatComponent\nfrom langflow.inputs import BoolInput\nfrom langflow.io import DropdownInput, MessageTextInput, Output\nfrom langflow.memory import store_message\nfrom langflow.schema.message import Message\nfrom langflow.utils.constants import MESSAGE_SENDER_AI, MESSAGE_SENDER_NAME_AI, MESSAGE_SENDER_USER\n\n\nclass ChatOutput(ChatComponent):\n display_name = \"Chat Output\"\n description = \"Display a chat message in the Playground.\"\n icon = \"ChatOutput\"\n name = \"ChatOutput\"\n\n inputs = [\n MessageTextInput(\n name=\"input_value\",\n display_name=\"Text\",\n info=\"Message to be passed as output.\",\n ),\n BoolInput(\n name=\"should_store_message\",\n display_name=\"Store Messages\",\n info=\"Store the message in the history.\",\n value=True,\n advanced=True,\n ),\n DropdownInput(\n name=\"sender\",\n display_name=\"Sender Type\",\n options=[MESSAGE_SENDER_AI, MESSAGE_SENDER_USER],\n value=MESSAGE_SENDER_AI,\n advanced=True,\n info=\"Type of sender.\",\n ),\n MessageTextInput(\n name=\"sender_name\",\n display_name=\"Sender Name\",\n info=\"Name of the sender.\",\n value=MESSAGE_SENDER_NAME_AI,\n advanced=True,\n ),\n MessageTextInput(\n name=\"session_id\",\n display_name=\"Session ID\",\n info=\"The session ID of the chat. If empty, the current session ID parameter will be used.\",\n advanced=True,\n ),\n MessageTextInput(\n name=\"data_template\",\n display_name=\"Data Template\",\n value=\"{text}\",\n advanced=True,\n info=\"Template to convert Data to Text. If left empty, it will be dynamically set to the Data's text key.\",\n ),\n ]\n outputs = [\n Output(display_name=\"Message\", name=\"message\", method=\"message_response\"),\n ]\n\n def message_response(self) -> Message:\n message = Message(\n text=self.input_value,\n sender=self.sender,\n sender_name=self.sender_name,\n session_id=self.session_id,\n )\n if (\n self.session_id\n and isinstance(message, Message)\n and isinstance(message.text, str)\n and self.should_store_message\n ):\n store_message(\n message,\n flow_id=self.graph.flow_id,\n )\n self.message.value = message\n\n self.status = message\n return message\n", + "fileTypes": [], + "file_path": "", + "password": false, + "name": "code", + "advanced": true, + "dynamic": true, + "info": "", + "load_from_db": false, + "title_case": false + }, + "data_template": { + "trace_as_input": true, + "trace_as_metadata": true, + "load_from_db": false, + "list": false, + "required": false, + "placeholder": "", + "show": true, + "name": "data_template", + "value": "{text}", + "display_name": "Data Template", + "advanced": true, + "input_types": [ + "Message" + ], + "dynamic": false, + "info": "Template to convert Data to Text. If left empty, it will be dynamically set to the Data's text key.", + "title_case": false, + "type": "str", + "_input_type": "MessageTextInput" + }, + "input_value": { + "trace_as_input": true, + "trace_as_metadata": true, + "load_from_db": false, + "list": false, + "required": false, + "placeholder": "", + "show": true, + "name": "input_value", + "value": "", + "display_name": "Text", + "advanced": false, + "input_types": [ + "Message" + ], + "dynamic": false, + "info": "Message to be passed as output.", + "title_case": false, + "type": "str", + "_input_type": "MessageTextInput" + }, + "sender": { + "trace_as_metadata": true, + "options": [ + "Machine", + "User" + ], + "combobox": false, + "required": false, + "placeholder": "", + "show": true, + "name": "sender", + "value": "Machine", + "display_name": "Sender Type", + "advanced": true, + "dynamic": false, + "info": "Type of sender.", + "title_case": false, + "type": "str", + "_input_type": "DropdownInput" + }, + "sender_name": { + "trace_as_input": true, + "trace_as_metadata": true, + "load_from_db": false, + "list": false, + "required": false, + "placeholder": "", + "show": true, + "name": "sender_name", + "value": "AI", + "display_name": "Sender Name", + "advanced": true, + "input_types": [ + "Message" + ], + "dynamic": false, + "info": "Name of the sender.", + "title_case": false, + "type": "str", + "_input_type": "MessageTextInput" + }, + "session_id": { + "trace_as_input": true, + "trace_as_metadata": true, + "load_from_db": false, + "list": false, + "required": false, + "placeholder": "", + "show": true, + "name": "session_id", + "value": "", + "display_name": "Session ID", + "advanced": true, + "input_types": [ + "Message" + ], + "dynamic": false, + "info": "The session ID of the chat. If empty, the current session ID parameter will be used.", + "title_case": false, + "type": "str", + "_input_type": "MessageTextInput" + }, + "should_store_message": { + "trace_as_metadata": true, + "list": false, + "required": false, + "placeholder": "", + "show": true, + "name": "should_store_message", + "value": true, + "display_name": "Store Messages", + "advanced": true, + "dynamic": false, + "info": "Store the message in the history.", + "title_case": false, + "type": "bool", + "_input_type": "BoolInput" + } + }, + "description": "Display a chat message in the Playground.", + "icon": "ChatOutput", + "base_classes": [ + "Message" + ], + "display_name": "Chat Output", + "documentation": "", + "custom_fields": {}, + "output_types": [], + "pinned": false, + "conditional_paths": [], + "frozen": false, + "outputs": [ + { + "types": [ + "Message" + ], + "selected": "Message", + "name": "message", + "display_name": "Message", + "method": "message_response", + "value": "__UNDEFINED__", + "cache": true + } + ], + "field_order": [ + "input_value", + "should_store_message", + "sender", + "sender_name", + "session_id", + "data_template" + ], + "beta": false, + "edited": false, + "lf_version": "1.0.17" + }, + "id": "ChatOutput-TSCup" + }, + "selected": false, + "width": 384, + "height": 302, + "positionAbsolute": { + "x": 2649.190603849412, + "y": 841.0466487848925 + }, + "dragging": false + }, + { + "id": "ChatInput-bcq6D", + "type": "genericNode", + "position": { + "x": 557.6262725075026, + "y": 724.8518930903978 + }, + "data": { + "type": "ChatInput", + "node": { + "template": { + "_type": "Component", + "files": { + "trace_as_metadata": true, + "file_path": "", + "fileTypes": [ + "txt", + "md", + "mdx", + "csv", + "json", + "yaml", + "yml", + "xml", + "html", + "htm", + "pdf", + "docx", + "py", + "sh", + "sql", + "js", + "ts", + "tsx", + "jpg", + "jpeg", + "png", + "bmp", + "image" + ], + "list": true, + "required": false, + "placeholder": "", + "show": true, + "name": "files", + "value": "", + "display_name": "Files", + "advanced": true, + "dynamic": false, + "info": "Files to be sent with the message.", + "title_case": false, + "type": "file", + "_input_type": "FileInput" + }, + "code": { + "type": "code", + "required": true, + "placeholder": "", + "list": false, + "show": true, + "multiline": true, + "value": "from langflow.base.data.utils import IMG_FILE_TYPES, TEXT_FILE_TYPES\nfrom langflow.base.io.chat import ChatComponent\nfrom langflow.inputs import BoolInput\nfrom langflow.io import DropdownInput, FileInput, MessageTextInput, MultilineInput, Output\nfrom langflow.memory import store_message\nfrom langflow.schema.message import Message\nfrom langflow.utils.constants import MESSAGE_SENDER_AI, MESSAGE_SENDER_USER, MESSAGE_SENDER_NAME_USER\n\n\nclass ChatInput(ChatComponent):\n display_name = \"Chat Input\"\n description = \"Get chat inputs from the Playground.\"\n icon = \"ChatInput\"\n name = \"ChatInput\"\n\n inputs = [\n MultilineInput(\n name=\"input_value\",\n display_name=\"Text\",\n value=\"\",\n info=\"Message to be passed as input.\",\n ),\n BoolInput(\n name=\"should_store_message\",\n display_name=\"Store Messages\",\n info=\"Store the message in the history.\",\n value=True,\n advanced=True,\n ),\n DropdownInput(\n name=\"sender\",\n display_name=\"Sender Type\",\n options=[MESSAGE_SENDER_AI, MESSAGE_SENDER_USER],\n value=MESSAGE_SENDER_USER,\n info=\"Type of sender.\",\n advanced=True,\n ),\n MessageTextInput(\n name=\"sender_name\",\n display_name=\"Sender Name\",\n info=\"Name of the sender.\",\n value=MESSAGE_SENDER_NAME_USER,\n advanced=True,\n ),\n MessageTextInput(\n name=\"session_id\",\n display_name=\"Session ID\",\n info=\"The session ID of the chat. If empty, the current session ID parameter will be used.\",\n advanced=True,\n ),\n FileInput(\n name=\"files\",\n display_name=\"Files\",\n file_types=TEXT_FILE_TYPES + IMG_FILE_TYPES,\n info=\"Files to be sent with the message.\",\n advanced=True,\n is_list=True,\n ),\n ]\n outputs = [\n Output(display_name=\"Message\", name=\"message\", method=\"message_response\"),\n ]\n\n def message_response(self) -> Message:\n message = Message(\n text=self.input_value,\n sender=self.sender,\n sender_name=self.sender_name,\n session_id=self.session_id,\n files=self.files,\n )\n\n if (\n self.session_id\n and isinstance(message, Message)\n and isinstance(message.text, str)\n and self.should_store_message\n ):\n store_message(\n message,\n flow_id=self.graph.flow_id,\n )\n self.message.value = message\n\n self.status = message\n return message\n", + "fileTypes": [], + "file_path": "", + "password": false, + "name": "code", + "advanced": true, + "dynamic": true, + "info": "", + "load_from_db": false, + "title_case": false + }, + "input_value": { + "trace_as_input": true, + "multiline": true, + "trace_as_metadata": true, + "load_from_db": false, + "list": false, + "required": false, + "placeholder": "", + "show": true, + "name": "input_value", + "value": "list users", + "display_name": "Text", + "advanced": false, + "input_types": [ + "Message" + ], + "dynamic": false, + "info": "Message to be passed as input.", + "title_case": false, + "type": "str", + "_input_type": "MultilineInput" + }, + "sender": { + "trace_as_metadata": true, + "options": [ + "Machine", + "User" + ], + "combobox": false, + "required": false, + "placeholder": "", + "show": true, + "name": "sender", + "value": "User", + "display_name": "Sender Type", + "advanced": true, + "dynamic": false, + "info": "Type of sender.", + "title_case": false, + "type": "str", + "_input_type": "DropdownInput" + }, + "sender_name": { + "trace_as_input": true, + "trace_as_metadata": true, + "load_from_db": false, + "list": false, + "required": false, + "placeholder": "", + "show": true, + "name": "sender_name", + "value": "User", + "display_name": "Sender Name", + "advanced": true, + "input_types": [ + "Message" + ], + "dynamic": false, + "info": "Name of the sender.", + "title_case": false, + "type": "str", + "_input_type": "MessageTextInput" + }, + "session_id": { + "trace_as_input": true, + "trace_as_metadata": true, + "load_from_db": false, + "list": false, + "required": false, + "placeholder": "", + "show": true, + "name": "session_id", + "value": "", + "display_name": "Session ID", + "advanced": true, + "input_types": [ + "Message" + ], + "dynamic": false, + "info": "The session ID of the chat. If empty, the current session ID parameter will be used.", + "title_case": false, + "type": "str", + "_input_type": "MessageTextInput" + }, + "should_store_message": { + "trace_as_metadata": true, + "list": false, + "required": false, + "placeholder": "", + "show": true, + "name": "should_store_message", + "value": true, + "display_name": "Store Messages", + "advanced": true, + "dynamic": false, + "info": "Store the message in the history.", + "title_case": false, + "type": "bool", + "_input_type": "BoolInput" + } + }, + "description": "Get chat inputs from the Playground.", + "icon": "ChatInput", + "base_classes": [ + "Message" + ], + "display_name": "Chat Input", + "documentation": "", + "custom_fields": {}, + "output_types": [], + "pinned": false, + "conditional_paths": [], + "frozen": false, + "outputs": [ + { + "types": [ + "Message" + ], + "selected": "Message", + "name": "message", + "display_name": "Message", + "method": "message_response", + "value": "__UNDEFINED__", + "cache": true + } + ], + "field_order": [ + "input_value", + "should_store_message", + "sender", + "sender_name", + "session_id", + "files" + ], + "beta": false, + "edited": false, + "lf_version": "1.0.17" + }, + "id": "ChatInput-bcq6D" + }, + "selected": false, + "width": 384, + "height": 302, + "positionAbsolute": { + "x": 557.6262725075026, + "y": 724.8518930903978 + }, + "dragging": false + }, + { + "id": "ToolkitComponent-2lNG0", + "type": "genericNode", + "position": { + "x": 1731.8884789245508, + "y": 1378.7846304343796 + }, + "data": { + "type": "ToolkitComponent", + "node": { + "template": { + "_type": "Component", + "tools": { + "trace_as_metadata": true, + "list": true, + "required": false, + "placeholder": "", + "show": true, + "name": "tools", + "value": "", + "display_name": "Tools", + "advanced": false, + "input_types": [ + "Tool" + ], + "dynamic": false, + "info": "List of tools to combine.", + "title_case": false, + "type": "other", + "_input_type": "HandleInput" + }, + "code": { + "type": "code", + "required": true, + "placeholder": "", + "list": false, + "show": true, + "multiline": true, + "value": "from typing import List\r\nfrom langflow.custom import Component\r\nfrom langflow.inputs import HandleInput, MessageTextInput\r\nfrom langflow.template import Output\r\nfrom langflow.field_typing import Tool, Embeddings\r\nfrom langchain.tools.base import BaseTool, StructuredTool\r\nfrom langflow.schema import Data\r\n\r\nclass ToolkitComponent(Component):\r\n display_name = \"Toolkit\"\r\n description = \"Combines multiple tools into a single list of tools.\"\r\n icon = \"pocket-knife\"\r\n\r\n inputs = [\r\n HandleInput(\r\n name=\"tools\",\r\n display_name=\"Tools\",\r\n input_types=[\"Tool\"],\r\n info=\"List of tools to combine.\",\r\n is_list=True,\r\n ),\r\n ]\r\n\r\n outputs = [\r\n Output(display_name=\"Tools\", name=\"generated_tools\", method=\"generate_toolkit\"),\r\n Output(display_name=\"Tool Data\", name=\"tool_data\", method=\"generate_tool_data\"),\r\n ]\r\n\r\n def generate_toolkit(self) -> List[BaseTool]:\r\n combined_tools = []\r\n name_count = {}\r\n for index, tool in enumerate(self.tools):\r\n self.log(f\"Processing tool {index}: {type(tool)}\")\r\n if isinstance(tool, (BaseTool, StructuredTool)):\r\n processed_tool = tool\r\n elif hasattr(tool, 'build_tool'):\r\n processed_tool = tool.build_tool()\r\n else:\r\n self.log(f\"Unsupported tool type: {type(tool)}. Attempting to process anyway.\")\r\n processed_tool = tool\r\n\r\n original_name = getattr(processed_tool, 'name', f\"UnnamedTool_{index}\")\r\n self.log(f\"Original tool name: {original_name}\")\r\n\r\n if original_name not in name_count:\r\n name_count[original_name] = 0\r\n final_name = original_name\r\n else:\r\n name_count[original_name] += 1\r\n final_name = f\"{original_name}_{name_count[original_name]}\"\r\n\r\n if hasattr(processed_tool, 'name'):\r\n processed_tool.name = final_name\r\n\r\n self.log(f\"Final tool name: {final_name}\")\r\n\r\n if isinstance(processed_tool, StructuredTool) and hasattr(processed_tool, 'args_schema'):\r\n processed_tool.args_schema.name = f\"{final_name}_Schema\"\r\n\r\n combined_tools.append(processed_tool)\r\n\r\n debug_info = \"\\n\".join([f\"Tool {i}: {getattr(tool, 'name', f'UnnamedTool_{i}')} (Original: {getattr(tool, '_original_name', 'N/A')}) - Type: {type(tool)}\" for i, tool in enumerate(combined_tools)])\r\n self.log(\"Final toolkit composition:\")\r\n self.log(debug_info)\r\n\r\n\r\n self.status = combined_tools\r\n return combined_tools\r\n\r\n def generate_tool_data(self) -> List[Data]:\r\n tool_data = []\r\n for tool in self.generate_toolkit():\r\n tool_data.append(Data(\r\n data={\r\n \"name\": getattr(tool, 'name', 'Unnamed Tool'),\r\n \"description\": getattr(tool, 'description', 'No description available')\r\n }\r\n ))\r\n return tool_data", + "fileTypes": [], + "file_path": "", + "password": false, + "name": "code", + "advanced": true, + "dynamic": true, + "info": "", + "load_from_db": false, + "title_case": false + } + }, + "description": "Combines multiple tools into a single list of tools.", + "icon": "pocket-knife", + "base_classes": [ + "BaseTool", + "Data" + ], + "display_name": "Toolkit", + "documentation": "", + "custom_fields": {}, + "output_types": [], + "pinned": false, + "conditional_paths": [], + "frozen": false, + "outputs": [ + { + "types": [ + "BaseTool" + ], + "selected": "BaseTool", + "name": "generated_tools", + "display_name": "Tools", + "method": "generate_toolkit", + "value": "__UNDEFINED__", + "cache": true + }, + { + "types": [ + "Data" + ], + "selected": "Data", + "name": "tool_data", + "display_name": "Tool Data", + "method": "generate_tool_data", + "value": "__UNDEFINED__", + "cache": true, + "hidden": true + } + ], + "field_order": [ + "tools" + ], + "beta": false, + "edited": true, + "lf_version": "1.0.17" + }, + "id": "ToolkitComponent-2lNG0" + }, + "selected": false, + "width": 384, + "height": 292, + "dragging": false, + "positionAbsolute": { + "x": 1731.8884789245508, + "y": 1378.7846304343796 + } + }, + { + "id": "OpenAIModel-BJWIg", + "type": "genericNode", + "position": { + "x": 1718.9773974162958, + "y": 603.4642741725065 + }, + "data": { + "type": "OpenAIModel", + "node": { + "template": { + "_type": "Component", + "api_key": { + "load_from_db": true, + "required": false, + "placeholder": "", + "show": true, + "name": "api_key", + "value": "", + "display_name": "OpenAI API Key", + "advanced": false, + "input_types": [ + "Message" + ], + "dynamic": false, + "info": "The OpenAI API Key to use for the OpenAI model.", + "title_case": false, + "password": true, + "type": "str", + "_input_type": "SecretStrInput" + }, + "code": { + "type": "code", + "required": true, + "placeholder": "", + "list": false, + "show": true, + "multiline": true, + "value": "import operator\nfrom functools import reduce\n\nfrom langflow.field_typing.range_spec import RangeSpec\nfrom langchain_openai import ChatOpenAI\nfrom pydantic.v1 import SecretStr\n\nfrom langflow.base.models.model import LCModelComponent\nfrom langflow.base.models.openai_constants import OPENAI_MODEL_NAMES\nfrom langflow.field_typing import LanguageModel\nfrom langflow.inputs import (\n BoolInput,\n DictInput,\n DropdownInput,\n FloatInput,\n IntInput,\n SecretStrInput,\n StrInput,\n)\n\n\nclass OpenAIModelComponent(LCModelComponent):\n display_name = \"OpenAI\"\n description = \"Generates text using OpenAI LLMs.\"\n icon = \"OpenAI\"\n name = \"OpenAIModel\"\n\n inputs = LCModelComponent._base_inputs + [\n IntInput(\n name=\"max_tokens\",\n display_name=\"Max Tokens\",\n advanced=True,\n info=\"The maximum number of tokens to generate. Set to 0 for unlimited tokens.\",\n range_spec=RangeSpec(min=0, max=128000),\n ),\n DictInput(name=\"model_kwargs\", display_name=\"Model Kwargs\", advanced=True),\n BoolInput(\n name=\"json_mode\",\n display_name=\"JSON Mode\",\n advanced=True,\n info=\"If True, it will output JSON regardless of passing a schema.\",\n ),\n DictInput(\n name=\"output_schema\",\n is_list=True,\n display_name=\"Schema\",\n advanced=True,\n info=\"The schema for the Output of the model. You must pass the word JSON in the prompt. If left blank, JSON mode will be disabled.\",\n ),\n DropdownInput(\n name=\"model_name\",\n display_name=\"Model Name\",\n advanced=False,\n options=OPENAI_MODEL_NAMES,\n value=OPENAI_MODEL_NAMES[0],\n ),\n StrInput(\n name=\"openai_api_base\",\n display_name=\"OpenAI API Base\",\n advanced=True,\n info=\"The base URL of the OpenAI API. Defaults to https://api.openai.com/v1. You can change this to use other APIs like JinaChat, LocalAI and Prem.\",\n ),\n SecretStrInput(\n name=\"api_key\",\n display_name=\"OpenAI API Key\",\n info=\"The OpenAI API Key to use for the OpenAI model.\",\n advanced=False,\n value=\"OPENAI_API_KEY\",\n ),\n FloatInput(name=\"temperature\", display_name=\"Temperature\", value=0.1),\n IntInput(\n name=\"seed\",\n display_name=\"Seed\",\n info=\"The seed controls the reproducibility of the job.\",\n advanced=True,\n value=1,\n ),\n ]\n\n def build_model(self) -> LanguageModel: # type: ignore[type-var]\n # self.output_schema is a list of dictionaries\n # let's convert it to a dictionary\n output_schema_dict: dict[str, str] = reduce(operator.ior, self.output_schema or {}, {})\n openai_api_key = self.api_key\n temperature = self.temperature\n model_name: str = self.model_name\n max_tokens = self.max_tokens\n model_kwargs = self.model_kwargs or {}\n openai_api_base = self.openai_api_base or \"https://api.openai.com/v1\"\n json_mode = bool(output_schema_dict) or self.json_mode\n seed = self.seed\n\n if openai_api_key:\n api_key = SecretStr(openai_api_key)\n else:\n api_key = None\n output = ChatOpenAI(\n max_tokens=max_tokens or None,\n model_kwargs=model_kwargs,\n model=model_name,\n base_url=openai_api_base,\n api_key=api_key,\n temperature=temperature if temperature is not None else 0.1,\n seed=seed,\n )\n if json_mode:\n if output_schema_dict:\n output = output.with_structured_output(schema=output_schema_dict, method=\"json_mode\") # type: ignore\n else:\n output = output.bind(response_format={\"type\": \"json_object\"}) # type: ignore\n\n return output # type: ignore\n\n def _get_exception_message(self, e: Exception):\n \"\"\"\n Get a message from an OpenAI exception.\n\n Args:\n exception (Exception): The exception to get the message from.\n\n Returns:\n str: The message from the exception.\n \"\"\"\n\n try:\n from openai import BadRequestError\n except ImportError:\n return\n if isinstance(e, BadRequestError):\n message = e.body.get(\"message\") # type: ignore\n if message:\n return message\n return\n", + "fileTypes": [], + "file_path": "", + "password": false, + "name": "code", + "advanced": true, + "dynamic": true, + "info": "", + "load_from_db": false, + "title_case": false + }, + "input_value": { + "trace_as_input": true, + "trace_as_metadata": true, + "load_from_db": false, + "list": false, + "required": false, + "placeholder": "", + "show": true, + "name": "input_value", + "value": "", + "display_name": "Input", + "advanced": true, + "input_types": [ + "Message" + ], + "dynamic": false, + "info": "", + "title_case": false, + "type": "str", + "_input_type": "MessageInput" + }, + "json_mode": { + "trace_as_metadata": true, + "list": false, + "required": false, + "placeholder": "", + "show": true, + "name": "json_mode", + "value": false, + "display_name": "JSON Mode", + "advanced": true, + "dynamic": false, + "info": "If True, it will output JSON regardless of passing a schema.", + "title_case": false, + "type": "bool", + "_input_type": "BoolInput" + }, + "max_tokens": { + "trace_as_metadata": true, + "range_spec": { + "step_type": "float", + "min": 0, + "max": 128000, + "step": 0.1 + }, + "list": false, + "required": false, + "placeholder": "", + "show": true, + "name": "max_tokens", + "value": "", + "display_name": "Max Tokens", + "advanced": true, + "dynamic": false, + "info": "The maximum number of tokens to generate. Set to 0 for unlimited tokens.", + "title_case": false, + "type": "int", + "_input_type": "IntInput" + }, + "model_kwargs": { + "trace_as_input": true, + "list": false, + "required": false, + "placeholder": "", + "show": true, + "name": "model_kwargs", + "value": {}, + "display_name": "Model Kwargs", + "advanced": true, + "dynamic": false, + "info": "", + "title_case": false, + "type": "dict", + "_input_type": "DictInput" + }, + "model_name": { + "trace_as_metadata": true, + "options": [ + "gpt-4o-mini", + "gpt-4o", + "gpt-4-turbo", + "gpt-4-turbo-preview", + "gpt-4", + "gpt-3.5-turbo", + "gpt-3.5-turbo-0125" + ], + "combobox": false, + "required": false, + "placeholder": "", + "show": true, + "name": "model_name", + "value": "gpt-4o", + "display_name": "Model Name", + "advanced": false, + "dynamic": false, + "info": "", + "title_case": false, + "type": "str", + "_input_type": "DropdownInput" + }, + "openai_api_base": { + "trace_as_metadata": true, + "load_from_db": false, + "list": false, + "required": false, + "placeholder": "", + "show": true, + "name": "openai_api_base", + "value": "", + "display_name": "OpenAI API Base", + "advanced": true, + "dynamic": false, + "info": "The base URL of the OpenAI API. Defaults to https://api.openai.com/v1. You can change this to use other APIs like JinaChat, LocalAI and Prem.", + "title_case": false, + "type": "str", + "_input_type": "StrInput" + }, + "output_schema": { + "trace_as_input": true, + "list": true, + "required": false, + "placeholder": "", + "show": true, + "name": "output_schema", + "value": {}, + "display_name": "Schema", + "advanced": true, + "dynamic": false, + "info": "The schema for the Output of the model. You must pass the word JSON in the prompt. If left blank, JSON mode will be disabled.", + "title_case": false, + "type": "dict", + "_input_type": "DictInput" + }, + "seed": { + "trace_as_metadata": true, + "list": false, + "required": false, + "placeholder": "", + "show": true, + "name": "seed", + "value": 1, + "display_name": "Seed", + "advanced": true, + "dynamic": false, + "info": "The seed controls the reproducibility of the job.", + "title_case": false, + "type": "int", + "_input_type": "IntInput" + }, + "stream": { + "trace_as_metadata": true, + "list": false, + "required": false, + "placeholder": "", + "show": true, + "name": "stream", + "value": false, + "display_name": "Stream", + "advanced": true, + "dynamic": false, + "info": "Stream the response from the model. Streaming works only in Chat.", + "title_case": false, + "type": "bool", + "_input_type": "BoolInput" + }, + "system_message": { + "trace_as_input": true, + "trace_as_metadata": true, + "load_from_db": false, + "list": false, + "required": false, + "placeholder": "", + "show": true, + "name": "system_message", + "value": "", + "display_name": "System Message", + "advanced": true, + "input_types": [ + "Message" + ], + "dynamic": false, + "info": "System message to pass to the model.", + "title_case": false, + "type": "str", + "_input_type": "MessageTextInput" + }, + "temperature": { + "trace_as_metadata": true, + "list": false, + "required": false, + "placeholder": "", + "show": true, + "name": "temperature", + "value": "0.2", + "display_name": "Temperature", + "advanced": true, + "dynamic": false, + "info": "", + "title_case": false, + "type": "float", + "_input_type": "FloatInput" + } + }, + "description": "Generates text using OpenAI LLMs.", + "icon": "OpenAI", + "base_classes": [ + "LanguageModel", + "Message" + ], + "display_name": "OpenAI", + "documentation": "", + "custom_fields": {}, + "output_types": [], + "pinned": false, + "conditional_paths": [], + "frozen": false, + "outputs": [ + { + "types": [ + "Message" + ], + "selected": "Message", + "name": "text_output", + "display_name": "Text", + "method": "text_response", + "value": "__UNDEFINED__", + "cache": true + }, + { + "types": [ + "LanguageModel" + ], + "selected": "LanguageModel", + "name": "model_output", + "display_name": "Language Model", + "method": "build_model", + "value": "__UNDEFINED__", + "cache": true + } + ], + "field_order": [ + "input_value", + "system_message", + "stream", + "max_tokens", + "model_kwargs", + "json_mode", + "output_schema", + "model_name", + "openai_api_base", + "api_key", + "temperature", + "seed" + ], + "beta": false, + "edited": false, + "lf_version": "1.0.17" + }, + "id": "OpenAIModel-BJWIg" + }, + "selected": false, + "width": 384, + "height": 433, + "positionAbsolute": { + "x": 1718.9773974162958, + "y": 603.4642741725065 + }, + "dragging": false + }, + { + "id": "Memory-CTQWu", + "type": "genericNode", + "position": { + "x": 1240.7186213296432, + "y": 1059.5754404393747 + }, + "data": { + "type": "Memory", + "node": { + "template": { + "_type": "Component", + "memory": { + "trace_as_metadata": true, + "list": false, + "required": false, + "placeholder": "", + "show": true, + "name": "memory", + "value": "", + "display_name": "External Memory", + "advanced": true, + "input_types": [ + "BaseChatMessageHistory" + ], + "dynamic": false, + "info": "Retrieve messages from an external memory. If empty, it will use the Langflow tables.", + "title_case": false, + "type": "other", + "_input_type": "HandleInput" + }, + "code": { + "type": "code", + "required": true, + "placeholder": "", + "list": false, + "show": true, + "multiline": true, + "value": "from langchain.memory import ConversationBufferMemory\n\nfrom langflow.custom import Component\nfrom langflow.field_typing import BaseChatMemory\nfrom langflow.helpers.data import data_to_text\nfrom langflow.inputs import HandleInput\nfrom langflow.io import DropdownInput, IntInput, MessageTextInput, MultilineInput, Output\nfrom langflow.memory import LCBuiltinChatMemory, get_messages\nfrom langflow.schema import Data\nfrom langflow.schema.message import Message\nfrom langflow.utils.constants import MESSAGE_SENDER_AI, MESSAGE_SENDER_USER\n\n\nclass MemoryComponent(Component):\n display_name = \"Chat Memory\"\n description = \"Retrieves stored chat messages from Langflow tables or an external memory.\"\n icon = \"message-square-more\"\n name = \"Memory\"\n\n inputs = [\n HandleInput(\n name=\"memory\",\n display_name=\"External Memory\",\n input_types=[\"BaseChatMessageHistory\"],\n info=\"Retrieve messages from an external memory. If empty, it will use the Langflow tables.\",\n ),\n DropdownInput(\n name=\"sender\",\n display_name=\"Sender Type\",\n options=[MESSAGE_SENDER_AI, MESSAGE_SENDER_USER, \"Machine and User\"],\n value=\"Machine and User\",\n info=\"Filter by sender type.\",\n advanced=True,\n ),\n MessageTextInput(\n name=\"sender_name\",\n display_name=\"Sender Name\",\n info=\"Filter by sender name.\",\n advanced=True,\n ),\n IntInput(\n name=\"n_messages\",\n display_name=\"Number of Messages\",\n value=100,\n info=\"Number of messages to retrieve.\",\n advanced=True,\n ),\n MessageTextInput(\n name=\"session_id\",\n display_name=\"Session ID\",\n info=\"The session ID of the chat. If empty, the current session ID parameter will be used.\",\n advanced=True,\n ),\n DropdownInput(\n name=\"order\",\n display_name=\"Order\",\n options=[\"Ascending\", \"Descending\"],\n value=\"Ascending\",\n info=\"Order of the messages.\",\n advanced=True,\n ),\n MultilineInput(\n name=\"template\",\n display_name=\"Template\",\n info=\"The template to use for formatting the data. It can contain the keys {text}, {sender} or any other key in the message data.\",\n value=\"{sender_name}: {text}\",\n advanced=True,\n ),\n ]\n\n outputs = [\n Output(display_name=\"Messages (Data)\", name=\"messages\", method=\"retrieve_messages\"),\n Output(display_name=\"Messages (Text)\", name=\"messages_text\", method=\"retrieve_messages_as_text\"),\n Output(display_name=\"Memory\", name=\"lc_memory\", method=\"build_lc_memory\"),\n ]\n\n def retrieve_messages(self) -> Data:\n sender = self.sender\n sender_name = self.sender_name\n session_id = self.session_id\n n_messages = self.n_messages\n order = \"DESC\" if self.order == \"Descending\" else \"ASC\"\n\n if sender == \"Machine and User\":\n sender = None\n\n if self.memory:\n # override session_id\n self.memory.session_id = session_id\n\n stored = self.memory.messages\n # langchain memories are supposed to return messages in ascending order\n if order == \"DESC\":\n stored = stored[::-1]\n if n_messages:\n stored = stored[:n_messages]\n stored = [Message.from_lc_message(m) for m in stored]\n if sender:\n expected_type = MESSAGE_SENDER_AI if sender == MESSAGE_SENDER_AI else MESSAGE_SENDER_USER\n stored = [m for m in stored if m.type == expected_type]\n else:\n stored = get_messages(\n sender=sender,\n sender_name=sender_name,\n session_id=session_id,\n limit=n_messages,\n order=order,\n )\n self.status = stored\n return stored\n\n def retrieve_messages_as_text(self) -> Message:\n stored_text = data_to_text(self.template, self.retrieve_messages())\n self.status = stored_text\n return Message(text=stored_text)\n\n def build_lc_memory(self) -> BaseChatMemory:\n if self.memory:\n chat_memory = self.memory\n else:\n chat_memory = LCBuiltinChatMemory(flow_id=self.flow_id, session_id=self.session_id)\n return ConversationBufferMemory(chat_memory=chat_memory)\n", + "fileTypes": [], + "file_path": "", + "password": false, + "name": "code", + "advanced": true, + "dynamic": true, + "info": "", + "load_from_db": false, + "title_case": false + }, + "n_messages": { + "trace_as_metadata": true, + "list": false, + "required": false, + "placeholder": "", + "show": true, + "name": "n_messages", + "value": 100, + "display_name": "Number of Messages", + "advanced": true, + "dynamic": false, + "info": "Number of messages to retrieve.", + "title_case": false, + "type": "int", + "_input_type": "IntInput" + }, + "order": { + "trace_as_metadata": true, + "options": [ + "Ascending", + "Descending" + ], + "combobox": false, + "required": false, + "placeholder": "", + "show": true, + "name": "order", + "value": "Ascending", + "display_name": "Order", + "advanced": true, + "dynamic": false, + "info": "Order of the messages.", + "title_case": false, + "type": "str", + "_input_type": "DropdownInput" + }, + "sender": { + "trace_as_metadata": true, + "options": [ + "Machine", + "User", + "Machine and User" + ], + "combobox": false, + "required": false, + "placeholder": "", + "show": true, + "name": "sender", + "value": "Machine and User", + "display_name": "Sender Type", + "advanced": true, + "dynamic": false, + "info": "Filter by sender type.", + "title_case": false, + "type": "str", + "_input_type": "DropdownInput" + }, + "sender_name": { + "trace_as_input": true, + "trace_as_metadata": true, + "load_from_db": false, + "list": false, + "required": false, + "placeholder": "", + "show": true, + "name": "sender_name", + "value": "", + "display_name": "Sender Name", + "advanced": true, + "input_types": [ + "Message" + ], + "dynamic": false, + "info": "Filter by sender name.", + "title_case": false, + "type": "str", + "_input_type": "MessageTextInput" + }, + "session_id": { + "trace_as_input": true, + "trace_as_metadata": true, + "load_from_db": false, + "list": false, + "required": false, + "placeholder": "", + "show": true, + "name": "session_id", + "value": "", + "display_name": "Session ID", + "advanced": true, + "input_types": [ + "Message" + ], + "dynamic": false, + "info": "The session ID of the chat. If empty, the current session ID parameter will be used.", + "title_case": false, + "type": "str", + "_input_type": "MessageTextInput" + }, + "template": { + "trace_as_input": true, + "multiline": true, + "trace_as_metadata": true, + "load_from_db": false, + "list": false, + "required": false, + "placeholder": "", + "show": true, + "name": "template", + "value": "{sender_name}: {text}", + "display_name": "Template", + "advanced": true, + "input_types": [ + "Message" + ], + "dynamic": false, + "info": "The template to use for formatting the data. It can contain the keys {text}, {sender} or any other key in the message data.", + "title_case": false, + "type": "str", + "_input_type": "MultilineInput" + } + }, + "description": "Retrieves stored chat messages from Langflow tables or an external memory.", + "icon": "message-square-more", + "base_classes": [ + "BaseChatMemory", + "Data", + "Message" + ], + "display_name": "Chat Memory", + "documentation": "", + "custom_fields": {}, + "output_types": [], + "pinned": false, + "conditional_paths": [], + "frozen": false, + "outputs": [ + { + "types": [ + "Data" + ], + "selected": "Data", + "name": "messages", + "display_name": "Messages (Data)", + "method": "retrieve_messages", + "value": "__UNDEFINED__", + "cache": true + }, + { + "types": [ + "Message" + ], + "selected": "Message", + "name": "messages_text", + "display_name": "Messages (Text)", + "method": "retrieve_messages_as_text", + "value": "__UNDEFINED__", + "cache": true, + "hidden": true + }, + { + "types": [ + "BaseChatMemory" + ], + "selected": "BaseChatMemory", + "name": "lc_memory", + "display_name": "Memory", + "method": "build_lc_memory", + "value": "__UNDEFINED__", + "cache": true, + "hidden": true + } + ], + "field_order": [ + "memory", + "sender", + "sender_name", + "n_messages", + "session_id", + "order", + "template" + ], + "beta": false, + "edited": false, + "lf_version": "1.0.17" + }, + "id": "Memory-CTQWu" + }, + "selected": false, + "width": 384, + "height": 244, + "dragging": false, + "positionAbsolute": { + "x": 1240.7186213296432, + "y": 1059.5754404393747 + } + }, + { + "id": "Prompt-0dWZu", + "type": "genericNode", + "position": { + "x": 1227.4862876736101, + "y": 616.3826667128244 + }, + "data": { + "type": "Prompt", + "node": { + "template": { + "_type": "Component", + "code": { + "type": "code", + "required": true, + "placeholder": "", + "list": false, + "show": true, + "multiline": true, + "value": "from langflow.base.prompts.api_utils import process_prompt_template\nfrom langflow.custom import Component\nfrom langflow.inputs.inputs import DefaultPromptField\nfrom langflow.io import Output, PromptInput\nfrom langflow.schema.message import Message\nfrom langflow.template.utils import update_template_values\n\n\nclass PromptComponent(Component):\n display_name: str = \"Prompt\"\n description: str = \"Create a prompt template with dynamic variables.\"\n icon = \"prompts\"\n trace_type = \"prompt\"\n name = \"Prompt\"\n\n inputs = [\n PromptInput(name=\"template\", display_name=\"Template\"),\n ]\n\n outputs = [\n Output(display_name=\"Prompt Message\", name=\"prompt\", method=\"build_prompt\"),\n ]\n\n async def build_prompt(\n self,\n ) -> Message:\n prompt = Message.from_template_and_variables(**self._attributes)\n self.status = prompt.text\n return prompt\n\n def _update_template(self, frontend_node: dict):\n prompt_template = frontend_node[\"template\"][\"template\"][\"value\"]\n custom_fields = frontend_node[\"custom_fields\"]\n frontend_node_template = frontend_node[\"template\"]\n _ = process_prompt_template(\n template=prompt_template,\n name=\"template\",\n custom_fields=custom_fields,\n frontend_node_template=frontend_node_template,\n )\n return frontend_node\n\n def post_code_processing(self, new_frontend_node: dict, current_frontend_node: dict):\n \"\"\"\n This function is called after the code validation is done.\n \"\"\"\n frontend_node = super().post_code_processing(new_frontend_node, current_frontend_node)\n template = frontend_node[\"template\"][\"template\"][\"value\"]\n # Kept it duplicated for backwards compatibility\n _ = process_prompt_template(\n template=template,\n name=\"template\",\n custom_fields=frontend_node[\"custom_fields\"],\n frontend_node_template=frontend_node[\"template\"],\n )\n # Now that template is updated, we need to grab any values that were set in the current_frontend_node\n # and update the frontend_node with those values\n update_template_values(new_template=frontend_node, previous_template=current_frontend_node[\"template\"])\n return frontend_node\n\n def _get_fallback_input(self, **kwargs):\n return DefaultPromptField(**kwargs)\n", + "fileTypes": [], + "file_path": "", + "password": false, + "name": "code", + "advanced": true, + "dynamic": true, + "info": "", + "load_from_db": false, + "title_case": false + }, + "template": { + "trace_as_input": true, + "list": false, + "required": false, + "placeholder": "", + "show": true, + "name": "template", + "value": "\nYou are a Notion Agent, an AI assistant designed to help users interact with their Notion workspace. Your role is to understand user requests, utilize the appropriate Notion tools to fulfill these requests, and communicate clearly with the user throughout the process.\n\nGeneral Guidelines:\n\n1. Carefully analyze each user request to determine which tool(s) you need to use.\n\n2. Before using any tool, ensure you have all the necessary information. If you need more details, ask the user clear and concise questions.\n\n3. When using a tool, provide a brief explanation to the user about what you're doing and why.\n\n4. After using a tool, interpret the results for the user in a clear, concise manner.\n\n5. If a task requires multiple steps, outline your plan to the user before proceeding.\n\n6. If you encounter an error or limitation, explain it to the user and suggest possible solutions or alternative approaches.\n\n7. Always maintain a helpful and professional tone in your interactions.\n\n8. Be proactive in offering suggestions or alternatives if the user's initial request can't be fulfilled exactly as stated.\n\n9. When providing information or results, focus on relevance and clarity. Summarize when necessary, but provide details when they're important.\n\n10. If a user's request is unclear or could be interpreted in multiple ways, ask for clarification before proceeding.\n\n11. After completing a task, summarize what was accomplished and suggest any relevant next steps or additional actions the user might want to take.\n\n12. If a user asks about capabilities you don't have or tools you can't access, clearly explain your limitations and suggest alternative ways to assist if possible.\n\nRemember, your primary goal is to assist the user effectively with their Notion-related tasks using the provided tools. Always strive for clarity, accuracy, and helpfulness in your interactions. Adapt your communication style to the user's level of technical understanding and familiarity with Notion.\n\nNow, you're ready to assist the user\n\nToday is: {CURRENT_DATE}\n", + "display_name": "Template", + "advanced": false, + "dynamic": false, + "info": "", + "title_case": false, + "type": "prompt", + "_input_type": "PromptInput" + }, + "CURRENT_DATE": { + "field_type": "str", + "required": false, + "placeholder": "", + "list": false, + "show": true, + "multiline": true, + "value": "", + "fileTypes": [], + "file_path": "", + "password": false, + "name": "CURRENT_DATE", + "display_name": "CURRENT_DATE", + "advanced": false, + "input_types": [ + "Message", + "Text" + ], + "dynamic": false, + "info": "", + "load_from_db": false, + "title_case": false, + "type": "str" + } + }, + "description": "Create a prompt template with dynamic variables.", + "icon": "prompts", + "is_input": null, + "is_output": null, + "is_composition": null, + "base_classes": [ + "Message" + ], + "name": "", + "display_name": "Prompt", + "documentation": "", + "custom_fields": { + "template": [ + "CURRENT_DATE" + ] + }, + "output_types": [], + "full_path": null, + "pinned": false, + "conditional_paths": [], + "frozen": false, + "outputs": [ + { + "types": [ + "Message" + ], + "selected": "Message", + "name": "prompt", + "hidden": null, + "display_name": "Prompt Message", + "method": "build_prompt", + "value": "__UNDEFINED__", + "cache": true + } + ], + "field_order": [ + "template" + ], + "beta": false, + "error": null, + "edited": false, + "lf_version": "1.0.17" + }, + "id": "Prompt-0dWZu" + }, + "selected": false, + "width": 384, + "height": 416, + "positionAbsolute": { + "x": 1227.4862876736101, + "y": 616.3826667128244 + }, + "dragging": false + }, + { + "id": "CurrentDateComponent-NSNQ8", + "type": "genericNode", + "position": { + "x": 1092.5108512311297, + "y": 868.3249850335523 + }, + "data": { + "type": "CurrentDateComponent", + "node": { + "template": { + "_type": "Component", + "code": { + "type": "code", + "required": true, + "placeholder": "", + "list": false, + "show": true, + "multiline": true, + "value": "from datetime import datetime\r\nfrom zoneinfo import ZoneInfo\r\nfrom typing import List\r\n\r\nfrom langflow.custom import Component\r\nfrom langflow.io import DropdownInput, Output\r\nfrom langflow.schema.message import Message\r\n\r\nclass CurrentDateComponent(Component):\r\n display_name = \"Current Date 🕰️\"\r\n description = \"Returns the current date and time in the selected timezone.\"\r\n icon = \"clock\"\r\n\r\n inputs = [\r\n DropdownInput(\r\n name=\"timezone\",\r\n display_name=\"Timezone\",\r\n options=[\r\n \"UTC\",\r\n \"US/Eastern\",\r\n \"US/Central\",\r\n \"US/Mountain\",\r\n \"US/Pacific\",\r\n \"Europe/London\",\r\n \"Europe/Paris\",\r\n \"Asia/Tokyo\",\r\n \"Australia/Sydney\",\r\n \"America/Sao_Paulo\",\r\n \"America/Cuiaba\",\r\n ],\r\n value=\"UTC\",\r\n info=\"Select the timezone for the current date and time.\",\r\n ),\r\n ]\r\n\r\n outputs = [\r\n Output(display_name=\"Current Date\", name=\"current_date\", method=\"get_current_date\"),\r\n ]\r\n\r\n def get_current_date(self) -> Message:\r\n try:\r\n tz = ZoneInfo(self.timezone)\r\n current_date = datetime.now(tz).strftime(\"%Y-%m-%d %H:%M:%S %Z\")\r\n result = f\"Current date and time in {self.timezone}: {current_date}\"\r\n self.status = result\r\n return Message(text=result)\r\n except Exception as e:\r\n error_message = f\"Error: {str(e)}\"\r\n self.status = error_message\r\n return Message(text=error_message)", + "fileTypes": [], + "file_path": "", + "password": false, + "name": "code", + "advanced": true, + "dynamic": true, + "info": "", + "load_from_db": false, + "title_case": false + }, + "timezone": { + "trace_as_metadata": true, + "options": [ + "UTC", + "US/Eastern", + "US/Central", + "US/Mountain", + "US/Pacific", + "Europe/London", + "Europe/Paris", + "Asia/Tokyo", + "Australia/Sydney", + "America/Sao_Paulo", + "America/Cuiaba" + ], + "combobox": false, + "required": false, + "placeholder": "", + "show": true, + "name": "timezone", + "value": "UTC", + "display_name": "Timezone", + "advanced": false, + "dynamic": false, + "info": "Select the timezone for the current date and time.", + "title_case": false, + "type": "str", + "_input_type": "DropdownInput" + } + }, + "description": "Returns the current date and time in the selected timezone.", + "icon": "clock", + "base_classes": [ + "Message" + ], + "display_name": "Current Date", + "documentation": "", + "custom_fields": {}, + "output_types": [], + "pinned": false, + "conditional_paths": [], + "frozen": false, + "outputs": [ + { + "types": [ + "Message" + ], + "selected": "Message", + "name": "current_date", + "display_name": "Current Date", + "method": "get_current_date", + "value": "__UNDEFINED__", + "cache": true + } + ], + "field_order": [ + "timezone" + ], + "beta": false, + "edited": true, + "official": false, + "lf_version": "1.0.17" + }, + "id": "CurrentDateComponent-NSNQ8", + "showNode": false + }, + "selected": false, + "width": 96, + "height": 96, + "dragging": false, + "positionAbsolute": { + "x": 1092.5108512311297, + "y": 868.3249850335523 + } + } + ], + "edges": [ + { + "source": "ChatInput-bcq6D", + "target": "ToolCallingAgent-50Gcd", + "sourceHandle": "{œdataTypeœ:œChatInputœ,œidœ:œChatInput-bcq6Dœ,œnameœ:œmessageœ,œoutput_typesœ:[œMessageœ]}", + "targetHandle": "{œfieldNameœ:œinput_valueœ,œidœ:œToolCallingAgent-50Gcdœ,œinputTypesœ:[œMessageœ],œtypeœ:œstrœ}", + "id": "reactflow__edge-ChatInput-bcq6D{œdataTypeœ:œChatInputœ,œidœ:œChatInput-bcq6Dœ,œnameœ:œmessageœ,œoutput_typesœ:[œMessageœ]}-ToolCallingAgent-50Gcd{œfieldNameœ:œinput_valueœ,œidœ:œToolCallingAgent-50Gcdœ,œinputTypesœ:[œMessageœ],œtypeœ:œstrœ}", + "data": { + "targetHandle": { + "fieldName": "input_value", + "id": "ToolCallingAgent-50Gcd", + "inputTypes": [ + "Message" + ], + "type": "str" + }, + "sourceHandle": { + "dataType": "ChatInput", + "id": "ChatInput-bcq6D", + "name": "message", + "output_types": [ + "Message" + ] + } + }, + "selected": false, + "className": "" + }, + { + "source": "ToolCallingAgent-50Gcd", + "target": "ChatOutput-TSCup", + "sourceHandle": "{œdataTypeœ:œToolCallingAgentœ,œidœ:œToolCallingAgent-50Gcdœ,œnameœ:œresponseœ,œoutput_typesœ:[œMessageœ]}", + "targetHandle": "{œfieldNameœ:œinput_valueœ,œidœ:œChatOutput-TSCupœ,œinputTypesœ:[œMessageœ],œtypeœ:œstrœ}", + "id": "reactflow__edge-ToolCallingAgent-50Gcd{œdataTypeœ:œToolCallingAgentœ,œidœ:œToolCallingAgent-50Gcdœ,œnameœ:œresponseœ,œoutput_typesœ:[œMessageœ]}-ChatOutput-TSCup{œfieldNameœ:œinput_valueœ,œidœ:œChatOutput-TSCupœ,œinputTypesœ:[œMessageœ],œtypeœ:œstrœ}", + "data": { + "targetHandle": { + "fieldName": "input_value", + "id": "ChatOutput-TSCup", + "inputTypes": [ + "Message" + ], + "type": "str" + }, + "sourceHandle": { + "dataType": "ToolCallingAgent", + "id": "ToolCallingAgent-50Gcd", + "name": "response", + "output_types": [ + "Message" + ] + } + }, + "selected": false, + "className": "" + }, + { + "source": "ToolkitComponent-2lNG0", + "target": "ToolCallingAgent-50Gcd", + "sourceHandle": "{œdataTypeœ:œToolkitComponentœ,œidœ:œToolkitComponent-2lNG0œ,œnameœ:œgenerated_toolsœ,œoutput_typesœ:[œBaseToolœ]}", + "targetHandle": "{œfieldNameœ:œtoolsœ,œidœ:œToolCallingAgent-50Gcdœ,œinputTypesœ:[œToolœ,œBaseToolœ],œtypeœ:œotherœ}", + "id": "reactflow__edge-ToolkitComponent-2lNG0{œdataTypeœ:œToolkitComponentœ,œidœ:œToolkitComponent-2lNG0œ,œnameœ:œgenerated_toolsœ,œoutput_typesœ:[œBaseToolœ]}-ToolCallingAgent-50Gcd{œfieldNameœ:œtoolsœ,œidœ:œToolCallingAgent-50Gcdœ,œinputTypesœ:[œToolœ,œBaseToolœ],œtypeœ:œotherœ}", + "data": { + "targetHandle": { + "fieldName": "tools", + "id": "ToolCallingAgent-50Gcd", + "inputTypes": [ + "Tool", + "BaseTool" + ], + "type": "other" + }, + "sourceHandle": { + "dataType": "ToolkitComponent", + "id": "ToolkitComponent-2lNG0", + "name": "generated_tools", + "output_types": [ + "BaseTool" + ] + } + }, + "selected": false, + "className": "" + }, + { + "source": "NotionPageUpdate-6FyYd", + "sourceHandle": "{œdataTypeœ:œNotionPageUpdateœ,œidœ:œNotionPageUpdate-6FyYdœ,œnameœ:œexample_tool_outputœ,œoutput_typesœ:[œToolœ]}", + "target": "ToolkitComponent-2lNG0", + "targetHandle": "{œfieldNameœ:œtoolsœ,œidœ:œToolkitComponent-2lNG0œ,œinputTypesœ:[œToolœ],œtypeœ:œotherœ}", + "data": { + "targetHandle": { + "fieldName": "tools", + "id": "ToolkitComponent-2lNG0", + "inputTypes": [ + "Tool" + ], + "type": "other" + }, + "sourceHandle": { + "dataType": "NotionPageUpdate", + "id": "NotionPageUpdate-6FyYd", + "name": "example_tool_output", + "output_types": [ + "Tool" + ] + } + }, + "id": "reactflow__edge-NotionPageUpdate-6FyYd{œdataTypeœ:œNotionPageUpdateœ,œidœ:œNotionPageUpdate-6FyYdœ,œnameœ:œexample_tool_outputœ,œoutput_typesœ:[œToolœ]}-ToolkitComponent-2lNG0{œfieldNameœ:œtoolsœ,œidœ:œToolkitComponent-2lNG0œ,œinputTypesœ:[œToolœ],œtypeœ:œotherœ}", + "className": "", + "selected": false + }, + { + "source": "NotionPageCreator-6SCB5", + "sourceHandle": "{œdataTypeœ:œNotionPageCreatorœ,œidœ:œNotionPageCreator-6SCB5œ,œnameœ:œexample_tool_outputœ,œoutput_typesœ:[œToolœ]}", + "target": "ToolkitComponent-2lNG0", + "targetHandle": "{œfieldNameœ:œtoolsœ,œidœ:œToolkitComponent-2lNG0œ,œinputTypesœ:[œToolœ],œtypeœ:œotherœ}", + "data": { + "targetHandle": { + "fieldName": "tools", + "id": "ToolkitComponent-2lNG0", + "inputTypes": [ + "Tool" + ], + "type": "other" + }, + "sourceHandle": { + "dataType": "NotionPageCreator", + "id": "NotionPageCreator-6SCB5", + "name": "example_tool_output", + "output_types": [ + "Tool" + ] + } + }, + "id": "reactflow__edge-NotionPageCreator-6SCB5{œdataTypeœ:œNotionPageCreatorœ,œidœ:œNotionPageCreator-6SCB5œ,œnameœ:œexample_tool_outputœ,œoutput_typesœ:[œToolœ]}-ToolkitComponent-2lNG0{œfieldNameœ:œtoolsœ,œidœ:œToolkitComponent-2lNG0œ,œinputTypesœ:[œToolœ],œtypeœ:œotherœ}", + "className": "", + "selected": false + }, + { + "source": "AddContentToPage-ZezUn", + "sourceHandle": "{œdataTypeœ:œAddContentToPageœ,œidœ:œAddContentToPage-ZezUnœ,œnameœ:œexample_tool_outputœ,œoutput_typesœ:[œToolœ]}", + "target": "ToolkitComponent-2lNG0", + "targetHandle": "{œfieldNameœ:œtoolsœ,œidœ:œToolkitComponent-2lNG0œ,œinputTypesœ:[œToolœ],œtypeœ:œotherœ}", + "data": { + "targetHandle": { + "fieldName": "tools", + "id": "ToolkitComponent-2lNG0", + "inputTypes": [ + "Tool" + ], + "type": "other" + }, + "sourceHandle": { + "dataType": "AddContentToPage", + "id": "AddContentToPage-ZezUn", + "name": "example_tool_output", + "output_types": [ + "Tool" + ] + } + }, + "id": "reactflow__edge-AddContentToPage-ZezUn{œdataTypeœ:œAddContentToPageœ,œidœ:œAddContentToPage-ZezUnœ,œnameœ:œexample_tool_outputœ,œoutput_typesœ:[œToolœ]}-ToolkitComponent-2lNG0{œfieldNameœ:œtoolsœ,œidœ:œToolkitComponent-2lNG0œ,œinputTypesœ:[œToolœ],œtypeœ:œotherœ}", + "className": "", + "selected": false + }, + { + "source": "NotionDatabaseProperties-aeWil", + "sourceHandle": "{œdataTypeœ:œNotionDatabasePropertiesœ,œidœ:œNotionDatabaseProperties-aeWilœ,œnameœ:œexample_tool_outputœ,œoutput_typesœ:[œToolœ]}", + "target": "ToolkitComponent-2lNG0", + "targetHandle": "{œfieldNameœ:œtoolsœ,œidœ:œToolkitComponent-2lNG0œ,œinputTypesœ:[œToolœ],œtypeœ:œotherœ}", + "data": { + "targetHandle": { + "fieldName": "tools", + "id": "ToolkitComponent-2lNG0", + "inputTypes": [ + "Tool" + ], + "type": "other" + }, + "sourceHandle": { + "dataType": "NotionDatabaseProperties", + "id": "NotionDatabaseProperties-aeWil", + "name": "example_tool_output", + "output_types": [ + "Tool" + ] + } + }, + "id": "reactflow__edge-NotionDatabaseProperties-aeWil{œdataTypeœ:œNotionDatabasePropertiesœ,œidœ:œNotionDatabaseProperties-aeWilœ,œnameœ:œexample_tool_outputœ,œoutput_typesœ:[œToolœ]}-ToolkitComponent-2lNG0{œfieldNameœ:œtoolsœ,œidœ:œToolkitComponent-2lNG0œ,œinputTypesœ:[œToolœ],œtypeœ:œotherœ}", + "className": "", + "selected": false + }, + { + "source": "NotionListPages-znA3w", + "sourceHandle": "{œdataTypeœ:œNotionListPagesœ,œidœ:œNotionListPages-znA3wœ,œnameœ:œexample_tool_outputœ,œoutput_typesœ:[œToolœ]}", + "target": "ToolkitComponent-2lNG0", + "targetHandle": "{œfieldNameœ:œtoolsœ,œidœ:œToolkitComponent-2lNG0œ,œinputTypesœ:[œToolœ],œtypeœ:œotherœ}", + "data": { + "targetHandle": { + "fieldName": "tools", + "id": "ToolkitComponent-2lNG0", + "inputTypes": [ + "Tool" + ], + "type": "other" + }, + "sourceHandle": { + "dataType": "NotionListPages", + "id": "NotionListPages-znA3w", + "name": "example_tool_output", + "output_types": [ + "Tool" + ] + } + }, + "id": "reactflow__edge-NotionListPages-znA3w{œdataTypeœ:œNotionListPagesœ,œidœ:œNotionListPages-znA3wœ,œnameœ:œexample_tool_outputœ,œoutput_typesœ:[œToolœ]}-ToolkitComponent-2lNG0{œfieldNameœ:œtoolsœ,œidœ:œToolkitComponent-2lNG0œ,œinputTypesœ:[œToolœ],œtypeœ:œotherœ}", + "className": "", + "selected": false + }, + { + "source": "NotionPageContent-SlL21", + "sourceHandle": "{œdataTypeœ:œNotionPageContentœ,œidœ:œNotionPageContent-SlL21œ,œnameœ:œexample_tool_outputœ,œoutput_typesœ:[œToolœ]}", + "target": "ToolkitComponent-2lNG0", + "targetHandle": "{œfieldNameœ:œtoolsœ,œidœ:œToolkitComponent-2lNG0œ,œinputTypesœ:[œToolœ],œtypeœ:œotherœ}", + "data": { + "targetHandle": { + "fieldName": "tools", + "id": "ToolkitComponent-2lNG0", + "inputTypes": [ + "Tool" + ], + "type": "other" + }, + "sourceHandle": { + "dataType": "NotionPageContent", + "id": "NotionPageContent-SlL21", + "name": "example_tool_output", + "output_types": [ + "Tool" + ] + } + }, + "id": "reactflow__edge-NotionPageContent-SlL21{œdataTypeœ:œNotionPageContentœ,œidœ:œNotionPageContent-SlL21œ,œnameœ:œexample_tool_outputœ,œoutput_typesœ:[œToolœ]}-ToolkitComponent-2lNG0{œfieldNameœ:œtoolsœ,œidœ:œToolkitComponent-2lNG0œ,œinputTypesœ:[œToolœ],œtypeœ:œotherœ}", + "className": "", + "selected": false + }, + { + "source": "NotionUserList-C3eGn", + "sourceHandle": "{œdataTypeœ:œNotionUserListœ,œidœ:œNotionUserList-C3eGnœ,œnameœ:œexample_tool_outputœ,œoutput_typesœ:[œToolœ]}", + "target": "ToolkitComponent-2lNG0", + "targetHandle": "{œfieldNameœ:œtoolsœ,œidœ:œToolkitComponent-2lNG0œ,œinputTypesœ:[œToolœ],œtypeœ:œotherœ}", + "data": { + "targetHandle": { + "fieldName": "tools", + "id": "ToolkitComponent-2lNG0", + "inputTypes": [ + "Tool" + ], + "type": "other" + }, + "sourceHandle": { + "dataType": "NotionUserList", + "id": "NotionUserList-C3eGn", + "name": "example_tool_output", + "output_types": [ + "Tool" + ] + } + }, + "id": "reactflow__edge-NotionUserList-C3eGn{œdataTypeœ:œNotionUserListœ,œidœ:œNotionUserList-C3eGnœ,œnameœ:œexample_tool_outputœ,œoutput_typesœ:[œToolœ]}-ToolkitComponent-2lNG0{œfieldNameœ:œtoolsœ,œidœ:œToolkitComponent-2lNG0œ,œinputTypesœ:[œToolœ],œtypeœ:œotherœ}", + "className": "", + "selected": false + }, + { + "source": "NotionSearch-VS2mI", + "sourceHandle": "{œdataTypeœ:œNotionSearchœ,œidœ:œNotionSearch-VS2mIœ,œnameœ:œexample_tool_outputœ,œoutput_typesœ:[œToolœ]}", + "target": "ToolkitComponent-2lNG0", + "targetHandle": "{œfieldNameœ:œtoolsœ,œidœ:œToolkitComponent-2lNG0œ,œinputTypesœ:[œToolœ],œtypeœ:œotherœ}", + "data": { + "targetHandle": { + "fieldName": "tools", + "id": "ToolkitComponent-2lNG0", + "inputTypes": [ + "Tool" + ], + "type": "other" + }, + "sourceHandle": { + "dataType": "NotionSearch", + "id": "NotionSearch-VS2mI", + "name": "example_tool_output", + "output_types": [ + "Tool" + ] + } + }, + "id": "reactflow__edge-NotionSearch-VS2mI{œdataTypeœ:œNotionSearchœ,œidœ:œNotionSearch-VS2mIœ,œnameœ:œexample_tool_outputœ,œoutput_typesœ:[œToolœ]}-ToolkitComponent-2lNG0{œfieldNameœ:œtoolsœ,œidœ:œToolkitComponent-2lNG0œ,œinputTypesœ:[œToolœ],œtypeœ:œotherœ}", + "className": "", + "selected": false + }, + { + "source": "OpenAIModel-BJWIg", + "sourceHandle": "{œdataTypeœ:œOpenAIModelœ,œidœ:œOpenAIModel-BJWIgœ,œnameœ:œmodel_outputœ,œoutput_typesœ:[œLanguageModelœ]}", + "target": "ToolCallingAgent-50Gcd", + "targetHandle": "{œfieldNameœ:œllmœ,œidœ:œToolCallingAgent-50Gcdœ,œinputTypesœ:[œLanguageModelœ],œtypeœ:œotherœ}", + "data": { + "targetHandle": { + "fieldName": "llm", + "id": "ToolCallingAgent-50Gcd", + "inputTypes": [ + "LanguageModel" + ], + "type": "other" + }, + "sourceHandle": { + "dataType": "OpenAIModel", + "id": "OpenAIModel-BJWIg", + "name": "model_output", + "output_types": [ + "LanguageModel" + ] + } + }, + "id": "reactflow__edge-OpenAIModel-BJWIg{œdataTypeœ:œOpenAIModelœ,œidœ:œOpenAIModel-BJWIgœ,œnameœ:œmodel_outputœ,œoutput_typesœ:[œLanguageModelœ]}-ToolCallingAgent-50Gcd{œfieldNameœ:œllmœ,œidœ:œToolCallingAgent-50Gcdœ,œinputTypesœ:[œLanguageModelœ],œtypeœ:œotherœ}", + "className": "", + "selected": false + }, + { + "source": "Memory-CTQWu", + "sourceHandle": "{œdataTypeœ:œMemoryœ,œidœ:œMemory-CTQWuœ,œnameœ:œmessagesœ,œoutput_typesœ:[œDataœ]}", + "target": "ToolCallingAgent-50Gcd", + "targetHandle": "{œfieldNameœ:œchat_historyœ,œidœ:œToolCallingAgent-50Gcdœ,œinputTypesœ:[œDataœ],œtypeœ:œotherœ}", + "data": { + "targetHandle": { + "fieldName": "chat_history", + "id": "ToolCallingAgent-50Gcd", + "inputTypes": [ + "Data" + ], + "type": "other" + }, + "sourceHandle": { + "dataType": "Memory", + "id": "Memory-CTQWu", + "name": "messages", + "output_types": [ + "Data" + ] + } + }, + "id": "reactflow__edge-Memory-CTQWu{œdataTypeœ:œMemoryœ,œidœ:œMemory-CTQWuœ,œnameœ:œmessagesœ,œoutput_typesœ:[œDataœ]}-ToolCallingAgent-50Gcd{œfieldNameœ:œchat_historyœ,œidœ:œToolCallingAgent-50Gcdœ,œinputTypesœ:[œDataœ],œtypeœ:œotherœ}", + "className": "", + "selected": false + }, + { + "source": "Prompt-0dWZu", + "sourceHandle": "{œdataTypeœ:œPromptœ,œidœ:œPrompt-0dWZuœ,œnameœ:œpromptœ,œoutput_typesœ:[œMessageœ]}", + "target": "ToolCallingAgent-50Gcd", + "targetHandle": "{œfieldNameœ:œsystem_promptœ,œidœ:œToolCallingAgent-50Gcdœ,œinputTypesœ:[œMessageœ],œtypeœ:œstrœ}", + "data": { + "targetHandle": { + "fieldName": "system_prompt", + "id": "ToolCallingAgent-50Gcd", + "inputTypes": [ + "Message" + ], + "type": "str" + }, + "sourceHandle": { + "dataType": "Prompt", + "id": "Prompt-0dWZu", + "name": "prompt", + "output_types": [ + "Message" + ] + } + }, + "id": "reactflow__edge-Prompt-0dWZu{œdataTypeœ:œPromptœ,œidœ:œPrompt-0dWZuœ,œnameœ:œpromptœ,œoutput_typesœ:[œMessageœ]}-ToolCallingAgent-50Gcd{œfieldNameœ:œsystem_promptœ,œidœ:œToolCallingAgent-50Gcdœ,œinputTypesœ:[œMessageœ],œtypeœ:œstrœ}", + "className": "", + "selected": false + }, + { + "source": "CurrentDateComponent-NSNQ8", + "sourceHandle": "{œdataTypeœ:œCurrentDateComponentœ,œidœ:œCurrentDateComponent-NSNQ8œ,œnameœ:œcurrent_dateœ,œoutput_typesœ:[œMessageœ]}", + "target": "Prompt-0dWZu", + "targetHandle": "{œfieldNameœ:œCURRENT_DATEœ,œidœ:œPrompt-0dWZuœ,œinputTypesœ:[œMessageœ,œTextœ],œtypeœ:œstrœ}", + "data": { + "targetHandle": { + "fieldName": "CURRENT_DATE", + "id": "Prompt-0dWZu", + "inputTypes": [ + "Message", + "Text" + ], + "type": "str" + }, + "sourceHandle": { + "dataType": "CurrentDateComponent", + "id": "CurrentDateComponent-NSNQ8", + "name": "current_date", + "output_types": [ + "Message" + ] + } + }, + "id": "reactflow__edge-CurrentDateComponent-NSNQ8{œdataTypeœ:œCurrentDateComponentœ,œidœ:œCurrentDateComponent-NSNQ8œ,œnameœ:œcurrent_dateœ,œoutput_typesœ:[œMessageœ]}-Prompt-0dWZu{œfieldNameœ:œCURRENT_DATEœ,œidœ:œPrompt-0dWZuœ,œinputTypesœ:[œMessageœ,œTextœ],œtypeœ:œstrœ}", + "className": "", + "selected": false + } + ], + "viewport": { + "x": 97.72528949998423, + "y": -211.85229348429561, + "zoom": 0.41621432461249197 + } + }, + "description": "This flow creates an AI assistant that interacts with your Notion workspace. It understands natural language requests, performs actions in Notion (like creating pages or searching for information), and provides helpful responses. To use it, simply start a conversation by asking the agent to perform a Notion-related task, and it will guide you through the process, making it easy to manage your Notion workspace through chat.", + "name": "Conversational Notion Agent", + "last_tested_version": "1.0.17", + "endpoint_name": null, + "is_component": false +} \ No newline at end of file diff --git a/assets/files/Meeting_Notes_Agent-3bf013ee192aba15c84d74cc91079a4a.json b/assets/files/Meeting_Notes_Agent-3bf013ee192aba15c84d74cc91079a4a.json deleted file mode 100644 index 56d8e74e7a..0000000000 --- a/assets/files/Meeting_Notes_Agent-3bf013ee192aba15c84d74cc91079a4a.json +++ /dev/null @@ -1 +0,0 @@ -{"id":"b6de0fdb-31a2-40bf-b921-719bc0890a0e","data":{"nodes":[{"id":"TextInput-iJPEJ","type":"genericNode","position":{"x":94.43614181571661,"y":387.24602783243165},"data":{"type":"TextInput","node":{"template":{"_type":"Component","code":{"type":"code","required":true,"placeholder":"","list":false,"show":true,"multiline":true,"value":"from langflow.base.io.text import TextComponent\nfrom langflow.io import MultilineInput, Output\nfrom langflow.schema.message import Message\n\n\nclass TextInputComponent(TextComponent):\n display_name = \"Text Input\"\n description = \"Get text inputs from the Playground.\"\n icon = \"type\"\n name = \"TextInput\"\n\n inputs = [\n MultilineInput(\n name=\"input_value\",\n display_name=\"Text\",\n info=\"Text to be passed as input.\",\n ),\n ]\n outputs = [\n Output(display_name=\"Text\", name=\"text\", method=\"text_response\"),\n ]\n\n def text_response(self) -> Message:\n message = Message(\n text=self.input_value,\n )\n return message\n","fileTypes":[],"file_path":"","password":false,"name":"code","advanced":true,"dynamic":true,"info":"","load_from_db":false,"title_case":false},"input_value":{"trace_as_input":true,"multiline":true,"trace_as_metadata":true,"load_from_db":false,"list":false,"required":false,"placeholder":"","show":true,"name":"input_value","value":"Good morning. Thanks for joining this project review meeting. We've got quite a few tasks to discuss, especially some Notion-related ones. Shall we get started?\n\nMorning, Felipe. Absolutely, let's dive in. I see we have several projects and tasks on our plate.\n\nGreat. Let's begin with the AI Content Gen project. I'm currently working on \"Montar base agente seletor de cortes.\" It's in progress, and I'm aiming to complete it by June 14th. Have you had a chance to look at this task, Cezar?\n\nI haven't been directly involved with that one. Can you give me an overview of what it entails?\n\nOf course. Essentially, we're building a base agent that can intelligently select and edit content. It's part of our larger AI-driven content generation initiative. The challenge is creating an algorithm that can understand context and make smart editing decisions.\n\nInteresting. How's the progress so far?\n\nIt's coming along. I've set up the basic framework, but fine-tuning the selection criteria is proving to be more complex than initially anticipated. I might need an extra day or two beyond the June 14th deadline.\n\nUnderstood, Felipe. Keep me posted if you need any resources or if the deadline needs to be adjusted. By the way, I've been meaning to ask - have you had a chance to look into that new NLP library I mentioned last week? I think it could be useful for this project.\n\nActually, Cezar, I haven't gotten to that yet. Should we add it as a new task? Maybe \"Evaluate NLP library for content selection\"?\n\nGood idea. Let's add that to our task list with a due date of next Friday. Now, moving on to the next task in this project - \"Create Notion Task Automation.\" It's assigned to you and set for June 19th, but you haven't started it yet, right? This is where I'd like to focus our discussion today.\n\nThat's correct. So, the goal is to streamline our workflow by automating certain tasks within Notion. I'm thinking we could create scripts or use Notion's API to automatically create, assign, and update tasks based on certain triggers or schedules.\n\nThat sounds like it could save us a lot of time. What specific automations are you considering?\n\nI'm glad you asked, Cezar. I'm thinking of a few key areas:\n1. Automatic task creation based on project milestones\n2. Assigning tasks to team members based on their expertise and current workload\n3. Updating task statuses based on linked database entries\n4. Generating weekly progress reports\n5. Setting up reminders for overdue tasks\n\nThose all sound valuable. Have you looked into the technical requirements for implementing these?\n\nI've done some initial research. Notion's API seems robust enough to handle these automations. We'll likely need to use a combination of Notion's API and a server to run our scripts. I'm thinking of using Node.js for this.\n\nGood thinking. Do you foresee any challenges?\n\nThe main challenge will be ensuring our automations are flexible enough to handle different project structures and team dynamics. We'll need to build in some configurability.\n\nAgreed. Let's make sure we involve the team in defining these automations. Their input will be crucial for making this truly useful. Oh, and speaking of team input, I think we should add a task for \"Conduct team survey on Notion pain points.\" This could help us prioritize which automations to tackle first.\n\nThat's an excellent idea, Cezar. I'll create that task and aim to complete the survey by next Wednesday. Now, I see we have another Notion-related task: \"Subir Notion Agent no Langflow Prod.\" Can you remind me what this entails?\n\nYes, this task is about deploying our Notion integration agent to the Langflow production environment. It's not started yet, but it's a crucial step in making our Notion automations available to the whole team.\n\nI see. What's the timeline for this?\n\nWe haven't set a specific deadline yet, but I think we should aim to complete this shortly after the automation task. Let's tentatively say by the end of June?\n\nSounds reasonable. Make sure to coordinate with the DevOps team for a smooth deployment. And while we're on the topic of deployment, we should probably add a task for \"Create documentation for Notion Agent usage.\" We want to make sure the team knows how to use these new tools once they're available.\n\nYou're right, Felipe. I'll add that to our task list. Now, switching gears a bit, let's talk about the Internal Projects. I see you're working on \"Crypto Links\" - it's in progress.\n\nAh yes, our blockchain initiative. It's moving forward. I'm researching various blockchain platforms and their potential applications for our projects. I'm particularly interested in smart contract capabilities.\n\nInteresting. Keep me updated on any promising findings. By the way, have you considered reaching out to any blockchain experts for consultation? It might be worth adding a task for \"Schedule blockchain expert consultation.\"\n\nThat's a great suggestion, Cezar. I'll add it to my to-do list. Now, for the Internal Tasks, I see you're assigned to \"Revisar modos do Charlinho, preparar para open source.\" What's the status on that?\n\nI haven't started yet, but it's on my radar. The deadline is June 7th, so I'll be diving into it this week. Essentially, we need to review and refine Charlinho's modes before we open-source the project.\n\nSounds good. Let me know if you need any assistance with that. Oh, and don't forget we need to add a task for \"Prepare Charlinho documentation for open source.\" We want to make sure our project is well-documented when we release it.\n\nYou're right, Felipe. I'll make sure to include that in our task list. Now, I see you have several tasks assigned to you in the Internal Tasks section. Can you give me a quick rundown?\n\nOf course. I'm working on finding a freelancer to create flows in ComfyUI - that's in progress and due May 28th. I'm also handling the conception of the Agent UI, due May 30th. Both are moving along well.\n\nThere's also a task to \"Check, install and test Gladia to use a bot in Google Meet.\" That's in progress, and I'm collaborating with C on it.\n\nThat's quite a workload. How are you managing all these tasks?\n\nIt's challenging, but I'm prioritizing based on deadlines and dependencies. The Notion automation project is a high priority because it'll help us manage tasks more efficiently in the long run.\n\nGood strategy, Felipe. Is there anything you need from me or the team to help move these tasks forward?\n\nActually, yes. For the \"pegar os arquivos necessários para tentarmos montar um stinger com ffmpeg\" task, I could use some input on which files are critical for this. It's a low-priority task due June 2nd, but any insights would be helpful.\n\nI'll review our asset library and send you a list of potential files by tomorrow. Oh, and let's add a task for \"Create ffmpeg stinger tutorial\" once we figure out the process. It could be useful for the team in the future.\n\nGreat idea, Cezar. I'll add that to our backlog. Anything else we should discuss?\n\nI think we've covered the major points. Oh, one last thing - for the \"Create Notion Task Automation\" project, I was thinking of setting up a series of short daily meetings next week to keep everyone aligned. What do you think?\n\nThat's a good idea. Maybe 15-minute stand-ups? We can use those to address any roadblocks quickly. And let's add a task for \"Set up Notion Automation progress tracking board\" to help visualize our progress during these stand-ups.\n\nPerfect. I'll send out calendar invites this afternoon and create that tracking board task. Any final thoughts or concerns, Cezar?\n\nNot from my side. I think we have a clear path forward, especially with the Notion-related tasks and the new items we've added to our list.\n\nAgreed. Let's plan to reconvene next week to check on progress, particularly for the Notion automation project and these new tasks we've discussed. Thanks for the comprehensive update, Felipe.\n\nThank you, Cezar. I'll send out a summary of our discussion and action items shortly, including all the new tasks we've identified during this meeting.\n","display_name":"Text","advanced":false,"input_types":["Message"],"dynamic":false,"info":"Text to be passed as input.","title_case":false,"type":"str","_input_type":"MultilineInput"}},"description":"Get text inputs from the Playground.","icon":"type","base_classes":["Message"],"display_name":"Meeting Transcript","documentation":"","custom_fields":{},"output_types":[],"pinned":false,"conditional_paths":[],"frozen":false,"outputs":[{"types":["Message"],"selected":"Message","name":"text","display_name":"Text","method":"text_response","value":"__UNDEFINED__","cache":true}],"field_order":["input_value"],"beta":false,"edited":false,"lf_version":"1.0.17"},"id":"TextInput-iJPEJ"},"selected":false,"width":384,"height":302,"dragging":false,"positionAbsolute":{"x":94.43614181571661,"y":387.24602783243165}},{"id":"NotionUserList-TvIKS","type":"genericNode","position":{"x":80.49204196902156,"y":741.0568511678105},"data":{"type":"NotionUserList","node":{"template":{"_type":"Component","code":{"type":"code","required":true,"placeholder":"","list":false,"show":true,"multiline":true,"value":"import requests\nfrom typing import List, Dict\nfrom pydantic import BaseModel\nfrom langflow.io import Output\nfrom langflow.base.langchain_utilities.model import LCToolComponent\nfrom langflow.inputs import SecretStrInput\nfrom langflow.schema import Data\nfrom langflow.field_typing import Tool\nfrom langchain.tools import StructuredTool\n\n\nclass NotionUserList(LCToolComponent):\n display_name = \"List Users \"\n description = \"Retrieve users from Notion.\"\n documentation = \"https://docs.langflow.org/integrations/notion/list-users\"\n icon = \"NotionDirectoryLoader\"\n\n inputs = [\n SecretStrInput(\n name=\"notion_secret\",\n display_name=\"Notion Secret\",\n info=\"The Notion integration token.\",\n required=True,\n ),\n ]\n outputs = [\n Output(name=\"example_output\", display_name=\"Data\", method=\"run_model\"),\n Output(name=\"example_tool_output\", display_name=\"Tool\", method=\"build_tool\"),\n ]\n\n class NotionUserListSchema(BaseModel):\n pass\n\n def run_model(self) -> List[Data]:\n users = self._list_users()\n records = []\n combined_text = \"\"\n\n for user in users:\n output = \"User:\\n\"\n for key, value in user.items():\n output += f\"{key.replace('_', ' ').title()}: {value}\\n\"\n output += \"________________________\\n\"\n\n combined_text += output\n records.append(Data(text=output, data=user))\n\n self.status = records\n return records\n\n def build_tool(self) -> Tool:\n return StructuredTool.from_function(\n name=\"notion_list_users\",\n description=\"Retrieve users from Notion.\",\n func=self._list_users,\n args_schema=self.NotionUserListSchema,\n )\n\n def _list_users(self) -> List[Dict]:\n url = \"https://api.notion.com/v1/users\"\n headers = {\n \"Authorization\": f\"Bearer {self.notion_secret}\",\n \"Notion-Version\": \"2022-06-28\",\n }\n\n response = requests.get(url, headers=headers)\n response.raise_for_status()\n\n data = response.json()\n results = data[\"results\"]\n\n users = []\n for user in results:\n user_data = {\n \"id\": user[\"id\"],\n \"type\": user[\"type\"],\n \"name\": user.get(\"name\", \"\"),\n \"avatar_url\": user.get(\"avatar_url\", \"\"),\n }\n users.append(user_data)\n\n return users\n","fileTypes":[],"file_path":"","password":false,"name":"code","advanced":true,"dynamic":true,"info":"","load_from_db":false,"title_case":false},"notion_secret":{"load_from_db":false,"required":true,"placeholder":"","show":true,"name":"notion_secret","value":"","display_name":"Notion Secret","advanced":false,"input_types":["Message"],"dynamic":false,"info":"The Notion integration token.","title_case":false,"password":true,"type":"str","_input_type":"SecretStrInput"}},"description":"Retrieve users from Notion.","icon":"NotionDirectoryLoader","base_classes":["Data","Tool"],"display_name":"List Users ","documentation":"https://docs.langflow.org/integrations/notion/list-users","custom_fields":{},"output_types":[],"pinned":false,"conditional_paths":[],"frozen":false,"outputs":[{"types":["Data"],"selected":"Data","name":"example_output","display_name":"Data","method":"run_model","value":"__UNDEFINED__","cache":true},{"types":["Tool"],"selected":"Tool","name":"example_tool_output","display_name":"Tool","method":"build_tool","value":"__UNDEFINED__","cache":true,"hidden":true}],"field_order":["notion_secret"],"beta":false,"edited":true,"lf_version":"1.0.17"},"id":"NotionUserList-TvIKS","description":"Retrieve users from Notion.","display_name":"List Users "},"selected":false,"width":384,"height":302,"positionAbsolute":{"x":80.49204196902156,"y":741.0568511678105},"dragging":false},{"id":"NotionSearch-M66HF","type":"genericNode","position":{"x":1095.6934863134345,"y":407.8718765800806},"data":{"type":"NotionSearch","node":{"template":{"_type":"Component","code":{"type":"code","required":true,"placeholder":"","list":false,"show":true,"multiline":true,"value":"import requests\nfrom typing import Dict, Any, List\nfrom pydantic import BaseModel, Field\nfrom langflow.io import Output\nfrom langflow.base.langchain_utilities.model import LCToolComponent\nfrom langflow.inputs import SecretStrInput, StrInput, DropdownInput\nfrom langflow.schema import Data\nfrom langflow.field_typing import Tool\nfrom langchain.tools import StructuredTool\n\n\nclass NotionSearch(LCToolComponent):\n display_name: str = \"Search \"\n description: str = \"Searches all pages and databases that have been shared with an integration. The search field can be an empty value to show all values from that search\"\n documentation: str = \"https://docs.langflow.org/integrations/notion/search\"\n icon = \"NotionDirectoryLoader\"\n\n inputs = [\n SecretStrInput(\n name=\"notion_secret\",\n display_name=\"Notion Secret\",\n info=\"The Notion integration token.\",\n required=True,\n ),\n StrInput(\n name=\"query\",\n display_name=\"Search Query\",\n info=\"The text that the API compares page and database titles against.\",\n ),\n DropdownInput(\n name=\"filter_value\",\n display_name=\"Filter Type\",\n info=\"Limits the results to either only pages or only databases.\",\n options=[\"page\", \"database\"],\n value=\"page\",\n ),\n DropdownInput(\n name=\"sort_direction\",\n display_name=\"Sort Direction\",\n info=\"The direction to sort the results.\",\n options=[\"ascending\", \"descending\"],\n value=\"descending\",\n ),\n ]\n outputs = [\n Output(name=\"example_output\", display_name=\"Data\", method=\"run_model\"),\n Output(name=\"example_tool_output\", display_name=\"Tool\", method=\"build_tool\"),\n ]\n\n class NotionSearchSchema(BaseModel):\n query: str = Field(..., description=\"The search query text.\")\n filter_value: str = Field(default=\"page\", description=\"Filter type: 'page' or 'database'.\")\n sort_direction: str = Field(default=\"descending\", description=\"Sort direction: 'ascending' or 'descending'.\")\n\n def run_model(self) -> List[Data]:\n results = self._search_notion(self.query, self.filter_value, self.sort_direction)\n records = []\n combined_text = f\"Results found: {len(results)}\\n\\n\"\n\n for result in results:\n result_data = {\n \"id\": result[\"id\"],\n \"type\": result[\"object\"],\n \"last_edited_time\": result[\"last_edited_time\"],\n }\n\n if result[\"object\"] == \"page\":\n result_data[\"title_or_url\"] = result[\"url\"]\n text = f\"id: {result['id']}\\ntitle_or_url: {result['url']}\\n\"\n elif result[\"object\"] == \"database\":\n if \"title\" in result and isinstance(result[\"title\"], list) and len(result[\"title\"]) > 0:\n result_data[\"title_or_url\"] = result[\"title\"][0][\"plain_text\"]\n text = f\"id: {result['id']}\\ntitle_or_url: {result['title'][0]['plain_text']}\\n\"\n else:\n result_data[\"title_or_url\"] = \"N/A\"\n text = f\"id: {result['id']}\\ntitle_or_url: N/A\\n\"\n\n text += f\"type: {result['object']}\\nlast_edited_time: {result['last_edited_time']}\\n\\n\"\n combined_text += text\n records.append(Data(text=text, data=result_data))\n\n self.status = records\n return records\n\n def build_tool(self) -> Tool:\n return StructuredTool.from_function(\n name=\"notion_search\",\n description=\"Search Notion pages and databases. Input should include the search query and optionally filter type and sort direction.\",\n func=self._search_notion,\n args_schema=self.NotionSearchSchema,\n )\n\n def _search_notion(\n self, query: str, filter_value: str = \"page\", sort_direction: str = \"descending\"\n ) -> List[Dict[str, Any]]:\n url = \"https://api.notion.com/v1/search\"\n headers = {\n \"Authorization\": f\"Bearer {self.notion_secret}\",\n \"Content-Type\": \"application/json\",\n \"Notion-Version\": \"2022-06-28\",\n }\n\n data = {\n \"query\": query,\n \"filter\": {\"value\": filter_value, \"property\": \"object\"},\n \"sort\": {\"direction\": sort_direction, \"timestamp\": \"last_edited_time\"},\n }\n\n response = requests.post(url, headers=headers, json=data)\n response.raise_for_status()\n\n results = response.json()\n return results[\"results\"]\n","fileTypes":[],"file_path":"","password":false,"name":"code","advanced":true,"dynamic":true,"info":"","load_from_db":false,"title_case":false},"filter_value":{"trace_as_metadata":true,"options":["page","database"],"combobox":false,"required":false,"placeholder":"","show":true,"name":"filter_value","value":"database","display_name":"Filter Type","advanced":true,"dynamic":false,"info":"Limits the results to either only pages or only databases.","title_case":false,"type":"str","_input_type":"DropdownInput"},"notion_secret":{"load_from_db":false,"required":true,"placeholder":"","show":true,"name":"notion_secret","value":"","display_name":"Notion Secret","advanced":false,"input_types":["Message"],"dynamic":false,"info":"The Notion integration token.","title_case":false,"password":true,"type":"str","_input_type":"SecretStrInput"},"query":{"trace_as_metadata":true,"load_from_db":false,"list":false,"required":false,"placeholder":"","show":true,"name":"query","value":"","display_name":"Search Query","advanced":true,"dynamic":false,"info":"The text that the API compares page and database titles against.","title_case":false,"type":"str","_input_type":"StrInput"},"sort_direction":{"trace_as_metadata":true,"options":["ascending","descending"],"combobox":false,"required":false,"placeholder":"","show":true,"name":"sort_direction","value":"descending","display_name":"Sort Direction","advanced":true,"dynamic":false,"info":"The direction to sort the results.","title_case":false,"type":"str","_input_type":"DropdownInput"}},"description":"Searches all pages and databases that have been shared with an integration. The search field can be an empty value to show all values from that search","icon":"NotionDirectoryLoader","base_classes":["Data","Tool"],"display_name":"Search ","documentation":"https://docs.langflow.org/integrations/notion/search","custom_fields":{},"output_types":[],"pinned":false,"conditional_paths":[],"frozen":false,"outputs":[{"types":["Data"],"selected":"Data","name":"example_output","display_name":"Data","method":"run_model","value":"__UNDEFINED__","cache":true,"hidden":true},{"types":["Tool"],"selected":"Tool","name":"example_tool_output","display_name":"Tool","method":"build_tool","value":"__UNDEFINED__","cache":true,"hidden":false}],"field_order":["notion_secret","query","filter_value","sort_direction"],"beta":false,"edited":true,"lf_version":"1.0.17"},"id":"NotionSearch-M66HF","description":"Searches all pages and databases that have been shared with an integration.","display_name":"Search "},"selected":false,"width":384,"height":386,"positionAbsolute":{"x":1095.6934863134345,"y":407.8718765800806},"dragging":false},{"id":"Prompt-19rub","type":"genericNode","position":{"x":688.7954025956392,"y":456.4686463487848},"data":{"type":"Prompt","node":{"template":{"_type":"Component","code":{"type":"code","required":true,"placeholder":"","list":false,"show":true,"multiline":true,"value":"from langflow.base.prompts.api_utils import process_prompt_template\nfrom langflow.custom import Component\nfrom langflow.inputs.inputs import DefaultPromptField\nfrom langflow.io import Output, PromptInput\nfrom langflow.schema.message import Message\nfrom langflow.template.utils import update_template_values\n\n\nclass PromptComponent(Component):\n display_name: str = \"Prompt\"\n description: str = \"Create a prompt template with dynamic variables.\"\n icon = \"prompts\"\n trace_type = \"prompt\"\n name = \"Prompt\"\n\n inputs = [\n PromptInput(name=\"template\", display_name=\"Template\"),\n ]\n\n outputs = [\n Output(display_name=\"Prompt Message\", name=\"prompt\", method=\"build_prompt\"),\n ]\n\n async def build_prompt(\n self,\n ) -> Message:\n prompt = Message.from_template_and_variables(**self._attributes)\n self.status = prompt.text\n return prompt\n\n def _update_template(self, frontend_node: dict):\n prompt_template = frontend_node[\"template\"][\"template\"][\"value\"]\n custom_fields = frontend_node[\"custom_fields\"]\n frontend_node_template = frontend_node[\"template\"]\n _ = process_prompt_template(\n template=prompt_template,\n name=\"template\",\n custom_fields=custom_fields,\n frontend_node_template=frontend_node_template,\n )\n return frontend_node\n\n def post_code_processing(self, new_frontend_node: dict, current_frontend_node: dict):\n \"\"\"\n This function is called after the code validation is done.\n \"\"\"\n frontend_node = super().post_code_processing(new_frontend_node, current_frontend_node)\n template = frontend_node[\"template\"][\"template\"][\"value\"]\n # Kept it duplicated for backwards compatibility\n _ = process_prompt_template(\n template=template,\n name=\"template\",\n custom_fields=frontend_node[\"custom_fields\"],\n frontend_node_template=frontend_node[\"template\"],\n )\n # Now that template is updated, we need to grab any values that were set in the current_frontend_node\n # and update the frontend_node with those values\n update_template_values(new_template=frontend_node, previous_template=current_frontend_node[\"template\"])\n return frontend_node\n\n def _get_fallback_input(self, **kwargs):\n return DefaultPromptField(**kwargs)\n","fileTypes":[],"file_path":"","password":false,"name":"code","advanced":true,"dynamic":true,"info":"","load_from_db":false,"title_case":false},"template":{"trace_as_input":true,"list":false,"required":false,"placeholder":"","show":true,"name":"template","value":"\nYou are an AI assistant specialized in analyzing meeting transcripts and identifying tasks. Your goal is to extract relevant tasks from the given transcript, search for related existing tasks in Notion, and provide a comprehensive list of tasks with their current status and any needed updates.\n\nYou have access to the following input:\n\n\n{TRANSCRIPT}\n\n\n\n{USERS}\n\n\nFollow these steps to complete your task:\n\n1. Carefully read through the transcript and identify any mentioned tasks, action items, or follow-ups.\n\n2. For each identified task:\n a. Use the notion_search tool to find if there's an existing related task in Notion.\n b. If a related task is found, note its ID and current status.\n c. If no related task is found, mark it as a new task.\n\n3. For each task (existing or new), determine:\n a. The task name or description\n b. The assigned person (if mentioned)\n c. The current status (for existing tasks) or suggested status (for new tasks)\n d. Any updates or changes mentioned in the transcript\n\n4. Compile your findings into a list of tasks using the following format:\n\n\n\n[Notion page ID if existing, or \"NEW\" if new task]\n[Task name or description]\n[Assigned person, if mentioned]\n[Current status for existing tasks, or suggested status for new tasks]\n[Any updates or changes mentioned in the transcript]\n\n\n\nRemember to focus on tasks that are directly related to the meeting discussion. Do not include general conversation topics or unrelated mentions as tasks.\n\nProvide your final output in the format specified above, with each task enclosed in its own tags within the overall structure.\n\nToday is: {CURRENT_DATE}\n\n\n\n","display_name":"Template","advanced":false,"dynamic":false,"info":"","title_case":false,"type":"prompt","_input_type":"PromptInput"},"TRANSCRIPT":{"field_type":"str","required":false,"placeholder":"","list":false,"show":true,"multiline":true,"value":"","fileTypes":[],"file_path":"","password":false,"name":"TRANSCRIPT","display_name":"TRANSCRIPT","advanced":false,"input_types":["Message","Text"],"dynamic":false,"info":"","load_from_db":false,"title_case":false,"type":"str"},"USERS":{"field_type":"str","required":false,"placeholder":"","list":false,"show":true,"multiline":true,"value":"","fileTypes":[],"file_path":"","password":false,"name":"USERS","display_name":"USERS","advanced":false,"input_types":["Message","Text"],"dynamic":false,"info":"","load_from_db":false,"title_case":false,"type":"str"},"CURRENT_DATE":{"field_type":"str","required":false,"placeholder":"","list":false,"show":true,"multiline":true,"value":"","fileTypes":[],"file_path":"","password":false,"name":"CURRENT_DATE","display_name":"CURRENT_DATE","advanced":false,"input_types":["Message","Text"],"dynamic":false,"info":"","load_from_db":false,"title_case":false,"type":"str"}},"description":"Create a prompt template with dynamic variables.","icon":"prompts","is_input":null,"is_output":null,"is_composition":null,"base_classes":["Message"],"name":"","display_name":"Prompt","documentation":"","custom_fields":{"template":["TRANSCRIPT","USERS","CURRENT_DATE"]},"output_types":[],"full_path":null,"pinned":false,"conditional_paths":[],"frozen":false,"outputs":[{"types":["Message"],"selected":"Message","name":"prompt","hidden":null,"display_name":"Prompt Message","method":"build_prompt","value":"__UNDEFINED__","cache":true}],"field_order":["template"],"beta":false,"error":null,"edited":false,"lf_version":"1.0.17"},"id":"Prompt-19rub"},"selected":false,"width":384,"height":588,"positionAbsolute":{"x":688.7954025956392,"y":456.4686463487848},"dragging":false},{"id":"ParseData-aNk1v","type":"genericNode","position":{"x":540.4151030255898,"y":834.2819856588019},"data":{"type":"ParseData","node":{"template":{"_type":"Component","data":{"trace_as_metadata":true,"list":false,"trace_as_input":true,"required":false,"placeholder":"","show":true,"name":"data","value":"","display_name":"Data","advanced":false,"input_types":["Data"],"dynamic":false,"info":"The data to convert to text.","title_case":false,"type":"other","_input_type":"DataInput"},"code":{"type":"code","required":true,"placeholder":"","list":false,"show":true,"multiline":true,"value":"from langflow.custom import Component\nfrom langflow.helpers.data import data_to_text\nfrom langflow.io import DataInput, MultilineInput, Output, StrInput\nfrom langflow.schema.message import Message\n\n\nclass ParseDataComponent(Component):\n display_name = \"Parse Data\"\n description = \"Convert Data into plain text following a specified template.\"\n icon = \"braces\"\n name = \"ParseData\"\n\n inputs = [\n DataInput(name=\"data\", display_name=\"Data\", info=\"The data to convert to text.\"),\n MultilineInput(\n name=\"template\",\n display_name=\"Template\",\n info=\"The template to use for formatting the data. It can contain the keys {text}, {data} or any other key in the Data.\",\n value=\"{text}\",\n ),\n StrInput(name=\"sep\", display_name=\"Separator\", advanced=True, value=\"\\n\"),\n ]\n\n outputs = [\n Output(display_name=\"Text\", name=\"text\", method=\"parse_data\"),\n ]\n\n def parse_data(self) -> Message:\n data = self.data if isinstance(self.data, list) else [self.data]\n template = self.template\n\n result_string = data_to_text(template, data, sep=self.sep)\n self.status = result_string\n return Message(text=result_string)\n","fileTypes":[],"file_path":"","password":false,"name":"code","advanced":true,"dynamic":true,"info":"","load_from_db":false,"title_case":false},"sep":{"trace_as_metadata":true,"load_from_db":false,"list":false,"required":false,"placeholder":"","show":true,"name":"sep","value":"\n","display_name":"Separator","advanced":true,"dynamic":false,"info":"","title_case":false,"type":"str","_input_type":"StrInput"},"template":{"trace_as_input":true,"multiline":true,"trace_as_metadata":true,"load_from_db":false,"list":false,"required":false,"placeholder":"","show":true,"name":"template","value":"{text}","display_name":"Template","advanced":true,"input_types":["Message"],"dynamic":false,"info":"The template to use for formatting the data. It can contain the keys {text}, {data} or any other key in the Data.","title_case":false,"type":"str","_input_type":"MultilineInput"}},"description":"Convert Data into plain text following a specified template.","icon":"braces","base_classes":["Message"],"display_name":"Parse Data","documentation":"","custom_fields":{},"output_types":[],"pinned":false,"conditional_paths":[],"frozen":false,"outputs":[{"types":["Message"],"selected":"Message","name":"text","display_name":"Text","method":"parse_data","value":"__UNDEFINED__","cache":true}],"field_order":["data","template","sep"],"beta":false,"edited":false,"lf_version":"1.0.17"},"id":"ParseData-aNk1v","showNode":false},"selected":false,"width":96,"height":96,"dragging":false,"positionAbsolute":{"x":540.4151030255898,"y":834.2819856588019}},{"id":"ToolCallingAgent-rVWeq","type":"genericNode","position":{"x":1566.291217492157,"y":583.6687094567968},"data":{"type":"ToolCallingAgent","node":{"template":{"_type":"Component","chat_history":{"trace_as_metadata":true,"list":true,"trace_as_input":true,"required":false,"placeholder":"","show":true,"name":"chat_history","value":"","display_name":"Chat History","advanced":true,"input_types":["Data"],"dynamic":false,"info":"","title_case":false,"type":"other","_input_type":"DataInput"},"llm":{"trace_as_metadata":true,"list":false,"required":true,"placeholder":"","show":true,"name":"llm","value":"","display_name":"Language Model","advanced":false,"input_types":["LanguageModel"],"dynamic":false,"info":"","title_case":false,"type":"other","_input_type":"HandleInput"},"tools":{"trace_as_metadata":true,"list":true,"required":false,"placeholder":"","show":true,"name":"tools","value":"","display_name":"Tools","advanced":false,"input_types":["Tool","BaseTool"],"dynamic":false,"info":"","title_case":false,"type":"other","_input_type":"HandleInput"},"code":{"type":"code","required":true,"placeholder":"","list":false,"show":true,"multiline":true,"value":"from typing import Optional, List\n\nfrom langchain.agents import create_tool_calling_agent\nfrom langchain_core.prompts import ChatPromptTemplate, PromptTemplate, HumanMessagePromptTemplate\nfrom langflow.base.agents.agent import LCToolsAgentComponent\nfrom langflow.inputs import MultilineInput\nfrom langflow.inputs.inputs import HandleInput, DataInput\nfrom langflow.schema import Data\n\n\nclass ToolCallingAgentComponent(LCToolsAgentComponent):\n display_name: str = \"Tool Calling Agent\"\n description: str = \"Agent that uses tools\"\n icon = \"LangChain\"\n beta = True\n name = \"ToolCallingAgent\"\n\n inputs = LCToolsAgentComponent._base_inputs + [\n HandleInput(name=\"llm\", display_name=\"Language Model\", input_types=[\"LanguageModel\"], required=True),\n MultilineInput(\n name=\"system_prompt\",\n display_name=\"System Prompt\",\n info=\"System prompt for the agent.\",\n value=\"You are a helpful assistant\",\n ),\n MultilineInput(\n name=\"user_prompt\", display_name=\"Prompt\", info=\"This prompt must contain 'input' key.\", value=\"{input}\"\n ),\n DataInput(name=\"chat_history\", display_name=\"Chat History\", is_list=True, advanced=True),\n ]\n\n def get_chat_history_data(self) -> Optional[List[Data]]:\n return self.chat_history\n\n def create_agent_runnable(self):\n if \"input\" not in self.user_prompt:\n raise ValueError(\"Prompt must contain 'input' key.\")\n messages = [\n (\"system\", self.system_prompt),\n (\"placeholder\", \"{chat_history}\"),\n HumanMessagePromptTemplate(prompt=PromptTemplate(input_variables=[\"input\"], template=self.user_prompt)),\n (\"placeholder\", \"{agent_scratchpad}\"),\n ]\n prompt = ChatPromptTemplate.from_messages(messages)\n return create_tool_calling_agent(self.llm, self.tools, prompt)\n","fileTypes":[],"file_path":"","password":false,"name":"code","advanced":true,"dynamic":true,"info":"","load_from_db":false,"title_case":false},"handle_parsing_errors":{"trace_as_metadata":true,"list":false,"required":false,"placeholder":"","show":true,"name":"handle_parsing_errors","value":true,"display_name":"Handle Parse Errors","advanced":true,"dynamic":false,"info":"","title_case":false,"type":"bool","_input_type":"BoolInput"},"input_value":{"trace_as_input":true,"trace_as_metadata":true,"load_from_db":false,"list":false,"required":false,"placeholder":"","show":true,"name":"input_value","value":"Analyze this meeting","display_name":"Input","advanced":true,"input_types":["Message"],"dynamic":false,"info":"","title_case":false,"type":"str","_input_type":"MessageTextInput"},"max_iterations":{"trace_as_metadata":true,"list":false,"required":false,"placeholder":"","show":true,"name":"max_iterations","value":15,"display_name":"Max Iterations","advanced":true,"dynamic":false,"info":"","title_case":false,"type":"int","_input_type":"IntInput"},"system_prompt":{"trace_as_input":true,"multiline":true,"trace_as_metadata":true,"load_from_db":false,"list":false,"required":false,"placeholder":"","show":true,"name":"system_prompt","value":"","display_name":"System Prompt","advanced":false,"input_types":["Message"],"dynamic":false,"info":"System prompt for the agent.","title_case":false,"type":"str","_input_type":"MultilineInput"},"user_prompt":{"trace_as_input":true,"multiline":true,"trace_as_metadata":true,"load_from_db":false,"list":false,"required":false,"placeholder":"","show":true,"name":"user_prompt","value":"{input}","display_name":"Prompt","advanced":true,"input_types":["Message"],"dynamic":false,"info":"This prompt must contain 'input' key.","title_case":false,"type":"str","_input_type":"MultilineInput"},"verbose":{"trace_as_metadata":true,"list":false,"required":false,"placeholder":"","show":true,"name":"verbose","value":true,"display_name":"Verbose","advanced":true,"dynamic":false,"info":"","title_case":false,"type":"bool","_input_type":"BoolInput"}},"description":"Agent that uses tools","icon":"LangChain","base_classes":["AgentExecutor","Message"],"display_name":"Tool Calling Agent","documentation":"","custom_fields":{},"output_types":[],"pinned":false,"conditional_paths":[],"frozen":false,"outputs":[{"types":["AgentExecutor"],"selected":"AgentExecutor","name":"agent","display_name":"Agent","method":"build_agent","value":"__UNDEFINED__","cache":true,"hidden":true},{"types":["Message"],"selected":"Message","name":"response","display_name":"Response","method":"message_response","value":"__UNDEFINED__","cache":true}],"field_order":["input_value","handle_parsing_errors","verbose","max_iterations","tools","llm","system_prompt","user_prompt","chat_history"],"beta":true,"edited":false,"lf_version":"1.0.17"},"id":"ToolCallingAgent-rVWeq"},"selected":false,"width":384,"height":398,"positionAbsolute":{"x":1566.291217492157,"y":583.6687094567968},"dragging":false},{"id":"OpenAIModel-Ht8xI","type":"genericNode","position":{"x":1097.0545781920632,"y":805.60631548423},"data":{"type":"OpenAIModel","node":{"template":{"_type":"Component","api_key":{"load_from_db":false,"required":false,"placeholder":"","show":true,"name":"api_key","value":"","display_name":"OpenAI API Key","advanced":false,"input_types":["Message"],"dynamic":false,"info":"The OpenAI API Key to use for the OpenAI model.","title_case":false,"password":true,"type":"str","_input_type":"SecretStrInput"},"code":{"type":"code","required":true,"placeholder":"","list":false,"show":true,"multiline":true,"value":"import operator\nfrom functools import reduce\n\nfrom langflow.field_typing.range_spec import RangeSpec\nfrom langchain_openai import ChatOpenAI\nfrom pydantic.v1 import SecretStr\n\nfrom langflow.base.models.model import LCModelComponent\nfrom langflow.base.models.openai_constants import OPENAI_MODEL_NAMES\nfrom langflow.field_typing import LanguageModel\nfrom langflow.inputs import (\n BoolInput,\n DictInput,\n DropdownInput,\n FloatInput,\n IntInput,\n SecretStrInput,\n StrInput,\n)\n\n\nclass OpenAIModelComponent(LCModelComponent):\n display_name = \"OpenAI\"\n description = \"Generates text using OpenAI LLMs.\"\n icon = \"OpenAI\"\n name = \"OpenAIModel\"\n\n inputs = LCModelComponent._base_inputs + [\n IntInput(\n name=\"max_tokens\",\n display_name=\"Max Tokens\",\n advanced=True,\n info=\"The maximum number of tokens to generate. Set to 0 for unlimited tokens.\",\n range_spec=RangeSpec(min=0, max=128000),\n ),\n DictInput(name=\"model_kwargs\", display_name=\"Model Kwargs\", advanced=True),\n BoolInput(\n name=\"json_mode\",\n display_name=\"JSON Mode\",\n advanced=True,\n info=\"If True, it will output JSON regardless of passing a schema.\",\n ),\n DictInput(\n name=\"output_schema\",\n is_list=True,\n display_name=\"Schema\",\n advanced=True,\n info=\"The schema for the Output of the model. You must pass the word JSON in the prompt. If left blank, JSON mode will be disabled.\",\n ),\n DropdownInput(\n name=\"model_name\",\n display_name=\"Model Name\",\n advanced=False,\n options=OPENAI_MODEL_NAMES,\n value=OPENAI_MODEL_NAMES[0],\n ),\n StrInput(\n name=\"openai_api_base\",\n display_name=\"OpenAI API Base\",\n advanced=True,\n info=\"The base URL of the OpenAI API. Defaults to https://api.openai.com/v1. You can change this to use other APIs like JinaChat, LocalAI and Prem.\",\n ),\n SecretStrInput(\n name=\"api_key\",\n display_name=\"OpenAI API Key\",\n info=\"The OpenAI API Key to use for the OpenAI model.\",\n advanced=False,\n value=\"OPENAI_API_KEY\",\n ),\n FloatInput(name=\"temperature\", display_name=\"Temperature\", value=0.1),\n IntInput(\n name=\"seed\",\n display_name=\"Seed\",\n info=\"The seed controls the reproducibility of the job.\",\n advanced=True,\n value=1,\n ),\n ]\n\n def build_model(self) -> LanguageModel: # type: ignore[type-var]\n # self.output_schema is a list of dictionaries\n # let's convert it to a dictionary\n output_schema_dict: dict[str, str] = reduce(operator.ior, self.output_schema or {}, {})\n openai_api_key = self.api_key\n temperature = self.temperature\n model_name: str = self.model_name\n max_tokens = self.max_tokens\n model_kwargs = self.model_kwargs or {}\n openai_api_base = self.openai_api_base or \"https://api.openai.com/v1\"\n json_mode = bool(output_schema_dict) or self.json_mode\n seed = self.seed\n\n if openai_api_key:\n api_key = SecretStr(openai_api_key)\n else:\n api_key = None\n output = ChatOpenAI(\n max_tokens=max_tokens or None,\n model_kwargs=model_kwargs,\n model=model_name,\n base_url=openai_api_base,\n api_key=api_key,\n temperature=temperature if temperature is not None else 0.1,\n seed=seed,\n )\n if json_mode:\n if output_schema_dict:\n output = output.with_structured_output(schema=output_schema_dict, method=\"json_mode\") # type: ignore\n else:\n output = output.bind(response_format={\"type\": \"json_object\"}) # type: ignore\n\n return output # type: ignore\n\n def _get_exception_message(self, e: Exception):\n \"\"\"\n Get a message from an OpenAI exception.\n\n Args:\n exception (Exception): The exception to get the message from.\n\n Returns:\n str: The message from the exception.\n \"\"\"\n\n try:\n from openai import BadRequestError\n except ImportError:\n return\n if isinstance(e, BadRequestError):\n message = e.body.get(\"message\") # type: ignore\n if message:\n return message\n return\n","fileTypes":[],"file_path":"","password":false,"name":"code","advanced":true,"dynamic":true,"info":"","load_from_db":false,"title_case":false},"input_value":{"trace_as_input":true,"trace_as_metadata":true,"load_from_db":false,"list":false,"required":false,"placeholder":"","show":true,"name":"input_value","value":"","display_name":"Input","advanced":true,"input_types":["Message"],"dynamic":false,"info":"","title_case":false,"type":"str","_input_type":"MessageInput"},"json_mode":{"trace_as_metadata":true,"list":false,"required":false,"placeholder":"","show":true,"name":"json_mode","value":false,"display_name":"JSON Mode","advanced":true,"dynamic":false,"info":"If True, it will output JSON regardless of passing a schema.","title_case":false,"type":"bool","_input_type":"BoolInput"},"max_tokens":{"trace_as_metadata":true,"range_spec":{"step_type":"float","min":0,"max":128000,"step":0.1},"list":false,"required":false,"placeholder":"","show":true,"name":"max_tokens","value":"","display_name":"Max Tokens","advanced":true,"dynamic":false,"info":"The maximum number of tokens to generate. Set to 0 for unlimited tokens.","title_case":false,"type":"int","_input_type":"IntInput"},"model_kwargs":{"trace_as_input":true,"list":false,"required":false,"placeholder":"","show":true,"name":"model_kwargs","value":{},"display_name":"Model Kwargs","advanced":true,"dynamic":false,"info":"","title_case":false,"type":"dict","_input_type":"DictInput"},"model_name":{"trace_as_metadata":true,"options":["gpt-4o-mini","gpt-4o","gpt-4-turbo","gpt-4-turbo-preview","gpt-4","gpt-3.5-turbo","gpt-3.5-turbo-0125"],"combobox":false,"required":false,"placeholder":"","show":true,"name":"model_name","value":"gpt-4o","display_name":"Model Name","advanced":true,"dynamic":false,"info":"","title_case":false,"type":"str","_input_type":"DropdownInput"},"openai_api_base":{"trace_as_metadata":true,"load_from_db":false,"list":false,"required":false,"placeholder":"","show":true,"name":"openai_api_base","value":"","display_name":"OpenAI API Base","advanced":true,"dynamic":false,"info":"The base URL of the OpenAI API. Defaults to https://api.openai.com/v1. You can change this to use other APIs like JinaChat, LocalAI and Prem.","title_case":false,"type":"str","_input_type":"StrInput"},"output_schema":{"trace_as_input":true,"list":true,"required":false,"placeholder":"","show":true,"name":"output_schema","value":{},"display_name":"Schema","advanced":true,"dynamic":false,"info":"The schema for the Output of the model. You must pass the word JSON in the prompt. If left blank, JSON mode will be disabled.","title_case":false,"type":"dict","_input_type":"DictInput"},"seed":{"trace_as_metadata":true,"list":false,"required":false,"placeholder":"","show":true,"name":"seed","value":1,"display_name":"Seed","advanced":true,"dynamic":false,"info":"The seed controls the reproducibility of the job.","title_case":false,"type":"int","_input_type":"IntInput"},"stream":{"trace_as_metadata":true,"list":false,"required":false,"placeholder":"","show":true,"name":"stream","value":false,"display_name":"Stream","advanced":true,"dynamic":false,"info":"Stream the response from the model. Streaming works only in Chat.","title_case":false,"type":"bool","_input_type":"BoolInput"},"system_message":{"trace_as_input":true,"trace_as_metadata":true,"load_from_db":false,"list":false,"required":false,"placeholder":"","show":true,"name":"system_message","value":"","display_name":"System Message","advanced":true,"input_types":["Message"],"dynamic":false,"info":"System message to pass to the model.","title_case":false,"type":"str","_input_type":"MessageTextInput"},"temperature":{"trace_as_metadata":true,"list":false,"required":false,"placeholder":"","show":true,"name":"temperature","value":0.1,"display_name":"Temperature","advanced":true,"dynamic":false,"info":"","title_case":false,"type":"float","_input_type":"FloatInput"}},"description":"Generates text using OpenAI LLMs.","icon":"OpenAI","base_classes":["LanguageModel","Message"],"display_name":"OpenAI","documentation":"","custom_fields":{},"output_types":[],"pinned":false,"conditional_paths":[],"frozen":false,"outputs":[{"types":["Message"],"selected":"Message","name":"text_output","display_name":"Text","method":"text_response","value":"__UNDEFINED__","cache":true,"hidden":true},{"types":["LanguageModel"],"selected":"LanguageModel","name":"model_output","display_name":"Language Model","method":"build_model","value":"__UNDEFINED__","cache":true}],"field_order":["input_value","system_message","stream","max_tokens","model_kwargs","json_mode","output_schema","model_name","openai_api_base","api_key","temperature","seed"],"beta":false,"edited":false,"lf_version":"1.0.17"},"id":"OpenAIModel-Ht8xI"},"selected":false,"width":384,"height":302,"dragging":false,"positionAbsolute":{"x":1097.0545781920632,"y":805.60631548423}},{"id":"Prompt-Lbxk6","type":"genericNode","position":{"x":3042.6844997246735,"y":416.83992118486856},"data":{"type":"Prompt","node":{"template":{"_type":"Component","code":{"type":"code","required":true,"placeholder":"","list":false,"show":true,"multiline":true,"value":"from langflow.base.prompts.api_utils import process_prompt_template\nfrom langflow.custom import Component\nfrom langflow.inputs.inputs import DefaultPromptField\nfrom langflow.io import Output, PromptInput\nfrom langflow.schema.message import Message\nfrom langflow.template.utils import update_template_values\n\n\nclass PromptComponent(Component):\n display_name: str = \"Prompt\"\n description: str = \"Create a prompt template with dynamic variables.\"\n icon = \"prompts\"\n trace_type = \"prompt\"\n name = \"Prompt\"\n\n inputs = [\n PromptInput(name=\"template\", display_name=\"Template\"),\n ]\n\n outputs = [\n Output(display_name=\"Prompt Message\", name=\"prompt\", method=\"build_prompt\"),\n ]\n\n async def build_prompt(\n self,\n ) -> Message:\n prompt = Message.from_template_and_variables(**self._attributes)\n self.status = prompt.text\n return prompt\n\n def _update_template(self, frontend_node: dict):\n prompt_template = frontend_node[\"template\"][\"template\"][\"value\"]\n custom_fields = frontend_node[\"custom_fields\"]\n frontend_node_template = frontend_node[\"template\"]\n _ = process_prompt_template(\n template=prompt_template,\n name=\"template\",\n custom_fields=custom_fields,\n frontend_node_template=frontend_node_template,\n )\n return frontend_node\n\n def post_code_processing(self, new_frontend_node: dict, current_frontend_node: dict):\n \"\"\"\n This function is called after the code validation is done.\n \"\"\"\n frontend_node = super().post_code_processing(new_frontend_node, current_frontend_node)\n template = frontend_node[\"template\"][\"template\"][\"value\"]\n # Kept it duplicated for backwards compatibility\n _ = process_prompt_template(\n template=template,\n name=\"template\",\n custom_fields=frontend_node[\"custom_fields\"],\n frontend_node_template=frontend_node[\"template\"],\n )\n # Now that template is updated, we need to grab any values that were set in the current_frontend_node\n # and update the frontend_node with those values\n update_template_values(new_template=frontend_node, previous_template=current_frontend_node[\"template\"])\n return frontend_node\n\n def _get_fallback_input(self, **kwargs):\n return DefaultPromptField(**kwargs)\n","fileTypes":[],"file_path":"","password":false,"name":"code","advanced":true,"dynamic":true,"info":"","load_from_db":false,"title_case":false},"template":{"trace_as_input":true,"list":false,"required":false,"placeholder":"","show":true,"name":"template","value":"\nYou are an AI assistant responsible for updating tasks in Notion based on the information provided from a meeting analysis. Your goal is to create new tasks and update existing ones using the Notion API tools available to you, and then provide a summary in a simple markdown format suitable for a chat interface.\n\nYou have access to the following inputs:\n\n\n{TASK_LIST}\n\n\n\n{DATABASES}\n\n\n\n{USERS}\n\n\nFollow these steps to update the tasks in Notion and generate a markdown summary:\n\n1. Identify the Task database ID from the provided list.\n\n2. Before processing any tasks, retrieve the database properties for the Task database:\n a. Use the notion_database_properties and carefully review the properties, their types, and any options for select or multi-select properties.\n b. Pay attention to the properties format for further usage.\n\n3. For each task in the task list:\n a. If the task ID is \"NEW\", create a new task using the create_notion_page tool.\n b. If the task has an existing ID, update the task using the update_notion_page tool.\n c. Remember to use the properties from the DB retrieved from the notion_database_properties tool\n\n4. When creating a new task:\n a. Use the create_notion_page tool.\n b. Include the task name, assignee (if available), status, and any other relevant properties based on the database structure.\n c. Ensure that the property names and types match exactly with what you retrieved from the notion_database_properties call.\n\n5. When updating an existing task:\n a. Use the update_notion_page tool.\n b. Update the status, assignee, or any other relevant properties mentioned in the field.\n c. Ensure that the property names and types match exactly with what you retrieved from the notion_database_properties call.\n\n6. After each function call, wait for the before proceeding to the next task.\n\n7. If you encounter any errors during the process, note them and continue with the next task.\n\n8. Provide a summary of your actions for each task in a simple markdown format. Use the following structure:\n # Task Update Summary\n\n ## Created Tasks\n - **[Task Name]**: Assigned to [Assignee], Status: [Status]\n - Details: [Brief description of the new task]\n\n ## Updated Tasks\n - **[Task Name]** (ID: [Notion Page ID])\n - Changes: [Brief description of changes]\n - Status: [Success/Error]\n\n ## Errors\n - **[Task Name or ID]**: [Description of the error encountered]\n\n\nRemember to use the exact property names, types, and options as specified in the Notion database properties you retrieved at the beginning. This is crucial for ensuring that all updates and creations are done correctly.\n\nIf you encounter any errors or uncertainties, include them in the Errors section of the markdown summary. With enough detail to the user understand the issues.\n\nProvide your final output as a complete markdown document containing all the tasks you've processed, whether they were created, updated, or encountered errors. Use only basic markdown formatting (headers, bold, lists) to ensure compatibility with chat interfaces. Do not include any XML tags or complex formatting in your final output.\n\nToday is: {CURRENT_DATE}\n\n","display_name":"Template","advanced":false,"dynamic":false,"info":"","title_case":false,"type":"prompt","_input_type":"PromptInput"},"TASK_LIST":{"field_type":"str","required":false,"placeholder":"","list":false,"show":true,"multiline":true,"value":"","fileTypes":[],"file_path":"","password":false,"name":"TASK_LIST","display_name":"TASK_LIST","advanced":false,"input_types":["Message","Text"],"dynamic":false,"info":"","load_from_db":false,"title_case":false,"type":"str"},"DATABASES":{"field_type":"str","required":false,"placeholder":"","list":false,"show":true,"multiline":true,"value":"","fileTypes":[],"file_path":"","password":false,"name":"DATABASES","display_name":"DATABASES","advanced":false,"input_types":["Message","Text"],"dynamic":false,"info":"","load_from_db":false,"title_case":false,"type":"str"},"USERS":{"field_type":"str","required":false,"placeholder":"","list":false,"show":true,"multiline":true,"value":"","fileTypes":[],"file_path":"","password":false,"name":"USERS","display_name":"USERS","advanced":false,"input_types":["Message","Text"],"dynamic":false,"info":"","load_from_db":false,"title_case":false,"type":"str"},"CURRENT_DATE":{"field_type":"str","required":false,"placeholder":"","list":false,"show":true,"multiline":true,"value":"","fileTypes":[],"file_path":"","password":false,"name":"CURRENT_DATE","display_name":"CURRENT_DATE","advanced":false,"input_types":["Message","Text"],"dynamic":false,"info":"","load_from_db":false,"title_case":false,"type":"str"}},"description":"Create a prompt template with dynamic variables.","icon":"prompts","is_input":null,"is_output":null,"is_composition":null,"base_classes":["Message"],"name":"","display_name":"Prompt","documentation":"","custom_fields":{"template":["TASK_LIST","DATABASES","USERS","CURRENT_DATE"]},"output_types":[],"full_path":null,"pinned":false,"conditional_paths":[],"frozen":false,"outputs":[{"types":["Message"],"selected":"Message","name":"prompt","hidden":null,"display_name":"Prompt Message","method":"build_prompt","value":"__UNDEFINED__","cache":true}],"field_order":["template"],"beta":false,"error":null,"edited":false},"id":"Prompt-Lbxk6"},"selected":false,"width":384,"height":674,"positionAbsolute":{"x":3042.6844997246735,"y":416.83992118486856},"dragging":false},{"id":"ToolCallingAgent-GurdE","type":"genericNode","position":{"x":3974.1377259893243,"y":867.4647271037014},"data":{"type":"ToolCallingAgent","node":{"template":{"_type":"Component","chat_history":{"trace_as_metadata":true,"list":true,"trace_as_input":true,"required":false,"placeholder":"","show":true,"name":"chat_history","value":"","display_name":"Chat History","advanced":true,"input_types":["Data"],"dynamic":false,"info":"","title_case":false,"type":"other","_input_type":"DataInput"},"llm":{"trace_as_metadata":true,"list":false,"required":true,"placeholder":"","show":true,"name":"llm","value":"","display_name":"Language Model","advanced":false,"input_types":["LanguageModel"],"dynamic":false,"info":"","title_case":false,"type":"other","_input_type":"HandleInput"},"tools":{"trace_as_metadata":true,"list":true,"required":false,"placeholder":"","show":true,"name":"tools","value":"","display_name":"Tools","advanced":false,"input_types":["Tool","BaseTool"],"dynamic":false,"info":"","title_case":false,"type":"other","_input_type":"HandleInput"},"code":{"type":"code","required":true,"placeholder":"","list":false,"show":true,"multiline":true,"value":"from typing import Optional, List\n\nfrom langchain.agents import create_tool_calling_agent\nfrom langchain_core.prompts import ChatPromptTemplate, PromptTemplate, HumanMessagePromptTemplate\nfrom langflow.base.agents.agent import LCToolsAgentComponent\nfrom langflow.inputs import MultilineInput\nfrom langflow.inputs.inputs import HandleInput, DataInput\nfrom langflow.schema import Data\n\n\nclass ToolCallingAgentComponent(LCToolsAgentComponent):\n display_name: str = \"Tool Calling Agent\"\n description: str = \"Agent that uses tools\"\n icon = \"LangChain\"\n beta = True\n name = \"ToolCallingAgent\"\n\n inputs = LCToolsAgentComponent._base_inputs + [\n HandleInput(name=\"llm\", display_name=\"Language Model\", input_types=[\"LanguageModel\"], required=True),\n MultilineInput(\n name=\"system_prompt\",\n display_name=\"System Prompt\",\n info=\"System prompt for the agent.\",\n value=\"You are a helpful assistant\",\n ),\n MultilineInput(\n name=\"user_prompt\", display_name=\"Prompt\", info=\"This prompt must contain 'input' key.\", value=\"{input}\"\n ),\n DataInput(name=\"chat_history\", display_name=\"Chat History\", is_list=True, advanced=True),\n ]\n\n def get_chat_history_data(self) -> Optional[List[Data]]:\n return self.chat_history\n\n def create_agent_runnable(self):\n if \"input\" not in self.user_prompt:\n raise ValueError(\"Prompt must contain 'input' key.\")\n messages = [\n (\"system\", self.system_prompt),\n (\"placeholder\", \"{chat_history}\"),\n HumanMessagePromptTemplate(prompt=PromptTemplate(input_variables=[\"input\"], template=self.user_prompt)),\n (\"placeholder\", \"{agent_scratchpad}\"),\n ]\n prompt = ChatPromptTemplate.from_messages(messages)\n return create_tool_calling_agent(self.llm, self.tools, prompt)\n","fileTypes":[],"file_path":"","password":false,"name":"code","advanced":true,"dynamic":true,"info":"","load_from_db":false,"title_case":false},"handle_parsing_errors":{"trace_as_metadata":true,"list":false,"required":false,"placeholder":"","show":true,"name":"handle_parsing_errors","value":true,"display_name":"Handle Parse Errors","advanced":true,"dynamic":false,"info":"","title_case":false,"type":"bool","_input_type":"BoolInput"},"input_value":{"trace_as_input":true,"trace_as_metadata":true,"load_from_db":false,"list":false,"required":false,"placeholder":"","show":true,"name":"input_value","value":"Do your task.","display_name":"Input","advanced":true,"input_types":["Message"],"dynamic":false,"info":"","title_case":false,"type":"str","_input_type":"MessageTextInput"},"max_iterations":{"trace_as_metadata":true,"list":false,"required":false,"placeholder":"","show":true,"name":"max_iterations","value":15,"display_name":"Max Iterations","advanced":true,"dynamic":false,"info":"","title_case":false,"type":"int","_input_type":"IntInput"},"system_prompt":{"trace_as_input":true,"multiline":true,"trace_as_metadata":true,"load_from_db":false,"list":false,"required":false,"placeholder":"","show":true,"name":"system_prompt","value":"","display_name":"System Prompt","advanced":false,"input_types":["Message"],"dynamic":false,"info":"System prompt for the agent.","title_case":false,"type":"str","_input_type":"MultilineInput"},"user_prompt":{"trace_as_input":true,"multiline":true,"trace_as_metadata":true,"load_from_db":false,"list":false,"required":false,"placeholder":"","show":true,"name":"user_prompt","value":"{input}","display_name":"Prompt","advanced":true,"input_types":["Message"],"dynamic":false,"info":"This prompt must contain 'input' key.","title_case":false,"type":"str","_input_type":"MultilineInput"},"verbose":{"trace_as_metadata":true,"list":false,"required":false,"placeholder":"","show":true,"name":"verbose","value":true,"display_name":"Verbose","advanced":true,"dynamic":false,"info":"","title_case":false,"type":"bool","_input_type":"BoolInput"}},"description":"Agent that uses tools","icon":"LangChain","base_classes":["AgentExecutor","Message"],"display_name":"Tool Calling Agent","documentation":"","custom_fields":{},"output_types":[],"pinned":false,"conditional_paths":[],"frozen":false,"outputs":[{"types":["AgentExecutor"],"selected":"AgentExecutor","name":"agent","display_name":"Agent","method":"build_agent","value":"__UNDEFINED__","cache":true,"hidden":true},{"types":["Message"],"selected":"Message","name":"response","display_name":"Response","method":"message_response","value":"__UNDEFINED__","cache":true}],"field_order":["input_value","handle_parsing_errors","verbose","max_iterations","tools","llm","system_prompt","user_prompt","chat_history"],"beta":true,"edited":false,"lf_version":"1.0.17"},"id":"ToolCallingAgent-GurdE"},"selected":false,"width":384,"height":398,"positionAbsolute":{"x":3974.1377259893243,"y":867.4647271037014},"dragging":false},{"id":"OpenAIModel-OTfnt","type":"genericNode","position":{"x":3513.5648778762093,"y":710.2099422974287},"data":{"type":"OpenAIModel","node":{"template":{"_type":"Component","api_key":{"load_from_db":false,"required":false,"placeholder":"","show":true,"name":"api_key","value":"","display_name":"OpenAI API Key","advanced":false,"input_types":["Message"],"dynamic":false,"info":"The OpenAI API Key to use for the OpenAI model.","title_case":false,"password":true,"type":"str","_input_type":"SecretStrInput"},"code":{"type":"code","required":true,"placeholder":"","list":false,"show":true,"multiline":true,"value":"import operator\nfrom functools import reduce\n\nfrom langflow.field_typing.range_spec import RangeSpec\nfrom langchain_openai import ChatOpenAI\nfrom pydantic.v1 import SecretStr\n\nfrom langflow.base.models.model import LCModelComponent\nfrom langflow.base.models.openai_constants import OPENAI_MODEL_NAMES\nfrom langflow.field_typing import LanguageModel\nfrom langflow.inputs import (\n BoolInput,\n DictInput,\n DropdownInput,\n FloatInput,\n IntInput,\n SecretStrInput,\n StrInput,\n)\n\n\nclass OpenAIModelComponent(LCModelComponent):\n display_name = \"OpenAI\"\n description = \"Generates text using OpenAI LLMs.\"\n icon = \"OpenAI\"\n name = \"OpenAIModel\"\n\n inputs = LCModelComponent._base_inputs + [\n IntInput(\n name=\"max_tokens\",\n display_name=\"Max Tokens\",\n advanced=True,\n info=\"The maximum number of tokens to generate. Set to 0 for unlimited tokens.\",\n range_spec=RangeSpec(min=0, max=128000),\n ),\n DictInput(name=\"model_kwargs\", display_name=\"Model Kwargs\", advanced=True),\n BoolInput(\n name=\"json_mode\",\n display_name=\"JSON Mode\",\n advanced=True,\n info=\"If True, it will output JSON regardless of passing a schema.\",\n ),\n DictInput(\n name=\"output_schema\",\n is_list=True,\n display_name=\"Schema\",\n advanced=True,\n info=\"The schema for the Output of the model. You must pass the word JSON in the prompt. If left blank, JSON mode will be disabled.\",\n ),\n DropdownInput(\n name=\"model_name\",\n display_name=\"Model Name\",\n advanced=False,\n options=OPENAI_MODEL_NAMES,\n value=OPENAI_MODEL_NAMES[0],\n ),\n StrInput(\n name=\"openai_api_base\",\n display_name=\"OpenAI API Base\",\n advanced=True,\n info=\"The base URL of the OpenAI API. Defaults to https://api.openai.com/v1. You can change this to use other APIs like JinaChat, LocalAI and Prem.\",\n ),\n SecretStrInput(\n name=\"api_key\",\n display_name=\"OpenAI API Key\",\n info=\"The OpenAI API Key to use for the OpenAI model.\",\n advanced=False,\n value=\"OPENAI_API_KEY\",\n ),\n FloatInput(name=\"temperature\", display_name=\"Temperature\", value=0.1),\n IntInput(\n name=\"seed\",\n display_name=\"Seed\",\n info=\"The seed controls the reproducibility of the job.\",\n advanced=True,\n value=1,\n ),\n ]\n\n def build_model(self) -> LanguageModel: # type: ignore[type-var]\n # self.output_schema is a list of dictionaries\n # let's convert it to a dictionary\n output_schema_dict: dict[str, str] = reduce(operator.ior, self.output_schema or {}, {})\n openai_api_key = self.api_key\n temperature = self.temperature\n model_name: str = self.model_name\n max_tokens = self.max_tokens\n model_kwargs = self.model_kwargs or {}\n openai_api_base = self.openai_api_base or \"https://api.openai.com/v1\"\n json_mode = bool(output_schema_dict) or self.json_mode\n seed = self.seed\n\n if openai_api_key:\n api_key = SecretStr(openai_api_key)\n else:\n api_key = None\n output = ChatOpenAI(\n max_tokens=max_tokens or None,\n model_kwargs=model_kwargs,\n model=model_name,\n base_url=openai_api_base,\n api_key=api_key,\n temperature=temperature if temperature is not None else 0.1,\n seed=seed,\n )\n if json_mode:\n if output_schema_dict:\n output = output.with_structured_output(schema=output_schema_dict, method=\"json_mode\") # type: ignore\n else:\n output = output.bind(response_format={\"type\": \"json_object\"}) # type: ignore\n\n return output # type: ignore\n\n def _get_exception_message(self, e: Exception):\n \"\"\"\n Get a message from an OpenAI exception.\n\n Args:\n exception (Exception): The exception to get the message from.\n\n Returns:\n str: The message from the exception.\n \"\"\"\n\n try:\n from openai import BadRequestError\n except ImportError:\n return\n if isinstance(e, BadRequestError):\n message = e.body.get(\"message\") # type: ignore\n if message:\n return message\n return\n","fileTypes":[],"file_path":"","password":false,"name":"code","advanced":true,"dynamic":true,"info":"","load_from_db":false,"title_case":false},"input_value":{"trace_as_input":true,"trace_as_metadata":true,"load_from_db":false,"list":false,"required":false,"placeholder":"","show":true,"name":"input_value","value":"","display_name":"Input","advanced":true,"input_types":["Message"],"dynamic":false,"info":"","title_case":false,"type":"str","_input_type":"MessageInput"},"json_mode":{"trace_as_metadata":true,"list":false,"required":false,"placeholder":"","show":true,"name":"json_mode","value":false,"display_name":"JSON Mode","advanced":true,"dynamic":false,"info":"If True, it will output JSON regardless of passing a schema.","title_case":false,"type":"bool","_input_type":"BoolInput"},"max_tokens":{"trace_as_metadata":true,"range_spec":{"step_type":"float","min":0,"max":128000,"step":0.1},"list":false,"required":false,"placeholder":"","show":true,"name":"max_tokens","value":"","display_name":"Max Tokens","advanced":true,"dynamic":false,"info":"The maximum number of tokens to generate. Set to 0 for unlimited tokens.","title_case":false,"type":"int","_input_type":"IntInput"},"model_kwargs":{"trace_as_input":true,"list":false,"required":false,"placeholder":"","show":true,"name":"model_kwargs","value":{},"display_name":"Model Kwargs","advanced":true,"dynamic":false,"info":"","title_case":false,"type":"dict","_input_type":"DictInput"},"model_name":{"trace_as_metadata":true,"options":["gpt-4o-mini","gpt-4o","gpt-4-turbo","gpt-4-turbo-preview","gpt-4","gpt-3.5-turbo","gpt-3.5-turbo-0125"],"combobox":false,"required":false,"placeholder":"","show":true,"name":"model_name","value":"gpt-4o","display_name":"Model Name","advanced":true,"dynamic":false,"info":"","title_case":false,"type":"str","_input_type":"DropdownInput"},"openai_api_base":{"trace_as_metadata":true,"load_from_db":false,"list":false,"required":false,"placeholder":"","show":true,"name":"openai_api_base","value":"","display_name":"OpenAI API Base","advanced":true,"dynamic":false,"info":"The base URL of the OpenAI API. Defaults to https://api.openai.com/v1. You can change this to use other APIs like JinaChat, LocalAI and Prem.","title_case":false,"type":"str","_input_type":"StrInput"},"output_schema":{"trace_as_input":true,"list":true,"required":false,"placeholder":"","show":true,"name":"output_schema","value":{},"display_name":"Schema","advanced":true,"dynamic":false,"info":"The schema for the Output of the model. You must pass the word JSON in the prompt. If left blank, JSON mode will be disabled.","title_case":false,"type":"dict","_input_type":"DictInput"},"seed":{"trace_as_metadata":true,"list":false,"required":false,"placeholder":"","show":true,"name":"seed","value":1,"display_name":"Seed","advanced":true,"dynamic":false,"info":"The seed controls the reproducibility of the job.","title_case":false,"type":"int","_input_type":"IntInput"},"stream":{"trace_as_metadata":true,"list":false,"required":false,"placeholder":"","show":true,"name":"stream","value":false,"display_name":"Stream","advanced":true,"dynamic":false,"info":"Stream the response from the model. Streaming works only in Chat.","title_case":false,"type":"bool","_input_type":"BoolInput"},"system_message":{"trace_as_input":true,"trace_as_metadata":true,"load_from_db":false,"list":false,"required":false,"placeholder":"","show":true,"name":"system_message","value":"","display_name":"System Message","advanced":true,"input_types":["Message"],"dynamic":false,"info":"System message to pass to the model.","title_case":false,"type":"str","_input_type":"MessageTextInput"},"temperature":{"trace_as_metadata":true,"list":false,"required":false,"placeholder":"","show":true,"name":"temperature","value":0.1,"display_name":"Temperature","advanced":true,"dynamic":false,"info":"","title_case":false,"type":"float","_input_type":"FloatInput"}},"description":"Generates text using OpenAI LLMs.","icon":"OpenAI","base_classes":["LanguageModel","Message"],"display_name":"OpenAI","documentation":"","custom_fields":{},"output_types":[],"pinned":false,"conditional_paths":[],"frozen":false,"outputs":[{"types":["Message"],"selected":"Message","name":"text_output","display_name":"Text","method":"text_response","value":"__UNDEFINED__","cache":true,"hidden":true},{"types":["LanguageModel"],"selected":"LanguageModel","name":"model_output","display_name":"Language Model","method":"build_model","value":"__UNDEFINED__","cache":true}],"field_order":["input_value","system_message","stream","max_tokens","model_kwargs","json_mode","output_schema","model_name","openai_api_base","api_key","temperature","seed"],"beta":false,"edited":false,"lf_version":"1.0.17"},"id":"OpenAIModel-OTfnt"},"selected":false,"width":384,"height":302,"positionAbsolute":{"x":3513.5648778762093,"y":710.2099422974287},"dragging":false},{"id":"AddContentToPage-vrAvx","type":"genericNode","position":{"x":2649.2991466550634,"y":1050.6250104897197},"data":{"type":"AddContentToPage","node":{"template":{"_type":"Component","block_id":{"trace_as_metadata":true,"load_from_db":false,"list":false,"required":false,"placeholder":"","show":true,"name":"block_id","value":"","display_name":"Page/Block ID","advanced":true,"dynamic":false,"info":"The ID of the page/block to add the content.","title_case":false,"type":"str","_input_type":"StrInput"},"code":{"type":"code","required":true,"placeholder":"","list":false,"show":true,"multiline":true,"value":"import json\nfrom typing import Dict, Any, Union\nfrom markdown import markdown\nfrom bs4 import BeautifulSoup\nimport requests\nfrom langflow.io import Output\nfrom langflow.base.langchain_utilities.model import LCToolComponent\nfrom langflow.inputs import SecretStrInput, StrInput, MultilineInput\nfrom langflow.schema import Data\nfrom langflow.field_typing import Tool\nfrom langchain.tools import StructuredTool\nfrom pydantic import BaseModel, Field\n\n\nclass AddContentToPage(LCToolComponent):\n display_name: str = \"Add Content to Page \"\n description: str = \"Convert markdown text to Notion blocks and append them to a Notion page.\"\n documentation: str = \"https://developers.notion.com/reference/patch-block-children\"\n icon = \"NotionDirectoryLoader\"\n\n inputs = [\n MultilineInput(\n name=\"markdown_text\",\n display_name=\"Markdown Text\",\n info=\"The markdown text to convert to Notion blocks.\",\n ),\n StrInput(\n name=\"block_id\",\n display_name=\"Page/Block ID\",\n info=\"The ID of the page/block to add the content.\",\n ),\n SecretStrInput(\n name=\"notion_secret\",\n display_name=\"Notion Secret\",\n info=\"The Notion integration token.\",\n required=True,\n ),\n ]\n outputs = [\n Output(name=\"example_output\", display_name=\"Data\", method=\"run_model\"),\n Output(name=\"example_tool_output\", display_name=\"Tool\", method=\"build_tool\"),\n ]\n\n class AddContentToPageSchema(BaseModel):\n markdown_text: str = Field(..., description=\"The markdown text to convert to Notion blocks.\")\n block_id: str = Field(..., description=\"The ID of the page/block to add the content.\")\n\n def run_model(self) -> Data:\n result = self._add_content_to_page(self.markdown_text, self.block_id)\n return Data(data=result, text=json.dumps(result))\n\n def build_tool(self) -> Tool:\n return StructuredTool.from_function(\n name=\"add_content_to_notion_page\",\n description=\"Convert markdown text to Notion blocks and append them to a Notion page.\",\n func=self._add_content_to_page,\n args_schema=self.AddContentToPageSchema,\n )\n\n def _add_content_to_page(self, markdown_text: str, block_id: str) -> Union[Dict[str, Any], str]:\n try:\n html_text = markdown(markdown_text)\n soup = BeautifulSoup(html_text, \"html.parser\")\n blocks = self.process_node(soup)\n\n url = f\"https://api.notion.com/v1/blocks/{block_id}/children\"\n headers = {\n \"Authorization\": f\"Bearer {self.notion_secret}\",\n \"Content-Type\": \"application/json\",\n \"Notion-Version\": \"2022-06-28\",\n }\n\n data = {\n \"children\": blocks,\n }\n\n response = requests.patch(url, headers=headers, json=data)\n response.raise_for_status()\n\n return response.json()\n except requests.exceptions.RequestException as e:\n error_message = f\"Error: Failed to add content to Notion page. {str(e)}\"\n if hasattr(e, \"response\") and e.response is not None:\n error_message += f\" Status code: {e.response.status_code}, Response: {e.response.text}\"\n return error_message\n except Exception as e:\n return f\"Error: An unexpected error occurred while adding content to Notion page. {str(e)}\"\n\n def process_node(self, node):\n blocks = []\n if isinstance(node, str):\n text = node.strip()\n if text:\n if text.startswith(\"#\"):\n heading_level = text.count(\"#\", 0, 6)\n heading_text = text[heading_level:].strip()\n if heading_level == 1:\n blocks.append(self.create_block(\"heading_1\", heading_text))\n elif heading_level == 2:\n blocks.append(self.create_block(\"heading_2\", heading_text))\n elif heading_level == 3:\n blocks.append(self.create_block(\"heading_3\", heading_text))\n else:\n blocks.append(self.create_block(\"paragraph\", text))\n elif node.name == \"h1\":\n blocks.append(self.create_block(\"heading_1\", node.get_text(strip=True)))\n elif node.name == \"h2\":\n blocks.append(self.create_block(\"heading_2\", node.get_text(strip=True)))\n elif node.name == \"h3\":\n blocks.append(self.create_block(\"heading_3\", node.get_text(strip=True)))\n elif node.name == \"p\":\n code_node = node.find(\"code\")\n if code_node:\n code_text = code_node.get_text()\n language, code = self.extract_language_and_code(code_text)\n blocks.append(self.create_block(\"code\", code, language=language))\n elif self.is_table(str(node)):\n blocks.extend(self.process_table(node))\n else:\n blocks.append(self.create_block(\"paragraph\", node.get_text(strip=True)))\n elif node.name == \"ul\":\n blocks.extend(self.process_list(node, \"bulleted_list_item\"))\n elif node.name == \"ol\":\n blocks.extend(self.process_list(node, \"numbered_list_item\"))\n elif node.name == \"blockquote\":\n blocks.append(self.create_block(\"quote\", node.get_text(strip=True)))\n elif node.name == \"hr\":\n blocks.append(self.create_block(\"divider\", \"\"))\n elif node.name == \"img\":\n blocks.append(self.create_block(\"image\", \"\", image_url=node.get(\"src\")))\n elif node.name == \"a\":\n blocks.append(self.create_block(\"bookmark\", node.get_text(strip=True), link_url=node.get(\"href\")))\n elif node.name == \"table\":\n blocks.extend(self.process_table(node))\n\n for child in node.children:\n if isinstance(child, str):\n continue\n blocks.extend(self.process_node(child))\n\n return blocks\n\n def extract_language_and_code(self, code_text):\n lines = code_text.split(\"\\n\")\n language = lines[0].strip()\n code = \"\\n\".join(lines[1:]).strip()\n return language, code\n\n def is_code_block(self, text):\n return text.startswith(\"```\")\n\n def extract_code_block(self, text):\n lines = text.split(\"\\n\")\n language = lines[0].strip(\"`\").strip()\n code = \"\\n\".join(lines[1:]).strip(\"`\").strip()\n return language, code\n\n def is_table(self, text):\n rows = text.split(\"\\n\")\n if len(rows) < 2:\n return False\n\n has_separator = False\n for i, row in enumerate(rows):\n if \"|\" in row:\n cells = [cell.strip() for cell in row.split(\"|\")]\n cells = [cell for cell in cells if cell] # Remove empty cells\n if i == 1 and all(set(cell) <= set(\"-|\") for cell in cells):\n has_separator = True\n elif not cells:\n return False\n\n return has_separator and len(rows) >= 3\n\n def process_list(self, node, list_type):\n blocks = []\n for item in node.find_all(\"li\"):\n item_text = item.get_text(strip=True)\n checked = item_text.startswith(\"[x]\")\n is_checklist = item_text.startswith(\"[ ]\") or checked\n\n if is_checklist:\n item_text = item_text.replace(\"[x]\", \"\").replace(\"[ ]\", \"\").strip()\n blocks.append(self.create_block(\"to_do\", item_text, checked=checked))\n else:\n blocks.append(self.create_block(list_type, item_text))\n return blocks\n\n def process_table(self, node):\n blocks = []\n header_row = node.find(\"thead\").find(\"tr\") if node.find(\"thead\") else None\n body_rows = node.find(\"tbody\").find_all(\"tr\") if node.find(\"tbody\") else []\n\n if header_row or body_rows:\n table_width = max(\n len(header_row.find_all([\"th\", \"td\"])) if header_row else 0,\n max(len(row.find_all([\"th\", \"td\"])) for row in body_rows),\n )\n\n table_block = self.create_block(\"table\", \"\", table_width=table_width, has_column_header=bool(header_row))\n blocks.append(table_block)\n\n if header_row:\n header_cells = [cell.get_text(strip=True) for cell in header_row.find_all([\"th\", \"td\"])]\n header_row_block = self.create_block(\"table_row\", header_cells)\n blocks.append(header_row_block)\n\n for row in body_rows:\n cells = [cell.get_text(strip=True) for cell in row.find_all([\"th\", \"td\"])]\n row_block = self.create_block(\"table_row\", cells)\n blocks.append(row_block)\n\n return blocks\n\n def create_block(self, block_type: str, content: str, **kwargs) -> Dict[str, Any]:\n block: dict[str, Any] = {\n \"object\": \"block\",\n \"type\": block_type,\n block_type: {},\n }\n\n if block_type in [\n \"paragraph\",\n \"heading_1\",\n \"heading_2\",\n \"heading_3\",\n \"bulleted_list_item\",\n \"numbered_list_item\",\n \"quote\",\n ]:\n block[block_type][\"rich_text\"] = [\n {\n \"type\": \"text\",\n \"text\": {\n \"content\": content,\n },\n }\n ]\n elif block_type == \"to_do\":\n block[block_type][\"rich_text\"] = [\n {\n \"type\": \"text\",\n \"text\": {\n \"content\": content,\n },\n }\n ]\n block[block_type][\"checked\"] = kwargs.get(\"checked\", False)\n elif block_type == \"code\":\n block[block_type][\"rich_text\"] = [\n {\n \"type\": \"text\",\n \"text\": {\n \"content\": content,\n },\n }\n ]\n block[block_type][\"language\"] = kwargs.get(\"language\", \"plain text\")\n elif block_type == \"image\":\n block[block_type] = {\"type\": \"external\", \"external\": {\"url\": kwargs.get(\"image_url\", \"\")}}\n elif block_type == \"divider\":\n pass\n elif block_type == \"bookmark\":\n block[block_type][\"url\"] = kwargs.get(\"link_url\", \"\")\n elif block_type == \"table\":\n block[block_type][\"table_width\"] = kwargs.get(\"table_width\", 0)\n block[block_type][\"has_column_header\"] = kwargs.get(\"has_column_header\", False)\n block[block_type][\"has_row_header\"] = kwargs.get(\"has_row_header\", False)\n elif block_type == \"table_row\":\n block[block_type][\"cells\"] = [[{\"type\": \"text\", \"text\": {\"content\": cell}} for cell in content]]\n\n return block\n","fileTypes":[],"file_path":"","password":false,"name":"code","advanced":true,"dynamic":true,"info":"","load_from_db":false,"title_case":false},"markdown_text":{"trace_as_input":true,"multiline":true,"trace_as_metadata":true,"load_from_db":false,"list":false,"required":false,"placeholder":"","show":true,"name":"markdown_text","value":"","display_name":"Markdown Text","advanced":true,"input_types":["Message"],"dynamic":false,"info":"The markdown text to convert to Notion blocks.","title_case":false,"type":"str","_input_type":"MultilineInput"},"notion_secret":{"load_from_db":false,"required":true,"placeholder":"","show":true,"name":"notion_secret","value":"","display_name":"Notion Secret","advanced":false,"input_types":["Message"],"dynamic":false,"info":"The Notion integration token.","title_case":false,"password":true,"type":"str","_input_type":"SecretStrInput"}},"description":"Convert markdown text to Notion blocks and append them to a Notion page.","icon":"NotionDirectoryLoader","base_classes":["Data","Tool"],"display_name":"Add Content to Page ","documentation":"https://developers.notion.com/reference/patch-block-children","custom_fields":{},"output_types":[],"pinned":false,"conditional_paths":[],"frozen":false,"outputs":[{"types":["Data"],"selected":"Data","name":"example_output","display_name":"Data","method":"run_model","value":"__UNDEFINED__","cache":true,"hidden":true},{"types":["Tool"],"selected":"Tool","name":"example_tool_output","display_name":"Tool","method":"build_tool","value":"__UNDEFINED__","cache":true}],"field_order":["markdown_text","block_id","notion_secret"],"beta":false,"edited":true,"lf_version":"1.0.17"},"id":"AddContentToPage-vrAvx","description":"Convert markdown text to Notion blocks and append them to a Notion page.","display_name":"Add Content to Page "},"selected":false,"width":384,"height":330,"positionAbsolute":{"x":2649.2991466550634,"y":1050.6250104897197},"dragging":false},{"id":"NotionPageCreator-Exc7f","type":"genericNode","position":{"x":3050.8201437255634,"y":1391.0449862668834},"data":{"type":"NotionPageCreator","node":{"template":{"_type":"Component","code":{"type":"code","required":true,"placeholder":"","list":false,"show":true,"multiline":true,"value":"import json\nfrom typing import Dict, Any, Union\nimport requests\nfrom pydantic import BaseModel, Field\nfrom langflow.base.langchain_utilities.model import LCToolComponent\nfrom langflow.inputs import SecretStrInput, StrInput, MultilineInput\nfrom langflow.schema import Data\nfrom langflow.field_typing import Tool\nfrom langchain.tools import StructuredTool\nfrom langflow.io import Output\n\nclass NotionPageCreator(LCToolComponent):\n display_name: str = \"Create Page \"\n description: str = \"A component for creating Notion pages.\"\n documentation: str = \"https://docs.langflow.org/integrations/notion/page-create\"\n icon = \"NotionDirectoryLoader\"\n\n inputs = [\n StrInput(\n name=\"database_id\",\n display_name=\"Database ID\",\n info=\"The ID of the Notion database.\",\n ),\n SecretStrInput(\n name=\"notion_secret\",\n display_name=\"Notion Secret\",\n info=\"The Notion integration token.\",\n required=True,\n ),\n MultilineInput(\n name=\"properties_json\",\n display_name=\"Properties (JSON)\",\n info=\"The properties of the new page as a JSON string.\",\n ),\n ]\n outputs = [\n Output(name=\"example_output\", display_name=\"Data\", method=\"run_model\"),\n Output(name=\"example_tool_output\", display_name=\"Tool\", method=\"build_tool\"),\n ]\n\n class NotionPageCreatorSchema(BaseModel):\n database_id: str = Field(..., description=\"The ID of the Notion database.\")\n properties_json: str = Field(..., description=\"The properties of the new page as a JSON string.\")\n\n def run_model(self) -> Data:\n result = self._create_notion_page(self.database_id, self.properties_json)\n if isinstance(result, str):\n # An error occurred, return it as text\n return Data(text=result)\n else:\n # Success, return the created page data\n output = \"Created page properties:\\n\"\n for prop_name, prop_value in result.get(\"properties\", {}).items():\n output += f\"{prop_name}: {prop_value}\\n\"\n return Data(text=output, data=result)\n\n def build_tool(self) -> Tool:\n return StructuredTool.from_function(\n name=\"create_notion_page\",\n description=\"Create a new page in a Notion database. IMPORTANT: Use the tool to check the Database properties for more details before using this tool.\",\n func=self._create_notion_page,\n args_schema=self.NotionPageCreatorSchema,\n )\n\n def _create_notion_page(self, database_id: str, properties_json: str) -> Union[Dict[str, Any], str]:\n if not database_id or not properties_json:\n return \"Invalid input. Please provide 'database_id' and 'properties_json'.\"\n\n try:\n properties = json.loads(properties_json)\n except json.JSONDecodeError as e:\n return f\"Invalid properties format. Please provide a valid JSON string. Error: {str(e)}\"\n\n headers = {\n \"Authorization\": f\"Bearer {self.notion_secret}\",\n \"Content-Type\": \"application/json\",\n \"Notion-Version\": \"2022-06-28\",\n }\n\n data = {\n \"parent\": {\"database_id\": database_id},\n \"properties\": properties,\n }\n\n try:\n response = requests.post(\"https://api.notion.com/v1/pages\", headers=headers, json=data)\n response.raise_for_status()\n result = response.json()\n return result\n except requests.exceptions.RequestException as e:\n error_message = f\"Failed to create Notion page. Error: {str(e)}\"\n if hasattr(e, \"response\") and e.response is not None:\n error_message += f\" Status code: {e.response.status_code}, Response: {e.response.text}\"\n return error_message\n\n def __call__(self, *args, **kwargs):\n return self._create_notion_page(*args, **kwargs)\n","fileTypes":[],"file_path":"","password":false,"name":"code","advanced":true,"dynamic":true,"info":"","load_from_db":false,"title_case":false},"database_id":{"trace_as_metadata":true,"load_from_db":false,"list":false,"required":false,"placeholder":"","show":true,"name":"database_id","value":"","display_name":"Database ID","advanced":true,"dynamic":false,"info":"The ID of the Notion database.","title_case":false,"type":"str","_input_type":"StrInput"},"notion_secret":{"load_from_db":false,"required":true,"placeholder":"","show":true,"name":"notion_secret","value":"","display_name":"Notion Secret","advanced":false,"input_types":["Message"],"dynamic":false,"info":"The Notion integration token.","title_case":false,"password":true,"type":"str","_input_type":"SecretStrInput"},"properties_json":{"trace_as_input":true,"multiline":true,"trace_as_metadata":true,"load_from_db":false,"list":false,"required":false,"placeholder":"","show":true,"name":"properties_json","value":"","display_name":"Properties (JSON)","advanced":true,"input_types":["Message"],"dynamic":false,"info":"The properties of the new page as a JSON string.","title_case":false,"type":"str","_input_type":"MultilineInput"}},"description":"A component for creating Notion pages.","icon":"NotionDirectoryLoader","base_classes":["Data","Tool"],"display_name":"Create Page ","documentation":"https://docs.langflow.org/integrations/notion/page-create","custom_fields":{},"output_types":[],"pinned":false,"conditional_paths":[],"frozen":false,"outputs":[{"types":["Data"],"selected":"Data","name":"example_output","display_name":"Data","method":"run_model","value":"__UNDEFINED__","cache":true,"hidden":true},{"types":["Tool"],"selected":"Tool","name":"example_tool_output","display_name":"Tool","method":"build_tool","value":"__UNDEFINED__","cache":true}],"field_order":["database_id","notion_secret","properties_json"],"beta":false,"edited":true,"lf_version":"1.0.17"},"id":"NotionPageCreator-Exc7f","description":"A component for creating Notion pages.","display_name":"Create Page "},"selected":false,"width":384,"height":302,"positionAbsolute":{"x":3050.8201437255634,"y":1391.0449862668834},"dragging":false},{"id":"NotionDatabaseProperties-IjzLV","type":"genericNode","position":{"x":3053.0023230574693,"y":1061.535907149244},"data":{"type":"NotionDatabaseProperties","node":{"template":{"_type":"Component","code":{"type":"code","required":true,"placeholder":"","list":false,"show":true,"multiline":true,"value":"import requests\nfrom typing import Dict, Union\nfrom pydantic import BaseModel, Field\nfrom langflow.base.langchain_utilities.model import LCToolComponent\nfrom langflow.inputs import SecretStrInput, StrInput\nfrom langflow.schema import Data\nfrom langflow.field_typing import Tool\nfrom langchain.tools import StructuredTool\nfrom langflow.io import Output\n\nclass NotionDatabaseProperties(LCToolComponent):\n display_name: str = \"List Database Properties \"\n description: str = \"Retrieve properties of a Notion database.\"\n documentation: str = \"https://docs.langflow.org/integrations/notion/list-database-properties\"\n icon = \"NotionDirectoryLoader\"\n\n inputs = [\n StrInput(\n name=\"database_id\",\n display_name=\"Database ID\",\n info=\"The ID of the Notion database.\",\n ),\n SecretStrInput(\n name=\"notion_secret\",\n display_name=\"Notion Secret\",\n info=\"The Notion integration token.\",\n required=True,\n ),\n ]\n outputs = [\n Output(name=\"example_output\", display_name=\"Data\", method=\"run_model\"),\n Output(name=\"example_tool_output\", display_name=\"Tool\", method=\"build_tool\"),\n ]\n\n class NotionDatabasePropertiesSchema(BaseModel):\n database_id: str = Field(..., description=\"The ID of the Notion database.\")\n\n def run_model(self) -> Data:\n result = self._fetch_database_properties(self.database_id)\n if isinstance(result, str):\n # An error occurred, return it as text\n return Data(text=result)\n else:\n # Success, return the properties\n return Data(text=str(result), data=result)\n\n def build_tool(self) -> Tool:\n return StructuredTool.from_function(\n name=\"notion_database_properties\",\n description=\"Retrieve properties of a Notion database. Input should include the database ID.\",\n func=self._fetch_database_properties,\n args_schema=self.NotionDatabasePropertiesSchema,\n )\n\n def _fetch_database_properties(self, database_id: str) -> Union[Dict, str]:\n url = f\"https://api.notion.com/v1/databases/{database_id}\"\n headers = {\n \"Authorization\": f\"Bearer {self.notion_secret}\",\n \"Notion-Version\": \"2022-06-28\", # Use the latest supported version\n }\n try:\n response = requests.get(url, headers=headers)\n response.raise_for_status()\n data = response.json()\n properties = data.get(\"properties\", {})\n return properties\n except requests.exceptions.RequestException as e:\n return f\"Error fetching Notion database properties: {str(e)}\"\n except ValueError as e:\n return f\"Error parsing Notion API response: {str(e)}\"\n except Exception as e:\n return f\"An unexpected error occurred: {str(e)}\"\n","fileTypes":[],"file_path":"","password":false,"name":"code","advanced":true,"dynamic":true,"info":"","load_from_db":false,"title_case":false},"database_id":{"trace_as_metadata":true,"load_from_db":false,"list":false,"required":false,"placeholder":"","show":true,"name":"database_id","value":"","display_name":"Database ID","advanced":true,"dynamic":false,"info":"The ID of the Notion database.","title_case":false,"type":"str","_input_type":"StrInput"},"notion_secret":{"load_from_db":false,"required":true,"placeholder":"","show":true,"name":"notion_secret","value":"","display_name":"Notion Secret","advanced":false,"input_types":["Message"],"dynamic":false,"info":"The Notion integration token.","title_case":false,"password":true,"type":"str","_input_type":"SecretStrInput"}},"description":"Retrieve properties of a Notion database.","icon":"NotionDirectoryLoader","base_classes":["Data","Tool"],"display_name":"List Database Properties ","documentation":"https://docs.langflow.org/integrations/notion/list-database-properties","custom_fields":{},"output_types":[],"pinned":false,"conditional_paths":[],"frozen":false,"outputs":[{"types":["Data"],"selected":"Data","name":"example_output","display_name":"Data","method":"run_model","value":"__UNDEFINED__","cache":true,"hidden":true},{"types":["Tool"],"selected":"Tool","name":"example_tool_output","display_name":"Tool","method":"build_tool","value":"__UNDEFINED__","cache":true}],"field_order":["database_id","notion_secret"],"beta":false,"edited":true,"lf_version":"1.0.17"},"id":"NotionDatabaseProperties-IjzLV","description":"Retrieve properties of a Notion database.","display_name":"List Database Properties "},"selected":false,"width":384,"height":302,"positionAbsolute":{"x":3053.0023230574693,"y":1061.535907149244},"dragging":false},{"id":"NotionPageUpdate-bexvy","type":"genericNode","position":{"x":2649.2991466550625,"y":1385.262204377853},"data":{"type":"NotionPageUpdate","node":{"template":{"_type":"Component","code":{"type":"code","required":true,"placeholder":"","list":false,"show":true,"multiline":true,"value":"import json\nimport requests\nfrom typing import Dict, Any, Union\nfrom pydantic import BaseModel, Field\nfrom langflow.base.langchain_utilities.model import LCToolComponent\nfrom langflow.inputs import SecretStrInput, StrInput, MultilineInput\nfrom langflow.schema import Data\nfrom langflow.field_typing import Tool\nfrom langchain.tools import StructuredTool\nfrom loguru import logger\nfrom langflow.io import Output\n\nclass NotionPageUpdate(LCToolComponent):\n display_name: str = \"Update Page Property \"\n description: str = \"Update the properties of a Notion page.\"\n documentation: str = \"https://docs.langflow.org/integrations/notion/page-update\"\n icon = \"NotionDirectoryLoader\"\n\n inputs = [\n StrInput(\n name=\"page_id\",\n display_name=\"Page ID\",\n info=\"The ID of the Notion page to update.\",\n ),\n MultilineInput(\n name=\"properties\",\n display_name=\"Properties\",\n info=\"The properties to update on the page (as a JSON string or a dictionary).\",\n ),\n SecretStrInput(\n name=\"notion_secret\",\n display_name=\"Notion Secret\",\n info=\"The Notion integration token.\",\n required=True,\n ),\n ]\n outputs = [\n Output(name=\"example_output\", display_name=\"Data\", method=\"run_model\"),\n Output(name=\"example_tool_output\", display_name=\"Tool\", method=\"build_tool\"),\n ]\n\n class NotionPageUpdateSchema(BaseModel):\n page_id: str = Field(..., description=\"The ID of the Notion page to update.\")\n properties: Union[str, Dict[str, Any]] = Field(\n ..., description=\"The properties to update on the page (as a JSON string or a dictionary).\"\n )\n\n def run_model(self) -> Data:\n result = self._update_notion_page(self.page_id, self.properties)\n if isinstance(result, str):\n # An error occurred, return it as text\n return Data(text=result)\n else:\n # Success, return the updated page data\n output = \"Updated page properties:\\n\"\n for prop_name, prop_value in result.get(\"properties\", {}).items():\n output += f\"{prop_name}: {prop_value}\\n\"\n return Data(text=output, data=result)\n\n def build_tool(self) -> Tool:\n return StructuredTool.from_function(\n name=\"update_notion_page\",\n description=\"Update the properties of a Notion page. IMPORTANT: Use the tool to check the Database properties for more details before using this tool.\",\n func=self._update_notion_page,\n args_schema=self.NotionPageUpdateSchema,\n )\n\n def _update_notion_page(self, page_id: str, properties: Union[str, Dict[str, Any]]) -> Union[Dict[str, Any], str]:\n url = f\"https://api.notion.com/v1/pages/{page_id}\"\n headers = {\n \"Authorization\": f\"Bearer {self.notion_secret}\",\n \"Content-Type\": \"application/json\",\n \"Notion-Version\": \"2022-06-28\", # Use the latest supported version\n }\n\n # Parse properties if it's a string\n if isinstance(properties, str):\n try:\n parsed_properties = json.loads(properties)\n except json.JSONDecodeError as e:\n error_message = f\"Invalid JSON format for properties: {str(e)}\"\n logger.error(error_message)\n return error_message\n\n else:\n parsed_properties = properties\n\n data = {\"properties\": parsed_properties}\n\n try:\n logger.info(f\"Sending request to Notion API: URL: {url}, Data: {json.dumps(data)}\")\n response = requests.patch(url, headers=headers, json=data)\n response.raise_for_status()\n updated_page = response.json()\n\n logger.info(f\"Successfully updated Notion page. Response: {json.dumps(updated_page)}\")\n return updated_page\n except requests.exceptions.HTTPError as e:\n error_message = f\"HTTP Error occurred: {str(e)}\"\n if e.response is not None:\n error_message += f\"\\nStatus code: {e.response.status_code}\"\n error_message += f\"\\nResponse body: {e.response.text}\"\n logger.error(error_message)\n return error_message\n except requests.exceptions.RequestException as e:\n error_message = f\"An error occurred while making the request: {str(e)}\"\n logger.error(error_message)\n return error_message\n except Exception as e:\n error_message = f\"An unexpected error occurred: {str(e)}\"\n logger.error(error_message)\n return error_message\n\n def __call__(self, *args, **kwargs):\n return self._update_notion_page(*args, **kwargs)\n","fileTypes":[],"file_path":"","password":false,"name":"code","advanced":true,"dynamic":true,"info":"","load_from_db":false,"title_case":false},"notion_secret":{"load_from_db":false,"required":true,"placeholder":"","show":true,"name":"notion_secret","value":"","display_name":"Notion Secret","advanced":false,"input_types":["Message"],"dynamic":false,"info":"The Notion integration token.","title_case":false,"password":true,"type":"str","_input_type":"SecretStrInput"},"page_id":{"trace_as_metadata":true,"load_from_db":false,"list":false,"required":false,"placeholder":"","show":true,"name":"page_id","value":"","display_name":"Page ID","advanced":true,"dynamic":false,"info":"The ID of the Notion page to update.","title_case":false,"type":"str","_input_type":"StrInput"},"properties":{"trace_as_input":true,"multiline":true,"trace_as_metadata":true,"load_from_db":false,"list":false,"required":false,"placeholder":"","show":true,"name":"properties","value":"","display_name":"Properties","advanced":true,"input_types":["Message"],"dynamic":false,"info":"The properties to update on the page (as a JSON string or a dictionary).","title_case":false,"type":"str","_input_type":"MultilineInput"}},"description":"Update the properties of a Notion page.","icon":"NotionDirectoryLoader","base_classes":["Data","Tool"],"display_name":"Update Page Property ","documentation":"https://docs.langflow.org/integrations/notion/page-update","custom_fields":{},"output_types":[],"pinned":false,"conditional_paths":[],"frozen":false,"outputs":[{"types":["Data"],"selected":"Data","name":"example_output","display_name":"Data","method":"run_model","value":"__UNDEFINED__","cache":true,"hidden":true},{"types":["Tool"],"selected":"Tool","name":"example_tool_output","display_name":"Tool","method":"build_tool","value":"__UNDEFINED__","cache":true}],"field_order":["page_id","properties","notion_secret"],"beta":false,"edited":true,"lf_version":"1.0.17"},"id":"NotionPageUpdate-bexvy","description":"Update the properties of a Notion page.","display_name":"Update Page Property "},"selected":false,"width":384,"height":302,"positionAbsolute":{"x":2649.2991466550625,"y":1385.262204377853},"dragging":false},{"id":"NotionSearch-EdSJb","type":"genericNode","position":{"x":2435.4455721283834,"y":357.45573905064634},"data":{"type":"NotionSearch","node":{"template":{"_type":"Component","code":{"type":"code","required":true,"placeholder":"","list":false,"show":true,"multiline":true,"value":"import requests\nfrom typing import Dict, Any, List\nfrom pydantic import BaseModel, Field\nfrom langflow.io import Output\nfrom langflow.base.langchain_utilities.model import LCToolComponent\nfrom langflow.inputs import SecretStrInput, StrInput, DropdownInput\nfrom langflow.schema import Data\nfrom langflow.field_typing import Tool\nfrom langchain.tools import StructuredTool\n\n\nclass NotionSearch(LCToolComponent):\n display_name: str = \"Search \"\n description: str = \"Searches all pages and databases that have been shared with an integration. The search field can be an empty value to show all values from that search\"\n documentation: str = \"https://docs.langflow.org/integrations/notion/search\"\n icon = \"NotionDirectoryLoader\"\n\n inputs = [\n SecretStrInput(\n name=\"notion_secret\",\n display_name=\"Notion Secret\",\n info=\"The Notion integration token.\",\n required=True,\n ),\n StrInput(\n name=\"query\",\n display_name=\"Search Query\",\n info=\"The text that the API compares page and database titles against.\",\n ),\n DropdownInput(\n name=\"filter_value\",\n display_name=\"Filter Type\",\n info=\"Limits the results to either only pages or only databases.\",\n options=[\"page\", \"database\"],\n value=\"page\",\n ),\n DropdownInput(\n name=\"sort_direction\",\n display_name=\"Sort Direction\",\n info=\"The direction to sort the results.\",\n options=[\"ascending\", \"descending\"],\n value=\"descending\",\n ),\n ]\n outputs = [\n Output(name=\"example_output\", display_name=\"Data\", method=\"run_model\"),\n Output(name=\"example_tool_output\", display_name=\"Tool\", method=\"build_tool\"),\n ]\n\n class NotionSearchSchema(BaseModel):\n query: str = Field(..., description=\"The search query text.\")\n filter_value: str = Field(default=\"page\", description=\"Filter type: 'page' or 'database'.\")\n sort_direction: str = Field(default=\"descending\", description=\"Sort direction: 'ascending' or 'descending'.\")\n\n def run_model(self) -> List[Data]:\n results = self._search_notion(self.query, self.filter_value, self.sort_direction)\n records = []\n combined_text = f\"Results found: {len(results)}\\n\\n\"\n\n for result in results:\n result_data = {\n \"id\": result[\"id\"],\n \"type\": result[\"object\"],\n \"last_edited_time\": result[\"last_edited_time\"],\n }\n\n if result[\"object\"] == \"page\":\n result_data[\"title_or_url\"] = result[\"url\"]\n text = f\"id: {result['id']}\\ntitle_or_url: {result['url']}\\n\"\n elif result[\"object\"] == \"database\":\n if \"title\" in result and isinstance(result[\"title\"], list) and len(result[\"title\"]) > 0:\n result_data[\"title_or_url\"] = result[\"title\"][0][\"plain_text\"]\n text = f\"id: {result['id']}\\ntitle_or_url: {result['title'][0]['plain_text']}\\n\"\n else:\n result_data[\"title_or_url\"] = \"N/A\"\n text = f\"id: {result['id']}\\ntitle_or_url: N/A\\n\"\n\n text += f\"type: {result['object']}\\nlast_edited_time: {result['last_edited_time']}\\n\\n\"\n combined_text += text\n records.append(Data(text=text, data=result_data))\n\n self.status = records\n return records\n\n def build_tool(self) -> Tool:\n return StructuredTool.from_function(\n name=\"notion_search\",\n description=\"Search Notion pages and databases. Input should include the search query and optionally filter type and sort direction.\",\n func=self._search_notion,\n args_schema=self.NotionSearchSchema,\n )\n\n def _search_notion(\n self, query: str, filter_value: str = \"page\", sort_direction: str = \"descending\"\n ) -> List[Dict[str, Any]]:\n url = \"https://api.notion.com/v1/search\"\n headers = {\n \"Authorization\": f\"Bearer {self.notion_secret}\",\n \"Content-Type\": \"application/json\",\n \"Notion-Version\": \"2022-06-28\",\n }\n\n data = {\n \"query\": query,\n \"filter\": {\"value\": filter_value, \"property\": \"object\"},\n \"sort\": {\"direction\": sort_direction, \"timestamp\": \"last_edited_time\"},\n }\n\n response = requests.post(url, headers=headers, json=data)\n response.raise_for_status()\n\n results = response.json()\n return results[\"results\"]\n","fileTypes":[],"file_path":"","password":false,"name":"code","advanced":true,"dynamic":true,"info":"","load_from_db":false,"title_case":false},"filter_value":{"trace_as_metadata":true,"options":["page","database"],"combobox":false,"required":false,"placeholder":"","show":true,"name":"filter_value","value":"database","display_name":"Filter Type","advanced":true,"dynamic":false,"info":"Limits the results to either only pages or only databases.","title_case":false,"type":"str","_input_type":"DropdownInput"},"notion_secret":{"load_from_db":false,"required":true,"placeholder":"","show":true,"name":"notion_secret","value":"","display_name":"Notion Secret","advanced":false,"input_types":["Message"],"dynamic":false,"info":"The Notion integration token.","title_case":false,"password":true,"type":"str","_input_type":"SecretStrInput"},"query":{"trace_as_metadata":true,"load_from_db":false,"list":false,"required":false,"placeholder":"","show":true,"name":"query","value":"","display_name":"Search Query","advanced":true,"dynamic":false,"info":"The text that the API compares page and database titles against.","title_case":false,"type":"str","_input_type":"StrInput"},"sort_direction":{"trace_as_metadata":true,"options":["ascending","descending"],"combobox":false,"required":false,"placeholder":"","show":true,"name":"sort_direction","value":"descending","display_name":"Sort Direction","advanced":true,"dynamic":false,"info":"The direction to sort the results.","title_case":false,"type":"str","_input_type":"DropdownInput"}},"description":"List All Databases","icon":"NotionDirectoryLoader","base_classes":["Data","Tool"],"display_name":"List Databases","documentation":"https://docs.langflow.org/integrations/notion/search","custom_fields":{},"output_types":[],"pinned":false,"conditional_paths":[],"frozen":false,"outputs":[{"types":["Data"],"selected":"Data","name":"example_output","display_name":"Data","method":"run_model","value":"__UNDEFINED__","cache":true,"hidden":false},{"types":["Tool"],"selected":"Tool","name":"example_tool_output","display_name":"Tool","method":"build_tool","value":"__UNDEFINED__","cache":true,"hidden":true}],"field_order":["notion_secret","query","filter_value","sort_direction"],"beta":false,"edited":true,"lf_version":"1.0.17"},"id":"NotionSearch-EdSJb","description":"Searches all pages and databases that have been shared with an integration.","display_name":"Search "},"selected":false,"width":384,"height":302,"positionAbsolute":{"x":2435.4455721283834,"y":357.45573905064634},"dragging":false},{"id":"ParseData-vYVwu","type":"genericNode","position":{"x":2871.5903532688335,"y":563.1965154816405},"data":{"type":"ParseData","node":{"template":{"_type":"Component","data":{"trace_as_metadata":true,"list":false,"trace_as_input":true,"required":false,"placeholder":"","show":true,"name":"data","value":"","display_name":"Data","advanced":false,"input_types":["Data"],"dynamic":false,"info":"The data to convert to text.","title_case":false,"type":"other","_input_type":"DataInput"},"code":{"type":"code","required":true,"placeholder":"","list":false,"show":true,"multiline":true,"value":"from langflow.custom import Component\nfrom langflow.helpers.data import data_to_text\nfrom langflow.io import DataInput, MultilineInput, Output, StrInput\nfrom langflow.schema.message import Message\n\n\nclass ParseDataComponent(Component):\n display_name = \"Parse Data\"\n description = \"Convert Data into plain text following a specified template.\"\n icon = \"braces\"\n name = \"ParseData\"\n\n inputs = [\n DataInput(name=\"data\", display_name=\"Data\", info=\"The data to convert to text.\"),\n MultilineInput(\n name=\"template\",\n display_name=\"Template\",\n info=\"The template to use for formatting the data. It can contain the keys {text}, {data} or any other key in the Data.\",\n value=\"{text}\",\n ),\n StrInput(name=\"sep\", display_name=\"Separator\", advanced=True, value=\"\\n\"),\n ]\n\n outputs = [\n Output(display_name=\"Text\", name=\"text\", method=\"parse_data\"),\n ]\n\n def parse_data(self) -> Message:\n data = self.data if isinstance(self.data, list) else [self.data]\n template = self.template\n\n result_string = data_to_text(template, data, sep=self.sep)\n self.status = result_string\n return Message(text=result_string)\n","fileTypes":[],"file_path":"","password":false,"name":"code","advanced":true,"dynamic":true,"info":"","load_from_db":false,"title_case":false},"sep":{"trace_as_metadata":true,"load_from_db":false,"list":false,"required":false,"placeholder":"","show":true,"name":"sep","value":"\n","display_name":"Separator","advanced":true,"dynamic":false,"info":"","title_case":false,"type":"str","_input_type":"StrInput"},"template":{"trace_as_input":true,"multiline":true,"trace_as_metadata":true,"load_from_db":false,"list":false,"required":false,"placeholder":"","show":true,"name":"template","value":"{text}","display_name":"Template","advanced":true,"input_types":["Message"],"dynamic":false,"info":"The template to use for formatting the data. It can contain the keys {text}, {data} or any other key in the Data.","title_case":false,"type":"str","_input_type":"MultilineInput"}},"description":"Convert Data into plain text following a specified template.","icon":"braces","base_classes":["Message"],"display_name":"Parse Data","documentation":"","custom_fields":{},"output_types":[],"pinned":false,"conditional_paths":[],"frozen":false,"outputs":[{"types":["Message"],"selected":"Message","name":"text","display_name":"Text","method":"parse_data","value":"__UNDEFINED__","cache":true}],"field_order":["data","template","sep"],"beta":false,"edited":false,"lf_version":"1.0.17"},"id":"ParseData-vYVwu","showNode":false},"selected":false,"width":96,"height":96,"positionAbsolute":{"x":2871.5903532688335,"y":563.1965154816405},"dragging":false},{"id":"ChatOutput-zBv53","type":"genericNode","position":{"x":4429.812566227955,"y":940.6072472757681},"data":{"type":"ChatOutput","node":{"template":{"_type":"Component","code":{"type":"code","required":true,"placeholder":"","list":false,"show":true,"multiline":true,"value":"from langflow.base.io.chat import ChatComponent\nfrom langflow.inputs import BoolInput\nfrom langflow.io import DropdownInput, MessageTextInput, Output\nfrom langflow.memory import store_message\nfrom langflow.schema.message import Message\nfrom langflow.utils.constants import MESSAGE_SENDER_AI, MESSAGE_SENDER_NAME_AI, MESSAGE_SENDER_USER\n\n\nclass ChatOutput(ChatComponent):\n display_name = \"Chat Output\"\n description = \"Display a chat message in the Playground.\"\n icon = \"ChatOutput\"\n name = \"ChatOutput\"\n\n inputs = [\n MessageTextInput(\n name=\"input_value\",\n display_name=\"Text\",\n info=\"Message to be passed as output.\",\n ),\n BoolInput(\n name=\"should_store_message\",\n display_name=\"Store Messages\",\n info=\"Store the message in the history.\",\n value=True,\n advanced=True,\n ),\n DropdownInput(\n name=\"sender\",\n display_name=\"Sender Type\",\n options=[MESSAGE_SENDER_AI, MESSAGE_SENDER_USER],\n value=MESSAGE_SENDER_AI,\n advanced=True,\n info=\"Type of sender.\",\n ),\n MessageTextInput(\n name=\"sender_name\",\n display_name=\"Sender Name\",\n info=\"Name of the sender.\",\n value=MESSAGE_SENDER_NAME_AI,\n advanced=True,\n ),\n MessageTextInput(\n name=\"session_id\",\n display_name=\"Session ID\",\n info=\"The session ID of the chat. If empty, the current session ID parameter will be used.\",\n advanced=True,\n ),\n MessageTextInput(\n name=\"data_template\",\n display_name=\"Data Template\",\n value=\"{text}\",\n advanced=True,\n info=\"Template to convert Data to Text. If left empty, it will be dynamically set to the Data's text key.\",\n ),\n ]\n outputs = [\n Output(display_name=\"Message\", name=\"message\", method=\"message_response\"),\n ]\n\n def message_response(self) -> Message:\n message = Message(\n text=self.input_value,\n sender=self.sender,\n sender_name=self.sender_name,\n session_id=self.session_id,\n )\n if (\n self.session_id\n and isinstance(message, Message)\n and isinstance(message.text, str)\n and self.should_store_message\n ):\n store_message(\n message,\n flow_id=self.graph.flow_id,\n )\n self.message.value = message\n\n self.status = message\n return message\n","fileTypes":[],"file_path":"","password":false,"name":"code","advanced":true,"dynamic":true,"info":"","load_from_db":false,"title_case":false},"data_template":{"trace_as_input":true,"trace_as_metadata":true,"load_from_db":false,"list":false,"required":false,"placeholder":"","show":true,"name":"data_template","value":"{text}","display_name":"Data Template","advanced":true,"input_types":["Message"],"dynamic":false,"info":"Template to convert Data to Text. If left empty, it will be dynamically set to the Data's text key.","title_case":false,"type":"str","_input_type":"MessageTextInput"},"input_value":{"trace_as_input":true,"trace_as_metadata":true,"load_from_db":false,"list":false,"required":false,"placeholder":"","show":true,"name":"input_value","value":"","display_name":"Text","advanced":false,"input_types":["Message"],"dynamic":false,"info":"Message to be passed as output.","title_case":false,"type":"str","_input_type":"MessageTextInput"},"sender":{"trace_as_metadata":true,"options":["Machine","User"],"combobox":false,"required":false,"placeholder":"","show":true,"name":"sender","value":"Machine","display_name":"Sender Type","advanced":true,"dynamic":false,"info":"Type of sender.","title_case":false,"type":"str","_input_type":"DropdownInput"},"sender_name":{"trace_as_input":true,"trace_as_metadata":true,"load_from_db":false,"list":false,"required":false,"placeholder":"","show":true,"name":"sender_name","value":"AI","display_name":"Sender Name","advanced":true,"input_types":["Message"],"dynamic":false,"info":"Name of the sender.","title_case":false,"type":"str","_input_type":"MessageTextInput"},"session_id":{"trace_as_input":true,"trace_as_metadata":true,"load_from_db":false,"list":false,"required":false,"placeholder":"","show":true,"name":"session_id","value":"","display_name":"Session ID","advanced":true,"input_types":["Message"],"dynamic":false,"info":"The session ID of the chat. If empty, the current session ID parameter will be used.","title_case":false,"type":"str","_input_type":"MessageTextInput"},"should_store_message":{"trace_as_metadata":true,"list":false,"required":false,"placeholder":"","show":true,"name":"should_store_message","value":true,"display_name":"Store Messages","advanced":true,"dynamic":false,"info":"Store the message in the history.","title_case":false,"type":"bool","_input_type":"BoolInput"}},"description":"Display a chat message in the Playground.","icon":"ChatOutput","base_classes":["Message"],"display_name":"Chat Output","documentation":"","custom_fields":{},"output_types":[],"pinned":false,"conditional_paths":[],"frozen":false,"outputs":[{"types":["Message"],"selected":"Message","name":"message","display_name":"Message","method":"message_response","value":"__UNDEFINED__","cache":true}],"field_order":["input_value","should_store_message","sender","sender_name","session_id","data_template"],"beta":false,"edited":false,"lf_version":"1.0.17"},"id":"ChatOutput-zBv53"},"selected":false,"width":384,"height":302,"positionAbsolute":{"x":4429.812566227955,"y":940.6072472757681},"dragging":false},{"id":"NotionUserList-wFEb1","type":"genericNode","position":{"x":2390.6365450681037,"y":694.4867003504073},"data":{"type":"NotionUserList","node":{"template":{"_type":"Component","code":{"type":"code","required":true,"placeholder":"","list":false,"show":true,"multiline":true,"value":"import requests\nfrom typing import List, Dict\nfrom pydantic import BaseModel\nfrom langflow.io import Output\nfrom langflow.base.langchain_utilities.model import LCToolComponent\nfrom langflow.inputs import SecretStrInput\nfrom langflow.schema import Data\nfrom langflow.field_typing import Tool\nfrom langchain.tools import StructuredTool\n\n\nclass NotionUserList(LCToolComponent):\n display_name = \"List Users \"\n description = \"Retrieve users from Notion.\"\n documentation = \"https://docs.langflow.org/integrations/notion/list-users\"\n icon = \"NotionDirectoryLoader\"\n\n inputs = [\n SecretStrInput(\n name=\"notion_secret\",\n display_name=\"Notion Secret\",\n info=\"The Notion integration token.\",\n required=True,\n ),\n ]\n outputs = [\n Output(name=\"example_output\", display_name=\"Data\", method=\"run_model\"),\n Output(name=\"example_tool_output\", display_name=\"Tool\", method=\"build_tool\"),\n ]\n\n class NotionUserListSchema(BaseModel):\n pass\n\n def run_model(self) -> List[Data]:\n users = self._list_users()\n records = []\n combined_text = \"\"\n\n for user in users:\n output = \"User:\\n\"\n for key, value in user.items():\n output += f\"{key.replace('_', ' ').title()}: {value}\\n\"\n output += \"________________________\\n\"\n\n combined_text += output\n records.append(Data(text=output, data=user))\n\n self.status = records\n return records\n\n def build_tool(self) -> Tool:\n return StructuredTool.from_function(\n name=\"notion_list_users\",\n description=\"Retrieve users from Notion.\",\n func=self._list_users,\n args_schema=self.NotionUserListSchema,\n )\n\n def _list_users(self) -> List[Dict]:\n url = \"https://api.notion.com/v1/users\"\n headers = {\n \"Authorization\": f\"Bearer {self.notion_secret}\",\n \"Notion-Version\": \"2022-06-28\",\n }\n\n response = requests.get(url, headers=headers)\n response.raise_for_status()\n\n data = response.json()\n results = data[\"results\"]\n\n users = []\n for user in results:\n user_data = {\n \"id\": user[\"id\"],\n \"type\": user[\"type\"],\n \"name\": user.get(\"name\", \"\"),\n \"avatar_url\": user.get(\"avatar_url\", \"\"),\n }\n users.append(user_data)\n\n return users\n","fileTypes":[],"file_path":"","password":false,"name":"code","advanced":true,"dynamic":true,"info":"","load_from_db":false,"title_case":false},"notion_secret":{"load_from_db":false,"required":true,"placeholder":"","show":true,"name":"notion_secret","value":"","display_name":"Notion Secret","advanced":false,"input_types":["Message"],"dynamic":false,"info":"The Notion integration token.","title_case":false,"password":true,"type":"str","_input_type":"SecretStrInput"}},"description":"Retrieve users from Notion.","icon":"NotionDirectoryLoader","base_classes":["Data","Tool"],"display_name":"List Users ","documentation":"https://docs.langflow.org/integrations/notion/list-users","custom_fields":{},"output_types":[],"pinned":false,"conditional_paths":[],"frozen":false,"outputs":[{"types":["Data"],"selected":"Data","name":"example_output","display_name":"Data","method":"run_model","value":"__UNDEFINED__","cache":true},{"types":["Tool"],"selected":"Tool","name":"example_tool_output","display_name":"Tool","method":"build_tool","value":"__UNDEFINED__","cache":true,"hidden":true}],"field_order":["notion_secret"],"beta":false,"edited":true,"lf_version":"1.0.17"},"id":"NotionUserList-wFEb1","description":"Retrieve users from Notion.","display_name":"List Users "},"selected":false,"width":384,"height":302,"positionAbsolute":{"x":2390.6365450681037,"y":694.4867003504073},"dragging":false},{"id":"ParseData-WKjW6","type":"genericNode","position":{"x":2877.571533084884,"y":856.8480898893301},"data":{"type":"ParseData","node":{"template":{"_type":"Component","data":{"trace_as_metadata":true,"list":false,"trace_as_input":true,"required":false,"placeholder":"","show":true,"name":"data","value":"","display_name":"Data","advanced":false,"input_types":["Data"],"dynamic":false,"info":"The data to convert to text.","title_case":false,"type":"other","_input_type":"DataInput"},"code":{"type":"code","required":true,"placeholder":"","list":false,"show":true,"multiline":true,"value":"from langflow.custom import Component\nfrom langflow.helpers.data import data_to_text\nfrom langflow.io import DataInput, MultilineInput, Output, StrInput\nfrom langflow.schema.message import Message\n\n\nclass ParseDataComponent(Component):\n display_name = \"Parse Data\"\n description = \"Convert Data into plain text following a specified template.\"\n icon = \"braces\"\n name = \"ParseData\"\n\n inputs = [\n DataInput(name=\"data\", display_name=\"Data\", info=\"The data to convert to text.\"),\n MultilineInput(\n name=\"template\",\n display_name=\"Template\",\n info=\"The template to use for formatting the data. It can contain the keys {text}, {data} or any other key in the Data.\",\n value=\"{text}\",\n ),\n StrInput(name=\"sep\", display_name=\"Separator\", advanced=True, value=\"\\n\"),\n ]\n\n outputs = [\n Output(display_name=\"Text\", name=\"text\", method=\"parse_data\"),\n ]\n\n def parse_data(self) -> Message:\n data = self.data if isinstance(self.data, list) else [self.data]\n template = self.template\n\n result_string = data_to_text(template, data, sep=self.sep)\n self.status = result_string\n return Message(text=result_string)\n","fileTypes":[],"file_path":"","password":false,"name":"code","advanced":true,"dynamic":true,"info":"","load_from_db":false,"title_case":false},"sep":{"trace_as_metadata":true,"load_from_db":false,"list":false,"required":false,"placeholder":"","show":true,"name":"sep","value":"\n","display_name":"Separator","advanced":true,"dynamic":false,"info":"","title_case":false,"type":"str","_input_type":"StrInput"},"template":{"trace_as_input":true,"multiline":true,"trace_as_metadata":true,"load_from_db":false,"list":false,"required":false,"placeholder":"","show":true,"name":"template","value":"{text}","display_name":"Template","advanced":true,"input_types":["Message"],"dynamic":false,"info":"The template to use for formatting the data. It can contain the keys {text}, {data} or any other key in the Data.","title_case":false,"type":"str","_input_type":"MultilineInput"}},"description":"Convert Data into plain text following a specified template.","icon":"braces","base_classes":["Message"],"display_name":"Parse Data","documentation":"","custom_fields":{},"output_types":[],"pinned":false,"conditional_paths":[],"frozen":false,"outputs":[{"types":["Message"],"selected":"Message","name":"text","display_name":"Text","method":"parse_data","value":"__UNDEFINED__","cache":true}],"field_order":["data","template","sep"],"beta":false,"edited":false,"lf_version":"1.0.17"},"id":"ParseData-WKjW6","showNode":false},"selected":false,"width":96,"height":96,"positionAbsolute":{"x":2877.571533084884,"y":856.8480898893301},"dragging":false},{"id":"CurrentDateComponent-WOwNq","type":"genericNode","position":{"x":536.7929500860405,"y":617.6055631700241},"data":{"type":"CurrentDateComponent","node":{"template":{"_type":"Component","code":{"type":"code","required":true,"placeholder":"","list":false,"show":true,"multiline":true,"value":"from datetime import datetime\r\nfrom zoneinfo import ZoneInfo\r\nfrom typing import List\r\n\r\nfrom langflow.custom import Component\r\nfrom langflow.io import DropdownInput, Output\r\nfrom langflow.schema.message import Message\r\n\r\nclass CurrentDateComponent(Component):\r\n display_name = \"Current Date 🕰️\"\r\n description = \"Returns the current date and time in the selected timezone.\"\r\n icon = \"clock\"\r\n\r\n inputs = [\r\n DropdownInput(\r\n name=\"timezone\",\r\n display_name=\"Timezone\",\r\n options=[\r\n \"UTC\",\r\n \"US/Eastern\",\r\n \"US/Central\",\r\n \"US/Mountain\",\r\n \"US/Pacific\",\r\n \"Europe/London\",\r\n \"Europe/Paris\",\r\n \"Asia/Tokyo\",\r\n \"Australia/Sydney\",\r\n \"America/Sao_Paulo\",\r\n \"America/Cuiaba\",\r\n ],\r\n value=\"UTC\",\r\n info=\"Select the timezone for the current date and time.\",\r\n ),\r\n ]\r\n\r\n outputs = [\r\n Output(display_name=\"Current Date\", name=\"current_date\", method=\"get_current_date\"),\r\n ]\r\n\r\n def get_current_date(self) -> Message:\r\n try:\r\n tz = ZoneInfo(self.timezone)\r\n current_date = datetime.now(tz).strftime(\"%Y-%m-%d %H:%M:%S %Z\")\r\n result = f\"Current date and time in {self.timezone}: {current_date}\"\r\n self.status = result\r\n return Message(text=result)\r\n except Exception as e:\r\n error_message = f\"Error: {str(e)}\"\r\n self.status = error_message\r\n return Message(text=error_message)","fileTypes":[],"file_path":"","password":false,"name":"code","advanced":true,"dynamic":true,"info":"","load_from_db":false,"title_case":false},"timezone":{"trace_as_metadata":true,"options":["UTC","US/Eastern","US/Central","US/Mountain","US/Pacific","Europe/London","Europe/Paris","Asia/Tokyo","Australia/Sydney","America/Sao_Paulo","America/Cuiaba"],"combobox":false,"required":false,"placeholder":"","show":true,"name":"timezone","value":"UTC","display_name":"Timezone","advanced":false,"dynamic":false,"info":"Select the timezone for the current date and time.","title_case":false,"type":"str","_input_type":"DropdownInput"}},"description":"Returns the current date and time in the selected timezone.","icon":"clock","base_classes":["Message"],"display_name":"Current Date","documentation":"","custom_fields":{},"output_types":[],"pinned":false,"conditional_paths":[],"frozen":false,"outputs":[{"types":["Message"],"selected":"Message","name":"current_date","display_name":"Current Date","method":"get_current_date","value":"__UNDEFINED__","cache":true}],"field_order":["timezone"],"beta":false,"edited":true},"id":"CurrentDateComponent-WOwNq","showNode":false},"selected":false,"width":96,"height":96,"dragging":false,"positionAbsolute":{"x":536.7929500860405,"y":617.6055631700241}},{"id":"CurrentDateComponent-PZ8xJ","type":"genericNode","position":{"x":2871.6341688682833,"y":453.3374434097356},"data":{"type":"CurrentDateComponent","node":{"template":{"_type":"Component","code":{"type":"code","required":true,"placeholder":"","list":false,"show":true,"multiline":true,"value":"from datetime import datetime\r\nfrom zoneinfo import ZoneInfo\r\nfrom typing import List\r\n\r\nfrom langflow.custom import Component\r\nfrom langflow.io import DropdownInput, Output\r\nfrom langflow.schema.message import Message\r\n\r\nclass CurrentDateComponent(Component):\r\n display_name = \"Current Date 🕰️\"\r\n description = \"Returns the current date and time in the selected timezone.\"\r\n icon = \"clock\"\r\n\r\n inputs = [\r\n DropdownInput(\r\n name=\"timezone\",\r\n display_name=\"Timezone\",\r\n options=[\r\n \"UTC\",\r\n \"US/Eastern\",\r\n \"US/Central\",\r\n \"US/Mountain\",\r\n \"US/Pacific\",\r\n \"Europe/London\",\r\n \"Europe/Paris\",\r\n \"Asia/Tokyo\",\r\n \"Australia/Sydney\",\r\n \"America/Sao_Paulo\",\r\n \"America/Cuiaba\",\r\n ],\r\n value=\"UTC\",\r\n info=\"Select the timezone for the current date and time.\",\r\n ),\r\n ]\r\n\r\n outputs = [\r\n Output(display_name=\"Current Date\", name=\"current_date\", method=\"get_current_date\"),\r\n ]\r\n\r\n def get_current_date(self) -> Message:\r\n try:\r\n tz = ZoneInfo(self.timezone)\r\n current_date = datetime.now(tz).strftime(\"%Y-%m-%d %H:%M:%S %Z\")\r\n result = f\"Current date and time in {self.timezone}: {current_date}\"\r\n self.status = result\r\n return Message(text=result)\r\n except Exception as e:\r\n error_message = f\"Error: {str(e)}\"\r\n self.status = error_message\r\n return Message(text=error_message)","fileTypes":[],"file_path":"","password":false,"name":"code","advanced":true,"dynamic":true,"info":"","load_from_db":false,"title_case":false},"timezone":{"trace_as_metadata":true,"options":["UTC","US/Eastern","US/Central","US/Mountain","US/Pacific","Europe/London","Europe/Paris","Asia/Tokyo","Australia/Sydney","America/Sao_Paulo","America/Cuiaba"],"combobox":false,"required":false,"placeholder":"","show":true,"name":"timezone","value":"UTC","display_name":"Timezone","advanced":false,"dynamic":false,"info":"Select the timezone for the current date and time.","title_case":false,"type":"str","_input_type":"DropdownInput"}},"description":"Returns the current date and time in the selected timezone.","icon":"clock","base_classes":["Message"],"display_name":"Current Date","documentation":"","custom_fields":{},"output_types":[],"pinned":false,"conditional_paths":[],"frozen":false,"outputs":[{"types":["Message"],"selected":"Message","name":"current_date","display_name":"Current Date","method":"get_current_date","value":"__UNDEFINED__","cache":true}],"field_order":["timezone"],"beta":false,"edited":true,"official":false},"id":"CurrentDateComponent-PZ8xJ","showNode":false},"selected":false,"width":96,"height":96,"dragging":false,"positionAbsolute":{"x":2871.6341688682833,"y":453.3374434097356}}],"edges":[{"source":"TextInput-iJPEJ","sourceHandle":"{œdataTypeœ:œTextInputœ,œidœ:œTextInput-iJPEJœ,œnameœ:œtextœ,œoutput_typesœ:[œMessageœ]}","target":"Prompt-19rub","targetHandle":"{œfieldNameœ:œTRANSCRIPTœ,œidœ:œPrompt-19rubœ,œinputTypesœ:[œMessageœ,œTextœ],œtypeœ:œstrœ}","data":{"targetHandle":{"fieldName":"TRANSCRIPT","id":"Prompt-19rub","inputTypes":["Message","Text"],"type":"str"},"sourceHandle":{"dataType":"TextInput","id":"TextInput-iJPEJ","name":"text","output_types":["Message"]}},"id":"reactflow__edge-TextInput-iJPEJ{œdataTypeœ:œTextInputœ,œidœ:œTextInput-iJPEJœ,œnameœ:œtextœ,œoutput_typesœ:[œMessageœ]}-Prompt-19rub{œfieldNameœ:œTRANSCRIPTœ,œidœ:œPrompt-19rubœ,œinputTypesœ:[œMessageœ,œTextœ],œtypeœ:œstrœ}","selected":false,"className":""},{"source":"NotionUserList-TvIKS","sourceHandle":"{œdataTypeœ:œNotionUserListœ,œidœ:œNotionUserList-TvIKSœ,œnameœ:œexample_outputœ,œoutput_typesœ:[œDataœ]}","target":"ParseData-aNk1v","targetHandle":"{œfieldNameœ:œdataœ,œidœ:œParseData-aNk1vœ,œinputTypesœ:[œDataœ],œtypeœ:œotherœ}","data":{"targetHandle":{"fieldName":"data","id":"ParseData-aNk1v","inputTypes":["Data"],"type":"other"},"sourceHandle":{"dataType":"NotionUserList","id":"NotionUserList-TvIKS","name":"example_output","output_types":["Data"]}},"id":"reactflow__edge-NotionUserList-TvIKS{œdataTypeœ:œNotionUserListœ,œidœ:œNotionUserList-TvIKSœ,œnameœ:œexample_outputœ,œoutput_typesœ:[œDataœ]}-ParseData-aNk1v{œfieldNameœ:œdataœ,œidœ:œParseData-aNk1vœ,œinputTypesœ:[œDataœ],œtypeœ:œotherœ}","selected":false,"className":""},{"source":"ParseData-aNk1v","sourceHandle":"{œdataTypeœ:œParseDataœ,œidœ:œParseData-aNk1vœ,œnameœ:œtextœ,œoutput_typesœ:[œMessageœ]}","target":"Prompt-19rub","targetHandle":"{œfieldNameœ:œUSERSœ,œidœ:œPrompt-19rubœ,œinputTypesœ:[œMessageœ,œTextœ],œtypeœ:œstrœ}","data":{"targetHandle":{"fieldName":"USERS","id":"Prompt-19rub","inputTypes":["Message","Text"],"type":"str"},"sourceHandle":{"dataType":"ParseData","id":"ParseData-aNk1v","name":"text","output_types":["Message"]}},"id":"reactflow__edge-ParseData-aNk1v{œdataTypeœ:œParseDataœ,œidœ:œParseData-aNk1vœ,œnameœ:œtextœ,œoutput_typesœ:[œMessageœ]}-Prompt-19rub{œfieldNameœ:œUSERSœ,œidœ:œPrompt-19rubœ,œinputTypesœ:[œMessageœ,œTextœ],œtypeœ:œstrœ}","selected":false,"className":""},{"source":"Prompt-19rub","sourceHandle":"{œdataTypeœ:œPromptœ,œidœ:œPrompt-19rubœ,œnameœ:œpromptœ,œoutput_typesœ:[œMessageœ]}","target":"ToolCallingAgent-rVWeq","targetHandle":"{œfieldNameœ:œsystem_promptœ,œidœ:œToolCallingAgent-rVWeqœ,œinputTypesœ:[œMessageœ],œtypeœ:œstrœ}","data":{"targetHandle":{"fieldName":"system_prompt","id":"ToolCallingAgent-rVWeq","inputTypes":["Message"],"type":"str"},"sourceHandle":{"dataType":"Prompt","id":"Prompt-19rub","name":"prompt","output_types":["Message"]}},"id":"reactflow__edge-Prompt-19rub{œdataTypeœ:œPromptœ,œidœ:œPrompt-19rubœ,œnameœ:œpromptœ,œoutput_typesœ:[œMessageœ]}-ToolCallingAgent-rVWeq{œfieldNameœ:œsystem_promptœ,œidœ:œToolCallingAgent-rVWeqœ,œinputTypesœ:[œMessageœ],œtypeœ:œstrœ}","selected":false,"className":""},{"source":"NotionSearch-M66HF","sourceHandle":"{œdataTypeœ:œNotionSearchœ,œidœ:œNotionSearch-M66HFœ,œnameœ:œexample_tool_outputœ,œoutput_typesœ:[œToolœ]}","target":"ToolCallingAgent-rVWeq","targetHandle":"{œfieldNameœ:œtoolsœ,œidœ:œToolCallingAgent-rVWeqœ,œinputTypesœ:[œToolœ,œBaseToolœ],œtypeœ:œotherœ}","data":{"targetHandle":{"fieldName":"tools","id":"ToolCallingAgent-rVWeq","inputTypes":["Tool","BaseTool"],"type":"other"},"sourceHandle":{"dataType":"NotionSearch","id":"NotionSearch-M66HF","name":"example_tool_output","output_types":["Tool"]}},"id":"reactflow__edge-NotionSearch-M66HF{œdataTypeœ:œNotionSearchœ,œidœ:œNotionSearch-M66HFœ,œnameœ:œexample_tool_outputœ,œoutput_typesœ:[œToolœ]}-ToolCallingAgent-rVWeq{œfieldNameœ:œtoolsœ,œidœ:œToolCallingAgent-rVWeqœ,œinputTypesœ:[œToolœ,œBaseToolœ],œtypeœ:œotherœ}","selected":false,"className":""},{"source":"OpenAIModel-Ht8xI","sourceHandle":"{œdataTypeœ:œOpenAIModelœ,œidœ:œOpenAIModel-Ht8xIœ,œnameœ:œmodel_outputœ,œoutput_typesœ:[œLanguageModelœ]}","target":"ToolCallingAgent-rVWeq","targetHandle":"{œfieldNameœ:œllmœ,œidœ:œToolCallingAgent-rVWeqœ,œinputTypesœ:[œLanguageModelœ],œtypeœ:œotherœ}","data":{"targetHandle":{"fieldName":"llm","id":"ToolCallingAgent-rVWeq","inputTypes":["LanguageModel"],"type":"other"},"sourceHandle":{"dataType":"OpenAIModel","id":"OpenAIModel-Ht8xI","name":"model_output","output_types":["LanguageModel"]}},"id":"reactflow__edge-OpenAIModel-Ht8xI{œdataTypeœ:œOpenAIModelœ,œidœ:œOpenAIModel-Ht8xIœ,œnameœ:œmodel_outputœ,œoutput_typesœ:[œLanguageModelœ]}-ToolCallingAgent-rVWeq{œfieldNameœ:œllmœ,œidœ:œToolCallingAgent-rVWeqœ,œinputTypesœ:[œLanguageModelœ],œtypeœ:œotherœ}","selected":false,"className":""},{"source":"ToolCallingAgent-rVWeq","sourceHandle":"{œdataTypeœ:œToolCallingAgentœ,œidœ:œToolCallingAgent-rVWeqœ,œnameœ:œresponseœ,œoutput_typesœ:[œMessageœ]}","target":"Prompt-Lbxk6","targetHandle":"{œfieldNameœ:œTASK_LISTœ,œidœ:œPrompt-Lbxk6œ,œinputTypesœ:[œMessageœ,œTextœ],œtypeœ:œstrœ}","data":{"targetHandle":{"fieldName":"TASK_LIST","id":"Prompt-Lbxk6","inputTypes":["Message","Text"],"type":"str"},"sourceHandle":{"dataType":"ToolCallingAgent","id":"ToolCallingAgent-rVWeq","name":"response","output_types":["Message"]}},"id":"reactflow__edge-ToolCallingAgent-rVWeq{œdataTypeœ:œToolCallingAgentœ,œidœ:œToolCallingAgent-rVWeqœ,œnameœ:œresponseœ,œoutput_typesœ:[œMessageœ]}-Prompt-Lbxk6{œfieldNameœ:œTASK_LISTœ,œidœ:œPrompt-Lbxk6œ,œinputTypesœ:[œMessageœ,œTextœ],œtypeœ:œstrœ}","selected":false,"className":""},{"source":"OpenAIModel-OTfnt","sourceHandle":"{œdataTypeœ:œOpenAIModelœ,œidœ:œOpenAIModel-OTfntœ,œnameœ:œmodel_outputœ,œoutput_typesœ:[œLanguageModelœ]}","target":"ToolCallingAgent-GurdE","targetHandle":"{œfieldNameœ:œllmœ,œidœ:œToolCallingAgent-GurdEœ,œinputTypesœ:[œLanguageModelœ],œtypeœ:œotherœ}","data":{"targetHandle":{"fieldName":"llm","id":"ToolCallingAgent-GurdE","inputTypes":["LanguageModel"],"type":"other"},"sourceHandle":{"dataType":"OpenAIModel","id":"OpenAIModel-OTfnt","name":"model_output","output_types":["LanguageModel"]}},"id":"reactflow__edge-OpenAIModel-OTfnt{œdataTypeœ:œOpenAIModelœ,œidœ:œOpenAIModel-OTfntœ,œnameœ:œmodel_outputœ,œoutput_typesœ:[œLanguageModelœ]}-ToolCallingAgent-GurdE{œfieldNameœ:œllmœ,œidœ:œToolCallingAgent-GurdEœ,œinputTypesœ:[œLanguageModelœ],œtypeœ:œotherœ}","selected":false,"className":""},{"source":"Prompt-Lbxk6","sourceHandle":"{œdataTypeœ:œPromptœ,œidœ:œPrompt-Lbxk6œ,œnameœ:œpromptœ,œoutput_typesœ:[œMessageœ]}","target":"ToolCallingAgent-GurdE","targetHandle":"{œfieldNameœ:œsystem_promptœ,œidœ:œToolCallingAgent-GurdEœ,œinputTypesœ:[œMessageœ],œtypeœ:œstrœ}","data":{"targetHandle":{"fieldName":"system_prompt","id":"ToolCallingAgent-GurdE","inputTypes":["Message"],"type":"str"},"sourceHandle":{"dataType":"Prompt","id":"Prompt-Lbxk6","name":"prompt","output_types":["Message"]}},"id":"reactflow__edge-Prompt-Lbxk6{œdataTypeœ:œPromptœ,œidœ:œPrompt-Lbxk6œ,œnameœ:œpromptœ,œoutput_typesœ:[œMessageœ]}-ToolCallingAgent-GurdE{œfieldNameœ:œsystem_promptœ,œidœ:œToolCallingAgent-GurdEœ,œinputTypesœ:[œMessageœ],œtypeœ:œstrœ}","selected":false,"className":""},{"source":"AddContentToPage-vrAvx","sourceHandle":"{œdataTypeœ:œAddContentToPageœ,œidœ:œAddContentToPage-vrAvxœ,œnameœ:œexample_tool_outputœ,œoutput_typesœ:[œToolœ]}","target":"ToolCallingAgent-GurdE","targetHandle":"{œfieldNameœ:œtoolsœ,œidœ:œToolCallingAgent-GurdEœ,œinputTypesœ:[œToolœ,œBaseToolœ],œtypeœ:œotherœ}","data":{"targetHandle":{"fieldName":"tools","id":"ToolCallingAgent-GurdE","inputTypes":["Tool","BaseTool"],"type":"other"},"sourceHandle":{"dataType":"AddContentToPage","id":"AddContentToPage-vrAvx","name":"example_tool_output","output_types":["Tool"]}},"id":"reactflow__edge-AddContentToPage-vrAvx{œdataTypeœ:œAddContentToPageœ,œidœ:œAddContentToPage-vrAvxœ,œnameœ:œexample_tool_outputœ,œoutput_typesœ:[œToolœ]}-ToolCallingAgent-GurdE{œfieldNameœ:œtoolsœ,œidœ:œToolCallingAgent-GurdEœ,œinputTypesœ:[œToolœ,œBaseToolœ],œtypeœ:œotherœ}","selected":false,"className":""},{"source":"NotionPageCreator-Exc7f","sourceHandle":"{œdataTypeœ:œNotionPageCreatorœ,œidœ:œNotionPageCreator-Exc7fœ,œnameœ:œexample_tool_outputœ,œoutput_typesœ:[œToolœ]}","target":"ToolCallingAgent-GurdE","targetHandle":"{œfieldNameœ:œtoolsœ,œidœ:œToolCallingAgent-GurdEœ,œinputTypesœ:[œToolœ,œBaseToolœ],œtypeœ:œotherœ}","data":{"targetHandle":{"fieldName":"tools","id":"ToolCallingAgent-GurdE","inputTypes":["Tool","BaseTool"],"type":"other"},"sourceHandle":{"dataType":"NotionPageCreator","id":"NotionPageCreator-Exc7f","name":"example_tool_output","output_types":["Tool"]}},"id":"reactflow__edge-NotionPageCreator-Exc7f{œdataTypeœ:œNotionPageCreatorœ,œidœ:œNotionPageCreator-Exc7fœ,œnameœ:œexample_tool_outputœ,œoutput_typesœ:[œToolœ]}-ToolCallingAgent-GurdE{œfieldNameœ:œtoolsœ,œidœ:œToolCallingAgent-GurdEœ,œinputTypesœ:[œToolœ,œBaseToolœ],œtypeœ:œotherœ}","selected":false,"className":""},{"source":"NotionDatabaseProperties-IjzLV","sourceHandle":"{œdataTypeœ:œNotionDatabasePropertiesœ,œidœ:œNotionDatabaseProperties-IjzLVœ,œnameœ:œexample_tool_outputœ,œoutput_typesœ:[œToolœ]}","target":"ToolCallingAgent-GurdE","targetHandle":"{œfieldNameœ:œtoolsœ,œidœ:œToolCallingAgent-GurdEœ,œinputTypesœ:[œToolœ,œBaseToolœ],œtypeœ:œotherœ}","data":{"targetHandle":{"fieldName":"tools","id":"ToolCallingAgent-GurdE","inputTypes":["Tool","BaseTool"],"type":"other"},"sourceHandle":{"dataType":"NotionDatabaseProperties","id":"NotionDatabaseProperties-IjzLV","name":"example_tool_output","output_types":["Tool"]}},"id":"reactflow__edge-NotionDatabaseProperties-IjzLV{œdataTypeœ:œNotionDatabasePropertiesœ,œidœ:œNotionDatabaseProperties-IjzLVœ,œnameœ:œexample_tool_outputœ,œoutput_typesœ:[œToolœ]}-ToolCallingAgent-GurdE{œfieldNameœ:œtoolsœ,œidœ:œToolCallingAgent-GurdEœ,œinputTypesœ:[œToolœ,œBaseToolœ],œtypeœ:œotherœ}","selected":false,"className":""},{"source":"NotionPageUpdate-bexvy","sourceHandle":"{œdataTypeœ:œNotionPageUpdateœ,œidœ:œNotionPageUpdate-bexvyœ,œnameœ:œexample_tool_outputœ,œoutput_typesœ:[œToolœ]}","target":"ToolCallingAgent-GurdE","targetHandle":"{œfieldNameœ:œtoolsœ,œidœ:œToolCallingAgent-GurdEœ,œinputTypesœ:[œToolœ,œBaseToolœ],œtypeœ:œotherœ}","data":{"targetHandle":{"fieldName":"tools","id":"ToolCallingAgent-GurdE","inputTypes":["Tool","BaseTool"],"type":"other"},"sourceHandle":{"dataType":"NotionPageUpdate","id":"NotionPageUpdate-bexvy","name":"example_tool_output","output_types":["Tool"]}},"id":"reactflow__edge-NotionPageUpdate-bexvy{œdataTypeœ:œNotionPageUpdateœ,œidœ:œNotionPageUpdate-bexvyœ,œnameœ:œexample_tool_outputœ,œoutput_typesœ:[œToolœ]}-ToolCallingAgent-GurdE{œfieldNameœ:œtoolsœ,œidœ:œToolCallingAgent-GurdEœ,œinputTypesœ:[œToolœ,œBaseToolœ],œtypeœ:œotherœ}","selected":false,"className":""},{"source":"NotionSearch-EdSJb","sourceHandle":"{œdataTypeœ:œNotionSearchœ,œidœ:œNotionSearch-EdSJbœ,œnameœ:œexample_outputœ,œoutput_typesœ:[œDataœ]}","target":"ParseData-vYVwu","targetHandle":"{œfieldNameœ:œdataœ,œidœ:œParseData-vYVwuœ,œinputTypesœ:[œDataœ],œtypeœ:œotherœ}","data":{"targetHandle":{"fieldName":"data","id":"ParseData-vYVwu","inputTypes":["Data"],"type":"other"},"sourceHandle":{"dataType":"NotionSearch","id":"NotionSearch-EdSJb","name":"example_output","output_types":["Data"]}},"id":"reactflow__edge-NotionSearch-EdSJb{œdataTypeœ:œNotionSearchœ,œidœ:œNotionSearch-EdSJbœ,œnameœ:œexample_outputœ,œoutput_typesœ:[œDataœ]}-ParseData-vYVwu{œfieldNameœ:œdataœ,œidœ:œParseData-vYVwuœ,œinputTypesœ:[œDataœ],œtypeœ:œotherœ}","selected":false,"className":""},{"source":"ParseData-vYVwu","sourceHandle":"{œdataTypeœ:œParseDataœ,œidœ:œParseData-vYVwuœ,œnameœ:œtextœ,œoutput_typesœ:[œMessageœ]}","target":"Prompt-Lbxk6","targetHandle":"{œfieldNameœ:œDATABASESœ,œidœ:œPrompt-Lbxk6œ,œinputTypesœ:[œMessageœ,œTextœ],œtypeœ:œstrœ}","data":{"targetHandle":{"fieldName":"DATABASES","id":"Prompt-Lbxk6","inputTypes":["Message","Text"],"type":"str"},"sourceHandle":{"dataType":"ParseData","id":"ParseData-vYVwu","name":"text","output_types":["Message"]}},"id":"reactflow__edge-ParseData-vYVwu{œdataTypeœ:œParseDataœ,œidœ:œParseData-vYVwuœ,œnameœ:œtextœ,œoutput_typesœ:[œMessageœ]}-Prompt-Lbxk6{œfieldNameœ:œDATABASESœ,œidœ:œPrompt-Lbxk6œ,œinputTypesœ:[œMessageœ,œTextœ],œtypeœ:œstrœ}","selected":false,"className":""},{"source":"ToolCallingAgent-GurdE","sourceHandle":"{œdataTypeœ:œToolCallingAgentœ,œidœ:œToolCallingAgent-GurdEœ,œnameœ:œresponseœ,œoutput_typesœ:[œMessageœ]}","target":"ChatOutput-zBv53","targetHandle":"{œfieldNameœ:œinput_valueœ,œidœ:œChatOutput-zBv53œ,œinputTypesœ:[œMessageœ],œtypeœ:œstrœ}","data":{"targetHandle":{"fieldName":"input_value","id":"ChatOutput-zBv53","inputTypes":["Message"],"type":"str"},"sourceHandle":{"dataType":"ToolCallingAgent","id":"ToolCallingAgent-GurdE","name":"response","output_types":["Message"]}},"id":"reactflow__edge-ToolCallingAgent-GurdE{œdataTypeœ:œToolCallingAgentœ,œidœ:œToolCallingAgent-GurdEœ,œnameœ:œresponseœ,œoutput_typesœ:[œMessageœ]}-ChatOutput-zBv53{œfieldNameœ:œinput_valueœ,œidœ:œChatOutput-zBv53œ,œinputTypesœ:[œMessageœ],œtypeœ:œstrœ}","selected":false,"className":""},{"source":"NotionUserList-wFEb1","sourceHandle":"{œdataTypeœ:œNotionUserListœ,œidœ:œNotionUserList-wFEb1œ,œnameœ:œexample_outputœ,œoutput_typesœ:[œDataœ]}","target":"ParseData-WKjW6","targetHandle":"{œfieldNameœ:œdataœ,œidœ:œParseData-WKjW6œ,œinputTypesœ:[œDataœ],œtypeœ:œotherœ}","data":{"targetHandle":{"fieldName":"data","id":"ParseData-WKjW6","inputTypes":["Data"],"type":"other"},"sourceHandle":{"dataType":"NotionUserList","id":"NotionUserList-wFEb1","name":"example_output","output_types":["Data"]}},"id":"reactflow__edge-NotionUserList-wFEb1{œdataTypeœ:œNotionUserListœ,œidœ:œNotionUserList-wFEb1œ,œnameœ:œexample_outputœ,œoutput_typesœ:[œDataœ]}-ParseData-WKjW6{œfieldNameœ:œdataœ,œidœ:œParseData-WKjW6œ,œinputTypesœ:[œDataœ],œtypeœ:œotherœ}","className":""},{"source":"ParseData-WKjW6","sourceHandle":"{œdataTypeœ:œParseDataœ,œidœ:œParseData-WKjW6œ,œnameœ:œtextœ,œoutput_typesœ:[œMessageœ]}","target":"Prompt-Lbxk6","targetHandle":"{œfieldNameœ:œUSERSœ,œidœ:œPrompt-Lbxk6œ,œinputTypesœ:[œMessageœ,œTextœ],œtypeœ:œstrœ}","data":{"targetHandle":{"fieldName":"USERS","id":"Prompt-Lbxk6","inputTypes":["Message","Text"],"type":"str"},"sourceHandle":{"dataType":"ParseData","id":"ParseData-WKjW6","name":"text","output_types":["Message"]}},"id":"reactflow__edge-ParseData-WKjW6{œdataTypeœ:œParseDataœ,œidœ:œParseData-WKjW6œ,œnameœ:œtextœ,œoutput_typesœ:[œMessageœ]}-Prompt-Lbxk6{œfieldNameœ:œUSERSœ,œidœ:œPrompt-Lbxk6œ,œinputTypesœ:[œMessageœ,œTextœ],œtypeœ:œstrœ}","className":""},{"source":"CurrentDateComponent-WOwNq","sourceHandle":"{œdataTypeœ:œCurrentDateComponentœ,œidœ:œCurrentDateComponent-WOwNqœ,œnameœ:œcurrent_dateœ,œoutput_typesœ:[œMessageœ]}","target":"Prompt-19rub","targetHandle":"{œfieldNameœ:œCURRENT_DATEœ,œidœ:œPrompt-19rubœ,œinputTypesœ:[œMessageœ,œTextœ],œtypeœ:œstrœ}","data":{"targetHandle":{"fieldName":"CURRENT_DATE","id":"Prompt-19rub","inputTypes":["Message","Text"],"type":"str"},"sourceHandle":{"dataType":"CurrentDateComponent","id":"CurrentDateComponent-WOwNq","name":"current_date","output_types":["Message"]}},"id":"reactflow__edge-CurrentDateComponent-WOwNq{œdataTypeœ:œCurrentDateComponentœ,œidœ:œCurrentDateComponent-WOwNqœ,œnameœ:œcurrent_dateœ,œoutput_typesœ:[œMessageœ]}-Prompt-19rub{œfieldNameœ:œCURRENT_DATEœ,œidœ:œPrompt-19rubœ,œinputTypesœ:[œMessageœ,œTextœ],œtypeœ:œstrœ}","className":""},{"source":"CurrentDateComponent-PZ8xJ","sourceHandle":"{œdataTypeœ:œCurrentDateComponentœ,œidœ:œCurrentDateComponent-PZ8xJœ,œnameœ:œcurrent_dateœ,œoutput_typesœ:[œMessageœ]}","target":"Prompt-Lbxk6","targetHandle":"{œfieldNameœ:œCURRENT_DATEœ,œidœ:œPrompt-Lbxk6œ,œinputTypesœ:[œMessageœ,œTextœ],œtypeœ:œstrœ}","data":{"targetHandle":{"fieldName":"CURRENT_DATE","id":"Prompt-Lbxk6","inputTypes":["Message","Text"],"type":"str"},"sourceHandle":{"dataType":"CurrentDateComponent","id":"CurrentDateComponent-PZ8xJ","name":"current_date","output_types":["Message"]}},"id":"reactflow__edge-CurrentDateComponent-PZ8xJ{œdataTypeœ:œCurrentDateComponentœ,œidœ:œCurrentDateComponent-PZ8xJœ,œnameœ:œcurrent_dateœ,œoutput_typesœ:[œMessageœ]}-Prompt-Lbxk6{œfieldNameœ:œCURRENT_DATEœ,œidœ:œPrompt-Lbxk6œ,œinputTypesœ:[œMessageœ,œTextœ],œtypeœ:œstrœ}","className":""}],"viewport":{"x":-65.48833753518215,"y":119.49034539812101,"zoom":0.5588906662759379}},"description":"The Notion Agent for Meeting Notes is an AI-powered tool that automatically processes meeting transcripts and updates your Notion workspace accordingly. It identifies tasks, action items, and key points from your meetings, then creates new tasks or updates existing ones in Notion without manual input.\n\nTo use it, simply add your API Keys and provide a meeting transcript. The agent will analyze it, interact with your Notion workspace to make necessary updates, and give you a summary of actions taken. This streamlines your workflow, ensuring important meeting outcomes are captured and organized in Notion effortlessly.","name":"Notion Agent - Meeting Notes ","last_tested_version":"1.0.17.dev8","endpoint_name":null,"is_component":false} \ No newline at end of file diff --git a/assets/files/Meeting_Notes_Agent-b29188c0cb70736d19dd52965db5f352.json b/assets/files/Meeting_Notes_Agent-b29188c0cb70736d19dd52965db5f352.json new file mode 100644 index 0000000000..e567567bab --- /dev/null +++ b/assets/files/Meeting_Notes_Agent-b29188c0cb70736d19dd52965db5f352.json @@ -0,0 +1,4150 @@ +{ + "id": "b6de0fdb-31a2-40bf-b921-719bc0890a0e", + "data": { + "nodes": [ + { + "id": "TextInput-iJPEJ", + "type": "genericNode", + "position": { + "x": 94.43614181571661, + "y": 387.24602783243165 + }, + "data": { + "type": "TextInput", + "node": { + "template": { + "_type": "Component", + "code": { + "type": "code", + "required": true, + "placeholder": "", + "list": false, + "show": true, + "multiline": true, + "value": "from langflow.base.io.text import TextComponent\nfrom langflow.io import MultilineInput, Output\nfrom langflow.schema.message import Message\n\n\nclass TextInputComponent(TextComponent):\n display_name = \"Text Input\"\n description = \"Get text inputs from the Playground.\"\n icon = \"type\"\n name = \"TextInput\"\n\n inputs = [\n MultilineInput(\n name=\"input_value\",\n display_name=\"Text\",\n info=\"Text to be passed as input.\",\n ),\n ]\n outputs = [\n Output(display_name=\"Text\", name=\"text\", method=\"text_response\"),\n ]\n\n def text_response(self) -> Message:\n message = Message(\n text=self.input_value,\n )\n return message\n", + "fileTypes": [], + "file_path": "", + "password": false, + "name": "code", + "advanced": true, + "dynamic": true, + "info": "", + "load_from_db": false, + "title_case": false + }, + "input_value": { + "trace_as_input": true, + "multiline": true, + "trace_as_metadata": true, + "load_from_db": false, + "list": false, + "required": false, + "placeholder": "", + "show": true, + "name": "input_value", + "value": "Good morning. Thanks for joining this project review meeting. We've got quite a few tasks to discuss, especially some Notion-related ones. Shall we get started?\n\nMorning, Felipe. Absolutely, let's dive in. I see we have several projects and tasks on our plate.\n\nGreat. Let's begin with the AI Content Gen project. I'm currently working on \"Montar base agente seletor de cortes.\" It's in progress, and I'm aiming to complete it by June 14th. Have you had a chance to look at this task, Cezar?\n\nI haven't been directly involved with that one. Can you give me an overview of what it entails?\n\nOf course. Essentially, we're building a base agent that can intelligently select and edit content. It's part of our larger AI-driven content generation initiative. The challenge is creating an algorithm that can understand context and make smart editing decisions.\n\nInteresting. How's the progress so far?\n\nIt's coming along. I've set up the basic framework, but fine-tuning the selection criteria is proving to be more complex than initially anticipated. I might need an extra day or two beyond the June 14th deadline.\n\nUnderstood, Felipe. Keep me posted if you need any resources or if the deadline needs to be adjusted. By the way, I've been meaning to ask - have you had a chance to look into that new NLP library I mentioned last week? I think it could be useful for this project.\n\nActually, Cezar, I haven't gotten to that yet. Should we add it as a new task? Maybe \"Evaluate NLP library for content selection\"?\n\nGood idea. Let's add that to our task list with a due date of next Friday. Now, moving on to the next task in this project - \"Create Notion Task Automation.\" It's assigned to you and set for June 19th, but you haven't started it yet, right? This is where I'd like to focus our discussion today.\n\nThat's correct. So, the goal is to streamline our workflow by automating certain tasks within Notion. I'm thinking we could create scripts or use Notion's API to automatically create, assign, and update tasks based on certain triggers or schedules.\n\nThat sounds like it could save us a lot of time. What specific automations are you considering?\n\nI'm glad you asked, Cezar. I'm thinking of a few key areas:\n1. Automatic task creation based on project milestones\n2. Assigning tasks to team members based on their expertise and current workload\n3. Updating task statuses based on linked database entries\n4. Generating weekly progress reports\n5. Setting up reminders for overdue tasks\n\nThose all sound valuable. Have you looked into the technical requirements for implementing these?\n\nI've done some initial research. Notion's API seems robust enough to handle these automations. We'll likely need to use a combination of Notion's API and a server to run our scripts. I'm thinking of using Node.js for this.\n\nGood thinking. Do you foresee any challenges?\n\nThe main challenge will be ensuring our automations are flexible enough to handle different project structures and team dynamics. We'll need to build in some configurability.\n\nAgreed. Let's make sure we involve the team in defining these automations. Their input will be crucial for making this truly useful. Oh, and speaking of team input, I think we should add a task for \"Conduct team survey on Notion pain points.\" This could help us prioritize which automations to tackle first.\n\nThat's an excellent idea, Cezar. I'll create that task and aim to complete the survey by next Wednesday. Now, I see we have another Notion-related task: \"Subir Notion Agent no Langflow Prod.\" Can you remind me what this entails?\n\nYes, this task is about deploying our Notion integration agent to the Langflow production environment. It's not started yet, but it's a crucial step in making our Notion automations available to the whole team.\n\nI see. What's the timeline for this?\n\nWe haven't set a specific deadline yet, but I think we should aim to complete this shortly after the automation task. Let's tentatively say by the end of June?\n\nSounds reasonable. Make sure to coordinate with the DevOps team for a smooth deployment. And while we're on the topic of deployment, we should probably add a task for \"Create documentation for Notion Agent usage.\" We want to make sure the team knows how to use these new tools once they're available.\n\nYou're right, Felipe. I'll add that to our task list. Now, switching gears a bit, let's talk about the Internal Projects. I see you're working on \"Crypto Links\" - it's in progress.\n\nAh yes, our blockchain initiative. It's moving forward. I'm researching various blockchain platforms and their potential applications for our projects. I'm particularly interested in smart contract capabilities.\n\nInteresting. Keep me updated on any promising findings. By the way, have you considered reaching out to any blockchain experts for consultation? It might be worth adding a task for \"Schedule blockchain expert consultation.\"\n\nThat's a great suggestion, Cezar. I'll add it to my to-do list. Now, for the Internal Tasks, I see you're assigned to \"Revisar modos do Charlinho, preparar para open source.\" What's the status on that?\n\nI haven't started yet, but it's on my radar. The deadline is June 7th, so I'll be diving into it this week. Essentially, we need to review and refine Charlinho's modes before we open-source the project.\n\nSounds good. Let me know if you need any assistance with that. Oh, and don't forget we need to add a task for \"Prepare Charlinho documentation for open source.\" We want to make sure our project is well-documented when we release it.\n\nYou're right, Felipe. I'll make sure to include that in our task list. Now, I see you have several tasks assigned to you in the Internal Tasks section. Can you give me a quick rundown?\n\nOf course. I'm working on finding a freelancer to create flows in ComfyUI - that's in progress and due May 28th. I'm also handling the conception of the Agent UI, due May 30th. Both are moving along well.\n\nThere's also a task to \"Check, install and test Gladia to use a bot in Google Meet.\" That's in progress, and I'm collaborating with C on it.\n\nThat's quite a workload. How are you managing all these tasks?\n\nIt's challenging, but I'm prioritizing based on deadlines and dependencies. The Notion automation project is a high priority because it'll help us manage tasks more efficiently in the long run.\n\nGood strategy, Felipe. Is there anything you need from me or the team to help move these tasks forward?\n\nActually, yes. For the \"pegar os arquivos necessários para tentarmos montar um stinger com ffmpeg\" task, I could use some input on which files are critical for this. It's a low-priority task due June 2nd, but any insights would be helpful.\n\nI'll review our asset library and send you a list of potential files by tomorrow. Oh, and let's add a task for \"Create ffmpeg stinger tutorial\" once we figure out the process. It could be useful for the team in the future.\n\nGreat idea, Cezar. I'll add that to our backlog. Anything else we should discuss?\n\nI think we've covered the major points. Oh, one last thing - for the \"Create Notion Task Automation\" project, I was thinking of setting up a series of short daily meetings next week to keep everyone aligned. What do you think?\n\nThat's a good idea. Maybe 15-minute stand-ups? We can use those to address any roadblocks quickly. And let's add a task for \"Set up Notion Automation progress tracking board\" to help visualize our progress during these stand-ups.\n\nPerfect. I'll send out calendar invites this afternoon and create that tracking board task. Any final thoughts or concerns, Cezar?\n\nNot from my side. I think we have a clear path forward, especially with the Notion-related tasks and the new items we've added to our list.\n\nAgreed. Let's plan to reconvene next week to check on progress, particularly for the Notion automation project and these new tasks we've discussed. Thanks for the comprehensive update, Felipe.\n\nThank you, Cezar. I'll send out a summary of our discussion and action items shortly, including all the new tasks we've identified during this meeting.\n", + "display_name": "Text", + "advanced": false, + "input_types": [ + "Message" + ], + "dynamic": false, + "info": "Text to be passed as input.", + "title_case": false, + "type": "str", + "_input_type": "MultilineInput" + } + }, + "description": "Get text inputs from the Playground.", + "icon": "type", + "base_classes": [ + "Message" + ], + "display_name": "Meeting Transcript", + "documentation": "", + "custom_fields": {}, + "output_types": [], + "pinned": false, + "conditional_paths": [], + "frozen": false, + "outputs": [ + { + "types": [ + "Message" + ], + "selected": "Message", + "name": "text", + "display_name": "Text", + "method": "text_response", + "value": "__UNDEFINED__", + "cache": true + } + ], + "field_order": [ + "input_value" + ], + "beta": false, + "edited": false, + "lf_version": "1.0.17" + }, + "id": "TextInput-iJPEJ" + }, + "selected": false, + "width": 384, + "height": 302, + "dragging": false, + "positionAbsolute": { + "x": 94.43614181571661, + "y": 387.24602783243165 + } + }, + { + "id": "NotionUserList-TvIKS", + "type": "genericNode", + "position": { + "x": 80.49204196902156, + "y": 741.0568511678105 + }, + "data": { + "type": "NotionUserList", + "node": { + "template": { + "_type": "Component", + "code": { + "type": "code", + "required": true, + "placeholder": "", + "list": false, + "show": true, + "multiline": true, + "value": "import requests\nfrom typing import List, Dict\nfrom pydantic import BaseModel\nfrom langflow.io import Output\nfrom langflow.base.langchain_utilities.model import LCToolComponent\nfrom langflow.inputs import SecretStrInput\nfrom langflow.schema import Data\nfrom langflow.field_typing import Tool\nfrom langchain.tools import StructuredTool\n\n\nclass NotionUserList(LCToolComponent):\n display_name = \"List Users \"\n description = \"Retrieve users from Notion.\"\n documentation = \"https://docs.langflow.org/integrations/notion/list-users\"\n icon = \"NotionDirectoryLoader\"\n\n inputs = [\n SecretStrInput(\n name=\"notion_secret\",\n display_name=\"Notion Secret\",\n info=\"The Notion integration token.\",\n required=True,\n ),\n ]\n outputs = [\n Output(name=\"example_output\", display_name=\"Data\", method=\"run_model\"),\n Output(name=\"example_tool_output\", display_name=\"Tool\", method=\"build_tool\"),\n ]\n\n class NotionUserListSchema(BaseModel):\n pass\n\n def run_model(self) -> List[Data]:\n users = self._list_users()\n records = []\n combined_text = \"\"\n\n for user in users:\n output = \"User:\\n\"\n for key, value in user.items():\n output += f\"{key.replace('_', ' ').title()}: {value}\\n\"\n output += \"________________________\\n\"\n\n combined_text += output\n records.append(Data(text=output, data=user))\n\n self.status = records\n return records\n\n def build_tool(self) -> Tool:\n return StructuredTool.from_function(\n name=\"notion_list_users\",\n description=\"Retrieve users from Notion.\",\n func=self._list_users,\n args_schema=self.NotionUserListSchema,\n )\n\n def _list_users(self) -> List[Dict]:\n url = \"https://api.notion.com/v1/users\"\n headers = {\n \"Authorization\": f\"Bearer {self.notion_secret}\",\n \"Notion-Version\": \"2022-06-28\",\n }\n\n response = requests.get(url, headers=headers)\n response.raise_for_status()\n\n data = response.json()\n results = data[\"results\"]\n\n users = []\n for user in results:\n user_data = {\n \"id\": user[\"id\"],\n \"type\": user[\"type\"],\n \"name\": user.get(\"name\", \"\"),\n \"avatar_url\": user.get(\"avatar_url\", \"\"),\n }\n users.append(user_data)\n\n return users\n", + "fileTypes": [], + "file_path": "", + "password": false, + "name": "code", + "advanced": true, + "dynamic": true, + "info": "", + "load_from_db": false, + "title_case": false + }, + "notion_secret": { + "load_from_db": false, + "required": true, + "placeholder": "", + "show": true, + "name": "notion_secret", + "value": "", + "display_name": "Notion Secret", + "advanced": false, + "input_types": [ + "Message" + ], + "dynamic": false, + "info": "The Notion integration token.", + "title_case": false, + "password": true, + "type": "str", + "_input_type": "SecretStrInput" + } + }, + "description": "Retrieve users from Notion.", + "icon": "NotionDirectoryLoader", + "base_classes": [ + "Data", + "Tool" + ], + "display_name": "List Users ", + "documentation": "https://docs.langflow.org/integrations/notion/list-users", + "custom_fields": {}, + "output_types": [], + "pinned": false, + "conditional_paths": [], + "frozen": false, + "outputs": [ + { + "types": [ + "Data" + ], + "selected": "Data", + "name": "example_output", + "display_name": "Data", + "method": "run_model", + "value": "__UNDEFINED__", + "cache": true + }, + { + "types": [ + "Tool" + ], + "selected": "Tool", + "name": "example_tool_output", + "display_name": "Tool", + "method": "build_tool", + "value": "__UNDEFINED__", + "cache": true, + "hidden": true + } + ], + "field_order": [ + "notion_secret" + ], + "beta": false, + "edited": true, + "lf_version": "1.0.17" + }, + "id": "NotionUserList-TvIKS", + "description": "Retrieve users from Notion.", + "display_name": "List Users " + }, + "selected": false, + "width": 384, + "height": 302, + "positionAbsolute": { + "x": 80.49204196902156, + "y": 741.0568511678105 + }, + "dragging": false + }, + { + "id": "NotionSearch-M66HF", + "type": "genericNode", + "position": { + "x": 1095.6934863134345, + "y": 407.8718765800806 + }, + "data": { + "type": "NotionSearch", + "node": { + "template": { + "_type": "Component", + "code": { + "type": "code", + "required": true, + "placeholder": "", + "list": false, + "show": true, + "multiline": true, + "value": "import requests\nfrom typing import Dict, Any, List\nfrom pydantic import BaseModel, Field\nfrom langflow.io import Output\nfrom langflow.base.langchain_utilities.model import LCToolComponent\nfrom langflow.inputs import SecretStrInput, StrInput, DropdownInput\nfrom langflow.schema import Data\nfrom langflow.field_typing import Tool\nfrom langchain.tools import StructuredTool\n\n\nclass NotionSearch(LCToolComponent):\n display_name: str = \"Search \"\n description: str = \"Searches all pages and databases that have been shared with an integration. The search field can be an empty value to show all values from that search\"\n documentation: str = \"https://docs.langflow.org/integrations/notion/search\"\n icon = \"NotionDirectoryLoader\"\n\n inputs = [\n SecretStrInput(\n name=\"notion_secret\",\n display_name=\"Notion Secret\",\n info=\"The Notion integration token.\",\n required=True,\n ),\n StrInput(\n name=\"query\",\n display_name=\"Search Query\",\n info=\"The text that the API compares page and database titles against.\",\n ),\n DropdownInput(\n name=\"filter_value\",\n display_name=\"Filter Type\",\n info=\"Limits the results to either only pages or only databases.\",\n options=[\"page\", \"database\"],\n value=\"page\",\n ),\n DropdownInput(\n name=\"sort_direction\",\n display_name=\"Sort Direction\",\n info=\"The direction to sort the results.\",\n options=[\"ascending\", \"descending\"],\n value=\"descending\",\n ),\n ]\n outputs = [\n Output(name=\"example_output\", display_name=\"Data\", method=\"run_model\"),\n Output(name=\"example_tool_output\", display_name=\"Tool\", method=\"build_tool\"),\n ]\n\n class NotionSearchSchema(BaseModel):\n query: str = Field(..., description=\"The search query text.\")\n filter_value: str = Field(default=\"page\", description=\"Filter type: 'page' or 'database'.\")\n sort_direction: str = Field(default=\"descending\", description=\"Sort direction: 'ascending' or 'descending'.\")\n\n def run_model(self) -> List[Data]:\n results = self._search_notion(self.query, self.filter_value, self.sort_direction)\n records = []\n combined_text = f\"Results found: {len(results)}\\n\\n\"\n\n for result in results:\n result_data = {\n \"id\": result[\"id\"],\n \"type\": result[\"object\"],\n \"last_edited_time\": result[\"last_edited_time\"],\n }\n\n if result[\"object\"] == \"page\":\n result_data[\"title_or_url\"] = result[\"url\"]\n text = f\"id: {result['id']}\\ntitle_or_url: {result['url']}\\n\"\n elif result[\"object\"] == \"database\":\n if \"title\" in result and isinstance(result[\"title\"], list) and len(result[\"title\"]) > 0:\n result_data[\"title_or_url\"] = result[\"title\"][0][\"plain_text\"]\n text = f\"id: {result['id']}\\ntitle_or_url: {result['title'][0]['plain_text']}\\n\"\n else:\n result_data[\"title_or_url\"] = \"N/A\"\n text = f\"id: {result['id']}\\ntitle_or_url: N/A\\n\"\n\n text += f\"type: {result['object']}\\nlast_edited_time: {result['last_edited_time']}\\n\\n\"\n combined_text += text\n records.append(Data(text=text, data=result_data))\n\n self.status = records\n return records\n\n def build_tool(self) -> Tool:\n return StructuredTool.from_function(\n name=\"notion_search\",\n description=\"Search Notion pages and databases. Input should include the search query and optionally filter type and sort direction.\",\n func=self._search_notion,\n args_schema=self.NotionSearchSchema,\n )\n\n def _search_notion(\n self, query: str, filter_value: str = \"page\", sort_direction: str = \"descending\"\n ) -> List[Dict[str, Any]]:\n url = \"https://api.notion.com/v1/search\"\n headers = {\n \"Authorization\": f\"Bearer {self.notion_secret}\",\n \"Content-Type\": \"application/json\",\n \"Notion-Version\": \"2022-06-28\",\n }\n\n data = {\n \"query\": query,\n \"filter\": {\"value\": filter_value, \"property\": \"object\"},\n \"sort\": {\"direction\": sort_direction, \"timestamp\": \"last_edited_time\"},\n }\n\n response = requests.post(url, headers=headers, json=data)\n response.raise_for_status()\n\n results = response.json()\n return results[\"results\"]\n", + "fileTypes": [], + "file_path": "", + "password": false, + "name": "code", + "advanced": true, + "dynamic": true, + "info": "", + "load_from_db": false, + "title_case": false + }, + "filter_value": { + "trace_as_metadata": true, + "options": [ + "page", + "database" + ], + "combobox": false, + "required": false, + "placeholder": "", + "show": true, + "name": "filter_value", + "value": "database", + "display_name": "Filter Type", + "advanced": true, + "dynamic": false, + "info": "Limits the results to either only pages or only databases.", + "title_case": false, + "type": "str", + "_input_type": "DropdownInput" + }, + "notion_secret": { + "load_from_db": false, + "required": true, + "placeholder": "", + "show": true, + "name": "notion_secret", + "value": "", + "display_name": "Notion Secret", + "advanced": false, + "input_types": [ + "Message" + ], + "dynamic": false, + "info": "The Notion integration token.", + "title_case": false, + "password": true, + "type": "str", + "_input_type": "SecretStrInput" + }, + "query": { + "trace_as_metadata": true, + "load_from_db": false, + "list": false, + "required": false, + "placeholder": "", + "show": true, + "name": "query", + "value": "", + "display_name": "Search Query", + "advanced": true, + "dynamic": false, + "info": "The text that the API compares page and database titles against.", + "title_case": false, + "type": "str", + "_input_type": "StrInput" + }, + "sort_direction": { + "trace_as_metadata": true, + "options": [ + "ascending", + "descending" + ], + "combobox": false, + "required": false, + "placeholder": "", + "show": true, + "name": "sort_direction", + "value": "descending", + "display_name": "Sort Direction", + "advanced": true, + "dynamic": false, + "info": "The direction to sort the results.", + "title_case": false, + "type": "str", + "_input_type": "DropdownInput" + } + }, + "description": "Searches all pages and databases that have been shared with an integration. The search field can be an empty value to show all values from that search", + "icon": "NotionDirectoryLoader", + "base_classes": [ + "Data", + "Tool" + ], + "display_name": "Search ", + "documentation": "https://docs.langflow.org/integrations/notion/search", + "custom_fields": {}, + "output_types": [], + "pinned": false, + "conditional_paths": [], + "frozen": false, + "outputs": [ + { + "types": [ + "Data" + ], + "selected": "Data", + "name": "example_output", + "display_name": "Data", + "method": "run_model", + "value": "__UNDEFINED__", + "cache": true, + "hidden": true + }, + { + "types": [ + "Tool" + ], + "selected": "Tool", + "name": "example_tool_output", + "display_name": "Tool", + "method": "build_tool", + "value": "__UNDEFINED__", + "cache": true, + "hidden": false + } + ], + "field_order": [ + "notion_secret", + "query", + "filter_value", + "sort_direction" + ], + "beta": false, + "edited": true, + "lf_version": "1.0.17" + }, + "id": "NotionSearch-M66HF", + "description": "Searches all pages and databases that have been shared with an integration.", + "display_name": "Search " + }, + "selected": false, + "width": 384, + "height": 386, + "positionAbsolute": { + "x": 1095.6934863134345, + "y": 407.8718765800806 + }, + "dragging": false + }, + { + "id": "Prompt-19rub", + "type": "genericNode", + "position": { + "x": 688.7954025956392, + "y": 456.4686463487848 + }, + "data": { + "type": "Prompt", + "node": { + "template": { + "_type": "Component", + "code": { + "type": "code", + "required": true, + "placeholder": "", + "list": false, + "show": true, + "multiline": true, + "value": "from langflow.base.prompts.api_utils import process_prompt_template\nfrom langflow.custom import Component\nfrom langflow.inputs.inputs import DefaultPromptField\nfrom langflow.io import Output, PromptInput\nfrom langflow.schema.message import Message\nfrom langflow.template.utils import update_template_values\n\n\nclass PromptComponent(Component):\n display_name: str = \"Prompt\"\n description: str = \"Create a prompt template with dynamic variables.\"\n icon = \"prompts\"\n trace_type = \"prompt\"\n name = \"Prompt\"\n\n inputs = [\n PromptInput(name=\"template\", display_name=\"Template\"),\n ]\n\n outputs = [\n Output(display_name=\"Prompt Message\", name=\"prompt\", method=\"build_prompt\"),\n ]\n\n async def build_prompt(\n self,\n ) -> Message:\n prompt = Message.from_template_and_variables(**self._attributes)\n self.status = prompt.text\n return prompt\n\n def _update_template(self, frontend_node: dict):\n prompt_template = frontend_node[\"template\"][\"template\"][\"value\"]\n custom_fields = frontend_node[\"custom_fields\"]\n frontend_node_template = frontend_node[\"template\"]\n _ = process_prompt_template(\n template=prompt_template,\n name=\"template\",\n custom_fields=custom_fields,\n frontend_node_template=frontend_node_template,\n )\n return frontend_node\n\n def post_code_processing(self, new_frontend_node: dict, current_frontend_node: dict):\n \"\"\"\n This function is called after the code validation is done.\n \"\"\"\n frontend_node = super().post_code_processing(new_frontend_node, current_frontend_node)\n template = frontend_node[\"template\"][\"template\"][\"value\"]\n # Kept it duplicated for backwards compatibility\n _ = process_prompt_template(\n template=template,\n name=\"template\",\n custom_fields=frontend_node[\"custom_fields\"],\n frontend_node_template=frontend_node[\"template\"],\n )\n # Now that template is updated, we need to grab any values that were set in the current_frontend_node\n # and update the frontend_node with those values\n update_template_values(new_template=frontend_node, previous_template=current_frontend_node[\"template\"])\n return frontend_node\n\n def _get_fallback_input(self, **kwargs):\n return DefaultPromptField(**kwargs)\n", + "fileTypes": [], + "file_path": "", + "password": false, + "name": "code", + "advanced": true, + "dynamic": true, + "info": "", + "load_from_db": false, + "title_case": false + }, + "template": { + "trace_as_input": true, + "list": false, + "required": false, + "placeholder": "", + "show": true, + "name": "template", + "value": "\nYou are an AI assistant specialized in analyzing meeting transcripts and identifying tasks. Your goal is to extract relevant tasks from the given transcript, search for related existing tasks in Notion, and provide a comprehensive list of tasks with their current status and any needed updates.\n\nYou have access to the following input:\n\n\n{TRANSCRIPT}\n\n\n\n{USERS}\n\n\nFollow these steps to complete your task:\n\n1. Carefully read through the transcript and identify any mentioned tasks, action items, or follow-ups.\n\n2. For each identified task:\n a. Use the notion_search tool to find if there's an existing related task in Notion.\n b. If a related task is found, note its ID and current status.\n c. If no related task is found, mark it as a new task.\n\n3. For each task (existing or new), determine:\n a. The task name or description\n b. The assigned person (if mentioned)\n c. The current status (for existing tasks) or suggested status (for new tasks)\n d. Any updates or changes mentioned in the transcript\n\n4. Compile your findings into a list of tasks using the following format:\n\n\n\n[Notion page ID if existing, or \"NEW\" if new task]\n[Task name or description]\n[Assigned person, if mentioned]\n[Current status for existing tasks, or suggested status for new tasks]\n[Any updates or changes mentioned in the transcript]\n\n\n\nRemember to focus on tasks that are directly related to the meeting discussion. Do not include general conversation topics or unrelated mentions as tasks.\n\nProvide your final output in the format specified above, with each task enclosed in its own tags within the overall structure.\n\nToday is: {CURRENT_DATE}\n\n\n\n", + "display_name": "Template", + "advanced": false, + "dynamic": false, + "info": "", + "title_case": false, + "type": "prompt", + "_input_type": "PromptInput" + }, + "TRANSCRIPT": { + "field_type": "str", + "required": false, + "placeholder": "", + "list": false, + "show": true, + "multiline": true, + "value": "", + "fileTypes": [], + "file_path": "", + "password": false, + "name": "TRANSCRIPT", + "display_name": "TRANSCRIPT", + "advanced": false, + "input_types": [ + "Message", + "Text" + ], + "dynamic": false, + "info": "", + "load_from_db": false, + "title_case": false, + "type": "str" + }, + "USERS": { + "field_type": "str", + "required": false, + "placeholder": "", + "list": false, + "show": true, + "multiline": true, + "value": "", + "fileTypes": [], + "file_path": "", + "password": false, + "name": "USERS", + "display_name": "USERS", + "advanced": false, + "input_types": [ + "Message", + "Text" + ], + "dynamic": false, + "info": "", + "load_from_db": false, + "title_case": false, + "type": "str" + }, + "CURRENT_DATE": { + "field_type": "str", + "required": false, + "placeholder": "", + "list": false, + "show": true, + "multiline": true, + "value": "", + "fileTypes": [], + "file_path": "", + "password": false, + "name": "CURRENT_DATE", + "display_name": "CURRENT_DATE", + "advanced": false, + "input_types": [ + "Message", + "Text" + ], + "dynamic": false, + "info": "", + "load_from_db": false, + "title_case": false, + "type": "str" + } + }, + "description": "Create a prompt template with dynamic variables.", + "icon": "prompts", + "is_input": null, + "is_output": null, + "is_composition": null, + "base_classes": [ + "Message" + ], + "name": "", + "display_name": "Prompt", + "documentation": "", + "custom_fields": { + "template": [ + "TRANSCRIPT", + "USERS", + "CURRENT_DATE" + ] + }, + "output_types": [], + "full_path": null, + "pinned": false, + "conditional_paths": [], + "frozen": false, + "outputs": [ + { + "types": [ + "Message" + ], + "selected": "Message", + "name": "prompt", + "hidden": null, + "display_name": "Prompt Message", + "method": "build_prompt", + "value": "__UNDEFINED__", + "cache": true + } + ], + "field_order": [ + "template" + ], + "beta": false, + "error": null, + "edited": false, + "lf_version": "1.0.17" + }, + "id": "Prompt-19rub" + }, + "selected": false, + "width": 384, + "height": 588, + "positionAbsolute": { + "x": 688.7954025956392, + "y": 456.4686463487848 + }, + "dragging": false + }, + { + "id": "ParseData-aNk1v", + "type": "genericNode", + "position": { + "x": 540.4151030255898, + "y": 834.2819856588019 + }, + "data": { + "type": "ParseData", + "node": { + "template": { + "_type": "Component", + "data": { + "trace_as_metadata": true, + "list": false, + "trace_as_input": true, + "required": false, + "placeholder": "", + "show": true, + "name": "data", + "value": "", + "display_name": "Data", + "advanced": false, + "input_types": [ + "Data" + ], + "dynamic": false, + "info": "The data to convert to text.", + "title_case": false, + "type": "other", + "_input_type": "DataInput" + }, + "code": { + "type": "code", + "required": true, + "placeholder": "", + "list": false, + "show": true, + "multiline": true, + "value": "from langflow.custom import Component\nfrom langflow.helpers.data import data_to_text\nfrom langflow.io import DataInput, MultilineInput, Output, StrInput\nfrom langflow.schema.message import Message\n\n\nclass ParseDataComponent(Component):\n display_name = \"Parse Data\"\n description = \"Convert Data into plain text following a specified template.\"\n icon = \"braces\"\n name = \"ParseData\"\n\n inputs = [\n DataInput(name=\"data\", display_name=\"Data\", info=\"The data to convert to text.\"),\n MultilineInput(\n name=\"template\",\n display_name=\"Template\",\n info=\"The template to use for formatting the data. It can contain the keys {text}, {data} or any other key in the Data.\",\n value=\"{text}\",\n ),\n StrInput(name=\"sep\", display_name=\"Separator\", advanced=True, value=\"\\n\"),\n ]\n\n outputs = [\n Output(display_name=\"Text\", name=\"text\", method=\"parse_data\"),\n ]\n\n def parse_data(self) -> Message:\n data = self.data if isinstance(self.data, list) else [self.data]\n template = self.template\n\n result_string = data_to_text(template, data, sep=self.sep)\n self.status = result_string\n return Message(text=result_string)\n", + "fileTypes": [], + "file_path": "", + "password": false, + "name": "code", + "advanced": true, + "dynamic": true, + "info": "", + "load_from_db": false, + "title_case": false + }, + "sep": { + "trace_as_metadata": true, + "load_from_db": false, + "list": false, + "required": false, + "placeholder": "", + "show": true, + "name": "sep", + "value": "\n", + "display_name": "Separator", + "advanced": true, + "dynamic": false, + "info": "", + "title_case": false, + "type": "str", + "_input_type": "StrInput" + }, + "template": { + "trace_as_input": true, + "multiline": true, + "trace_as_metadata": true, + "load_from_db": false, + "list": false, + "required": false, + "placeholder": "", + "show": true, + "name": "template", + "value": "{text}", + "display_name": "Template", + "advanced": true, + "input_types": [ + "Message" + ], + "dynamic": false, + "info": "The template to use for formatting the data. It can contain the keys {text}, {data} or any other key in the Data.", + "title_case": false, + "type": "str", + "_input_type": "MultilineInput" + } + }, + "description": "Convert Data into plain text following a specified template.", + "icon": "braces", + "base_classes": [ + "Message" + ], + "display_name": "Parse Data", + "documentation": "", + "custom_fields": {}, + "output_types": [], + "pinned": false, + "conditional_paths": [], + "frozen": false, + "outputs": [ + { + "types": [ + "Message" + ], + "selected": "Message", + "name": "text", + "display_name": "Text", + "method": "parse_data", + "value": "__UNDEFINED__", + "cache": true + } + ], + "field_order": [ + "data", + "template", + "sep" + ], + "beta": false, + "edited": false, + "lf_version": "1.0.17" + }, + "id": "ParseData-aNk1v", + "showNode": false + }, + "selected": false, + "width": 96, + "height": 96, + "dragging": false, + "positionAbsolute": { + "x": 540.4151030255898, + "y": 834.2819856588019 + } + }, + { + "id": "ToolCallingAgent-rVWeq", + "type": "genericNode", + "position": { + "x": 1566.291217492157, + "y": 583.6687094567968 + }, + "data": { + "type": "ToolCallingAgent", + "node": { + "template": { + "_type": "Component", + "chat_history": { + "trace_as_metadata": true, + "list": true, + "trace_as_input": true, + "required": false, + "placeholder": "", + "show": true, + "name": "chat_history", + "value": "", + "display_name": "Chat History", + "advanced": true, + "input_types": [ + "Data" + ], + "dynamic": false, + "info": "", + "title_case": false, + "type": "other", + "_input_type": "DataInput" + }, + "llm": { + "trace_as_metadata": true, + "list": false, + "required": true, + "placeholder": "", + "show": true, + "name": "llm", + "value": "", + "display_name": "Language Model", + "advanced": false, + "input_types": [ + "LanguageModel" + ], + "dynamic": false, + "info": "", + "title_case": false, + "type": "other", + "_input_type": "HandleInput" + }, + "tools": { + "trace_as_metadata": true, + "list": true, + "required": false, + "placeholder": "", + "show": true, + "name": "tools", + "value": "", + "display_name": "Tools", + "advanced": false, + "input_types": [ + "Tool", + "BaseTool" + ], + "dynamic": false, + "info": "", + "title_case": false, + "type": "other", + "_input_type": "HandleInput" + }, + "code": { + "type": "code", + "required": true, + "placeholder": "", + "list": false, + "show": true, + "multiline": true, + "value": "from typing import Optional, List\n\nfrom langchain.agents import create_tool_calling_agent\nfrom langchain_core.prompts import ChatPromptTemplate, PromptTemplate, HumanMessagePromptTemplate\nfrom langflow.base.agents.agent import LCToolsAgentComponent\nfrom langflow.inputs import MultilineInput\nfrom langflow.inputs.inputs import HandleInput, DataInput\nfrom langflow.schema import Data\n\n\nclass ToolCallingAgentComponent(LCToolsAgentComponent):\n display_name: str = \"Tool Calling Agent\"\n description: str = \"Agent that uses tools\"\n icon = \"LangChain\"\n beta = True\n name = \"ToolCallingAgent\"\n\n inputs = LCToolsAgentComponent._base_inputs + [\n HandleInput(name=\"llm\", display_name=\"Language Model\", input_types=[\"LanguageModel\"], required=True),\n MultilineInput(\n name=\"system_prompt\",\n display_name=\"System Prompt\",\n info=\"System prompt for the agent.\",\n value=\"You are a helpful assistant\",\n ),\n MultilineInput(\n name=\"user_prompt\", display_name=\"Prompt\", info=\"This prompt must contain 'input' key.\", value=\"{input}\"\n ),\n DataInput(name=\"chat_history\", display_name=\"Chat History\", is_list=True, advanced=True),\n ]\n\n def get_chat_history_data(self) -> Optional[List[Data]]:\n return self.chat_history\n\n def create_agent_runnable(self):\n if \"input\" not in self.user_prompt:\n raise ValueError(\"Prompt must contain 'input' key.\")\n messages = [\n (\"system\", self.system_prompt),\n (\"placeholder\", \"{chat_history}\"),\n HumanMessagePromptTemplate(prompt=PromptTemplate(input_variables=[\"input\"], template=self.user_prompt)),\n (\"placeholder\", \"{agent_scratchpad}\"),\n ]\n prompt = ChatPromptTemplate.from_messages(messages)\n return create_tool_calling_agent(self.llm, self.tools, prompt)\n", + "fileTypes": [], + "file_path": "", + "password": false, + "name": "code", + "advanced": true, + "dynamic": true, + "info": "", + "load_from_db": false, + "title_case": false + }, + "handle_parsing_errors": { + "trace_as_metadata": true, + "list": false, + "required": false, + "placeholder": "", + "show": true, + "name": "handle_parsing_errors", + "value": true, + "display_name": "Handle Parse Errors", + "advanced": true, + "dynamic": false, + "info": "", + "title_case": false, + "type": "bool", + "_input_type": "BoolInput" + }, + "input_value": { + "trace_as_input": true, + "trace_as_metadata": true, + "load_from_db": false, + "list": false, + "required": false, + "placeholder": "", + "show": true, + "name": "input_value", + "value": "Analyze this meeting", + "display_name": "Input", + "advanced": true, + "input_types": [ + "Message" + ], + "dynamic": false, + "info": "", + "title_case": false, + "type": "str", + "_input_type": "MessageTextInput" + }, + "max_iterations": { + "trace_as_metadata": true, + "list": false, + "required": false, + "placeholder": "", + "show": true, + "name": "max_iterations", + "value": 15, + "display_name": "Max Iterations", + "advanced": true, + "dynamic": false, + "info": "", + "title_case": false, + "type": "int", + "_input_type": "IntInput" + }, + "system_prompt": { + "trace_as_input": true, + "multiline": true, + "trace_as_metadata": true, + "load_from_db": false, + "list": false, + "required": false, + "placeholder": "", + "show": true, + "name": "system_prompt", + "value": "", + "display_name": "System Prompt", + "advanced": false, + "input_types": [ + "Message" + ], + "dynamic": false, + "info": "System prompt for the agent.", + "title_case": false, + "type": "str", + "_input_type": "MultilineInput" + }, + "user_prompt": { + "trace_as_input": true, + "multiline": true, + "trace_as_metadata": true, + "load_from_db": false, + "list": false, + "required": false, + "placeholder": "", + "show": true, + "name": "user_prompt", + "value": "{input}", + "display_name": "Prompt", + "advanced": true, + "input_types": [ + "Message" + ], + "dynamic": false, + "info": "This prompt must contain 'input' key.", + "title_case": false, + "type": "str", + "_input_type": "MultilineInput" + }, + "verbose": { + "trace_as_metadata": true, + "list": false, + "required": false, + "placeholder": "", + "show": true, + "name": "verbose", + "value": true, + "display_name": "Verbose", + "advanced": true, + "dynamic": false, + "info": "", + "title_case": false, + "type": "bool", + "_input_type": "BoolInput" + } + }, + "description": "Agent that uses tools", + "icon": "LangChain", + "base_classes": [ + "AgentExecutor", + "Message" + ], + "display_name": "Tool Calling Agent", + "documentation": "", + "custom_fields": {}, + "output_types": [], + "pinned": false, + "conditional_paths": [], + "frozen": false, + "outputs": [ + { + "types": [ + "AgentExecutor" + ], + "selected": "AgentExecutor", + "name": "agent", + "display_name": "Agent", + "method": "build_agent", + "value": "__UNDEFINED__", + "cache": true, + "hidden": true + }, + { + "types": [ + "Message" + ], + "selected": "Message", + "name": "response", + "display_name": "Response", + "method": "message_response", + "value": "__UNDEFINED__", + "cache": true + } + ], + "field_order": [ + "input_value", + "handle_parsing_errors", + "verbose", + "max_iterations", + "tools", + "llm", + "system_prompt", + "user_prompt", + "chat_history" + ], + "beta": true, + "edited": false, + "lf_version": "1.0.17" + }, + "id": "ToolCallingAgent-rVWeq" + }, + "selected": false, + "width": 384, + "height": 398, + "positionAbsolute": { + "x": 1566.291217492157, + "y": 583.6687094567968 + }, + "dragging": false + }, + { + "id": "OpenAIModel-Ht8xI", + "type": "genericNode", + "position": { + "x": 1097.0545781920632, + "y": 805.60631548423 + }, + "data": { + "type": "OpenAIModel", + "node": { + "template": { + "_type": "Component", + "api_key": { + "load_from_db": false, + "required": false, + "placeholder": "", + "show": true, + "name": "api_key", + "value": "", + "display_name": "OpenAI API Key", + "advanced": false, + "input_types": [ + "Message" + ], + "dynamic": false, + "info": "The OpenAI API Key to use for the OpenAI model.", + "title_case": false, + "password": true, + "type": "str", + "_input_type": "SecretStrInput" + }, + "code": { + "type": "code", + "required": true, + "placeholder": "", + "list": false, + "show": true, + "multiline": true, + "value": "import operator\nfrom functools import reduce\n\nfrom langflow.field_typing.range_spec import RangeSpec\nfrom langchain_openai import ChatOpenAI\nfrom pydantic.v1 import SecretStr\n\nfrom langflow.base.models.model import LCModelComponent\nfrom langflow.base.models.openai_constants import OPENAI_MODEL_NAMES\nfrom langflow.field_typing import LanguageModel\nfrom langflow.inputs import (\n BoolInput,\n DictInput,\n DropdownInput,\n FloatInput,\n IntInput,\n SecretStrInput,\n StrInput,\n)\n\n\nclass OpenAIModelComponent(LCModelComponent):\n display_name = \"OpenAI\"\n description = \"Generates text using OpenAI LLMs.\"\n icon = \"OpenAI\"\n name = \"OpenAIModel\"\n\n inputs = LCModelComponent._base_inputs + [\n IntInput(\n name=\"max_tokens\",\n display_name=\"Max Tokens\",\n advanced=True,\n info=\"The maximum number of tokens to generate. Set to 0 for unlimited tokens.\",\n range_spec=RangeSpec(min=0, max=128000),\n ),\n DictInput(name=\"model_kwargs\", display_name=\"Model Kwargs\", advanced=True),\n BoolInput(\n name=\"json_mode\",\n display_name=\"JSON Mode\",\n advanced=True,\n info=\"If True, it will output JSON regardless of passing a schema.\",\n ),\n DictInput(\n name=\"output_schema\",\n is_list=True,\n display_name=\"Schema\",\n advanced=True,\n info=\"The schema for the Output of the model. You must pass the word JSON in the prompt. If left blank, JSON mode will be disabled.\",\n ),\n DropdownInput(\n name=\"model_name\",\n display_name=\"Model Name\",\n advanced=False,\n options=OPENAI_MODEL_NAMES,\n value=OPENAI_MODEL_NAMES[0],\n ),\n StrInput(\n name=\"openai_api_base\",\n display_name=\"OpenAI API Base\",\n advanced=True,\n info=\"The base URL of the OpenAI API. Defaults to https://api.openai.com/v1. You can change this to use other APIs like JinaChat, LocalAI and Prem.\",\n ),\n SecretStrInput(\n name=\"api_key\",\n display_name=\"OpenAI API Key\",\n info=\"The OpenAI API Key to use for the OpenAI model.\",\n advanced=False,\n value=\"OPENAI_API_KEY\",\n ),\n FloatInput(name=\"temperature\", display_name=\"Temperature\", value=0.1),\n IntInput(\n name=\"seed\",\n display_name=\"Seed\",\n info=\"The seed controls the reproducibility of the job.\",\n advanced=True,\n value=1,\n ),\n ]\n\n def build_model(self) -> LanguageModel: # type: ignore[type-var]\n # self.output_schema is a list of dictionaries\n # let's convert it to a dictionary\n output_schema_dict: dict[str, str] = reduce(operator.ior, self.output_schema or {}, {})\n openai_api_key = self.api_key\n temperature = self.temperature\n model_name: str = self.model_name\n max_tokens = self.max_tokens\n model_kwargs = self.model_kwargs or {}\n openai_api_base = self.openai_api_base or \"https://api.openai.com/v1\"\n json_mode = bool(output_schema_dict) or self.json_mode\n seed = self.seed\n\n if openai_api_key:\n api_key = SecretStr(openai_api_key)\n else:\n api_key = None\n output = ChatOpenAI(\n max_tokens=max_tokens or None,\n model_kwargs=model_kwargs,\n model=model_name,\n base_url=openai_api_base,\n api_key=api_key,\n temperature=temperature if temperature is not None else 0.1,\n seed=seed,\n )\n if json_mode:\n if output_schema_dict:\n output = output.with_structured_output(schema=output_schema_dict, method=\"json_mode\") # type: ignore\n else:\n output = output.bind(response_format={\"type\": \"json_object\"}) # type: ignore\n\n return output # type: ignore\n\n def _get_exception_message(self, e: Exception):\n \"\"\"\n Get a message from an OpenAI exception.\n\n Args:\n exception (Exception): The exception to get the message from.\n\n Returns:\n str: The message from the exception.\n \"\"\"\n\n try:\n from openai import BadRequestError\n except ImportError:\n return\n if isinstance(e, BadRequestError):\n message = e.body.get(\"message\") # type: ignore\n if message:\n return message\n return\n", + "fileTypes": [], + "file_path": "", + "password": false, + "name": "code", + "advanced": true, + "dynamic": true, + "info": "", + "load_from_db": false, + "title_case": false + }, + "input_value": { + "trace_as_input": true, + "trace_as_metadata": true, + "load_from_db": false, + "list": false, + "required": false, + "placeholder": "", + "show": true, + "name": "input_value", + "value": "", + "display_name": "Input", + "advanced": true, + "input_types": [ + "Message" + ], + "dynamic": false, + "info": "", + "title_case": false, + "type": "str", + "_input_type": "MessageInput" + }, + "json_mode": { + "trace_as_metadata": true, + "list": false, + "required": false, + "placeholder": "", + "show": true, + "name": "json_mode", + "value": false, + "display_name": "JSON Mode", + "advanced": true, + "dynamic": false, + "info": "If True, it will output JSON regardless of passing a schema.", + "title_case": false, + "type": "bool", + "_input_type": "BoolInput" + }, + "max_tokens": { + "trace_as_metadata": true, + "range_spec": { + "step_type": "float", + "min": 0, + "max": 128000, + "step": 0.1 + }, + "list": false, + "required": false, + "placeholder": "", + "show": true, + "name": "max_tokens", + "value": "", + "display_name": "Max Tokens", + "advanced": true, + "dynamic": false, + "info": "The maximum number of tokens to generate. Set to 0 for unlimited tokens.", + "title_case": false, + "type": "int", + "_input_type": "IntInput" + }, + "model_kwargs": { + "trace_as_input": true, + "list": false, + "required": false, + "placeholder": "", + "show": true, + "name": "model_kwargs", + "value": {}, + "display_name": "Model Kwargs", + "advanced": true, + "dynamic": false, + "info": "", + "title_case": false, + "type": "dict", + "_input_type": "DictInput" + }, + "model_name": { + "trace_as_metadata": true, + "options": [ + "gpt-4o-mini", + "gpt-4o", + "gpt-4-turbo", + "gpt-4-turbo-preview", + "gpt-4", + "gpt-3.5-turbo", + "gpt-3.5-turbo-0125" + ], + "combobox": false, + "required": false, + "placeholder": "", + "show": true, + "name": "model_name", + "value": "gpt-4o", + "display_name": "Model Name", + "advanced": true, + "dynamic": false, + "info": "", + "title_case": false, + "type": "str", + "_input_type": "DropdownInput" + }, + "openai_api_base": { + "trace_as_metadata": true, + "load_from_db": false, + "list": false, + "required": false, + "placeholder": "", + "show": true, + "name": "openai_api_base", + "value": "", + "display_name": "OpenAI API Base", + "advanced": true, + "dynamic": false, + "info": "The base URL of the OpenAI API. Defaults to https://api.openai.com/v1. You can change this to use other APIs like JinaChat, LocalAI and Prem.", + "title_case": false, + "type": "str", + "_input_type": "StrInput" + }, + "output_schema": { + "trace_as_input": true, + "list": true, + "required": false, + "placeholder": "", + "show": true, + "name": "output_schema", + "value": {}, + "display_name": "Schema", + "advanced": true, + "dynamic": false, + "info": "The schema for the Output of the model. You must pass the word JSON in the prompt. If left blank, JSON mode will be disabled.", + "title_case": false, + "type": "dict", + "_input_type": "DictInput" + }, + "seed": { + "trace_as_metadata": true, + "list": false, + "required": false, + "placeholder": "", + "show": true, + "name": "seed", + "value": 1, + "display_name": "Seed", + "advanced": true, + "dynamic": false, + "info": "The seed controls the reproducibility of the job.", + "title_case": false, + "type": "int", + "_input_type": "IntInput" + }, + "stream": { + "trace_as_metadata": true, + "list": false, + "required": false, + "placeholder": "", + "show": true, + "name": "stream", + "value": false, + "display_name": "Stream", + "advanced": true, + "dynamic": false, + "info": "Stream the response from the model. Streaming works only in Chat.", + "title_case": false, + "type": "bool", + "_input_type": "BoolInput" + }, + "system_message": { + "trace_as_input": true, + "trace_as_metadata": true, + "load_from_db": false, + "list": false, + "required": false, + "placeholder": "", + "show": true, + "name": "system_message", + "value": "", + "display_name": "System Message", + "advanced": true, + "input_types": [ + "Message" + ], + "dynamic": false, + "info": "System message to pass to the model.", + "title_case": false, + "type": "str", + "_input_type": "MessageTextInput" + }, + "temperature": { + "trace_as_metadata": true, + "list": false, + "required": false, + "placeholder": "", + "show": true, + "name": "temperature", + "value": 0.1, + "display_name": "Temperature", + "advanced": true, + "dynamic": false, + "info": "", + "title_case": false, + "type": "float", + "_input_type": "FloatInput" + } + }, + "description": "Generates text using OpenAI LLMs.", + "icon": "OpenAI", + "base_classes": [ + "LanguageModel", + "Message" + ], + "display_name": "OpenAI", + "documentation": "", + "custom_fields": {}, + "output_types": [], + "pinned": false, + "conditional_paths": [], + "frozen": false, + "outputs": [ + { + "types": [ + "Message" + ], + "selected": "Message", + "name": "text_output", + "display_name": "Text", + "method": "text_response", + "value": "__UNDEFINED__", + "cache": true, + "hidden": true + }, + { + "types": [ + "LanguageModel" + ], + "selected": "LanguageModel", + "name": "model_output", + "display_name": "Language Model", + "method": "build_model", + "value": "__UNDEFINED__", + "cache": true + } + ], + "field_order": [ + "input_value", + "system_message", + "stream", + "max_tokens", + "model_kwargs", + "json_mode", + "output_schema", + "model_name", + "openai_api_base", + "api_key", + "temperature", + "seed" + ], + "beta": false, + "edited": false, + "lf_version": "1.0.17" + }, + "id": "OpenAIModel-Ht8xI" + }, + "selected": false, + "width": 384, + "height": 302, + "dragging": false, + "positionAbsolute": { + "x": 1097.0545781920632, + "y": 805.60631548423 + } + }, + { + "id": "Prompt-Lbxk6", + "type": "genericNode", + "position": { + "x": 3042.6844997246735, + "y": 416.83992118486856 + }, + "data": { + "type": "Prompt", + "node": { + "template": { + "_type": "Component", + "code": { + "type": "code", + "required": true, + "placeholder": "", + "list": false, + "show": true, + "multiline": true, + "value": "from langflow.base.prompts.api_utils import process_prompt_template\nfrom langflow.custom import Component\nfrom langflow.inputs.inputs import DefaultPromptField\nfrom langflow.io import Output, PromptInput\nfrom langflow.schema.message import Message\nfrom langflow.template.utils import update_template_values\n\n\nclass PromptComponent(Component):\n display_name: str = \"Prompt\"\n description: str = \"Create a prompt template with dynamic variables.\"\n icon = \"prompts\"\n trace_type = \"prompt\"\n name = \"Prompt\"\n\n inputs = [\n PromptInput(name=\"template\", display_name=\"Template\"),\n ]\n\n outputs = [\n Output(display_name=\"Prompt Message\", name=\"prompt\", method=\"build_prompt\"),\n ]\n\n async def build_prompt(\n self,\n ) -> Message:\n prompt = Message.from_template_and_variables(**self._attributes)\n self.status = prompt.text\n return prompt\n\n def _update_template(self, frontend_node: dict):\n prompt_template = frontend_node[\"template\"][\"template\"][\"value\"]\n custom_fields = frontend_node[\"custom_fields\"]\n frontend_node_template = frontend_node[\"template\"]\n _ = process_prompt_template(\n template=prompt_template,\n name=\"template\",\n custom_fields=custom_fields,\n frontend_node_template=frontend_node_template,\n )\n return frontend_node\n\n def post_code_processing(self, new_frontend_node: dict, current_frontend_node: dict):\n \"\"\"\n This function is called after the code validation is done.\n \"\"\"\n frontend_node = super().post_code_processing(new_frontend_node, current_frontend_node)\n template = frontend_node[\"template\"][\"template\"][\"value\"]\n # Kept it duplicated for backwards compatibility\n _ = process_prompt_template(\n template=template,\n name=\"template\",\n custom_fields=frontend_node[\"custom_fields\"],\n frontend_node_template=frontend_node[\"template\"],\n )\n # Now that template is updated, we need to grab any values that were set in the current_frontend_node\n # and update the frontend_node with those values\n update_template_values(new_template=frontend_node, previous_template=current_frontend_node[\"template\"])\n return frontend_node\n\n def _get_fallback_input(self, **kwargs):\n return DefaultPromptField(**kwargs)\n", + "fileTypes": [], + "file_path": "", + "password": false, + "name": "code", + "advanced": true, + "dynamic": true, + "info": "", + "load_from_db": false, + "title_case": false + }, + "template": { + "trace_as_input": true, + "list": false, + "required": false, + "placeholder": "", + "show": true, + "name": "template", + "value": "\nYou are an AI assistant responsible for updating tasks in Notion based on the information provided from a meeting analysis. Your goal is to create new tasks and update existing ones using the Notion API tools available to you, and then provide a summary in a simple markdown format suitable for a chat interface.\n\nYou have access to the following inputs:\n\n\n{TASK_LIST}\n\n\n\n{DATABASES}\n\n\n\n{USERS}\n\n\nFollow these steps to update the tasks in Notion and generate a markdown summary:\n\n1. Identify the Task database ID from the provided list.\n\n2. Before processing any tasks, retrieve the database properties for the Task database:\n a. Use the notion_database_properties and carefully review the properties, their types, and any options for select or multi-select properties.\n b. Pay attention to the properties format for further usage.\n\n3. For each task in the task list:\n a. If the task ID is \"NEW\", create a new task using the create_notion_page tool.\n b. If the task has an existing ID, update the task using the update_notion_page tool.\n c. Remember to use the properties from the DB retrieved from the notion_database_properties tool\n\n4. When creating a new task:\n a. Use the create_notion_page tool.\n b. Include the task name, assignee (if available), status, and any other relevant properties based on the database structure.\n c. Ensure that the property names and types match exactly with what you retrieved from the notion_database_properties call.\n\n5. When updating an existing task:\n a. Use the update_notion_page tool.\n b. Update the status, assignee, or any other relevant properties mentioned in the field.\n c. Ensure that the property names and types match exactly with what you retrieved from the notion_database_properties call.\n\n6. After each function call, wait for the before proceeding to the next task.\n\n7. If you encounter any errors during the process, note them and continue with the next task.\n\n8. Provide a summary of your actions for each task in a simple markdown format. Use the following structure:\n # Task Update Summary\n\n ## Created Tasks\n - **[Task Name]**: Assigned to [Assignee], Status: [Status]\n - Details: [Brief description of the new task]\n\n ## Updated Tasks\n - **[Task Name]** (ID: [Notion Page ID])\n - Changes: [Brief description of changes]\n - Status: [Success/Error]\n\n ## Errors\n - **[Task Name or ID]**: [Description of the error encountered]\n\n\nRemember to use the exact property names, types, and options as specified in the Notion database properties you retrieved at the beginning. This is crucial for ensuring that all updates and creations are done correctly.\n\nIf you encounter any errors or uncertainties, include them in the Errors section of the markdown summary. With enough detail to the user understand the issues.\n\nProvide your final output as a complete markdown document containing all the tasks you've processed, whether they were created, updated, or encountered errors. Use only basic markdown formatting (headers, bold, lists) to ensure compatibility with chat interfaces. Do not include any XML tags or complex formatting in your final output.\n\nToday is: {CURRENT_DATE}\n\n", + "display_name": "Template", + "advanced": false, + "dynamic": false, + "info": "", + "title_case": false, + "type": "prompt", + "_input_type": "PromptInput" + }, + "TASK_LIST": { + "field_type": "str", + "required": false, + "placeholder": "", + "list": false, + "show": true, + "multiline": true, + "value": "", + "fileTypes": [], + "file_path": "", + "password": false, + "name": "TASK_LIST", + "display_name": "TASK_LIST", + "advanced": false, + "input_types": [ + "Message", + "Text" + ], + "dynamic": false, + "info": "", + "load_from_db": false, + "title_case": false, + "type": "str" + }, + "DATABASES": { + "field_type": "str", + "required": false, + "placeholder": "", + "list": false, + "show": true, + "multiline": true, + "value": "", + "fileTypes": [], + "file_path": "", + "password": false, + "name": "DATABASES", + "display_name": "DATABASES", + "advanced": false, + "input_types": [ + "Message", + "Text" + ], + "dynamic": false, + "info": "", + "load_from_db": false, + "title_case": false, + "type": "str" + }, + "USERS": { + "field_type": "str", + "required": false, + "placeholder": "", + "list": false, + "show": true, + "multiline": true, + "value": "", + "fileTypes": [], + "file_path": "", + "password": false, + "name": "USERS", + "display_name": "USERS", + "advanced": false, + "input_types": [ + "Message", + "Text" + ], + "dynamic": false, + "info": "", + "load_from_db": false, + "title_case": false, + "type": "str" + }, + "CURRENT_DATE": { + "field_type": "str", + "required": false, + "placeholder": "", + "list": false, + "show": true, + "multiline": true, + "value": "", + "fileTypes": [], + "file_path": "", + "password": false, + "name": "CURRENT_DATE", + "display_name": "CURRENT_DATE", + "advanced": false, + "input_types": [ + "Message", + "Text" + ], + "dynamic": false, + "info": "", + "load_from_db": false, + "title_case": false, + "type": "str" + } + }, + "description": "Create a prompt template with dynamic variables.", + "icon": "prompts", + "is_input": null, + "is_output": null, + "is_composition": null, + "base_classes": [ + "Message" + ], + "name": "", + "display_name": "Prompt", + "documentation": "", + "custom_fields": { + "template": [ + "TASK_LIST", + "DATABASES", + "USERS", + "CURRENT_DATE" + ] + }, + "output_types": [], + "full_path": null, + "pinned": false, + "conditional_paths": [], + "frozen": false, + "outputs": [ + { + "types": [ + "Message" + ], + "selected": "Message", + "name": "prompt", + "hidden": null, + "display_name": "Prompt Message", + "method": "build_prompt", + "value": "__UNDEFINED__", + "cache": true + } + ], + "field_order": [ + "template" + ], + "beta": false, + "error": null, + "edited": false + }, + "id": "Prompt-Lbxk6" + }, + "selected": false, + "width": 384, + "height": 674, + "positionAbsolute": { + "x": 3042.6844997246735, + "y": 416.83992118486856 + }, + "dragging": false + }, + { + "id": "ToolCallingAgent-GurdE", + "type": "genericNode", + "position": { + "x": 3974.1377259893243, + "y": 867.4647271037014 + }, + "data": { + "type": "ToolCallingAgent", + "node": { + "template": { + "_type": "Component", + "chat_history": { + "trace_as_metadata": true, + "list": true, + "trace_as_input": true, + "required": false, + "placeholder": "", + "show": true, + "name": "chat_history", + "value": "", + "display_name": "Chat History", + "advanced": true, + "input_types": [ + "Data" + ], + "dynamic": false, + "info": "", + "title_case": false, + "type": "other", + "_input_type": "DataInput" + }, + "llm": { + "trace_as_metadata": true, + "list": false, + "required": true, + "placeholder": "", + "show": true, + "name": "llm", + "value": "", + "display_name": "Language Model", + "advanced": false, + "input_types": [ + "LanguageModel" + ], + "dynamic": false, + "info": "", + "title_case": false, + "type": "other", + "_input_type": "HandleInput" + }, + "tools": { + "trace_as_metadata": true, + "list": true, + "required": false, + "placeholder": "", + "show": true, + "name": "tools", + "value": "", + "display_name": "Tools", + "advanced": false, + "input_types": [ + "Tool", + "BaseTool" + ], + "dynamic": false, + "info": "", + "title_case": false, + "type": "other", + "_input_type": "HandleInput" + }, + "code": { + "type": "code", + "required": true, + "placeholder": "", + "list": false, + "show": true, + "multiline": true, + "value": "from typing import Optional, List\n\nfrom langchain.agents import create_tool_calling_agent\nfrom langchain_core.prompts import ChatPromptTemplate, PromptTemplate, HumanMessagePromptTemplate\nfrom langflow.base.agents.agent import LCToolsAgentComponent\nfrom langflow.inputs import MultilineInput\nfrom langflow.inputs.inputs import HandleInput, DataInput\nfrom langflow.schema import Data\n\n\nclass ToolCallingAgentComponent(LCToolsAgentComponent):\n display_name: str = \"Tool Calling Agent\"\n description: str = \"Agent that uses tools\"\n icon = \"LangChain\"\n beta = True\n name = \"ToolCallingAgent\"\n\n inputs = LCToolsAgentComponent._base_inputs + [\n HandleInput(name=\"llm\", display_name=\"Language Model\", input_types=[\"LanguageModel\"], required=True),\n MultilineInput(\n name=\"system_prompt\",\n display_name=\"System Prompt\",\n info=\"System prompt for the agent.\",\n value=\"You are a helpful assistant\",\n ),\n MultilineInput(\n name=\"user_prompt\", display_name=\"Prompt\", info=\"This prompt must contain 'input' key.\", value=\"{input}\"\n ),\n DataInput(name=\"chat_history\", display_name=\"Chat History\", is_list=True, advanced=True),\n ]\n\n def get_chat_history_data(self) -> Optional[List[Data]]:\n return self.chat_history\n\n def create_agent_runnable(self):\n if \"input\" not in self.user_prompt:\n raise ValueError(\"Prompt must contain 'input' key.\")\n messages = [\n (\"system\", self.system_prompt),\n (\"placeholder\", \"{chat_history}\"),\n HumanMessagePromptTemplate(prompt=PromptTemplate(input_variables=[\"input\"], template=self.user_prompt)),\n (\"placeholder\", \"{agent_scratchpad}\"),\n ]\n prompt = ChatPromptTemplate.from_messages(messages)\n return create_tool_calling_agent(self.llm, self.tools, prompt)\n", + "fileTypes": [], + "file_path": "", + "password": false, + "name": "code", + "advanced": true, + "dynamic": true, + "info": "", + "load_from_db": false, + "title_case": false + }, + "handle_parsing_errors": { + "trace_as_metadata": true, + "list": false, + "required": false, + "placeholder": "", + "show": true, + "name": "handle_parsing_errors", + "value": true, + "display_name": "Handle Parse Errors", + "advanced": true, + "dynamic": false, + "info": "", + "title_case": false, + "type": "bool", + "_input_type": "BoolInput" + }, + "input_value": { + "trace_as_input": true, + "trace_as_metadata": true, + "load_from_db": false, + "list": false, + "required": false, + "placeholder": "", + "show": true, + "name": "input_value", + "value": "Do your task.", + "display_name": "Input", + "advanced": true, + "input_types": [ + "Message" + ], + "dynamic": false, + "info": "", + "title_case": false, + "type": "str", + "_input_type": "MessageTextInput" + }, + "max_iterations": { + "trace_as_metadata": true, + "list": false, + "required": false, + "placeholder": "", + "show": true, + "name": "max_iterations", + "value": 15, + "display_name": "Max Iterations", + "advanced": true, + "dynamic": false, + "info": "", + "title_case": false, + "type": "int", + "_input_type": "IntInput" + }, + "system_prompt": { + "trace_as_input": true, + "multiline": true, + "trace_as_metadata": true, + "load_from_db": false, + "list": false, + "required": false, + "placeholder": "", + "show": true, + "name": "system_prompt", + "value": "", + "display_name": "System Prompt", + "advanced": false, + "input_types": [ + "Message" + ], + "dynamic": false, + "info": "System prompt for the agent.", + "title_case": false, + "type": "str", + "_input_type": "MultilineInput" + }, + "user_prompt": { + "trace_as_input": true, + "multiline": true, + "trace_as_metadata": true, + "load_from_db": false, + "list": false, + "required": false, + "placeholder": "", + "show": true, + "name": "user_prompt", + "value": "{input}", + "display_name": "Prompt", + "advanced": true, + "input_types": [ + "Message" + ], + "dynamic": false, + "info": "This prompt must contain 'input' key.", + "title_case": false, + "type": "str", + "_input_type": "MultilineInput" + }, + "verbose": { + "trace_as_metadata": true, + "list": false, + "required": false, + "placeholder": "", + "show": true, + "name": "verbose", + "value": true, + "display_name": "Verbose", + "advanced": true, + "dynamic": false, + "info": "", + "title_case": false, + "type": "bool", + "_input_type": "BoolInput" + } + }, + "description": "Agent that uses tools", + "icon": "LangChain", + "base_classes": [ + "AgentExecutor", + "Message" + ], + "display_name": "Tool Calling Agent", + "documentation": "", + "custom_fields": {}, + "output_types": [], + "pinned": false, + "conditional_paths": [], + "frozen": false, + "outputs": [ + { + "types": [ + "AgentExecutor" + ], + "selected": "AgentExecutor", + "name": "agent", + "display_name": "Agent", + "method": "build_agent", + "value": "__UNDEFINED__", + "cache": true, + "hidden": true + }, + { + "types": [ + "Message" + ], + "selected": "Message", + "name": "response", + "display_name": "Response", + "method": "message_response", + "value": "__UNDEFINED__", + "cache": true + } + ], + "field_order": [ + "input_value", + "handle_parsing_errors", + "verbose", + "max_iterations", + "tools", + "llm", + "system_prompt", + "user_prompt", + "chat_history" + ], + "beta": true, + "edited": false, + "lf_version": "1.0.17" + }, + "id": "ToolCallingAgent-GurdE" + }, + "selected": false, + "width": 384, + "height": 398, + "positionAbsolute": { + "x": 3974.1377259893243, + "y": 867.4647271037014 + }, + "dragging": false + }, + { + "id": "OpenAIModel-OTfnt", + "type": "genericNode", + "position": { + "x": 3513.5648778762093, + "y": 710.2099422974287 + }, + "data": { + "type": "OpenAIModel", + "node": { + "template": { + "_type": "Component", + "api_key": { + "load_from_db": false, + "required": false, + "placeholder": "", + "show": true, + "name": "api_key", + "value": "", + "display_name": "OpenAI API Key", + "advanced": false, + "input_types": [ + "Message" + ], + "dynamic": false, + "info": "The OpenAI API Key to use for the OpenAI model.", + "title_case": false, + "password": true, + "type": "str", + "_input_type": "SecretStrInput" + }, + "code": { + "type": "code", + "required": true, + "placeholder": "", + "list": false, + "show": true, + "multiline": true, + "value": "import operator\nfrom functools import reduce\n\nfrom langflow.field_typing.range_spec import RangeSpec\nfrom langchain_openai import ChatOpenAI\nfrom pydantic.v1 import SecretStr\n\nfrom langflow.base.models.model import LCModelComponent\nfrom langflow.base.models.openai_constants import OPENAI_MODEL_NAMES\nfrom langflow.field_typing import LanguageModel\nfrom langflow.inputs import (\n BoolInput,\n DictInput,\n DropdownInput,\n FloatInput,\n IntInput,\n SecretStrInput,\n StrInput,\n)\n\n\nclass OpenAIModelComponent(LCModelComponent):\n display_name = \"OpenAI\"\n description = \"Generates text using OpenAI LLMs.\"\n icon = \"OpenAI\"\n name = \"OpenAIModel\"\n\n inputs = LCModelComponent._base_inputs + [\n IntInput(\n name=\"max_tokens\",\n display_name=\"Max Tokens\",\n advanced=True,\n info=\"The maximum number of tokens to generate. Set to 0 for unlimited tokens.\",\n range_spec=RangeSpec(min=0, max=128000),\n ),\n DictInput(name=\"model_kwargs\", display_name=\"Model Kwargs\", advanced=True),\n BoolInput(\n name=\"json_mode\",\n display_name=\"JSON Mode\",\n advanced=True,\n info=\"If True, it will output JSON regardless of passing a schema.\",\n ),\n DictInput(\n name=\"output_schema\",\n is_list=True,\n display_name=\"Schema\",\n advanced=True,\n info=\"The schema for the Output of the model. You must pass the word JSON in the prompt. If left blank, JSON mode will be disabled.\",\n ),\n DropdownInput(\n name=\"model_name\",\n display_name=\"Model Name\",\n advanced=False,\n options=OPENAI_MODEL_NAMES,\n value=OPENAI_MODEL_NAMES[0],\n ),\n StrInput(\n name=\"openai_api_base\",\n display_name=\"OpenAI API Base\",\n advanced=True,\n info=\"The base URL of the OpenAI API. Defaults to https://api.openai.com/v1. You can change this to use other APIs like JinaChat, LocalAI and Prem.\",\n ),\n SecretStrInput(\n name=\"api_key\",\n display_name=\"OpenAI API Key\",\n info=\"The OpenAI API Key to use for the OpenAI model.\",\n advanced=False,\n value=\"OPENAI_API_KEY\",\n ),\n FloatInput(name=\"temperature\", display_name=\"Temperature\", value=0.1),\n IntInput(\n name=\"seed\",\n display_name=\"Seed\",\n info=\"The seed controls the reproducibility of the job.\",\n advanced=True,\n value=1,\n ),\n ]\n\n def build_model(self) -> LanguageModel: # type: ignore[type-var]\n # self.output_schema is a list of dictionaries\n # let's convert it to a dictionary\n output_schema_dict: dict[str, str] = reduce(operator.ior, self.output_schema or {}, {})\n openai_api_key = self.api_key\n temperature = self.temperature\n model_name: str = self.model_name\n max_tokens = self.max_tokens\n model_kwargs = self.model_kwargs or {}\n openai_api_base = self.openai_api_base or \"https://api.openai.com/v1\"\n json_mode = bool(output_schema_dict) or self.json_mode\n seed = self.seed\n\n if openai_api_key:\n api_key = SecretStr(openai_api_key)\n else:\n api_key = None\n output = ChatOpenAI(\n max_tokens=max_tokens or None,\n model_kwargs=model_kwargs,\n model=model_name,\n base_url=openai_api_base,\n api_key=api_key,\n temperature=temperature if temperature is not None else 0.1,\n seed=seed,\n )\n if json_mode:\n if output_schema_dict:\n output = output.with_structured_output(schema=output_schema_dict, method=\"json_mode\") # type: ignore\n else:\n output = output.bind(response_format={\"type\": \"json_object\"}) # type: ignore\n\n return output # type: ignore\n\n def _get_exception_message(self, e: Exception):\n \"\"\"\n Get a message from an OpenAI exception.\n\n Args:\n exception (Exception): The exception to get the message from.\n\n Returns:\n str: The message from the exception.\n \"\"\"\n\n try:\n from openai import BadRequestError\n except ImportError:\n return\n if isinstance(e, BadRequestError):\n message = e.body.get(\"message\") # type: ignore\n if message:\n return message\n return\n", + "fileTypes": [], + "file_path": "", + "password": false, + "name": "code", + "advanced": true, + "dynamic": true, + "info": "", + "load_from_db": false, + "title_case": false + }, + "input_value": { + "trace_as_input": true, + "trace_as_metadata": true, + "load_from_db": false, + "list": false, + "required": false, + "placeholder": "", + "show": true, + "name": "input_value", + "value": "", + "display_name": "Input", + "advanced": true, + "input_types": [ + "Message" + ], + "dynamic": false, + "info": "", + "title_case": false, + "type": "str", + "_input_type": "MessageInput" + }, + "json_mode": { + "trace_as_metadata": true, + "list": false, + "required": false, + "placeholder": "", + "show": true, + "name": "json_mode", + "value": false, + "display_name": "JSON Mode", + "advanced": true, + "dynamic": false, + "info": "If True, it will output JSON regardless of passing a schema.", + "title_case": false, + "type": "bool", + "_input_type": "BoolInput" + }, + "max_tokens": { + "trace_as_metadata": true, + "range_spec": { + "step_type": "float", + "min": 0, + "max": 128000, + "step": 0.1 + }, + "list": false, + "required": false, + "placeholder": "", + "show": true, + "name": "max_tokens", + "value": "", + "display_name": "Max Tokens", + "advanced": true, + "dynamic": false, + "info": "The maximum number of tokens to generate. Set to 0 for unlimited tokens.", + "title_case": false, + "type": "int", + "_input_type": "IntInput" + }, + "model_kwargs": { + "trace_as_input": true, + "list": false, + "required": false, + "placeholder": "", + "show": true, + "name": "model_kwargs", + "value": {}, + "display_name": "Model Kwargs", + "advanced": true, + "dynamic": false, + "info": "", + "title_case": false, + "type": "dict", + "_input_type": "DictInput" + }, + "model_name": { + "trace_as_metadata": true, + "options": [ + "gpt-4o-mini", + "gpt-4o", + "gpt-4-turbo", + "gpt-4-turbo-preview", + "gpt-4", + "gpt-3.5-turbo", + "gpt-3.5-turbo-0125" + ], + "combobox": false, + "required": false, + "placeholder": "", + "show": true, + "name": "model_name", + "value": "gpt-4o", + "display_name": "Model Name", + "advanced": true, + "dynamic": false, + "info": "", + "title_case": false, + "type": "str", + "_input_type": "DropdownInput" + }, + "openai_api_base": { + "trace_as_metadata": true, + "load_from_db": false, + "list": false, + "required": false, + "placeholder": "", + "show": true, + "name": "openai_api_base", + "value": "", + "display_name": "OpenAI API Base", + "advanced": true, + "dynamic": false, + "info": "The base URL of the OpenAI API. Defaults to https://api.openai.com/v1. You can change this to use other APIs like JinaChat, LocalAI and Prem.", + "title_case": false, + "type": "str", + "_input_type": "StrInput" + }, + "output_schema": { + "trace_as_input": true, + "list": true, + "required": false, + "placeholder": "", + "show": true, + "name": "output_schema", + "value": {}, + "display_name": "Schema", + "advanced": true, + "dynamic": false, + "info": "The schema for the Output of the model. You must pass the word JSON in the prompt. If left blank, JSON mode will be disabled.", + "title_case": false, + "type": "dict", + "_input_type": "DictInput" + }, + "seed": { + "trace_as_metadata": true, + "list": false, + "required": false, + "placeholder": "", + "show": true, + "name": "seed", + "value": 1, + "display_name": "Seed", + "advanced": true, + "dynamic": false, + "info": "The seed controls the reproducibility of the job.", + "title_case": false, + "type": "int", + "_input_type": "IntInput" + }, + "stream": { + "trace_as_metadata": true, + "list": false, + "required": false, + "placeholder": "", + "show": true, + "name": "stream", + "value": false, + "display_name": "Stream", + "advanced": true, + "dynamic": false, + "info": "Stream the response from the model. Streaming works only in Chat.", + "title_case": false, + "type": "bool", + "_input_type": "BoolInput" + }, + "system_message": { + "trace_as_input": true, + "trace_as_metadata": true, + "load_from_db": false, + "list": false, + "required": false, + "placeholder": "", + "show": true, + "name": "system_message", + "value": "", + "display_name": "System Message", + "advanced": true, + "input_types": [ + "Message" + ], + "dynamic": false, + "info": "System message to pass to the model.", + "title_case": false, + "type": "str", + "_input_type": "MessageTextInput" + }, + "temperature": { + "trace_as_metadata": true, + "list": false, + "required": false, + "placeholder": "", + "show": true, + "name": "temperature", + "value": 0.1, + "display_name": "Temperature", + "advanced": true, + "dynamic": false, + "info": "", + "title_case": false, + "type": "float", + "_input_type": "FloatInput" + } + }, + "description": "Generates text using OpenAI LLMs.", + "icon": "OpenAI", + "base_classes": [ + "LanguageModel", + "Message" + ], + "display_name": "OpenAI", + "documentation": "", + "custom_fields": {}, + "output_types": [], + "pinned": false, + "conditional_paths": [], + "frozen": false, + "outputs": [ + { + "types": [ + "Message" + ], + "selected": "Message", + "name": "text_output", + "display_name": "Text", + "method": "text_response", + "value": "__UNDEFINED__", + "cache": true, + "hidden": true + }, + { + "types": [ + "LanguageModel" + ], + "selected": "LanguageModel", + "name": "model_output", + "display_name": "Language Model", + "method": "build_model", + "value": "__UNDEFINED__", + "cache": true + } + ], + "field_order": [ + "input_value", + "system_message", + "stream", + "max_tokens", + "model_kwargs", + "json_mode", + "output_schema", + "model_name", + "openai_api_base", + "api_key", + "temperature", + "seed" + ], + "beta": false, + "edited": false, + "lf_version": "1.0.17" + }, + "id": "OpenAIModel-OTfnt" + }, + "selected": false, + "width": 384, + "height": 302, + "positionAbsolute": { + "x": 3513.5648778762093, + "y": 710.2099422974287 + }, + "dragging": false + }, + { + "id": "AddContentToPage-vrAvx", + "type": "genericNode", + "position": { + "x": 2649.2991466550634, + "y": 1050.6250104897197 + }, + "data": { + "type": "AddContentToPage", + "node": { + "template": { + "_type": "Component", + "block_id": { + "trace_as_metadata": true, + "load_from_db": false, + "list": false, + "required": false, + "placeholder": "", + "show": true, + "name": "block_id", + "value": "", + "display_name": "Page/Block ID", + "advanced": true, + "dynamic": false, + "info": "The ID of the page/block to add the content.", + "title_case": false, + "type": "str", + "_input_type": "StrInput" + }, + "code": { + "type": "code", + "required": true, + "placeholder": "", + "list": false, + "show": true, + "multiline": true, + "value": "import json\nfrom typing import Dict, Any, Union\nfrom markdown import markdown\nfrom bs4 import BeautifulSoup\nimport requests\nfrom langflow.io import Output\nfrom langflow.base.langchain_utilities.model import LCToolComponent\nfrom langflow.inputs import SecretStrInput, StrInput, MultilineInput\nfrom langflow.schema import Data\nfrom langflow.field_typing import Tool\nfrom langchain.tools import StructuredTool\nfrom pydantic import BaseModel, Field\n\n\nclass AddContentToPage(LCToolComponent):\n display_name: str = \"Add Content to Page \"\n description: str = \"Convert markdown text to Notion blocks and append them to a Notion page.\"\n documentation: str = \"https://developers.notion.com/reference/patch-block-children\"\n icon = \"NotionDirectoryLoader\"\n\n inputs = [\n MultilineInput(\n name=\"markdown_text\",\n display_name=\"Markdown Text\",\n info=\"The markdown text to convert to Notion blocks.\",\n ),\n StrInput(\n name=\"block_id\",\n display_name=\"Page/Block ID\",\n info=\"The ID of the page/block to add the content.\",\n ),\n SecretStrInput(\n name=\"notion_secret\",\n display_name=\"Notion Secret\",\n info=\"The Notion integration token.\",\n required=True,\n ),\n ]\n outputs = [\n Output(name=\"example_output\", display_name=\"Data\", method=\"run_model\"),\n Output(name=\"example_tool_output\", display_name=\"Tool\", method=\"build_tool\"),\n ]\n\n class AddContentToPageSchema(BaseModel):\n markdown_text: str = Field(..., description=\"The markdown text to convert to Notion blocks.\")\n block_id: str = Field(..., description=\"The ID of the page/block to add the content.\")\n\n def run_model(self) -> Data:\n result = self._add_content_to_page(self.markdown_text, self.block_id)\n return Data(data=result, text=json.dumps(result))\n\n def build_tool(self) -> Tool:\n return StructuredTool.from_function(\n name=\"add_content_to_notion_page\",\n description=\"Convert markdown text to Notion blocks and append them to a Notion page.\",\n func=self._add_content_to_page,\n args_schema=self.AddContentToPageSchema,\n )\n\n def _add_content_to_page(self, markdown_text: str, block_id: str) -> Union[Dict[str, Any], str]:\n try:\n html_text = markdown(markdown_text)\n soup = BeautifulSoup(html_text, \"html.parser\")\n blocks = self.process_node(soup)\n\n url = f\"https://api.notion.com/v1/blocks/{block_id}/children\"\n headers = {\n \"Authorization\": f\"Bearer {self.notion_secret}\",\n \"Content-Type\": \"application/json\",\n \"Notion-Version\": \"2022-06-28\",\n }\n\n data = {\n \"children\": blocks,\n }\n\n response = requests.patch(url, headers=headers, json=data)\n response.raise_for_status()\n\n return response.json()\n except requests.exceptions.RequestException as e:\n error_message = f\"Error: Failed to add content to Notion page. {str(e)}\"\n if hasattr(e, \"response\") and e.response is not None:\n error_message += f\" Status code: {e.response.status_code}, Response: {e.response.text}\"\n return error_message\n except Exception as e:\n return f\"Error: An unexpected error occurred while adding content to Notion page. {str(e)}\"\n\n def process_node(self, node):\n blocks = []\n if isinstance(node, str):\n text = node.strip()\n if text:\n if text.startswith(\"#\"):\n heading_level = text.count(\"#\", 0, 6)\n heading_text = text[heading_level:].strip()\n if heading_level == 1:\n blocks.append(self.create_block(\"heading_1\", heading_text))\n elif heading_level == 2:\n blocks.append(self.create_block(\"heading_2\", heading_text))\n elif heading_level == 3:\n blocks.append(self.create_block(\"heading_3\", heading_text))\n else:\n blocks.append(self.create_block(\"paragraph\", text))\n elif node.name == \"h1\":\n blocks.append(self.create_block(\"heading_1\", node.get_text(strip=True)))\n elif node.name == \"h2\":\n blocks.append(self.create_block(\"heading_2\", node.get_text(strip=True)))\n elif node.name == \"h3\":\n blocks.append(self.create_block(\"heading_3\", node.get_text(strip=True)))\n elif node.name == \"p\":\n code_node = node.find(\"code\")\n if code_node:\n code_text = code_node.get_text()\n language, code = self.extract_language_and_code(code_text)\n blocks.append(self.create_block(\"code\", code, language=language))\n elif self.is_table(str(node)):\n blocks.extend(self.process_table(node))\n else:\n blocks.append(self.create_block(\"paragraph\", node.get_text(strip=True)))\n elif node.name == \"ul\":\n blocks.extend(self.process_list(node, \"bulleted_list_item\"))\n elif node.name == \"ol\":\n blocks.extend(self.process_list(node, \"numbered_list_item\"))\n elif node.name == \"blockquote\":\n blocks.append(self.create_block(\"quote\", node.get_text(strip=True)))\n elif node.name == \"hr\":\n blocks.append(self.create_block(\"divider\", \"\"))\n elif node.name == \"img\":\n blocks.append(self.create_block(\"image\", \"\", image_url=node.get(\"src\")))\n elif node.name == \"a\":\n blocks.append(self.create_block(\"bookmark\", node.get_text(strip=True), link_url=node.get(\"href\")))\n elif node.name == \"table\":\n blocks.extend(self.process_table(node))\n\n for child in node.children:\n if isinstance(child, str):\n continue\n blocks.extend(self.process_node(child))\n\n return blocks\n\n def extract_language_and_code(self, code_text):\n lines = code_text.split(\"\\n\")\n language = lines[0].strip()\n code = \"\\n\".join(lines[1:]).strip()\n return language, code\n\n def is_code_block(self, text):\n return text.startswith(\"```\")\n\n def extract_code_block(self, text):\n lines = text.split(\"\\n\")\n language = lines[0].strip(\"`\").strip()\n code = \"\\n\".join(lines[1:]).strip(\"`\").strip()\n return language, code\n\n def is_table(self, text):\n rows = text.split(\"\\n\")\n if len(rows) < 2:\n return False\n\n has_separator = False\n for i, row in enumerate(rows):\n if \"|\" in row:\n cells = [cell.strip() for cell in row.split(\"|\")]\n cells = [cell for cell in cells if cell] # Remove empty cells\n if i == 1 and all(set(cell) <= set(\"-|\") for cell in cells):\n has_separator = True\n elif not cells:\n return False\n\n return has_separator and len(rows) >= 3\n\n def process_list(self, node, list_type):\n blocks = []\n for item in node.find_all(\"li\"):\n item_text = item.get_text(strip=True)\n checked = item_text.startswith(\"[x]\")\n is_checklist = item_text.startswith(\"[ ]\") or checked\n\n if is_checklist:\n item_text = item_text.replace(\"[x]\", \"\").replace(\"[ ]\", \"\").strip()\n blocks.append(self.create_block(\"to_do\", item_text, checked=checked))\n else:\n blocks.append(self.create_block(list_type, item_text))\n return blocks\n\n def process_table(self, node):\n blocks = []\n header_row = node.find(\"thead\").find(\"tr\") if node.find(\"thead\") else None\n body_rows = node.find(\"tbody\").find_all(\"tr\") if node.find(\"tbody\") else []\n\n if header_row or body_rows:\n table_width = max(\n len(header_row.find_all([\"th\", \"td\"])) if header_row else 0,\n max(len(row.find_all([\"th\", \"td\"])) for row in body_rows),\n )\n\n table_block = self.create_block(\"table\", \"\", table_width=table_width, has_column_header=bool(header_row))\n blocks.append(table_block)\n\n if header_row:\n header_cells = [cell.get_text(strip=True) for cell in header_row.find_all([\"th\", \"td\"])]\n header_row_block = self.create_block(\"table_row\", header_cells)\n blocks.append(header_row_block)\n\n for row in body_rows:\n cells = [cell.get_text(strip=True) for cell in row.find_all([\"th\", \"td\"])]\n row_block = self.create_block(\"table_row\", cells)\n blocks.append(row_block)\n\n return blocks\n\n def create_block(self, block_type: str, content: str, **kwargs) -> Dict[str, Any]:\n block: dict[str, Any] = {\n \"object\": \"block\",\n \"type\": block_type,\n block_type: {},\n }\n\n if block_type in [\n \"paragraph\",\n \"heading_1\",\n \"heading_2\",\n \"heading_3\",\n \"bulleted_list_item\",\n \"numbered_list_item\",\n \"quote\",\n ]:\n block[block_type][\"rich_text\"] = [\n {\n \"type\": \"text\",\n \"text\": {\n \"content\": content,\n },\n }\n ]\n elif block_type == \"to_do\":\n block[block_type][\"rich_text\"] = [\n {\n \"type\": \"text\",\n \"text\": {\n \"content\": content,\n },\n }\n ]\n block[block_type][\"checked\"] = kwargs.get(\"checked\", False)\n elif block_type == \"code\":\n block[block_type][\"rich_text\"] = [\n {\n \"type\": \"text\",\n \"text\": {\n \"content\": content,\n },\n }\n ]\n block[block_type][\"language\"] = kwargs.get(\"language\", \"plain text\")\n elif block_type == \"image\":\n block[block_type] = {\"type\": \"external\", \"external\": {\"url\": kwargs.get(\"image_url\", \"\")}}\n elif block_type == \"divider\":\n pass\n elif block_type == \"bookmark\":\n block[block_type][\"url\"] = kwargs.get(\"link_url\", \"\")\n elif block_type == \"table\":\n block[block_type][\"table_width\"] = kwargs.get(\"table_width\", 0)\n block[block_type][\"has_column_header\"] = kwargs.get(\"has_column_header\", False)\n block[block_type][\"has_row_header\"] = kwargs.get(\"has_row_header\", False)\n elif block_type == \"table_row\":\n block[block_type][\"cells\"] = [[{\"type\": \"text\", \"text\": {\"content\": cell}} for cell in content]]\n\n return block\n", + "fileTypes": [], + "file_path": "", + "password": false, + "name": "code", + "advanced": true, + "dynamic": true, + "info": "", + "load_from_db": false, + "title_case": false + }, + "markdown_text": { + "trace_as_input": true, + "multiline": true, + "trace_as_metadata": true, + "load_from_db": false, + "list": false, + "required": false, + "placeholder": "", + "show": true, + "name": "markdown_text", + "value": "", + "display_name": "Markdown Text", + "advanced": true, + "input_types": [ + "Message" + ], + "dynamic": false, + "info": "The markdown text to convert to Notion blocks.", + "title_case": false, + "type": "str", + "_input_type": "MultilineInput" + }, + "notion_secret": { + "load_from_db": false, + "required": true, + "placeholder": "", + "show": true, + "name": "notion_secret", + "value": "", + "display_name": "Notion Secret", + "advanced": false, + "input_types": [ + "Message" + ], + "dynamic": false, + "info": "The Notion integration token.", + "title_case": false, + "password": true, + "type": "str", + "_input_type": "SecretStrInput" + } + }, + "description": "Convert markdown text to Notion blocks and append them to a Notion page.", + "icon": "NotionDirectoryLoader", + "base_classes": [ + "Data", + "Tool" + ], + "display_name": "Add Content to Page ", + "documentation": "https://developers.notion.com/reference/patch-block-children", + "custom_fields": {}, + "output_types": [], + "pinned": false, + "conditional_paths": [], + "frozen": false, + "outputs": [ + { + "types": [ + "Data" + ], + "selected": "Data", + "name": "example_output", + "display_name": "Data", + "method": "run_model", + "value": "__UNDEFINED__", + "cache": true, + "hidden": true + }, + { + "types": [ + "Tool" + ], + "selected": "Tool", + "name": "example_tool_output", + "display_name": "Tool", + "method": "build_tool", + "value": "__UNDEFINED__", + "cache": true + } + ], + "field_order": [ + "markdown_text", + "block_id", + "notion_secret" + ], + "beta": false, + "edited": true, + "lf_version": "1.0.17" + }, + "id": "AddContentToPage-vrAvx", + "description": "Convert markdown text to Notion blocks and append them to a Notion page.", + "display_name": "Add Content to Page " + }, + "selected": false, + "width": 384, + "height": 330, + "positionAbsolute": { + "x": 2649.2991466550634, + "y": 1050.6250104897197 + }, + "dragging": false + }, + { + "id": "NotionPageCreator-Exc7f", + "type": "genericNode", + "position": { + "x": 3050.8201437255634, + "y": 1391.0449862668834 + }, + "data": { + "type": "NotionPageCreator", + "node": { + "template": { + "_type": "Component", + "code": { + "type": "code", + "required": true, + "placeholder": "", + "list": false, + "show": true, + "multiline": true, + "value": "import json\nfrom typing import Dict, Any, Union\nimport requests\nfrom pydantic import BaseModel, Field\nfrom langflow.base.langchain_utilities.model import LCToolComponent\nfrom langflow.inputs import SecretStrInput, StrInput, MultilineInput\nfrom langflow.schema import Data\nfrom langflow.field_typing import Tool\nfrom langchain.tools import StructuredTool\nfrom langflow.io import Output\n\nclass NotionPageCreator(LCToolComponent):\n display_name: str = \"Create Page \"\n description: str = \"A component for creating Notion pages.\"\n documentation: str = \"https://docs.langflow.org/integrations/notion/page-create\"\n icon = \"NotionDirectoryLoader\"\n\n inputs = [\n StrInput(\n name=\"database_id\",\n display_name=\"Database ID\",\n info=\"The ID of the Notion database.\",\n ),\n SecretStrInput(\n name=\"notion_secret\",\n display_name=\"Notion Secret\",\n info=\"The Notion integration token.\",\n required=True,\n ),\n MultilineInput(\n name=\"properties_json\",\n display_name=\"Properties (JSON)\",\n info=\"The properties of the new page as a JSON string.\",\n ),\n ]\n outputs = [\n Output(name=\"example_output\", display_name=\"Data\", method=\"run_model\"),\n Output(name=\"example_tool_output\", display_name=\"Tool\", method=\"build_tool\"),\n ]\n\n class NotionPageCreatorSchema(BaseModel):\n database_id: str = Field(..., description=\"The ID of the Notion database.\")\n properties_json: str = Field(..., description=\"The properties of the new page as a JSON string.\")\n\n def run_model(self) -> Data:\n result = self._create_notion_page(self.database_id, self.properties_json)\n if isinstance(result, str):\n # An error occurred, return it as text\n return Data(text=result)\n else:\n # Success, return the created page data\n output = \"Created page properties:\\n\"\n for prop_name, prop_value in result.get(\"properties\", {}).items():\n output += f\"{prop_name}: {prop_value}\\n\"\n return Data(text=output, data=result)\n\n def build_tool(self) -> Tool:\n return StructuredTool.from_function(\n name=\"create_notion_page\",\n description=\"Create a new page in a Notion database. IMPORTANT: Use the tool to check the Database properties for more details before using this tool.\",\n func=self._create_notion_page,\n args_schema=self.NotionPageCreatorSchema,\n )\n\n def _create_notion_page(self, database_id: str, properties_json: str) -> Union[Dict[str, Any], str]:\n if not database_id or not properties_json:\n return \"Invalid input. Please provide 'database_id' and 'properties_json'.\"\n\n try:\n properties = json.loads(properties_json)\n except json.JSONDecodeError as e:\n return f\"Invalid properties format. Please provide a valid JSON string. Error: {str(e)}\"\n\n headers = {\n \"Authorization\": f\"Bearer {self.notion_secret}\",\n \"Content-Type\": \"application/json\",\n \"Notion-Version\": \"2022-06-28\",\n }\n\n data = {\n \"parent\": {\"database_id\": database_id},\n \"properties\": properties,\n }\n\n try:\n response = requests.post(\"https://api.notion.com/v1/pages\", headers=headers, json=data)\n response.raise_for_status()\n result = response.json()\n return result\n except requests.exceptions.RequestException as e:\n error_message = f\"Failed to create Notion page. Error: {str(e)}\"\n if hasattr(e, \"response\") and e.response is not None:\n error_message += f\" Status code: {e.response.status_code}, Response: {e.response.text}\"\n return error_message\n\n def __call__(self, *args, **kwargs):\n return self._create_notion_page(*args, **kwargs)\n", + "fileTypes": [], + "file_path": "", + "password": false, + "name": "code", + "advanced": true, + "dynamic": true, + "info": "", + "load_from_db": false, + "title_case": false + }, + "database_id": { + "trace_as_metadata": true, + "load_from_db": false, + "list": false, + "required": false, + "placeholder": "", + "show": true, + "name": "database_id", + "value": "", + "display_name": "Database ID", + "advanced": true, + "dynamic": false, + "info": "The ID of the Notion database.", + "title_case": false, + "type": "str", + "_input_type": "StrInput" + }, + "notion_secret": { + "load_from_db": false, + "required": true, + "placeholder": "", + "show": true, + "name": "notion_secret", + "value": "", + "display_name": "Notion Secret", + "advanced": false, + "input_types": [ + "Message" + ], + "dynamic": false, + "info": "The Notion integration token.", + "title_case": false, + "password": true, + "type": "str", + "_input_type": "SecretStrInput" + }, + "properties_json": { + "trace_as_input": true, + "multiline": true, + "trace_as_metadata": true, + "load_from_db": false, + "list": false, + "required": false, + "placeholder": "", + "show": true, + "name": "properties_json", + "value": "", + "display_name": "Properties (JSON)", + "advanced": true, + "input_types": [ + "Message" + ], + "dynamic": false, + "info": "The properties of the new page as a JSON string.", + "title_case": false, + "type": "str", + "_input_type": "MultilineInput" + } + }, + "description": "A component for creating Notion pages.", + "icon": "NotionDirectoryLoader", + "base_classes": [ + "Data", + "Tool" + ], + "display_name": "Create Page ", + "documentation": "https://docs.langflow.org/integrations/notion/page-create", + "custom_fields": {}, + "output_types": [], + "pinned": false, + "conditional_paths": [], + "frozen": false, + "outputs": [ + { + "types": [ + "Data" + ], + "selected": "Data", + "name": "example_output", + "display_name": "Data", + "method": "run_model", + "value": "__UNDEFINED__", + "cache": true, + "hidden": true + }, + { + "types": [ + "Tool" + ], + "selected": "Tool", + "name": "example_tool_output", + "display_name": "Tool", + "method": "build_tool", + "value": "__UNDEFINED__", + "cache": true + } + ], + "field_order": [ + "database_id", + "notion_secret", + "properties_json" + ], + "beta": false, + "edited": true, + "lf_version": "1.0.17" + }, + "id": "NotionPageCreator-Exc7f", + "description": "A component for creating Notion pages.", + "display_name": "Create Page " + }, + "selected": false, + "width": 384, + "height": 302, + "positionAbsolute": { + "x": 3050.8201437255634, + "y": 1391.0449862668834 + }, + "dragging": false + }, + { + "id": "NotionDatabaseProperties-IjzLV", + "type": "genericNode", + "position": { + "x": 3053.0023230574693, + "y": 1061.535907149244 + }, + "data": { + "type": "NotionDatabaseProperties", + "node": { + "template": { + "_type": "Component", + "code": { + "type": "code", + "required": true, + "placeholder": "", + "list": false, + "show": true, + "multiline": true, + "value": "import requests\nfrom typing import Dict, Union\nfrom pydantic import BaseModel, Field\nfrom langflow.base.langchain_utilities.model import LCToolComponent\nfrom langflow.inputs import SecretStrInput, StrInput\nfrom langflow.schema import Data\nfrom langflow.field_typing import Tool\nfrom langchain.tools import StructuredTool\nfrom langflow.io import Output\n\nclass NotionDatabaseProperties(LCToolComponent):\n display_name: str = \"List Database Properties \"\n description: str = \"Retrieve properties of a Notion database.\"\n documentation: str = \"https://docs.langflow.org/integrations/notion/list-database-properties\"\n icon = \"NotionDirectoryLoader\"\n\n inputs = [\n StrInput(\n name=\"database_id\",\n display_name=\"Database ID\",\n info=\"The ID of the Notion database.\",\n ),\n SecretStrInput(\n name=\"notion_secret\",\n display_name=\"Notion Secret\",\n info=\"The Notion integration token.\",\n required=True,\n ),\n ]\n outputs = [\n Output(name=\"example_output\", display_name=\"Data\", method=\"run_model\"),\n Output(name=\"example_tool_output\", display_name=\"Tool\", method=\"build_tool\"),\n ]\n\n class NotionDatabasePropertiesSchema(BaseModel):\n database_id: str = Field(..., description=\"The ID of the Notion database.\")\n\n def run_model(self) -> Data:\n result = self._fetch_database_properties(self.database_id)\n if isinstance(result, str):\n # An error occurred, return it as text\n return Data(text=result)\n else:\n # Success, return the properties\n return Data(text=str(result), data=result)\n\n def build_tool(self) -> Tool:\n return StructuredTool.from_function(\n name=\"notion_database_properties\",\n description=\"Retrieve properties of a Notion database. Input should include the database ID.\",\n func=self._fetch_database_properties,\n args_schema=self.NotionDatabasePropertiesSchema,\n )\n\n def _fetch_database_properties(self, database_id: str) -> Union[Dict, str]:\n url = f\"https://api.notion.com/v1/databases/{database_id}\"\n headers = {\n \"Authorization\": f\"Bearer {self.notion_secret}\",\n \"Notion-Version\": \"2022-06-28\", # Use the latest supported version\n }\n try:\n response = requests.get(url, headers=headers)\n response.raise_for_status()\n data = response.json()\n properties = data.get(\"properties\", {})\n return properties\n except requests.exceptions.RequestException as e:\n return f\"Error fetching Notion database properties: {str(e)}\"\n except ValueError as e:\n return f\"Error parsing Notion API response: {str(e)}\"\n except Exception as e:\n return f\"An unexpected error occurred: {str(e)}\"\n", + "fileTypes": [], + "file_path": "", + "password": false, + "name": "code", + "advanced": true, + "dynamic": true, + "info": "", + "load_from_db": false, + "title_case": false + }, + "database_id": { + "trace_as_metadata": true, + "load_from_db": false, + "list": false, + "required": false, + "placeholder": "", + "show": true, + "name": "database_id", + "value": "", + "display_name": "Database ID", + "advanced": true, + "dynamic": false, + "info": "The ID of the Notion database.", + "title_case": false, + "type": "str", + "_input_type": "StrInput" + }, + "notion_secret": { + "load_from_db": false, + "required": true, + "placeholder": "", + "show": true, + "name": "notion_secret", + "value": "", + "display_name": "Notion Secret", + "advanced": false, + "input_types": [ + "Message" + ], + "dynamic": false, + "info": "The Notion integration token.", + "title_case": false, + "password": true, + "type": "str", + "_input_type": "SecretStrInput" + } + }, + "description": "Retrieve properties of a Notion database.", + "icon": "NotionDirectoryLoader", + "base_classes": [ + "Data", + "Tool" + ], + "display_name": "List Database Properties ", + "documentation": "https://docs.langflow.org/integrations/notion/list-database-properties", + "custom_fields": {}, + "output_types": [], + "pinned": false, + "conditional_paths": [], + "frozen": false, + "outputs": [ + { + "types": [ + "Data" + ], + "selected": "Data", + "name": "example_output", + "display_name": "Data", + "method": "run_model", + "value": "__UNDEFINED__", + "cache": true, + "hidden": true + }, + { + "types": [ + "Tool" + ], + "selected": "Tool", + "name": "example_tool_output", + "display_name": "Tool", + "method": "build_tool", + "value": "__UNDEFINED__", + "cache": true + } + ], + "field_order": [ + "database_id", + "notion_secret" + ], + "beta": false, + "edited": true, + "lf_version": "1.0.17" + }, + "id": "NotionDatabaseProperties-IjzLV", + "description": "Retrieve properties of a Notion database.", + "display_name": "List Database Properties " + }, + "selected": false, + "width": 384, + "height": 302, + "positionAbsolute": { + "x": 3053.0023230574693, + "y": 1061.535907149244 + }, + "dragging": false + }, + { + "id": "NotionPageUpdate-bexvy", + "type": "genericNode", + "position": { + "x": 2649.2991466550625, + "y": 1385.262204377853 + }, + "data": { + "type": "NotionPageUpdate", + "node": { + "template": { + "_type": "Component", + "code": { + "type": "code", + "required": true, + "placeholder": "", + "list": false, + "show": true, + "multiline": true, + "value": "import json\nimport requests\nfrom typing import Dict, Any, Union\nfrom pydantic import BaseModel, Field\nfrom langflow.base.langchain_utilities.model import LCToolComponent\nfrom langflow.inputs import SecretStrInput, StrInput, MultilineInput\nfrom langflow.schema import Data\nfrom langflow.field_typing import Tool\nfrom langchain.tools import StructuredTool\nfrom loguru import logger\nfrom langflow.io import Output\n\nclass NotionPageUpdate(LCToolComponent):\n display_name: str = \"Update Page Property \"\n description: str = \"Update the properties of a Notion page.\"\n documentation: str = \"https://docs.langflow.org/integrations/notion/page-update\"\n icon = \"NotionDirectoryLoader\"\n\n inputs = [\n StrInput(\n name=\"page_id\",\n display_name=\"Page ID\",\n info=\"The ID of the Notion page to update.\",\n ),\n MultilineInput(\n name=\"properties\",\n display_name=\"Properties\",\n info=\"The properties to update on the page (as a JSON string or a dictionary).\",\n ),\n SecretStrInput(\n name=\"notion_secret\",\n display_name=\"Notion Secret\",\n info=\"The Notion integration token.\",\n required=True,\n ),\n ]\n outputs = [\n Output(name=\"example_output\", display_name=\"Data\", method=\"run_model\"),\n Output(name=\"example_tool_output\", display_name=\"Tool\", method=\"build_tool\"),\n ]\n\n class NotionPageUpdateSchema(BaseModel):\n page_id: str = Field(..., description=\"The ID of the Notion page to update.\")\n properties: Union[str, Dict[str, Any]] = Field(\n ..., description=\"The properties to update on the page (as a JSON string or a dictionary).\"\n )\n\n def run_model(self) -> Data:\n result = self._update_notion_page(self.page_id, self.properties)\n if isinstance(result, str):\n # An error occurred, return it as text\n return Data(text=result)\n else:\n # Success, return the updated page data\n output = \"Updated page properties:\\n\"\n for prop_name, prop_value in result.get(\"properties\", {}).items():\n output += f\"{prop_name}: {prop_value}\\n\"\n return Data(text=output, data=result)\n\n def build_tool(self) -> Tool:\n return StructuredTool.from_function(\n name=\"update_notion_page\",\n description=\"Update the properties of a Notion page. IMPORTANT: Use the tool to check the Database properties for more details before using this tool.\",\n func=self._update_notion_page,\n args_schema=self.NotionPageUpdateSchema,\n )\n\n def _update_notion_page(self, page_id: str, properties: Union[str, Dict[str, Any]]) -> Union[Dict[str, Any], str]:\n url = f\"https://api.notion.com/v1/pages/{page_id}\"\n headers = {\n \"Authorization\": f\"Bearer {self.notion_secret}\",\n \"Content-Type\": \"application/json\",\n \"Notion-Version\": \"2022-06-28\", # Use the latest supported version\n }\n\n # Parse properties if it's a string\n if isinstance(properties, str):\n try:\n parsed_properties = json.loads(properties)\n except json.JSONDecodeError as e:\n error_message = f\"Invalid JSON format for properties: {str(e)}\"\n logger.error(error_message)\n return error_message\n\n else:\n parsed_properties = properties\n\n data = {\"properties\": parsed_properties}\n\n try:\n logger.info(f\"Sending request to Notion API: URL: {url}, Data: {json.dumps(data)}\")\n response = requests.patch(url, headers=headers, json=data)\n response.raise_for_status()\n updated_page = response.json()\n\n logger.info(f\"Successfully updated Notion page. Response: {json.dumps(updated_page)}\")\n return updated_page\n except requests.exceptions.HTTPError as e:\n error_message = f\"HTTP Error occurred: {str(e)}\"\n if e.response is not None:\n error_message += f\"\\nStatus code: {e.response.status_code}\"\n error_message += f\"\\nResponse body: {e.response.text}\"\n logger.error(error_message)\n return error_message\n except requests.exceptions.RequestException as e:\n error_message = f\"An error occurred while making the request: {str(e)}\"\n logger.error(error_message)\n return error_message\n except Exception as e:\n error_message = f\"An unexpected error occurred: {str(e)}\"\n logger.error(error_message)\n return error_message\n\n def __call__(self, *args, **kwargs):\n return self._update_notion_page(*args, **kwargs)\n", + "fileTypes": [], + "file_path": "", + "password": false, + "name": "code", + "advanced": true, + "dynamic": true, + "info": "", + "load_from_db": false, + "title_case": false + }, + "notion_secret": { + "load_from_db": false, + "required": true, + "placeholder": "", + "show": true, + "name": "notion_secret", + "value": "", + "display_name": "Notion Secret", + "advanced": false, + "input_types": [ + "Message" + ], + "dynamic": false, + "info": "The Notion integration token.", + "title_case": false, + "password": true, + "type": "str", + "_input_type": "SecretStrInput" + }, + "page_id": { + "trace_as_metadata": true, + "load_from_db": false, + "list": false, + "required": false, + "placeholder": "", + "show": true, + "name": "page_id", + "value": "", + "display_name": "Page ID", + "advanced": true, + "dynamic": false, + "info": "The ID of the Notion page to update.", + "title_case": false, + "type": "str", + "_input_type": "StrInput" + }, + "properties": { + "trace_as_input": true, + "multiline": true, + "trace_as_metadata": true, + "load_from_db": false, + "list": false, + "required": false, + "placeholder": "", + "show": true, + "name": "properties", + "value": "", + "display_name": "Properties", + "advanced": true, + "input_types": [ + "Message" + ], + "dynamic": false, + "info": "The properties to update on the page (as a JSON string or a dictionary).", + "title_case": false, + "type": "str", + "_input_type": "MultilineInput" + } + }, + "description": "Update the properties of a Notion page.", + "icon": "NotionDirectoryLoader", + "base_classes": [ + "Data", + "Tool" + ], + "display_name": "Update Page Property ", + "documentation": "https://docs.langflow.org/integrations/notion/page-update", + "custom_fields": {}, + "output_types": [], + "pinned": false, + "conditional_paths": [], + "frozen": false, + "outputs": [ + { + "types": [ + "Data" + ], + "selected": "Data", + "name": "example_output", + "display_name": "Data", + "method": "run_model", + "value": "__UNDEFINED__", + "cache": true, + "hidden": true + }, + { + "types": [ + "Tool" + ], + "selected": "Tool", + "name": "example_tool_output", + "display_name": "Tool", + "method": "build_tool", + "value": "__UNDEFINED__", + "cache": true + } + ], + "field_order": [ + "page_id", + "properties", + "notion_secret" + ], + "beta": false, + "edited": true, + "lf_version": "1.0.17" + }, + "id": "NotionPageUpdate-bexvy", + "description": "Update the properties of a Notion page.", + "display_name": "Update Page Property " + }, + "selected": false, + "width": 384, + "height": 302, + "positionAbsolute": { + "x": 2649.2991466550625, + "y": 1385.262204377853 + }, + "dragging": false + }, + { + "id": "NotionSearch-EdSJb", + "type": "genericNode", + "position": { + "x": 2435.4455721283834, + "y": 357.45573905064634 + }, + "data": { + "type": "NotionSearch", + "node": { + "template": { + "_type": "Component", + "code": { + "type": "code", + "required": true, + "placeholder": "", + "list": false, + "show": true, + "multiline": true, + "value": "import requests\nfrom typing import Dict, Any, List\nfrom pydantic import BaseModel, Field\nfrom langflow.io import Output\nfrom langflow.base.langchain_utilities.model import LCToolComponent\nfrom langflow.inputs import SecretStrInput, StrInput, DropdownInput\nfrom langflow.schema import Data\nfrom langflow.field_typing import Tool\nfrom langchain.tools import StructuredTool\n\n\nclass NotionSearch(LCToolComponent):\n display_name: str = \"Search \"\n description: str = \"Searches all pages and databases that have been shared with an integration. The search field can be an empty value to show all values from that search\"\n documentation: str = \"https://docs.langflow.org/integrations/notion/search\"\n icon = \"NotionDirectoryLoader\"\n\n inputs = [\n SecretStrInput(\n name=\"notion_secret\",\n display_name=\"Notion Secret\",\n info=\"The Notion integration token.\",\n required=True,\n ),\n StrInput(\n name=\"query\",\n display_name=\"Search Query\",\n info=\"The text that the API compares page and database titles against.\",\n ),\n DropdownInput(\n name=\"filter_value\",\n display_name=\"Filter Type\",\n info=\"Limits the results to either only pages or only databases.\",\n options=[\"page\", \"database\"],\n value=\"page\",\n ),\n DropdownInput(\n name=\"sort_direction\",\n display_name=\"Sort Direction\",\n info=\"The direction to sort the results.\",\n options=[\"ascending\", \"descending\"],\n value=\"descending\",\n ),\n ]\n outputs = [\n Output(name=\"example_output\", display_name=\"Data\", method=\"run_model\"),\n Output(name=\"example_tool_output\", display_name=\"Tool\", method=\"build_tool\"),\n ]\n\n class NotionSearchSchema(BaseModel):\n query: str = Field(..., description=\"The search query text.\")\n filter_value: str = Field(default=\"page\", description=\"Filter type: 'page' or 'database'.\")\n sort_direction: str = Field(default=\"descending\", description=\"Sort direction: 'ascending' or 'descending'.\")\n\n def run_model(self) -> List[Data]:\n results = self._search_notion(self.query, self.filter_value, self.sort_direction)\n records = []\n combined_text = f\"Results found: {len(results)}\\n\\n\"\n\n for result in results:\n result_data = {\n \"id\": result[\"id\"],\n \"type\": result[\"object\"],\n \"last_edited_time\": result[\"last_edited_time\"],\n }\n\n if result[\"object\"] == \"page\":\n result_data[\"title_or_url\"] = result[\"url\"]\n text = f\"id: {result['id']}\\ntitle_or_url: {result['url']}\\n\"\n elif result[\"object\"] == \"database\":\n if \"title\" in result and isinstance(result[\"title\"], list) and len(result[\"title\"]) > 0:\n result_data[\"title_or_url\"] = result[\"title\"][0][\"plain_text\"]\n text = f\"id: {result['id']}\\ntitle_or_url: {result['title'][0]['plain_text']}\\n\"\n else:\n result_data[\"title_or_url\"] = \"N/A\"\n text = f\"id: {result['id']}\\ntitle_or_url: N/A\\n\"\n\n text += f\"type: {result['object']}\\nlast_edited_time: {result['last_edited_time']}\\n\\n\"\n combined_text += text\n records.append(Data(text=text, data=result_data))\n\n self.status = records\n return records\n\n def build_tool(self) -> Tool:\n return StructuredTool.from_function(\n name=\"notion_search\",\n description=\"Search Notion pages and databases. Input should include the search query and optionally filter type and sort direction.\",\n func=self._search_notion,\n args_schema=self.NotionSearchSchema,\n )\n\n def _search_notion(\n self, query: str, filter_value: str = \"page\", sort_direction: str = \"descending\"\n ) -> List[Dict[str, Any]]:\n url = \"https://api.notion.com/v1/search\"\n headers = {\n \"Authorization\": f\"Bearer {self.notion_secret}\",\n \"Content-Type\": \"application/json\",\n \"Notion-Version\": \"2022-06-28\",\n }\n\n data = {\n \"query\": query,\n \"filter\": {\"value\": filter_value, \"property\": \"object\"},\n \"sort\": {\"direction\": sort_direction, \"timestamp\": \"last_edited_time\"},\n }\n\n response = requests.post(url, headers=headers, json=data)\n response.raise_for_status()\n\n results = response.json()\n return results[\"results\"]\n", + "fileTypes": [], + "file_path": "", + "password": false, + "name": "code", + "advanced": true, + "dynamic": true, + "info": "", + "load_from_db": false, + "title_case": false + }, + "filter_value": { + "trace_as_metadata": true, + "options": [ + "page", + "database" + ], + "combobox": false, + "required": false, + "placeholder": "", + "show": true, + "name": "filter_value", + "value": "database", + "display_name": "Filter Type", + "advanced": true, + "dynamic": false, + "info": "Limits the results to either only pages or only databases.", + "title_case": false, + "type": "str", + "_input_type": "DropdownInput" + }, + "notion_secret": { + "load_from_db": false, + "required": true, + "placeholder": "", + "show": true, + "name": "notion_secret", + "value": "", + "display_name": "Notion Secret", + "advanced": false, + "input_types": [ + "Message" + ], + "dynamic": false, + "info": "The Notion integration token.", + "title_case": false, + "password": true, + "type": "str", + "_input_type": "SecretStrInput" + }, + "query": { + "trace_as_metadata": true, + "load_from_db": false, + "list": false, + "required": false, + "placeholder": "", + "show": true, + "name": "query", + "value": "", + "display_name": "Search Query", + "advanced": true, + "dynamic": false, + "info": "The text that the API compares page and database titles against.", + "title_case": false, + "type": "str", + "_input_type": "StrInput" + }, + "sort_direction": { + "trace_as_metadata": true, + "options": [ + "ascending", + "descending" + ], + "combobox": false, + "required": false, + "placeholder": "", + "show": true, + "name": "sort_direction", + "value": "descending", + "display_name": "Sort Direction", + "advanced": true, + "dynamic": false, + "info": "The direction to sort the results.", + "title_case": false, + "type": "str", + "_input_type": "DropdownInput" + } + }, + "description": "List All Databases", + "icon": "NotionDirectoryLoader", + "base_classes": [ + "Data", + "Tool" + ], + "display_name": "List Databases", + "documentation": "https://docs.langflow.org/integrations/notion/search", + "custom_fields": {}, + "output_types": [], + "pinned": false, + "conditional_paths": [], + "frozen": false, + "outputs": [ + { + "types": [ + "Data" + ], + "selected": "Data", + "name": "example_output", + "display_name": "Data", + "method": "run_model", + "value": "__UNDEFINED__", + "cache": true, + "hidden": false + }, + { + "types": [ + "Tool" + ], + "selected": "Tool", + "name": "example_tool_output", + "display_name": "Tool", + "method": "build_tool", + "value": "__UNDEFINED__", + "cache": true, + "hidden": true + } + ], + "field_order": [ + "notion_secret", + "query", + "filter_value", + "sort_direction" + ], + "beta": false, + "edited": true, + "lf_version": "1.0.17" + }, + "id": "NotionSearch-EdSJb", + "description": "Searches all pages and databases that have been shared with an integration.", + "display_name": "Search " + }, + "selected": false, + "width": 384, + "height": 302, + "positionAbsolute": { + "x": 2435.4455721283834, + "y": 357.45573905064634 + }, + "dragging": false + }, + { + "id": "ParseData-vYVwu", + "type": "genericNode", + "position": { + "x": 2871.5903532688335, + "y": 563.1965154816405 + }, + "data": { + "type": "ParseData", + "node": { + "template": { + "_type": "Component", + "data": { + "trace_as_metadata": true, + "list": false, + "trace_as_input": true, + "required": false, + "placeholder": "", + "show": true, + "name": "data", + "value": "", + "display_name": "Data", + "advanced": false, + "input_types": [ + "Data" + ], + "dynamic": false, + "info": "The data to convert to text.", + "title_case": false, + "type": "other", + "_input_type": "DataInput" + }, + "code": { + "type": "code", + "required": true, + "placeholder": "", + "list": false, + "show": true, + "multiline": true, + "value": "from langflow.custom import Component\nfrom langflow.helpers.data import data_to_text\nfrom langflow.io import DataInput, MultilineInput, Output, StrInput\nfrom langflow.schema.message import Message\n\n\nclass ParseDataComponent(Component):\n display_name = \"Parse Data\"\n description = \"Convert Data into plain text following a specified template.\"\n icon = \"braces\"\n name = \"ParseData\"\n\n inputs = [\n DataInput(name=\"data\", display_name=\"Data\", info=\"The data to convert to text.\"),\n MultilineInput(\n name=\"template\",\n display_name=\"Template\",\n info=\"The template to use for formatting the data. It can contain the keys {text}, {data} or any other key in the Data.\",\n value=\"{text}\",\n ),\n StrInput(name=\"sep\", display_name=\"Separator\", advanced=True, value=\"\\n\"),\n ]\n\n outputs = [\n Output(display_name=\"Text\", name=\"text\", method=\"parse_data\"),\n ]\n\n def parse_data(self) -> Message:\n data = self.data if isinstance(self.data, list) else [self.data]\n template = self.template\n\n result_string = data_to_text(template, data, sep=self.sep)\n self.status = result_string\n return Message(text=result_string)\n", + "fileTypes": [], + "file_path": "", + "password": false, + "name": "code", + "advanced": true, + "dynamic": true, + "info": "", + "load_from_db": false, + "title_case": false + }, + "sep": { + "trace_as_metadata": true, + "load_from_db": false, + "list": false, + "required": false, + "placeholder": "", + "show": true, + "name": "sep", + "value": "\n", + "display_name": "Separator", + "advanced": true, + "dynamic": false, + "info": "", + "title_case": false, + "type": "str", + "_input_type": "StrInput" + }, + "template": { + "trace_as_input": true, + "multiline": true, + "trace_as_metadata": true, + "load_from_db": false, + "list": false, + "required": false, + "placeholder": "", + "show": true, + "name": "template", + "value": "{text}", + "display_name": "Template", + "advanced": true, + "input_types": [ + "Message" + ], + "dynamic": false, + "info": "The template to use for formatting the data. It can contain the keys {text}, {data} or any other key in the Data.", + "title_case": false, + "type": "str", + "_input_type": "MultilineInput" + } + }, + "description": "Convert Data into plain text following a specified template.", + "icon": "braces", + "base_classes": [ + "Message" + ], + "display_name": "Parse Data", + "documentation": "", + "custom_fields": {}, + "output_types": [], + "pinned": false, + "conditional_paths": [], + "frozen": false, + "outputs": [ + { + "types": [ + "Message" + ], + "selected": "Message", + "name": "text", + "display_name": "Text", + "method": "parse_data", + "value": "__UNDEFINED__", + "cache": true + } + ], + "field_order": [ + "data", + "template", + "sep" + ], + "beta": false, + "edited": false, + "lf_version": "1.0.17" + }, + "id": "ParseData-vYVwu", + "showNode": false + }, + "selected": false, + "width": 96, + "height": 96, + "positionAbsolute": { + "x": 2871.5903532688335, + "y": 563.1965154816405 + }, + "dragging": false + }, + { + "id": "ChatOutput-zBv53", + "type": "genericNode", + "position": { + "x": 4429.812566227955, + "y": 940.6072472757681 + }, + "data": { + "type": "ChatOutput", + "node": { + "template": { + "_type": "Component", + "code": { + "type": "code", + "required": true, + "placeholder": "", + "list": false, + "show": true, + "multiline": true, + "value": "from langflow.base.io.chat import ChatComponent\nfrom langflow.inputs import BoolInput\nfrom langflow.io import DropdownInput, MessageTextInput, Output\nfrom langflow.memory import store_message\nfrom langflow.schema.message import Message\nfrom langflow.utils.constants import MESSAGE_SENDER_AI, MESSAGE_SENDER_NAME_AI, MESSAGE_SENDER_USER\n\n\nclass ChatOutput(ChatComponent):\n display_name = \"Chat Output\"\n description = \"Display a chat message in the Playground.\"\n icon = \"ChatOutput\"\n name = \"ChatOutput\"\n\n inputs = [\n MessageTextInput(\n name=\"input_value\",\n display_name=\"Text\",\n info=\"Message to be passed as output.\",\n ),\n BoolInput(\n name=\"should_store_message\",\n display_name=\"Store Messages\",\n info=\"Store the message in the history.\",\n value=True,\n advanced=True,\n ),\n DropdownInput(\n name=\"sender\",\n display_name=\"Sender Type\",\n options=[MESSAGE_SENDER_AI, MESSAGE_SENDER_USER],\n value=MESSAGE_SENDER_AI,\n advanced=True,\n info=\"Type of sender.\",\n ),\n MessageTextInput(\n name=\"sender_name\",\n display_name=\"Sender Name\",\n info=\"Name of the sender.\",\n value=MESSAGE_SENDER_NAME_AI,\n advanced=True,\n ),\n MessageTextInput(\n name=\"session_id\",\n display_name=\"Session ID\",\n info=\"The session ID of the chat. If empty, the current session ID parameter will be used.\",\n advanced=True,\n ),\n MessageTextInput(\n name=\"data_template\",\n display_name=\"Data Template\",\n value=\"{text}\",\n advanced=True,\n info=\"Template to convert Data to Text. If left empty, it will be dynamically set to the Data's text key.\",\n ),\n ]\n outputs = [\n Output(display_name=\"Message\", name=\"message\", method=\"message_response\"),\n ]\n\n def message_response(self) -> Message:\n message = Message(\n text=self.input_value,\n sender=self.sender,\n sender_name=self.sender_name,\n session_id=self.session_id,\n )\n if (\n self.session_id\n and isinstance(message, Message)\n and isinstance(message.text, str)\n and self.should_store_message\n ):\n store_message(\n message,\n flow_id=self.graph.flow_id,\n )\n self.message.value = message\n\n self.status = message\n return message\n", + "fileTypes": [], + "file_path": "", + "password": false, + "name": "code", + "advanced": true, + "dynamic": true, + "info": "", + "load_from_db": false, + "title_case": false + }, + "data_template": { + "trace_as_input": true, + "trace_as_metadata": true, + "load_from_db": false, + "list": false, + "required": false, + "placeholder": "", + "show": true, + "name": "data_template", + "value": "{text}", + "display_name": "Data Template", + "advanced": true, + "input_types": [ + "Message" + ], + "dynamic": false, + "info": "Template to convert Data to Text. If left empty, it will be dynamically set to the Data's text key.", + "title_case": false, + "type": "str", + "_input_type": "MessageTextInput" + }, + "input_value": { + "trace_as_input": true, + "trace_as_metadata": true, + "load_from_db": false, + "list": false, + "required": false, + "placeholder": "", + "show": true, + "name": "input_value", + "value": "", + "display_name": "Text", + "advanced": false, + "input_types": [ + "Message" + ], + "dynamic": false, + "info": "Message to be passed as output.", + "title_case": false, + "type": "str", + "_input_type": "MessageTextInput" + }, + "sender": { + "trace_as_metadata": true, + "options": [ + "Machine", + "User" + ], + "combobox": false, + "required": false, + "placeholder": "", + "show": true, + "name": "sender", + "value": "Machine", + "display_name": "Sender Type", + "advanced": true, + "dynamic": false, + "info": "Type of sender.", + "title_case": false, + "type": "str", + "_input_type": "DropdownInput" + }, + "sender_name": { + "trace_as_input": true, + "trace_as_metadata": true, + "load_from_db": false, + "list": false, + "required": false, + "placeholder": "", + "show": true, + "name": "sender_name", + "value": "AI", + "display_name": "Sender Name", + "advanced": true, + "input_types": [ + "Message" + ], + "dynamic": false, + "info": "Name of the sender.", + "title_case": false, + "type": "str", + "_input_type": "MessageTextInput" + }, + "session_id": { + "trace_as_input": true, + "trace_as_metadata": true, + "load_from_db": false, + "list": false, + "required": false, + "placeholder": "", + "show": true, + "name": "session_id", + "value": "", + "display_name": "Session ID", + "advanced": true, + "input_types": [ + "Message" + ], + "dynamic": false, + "info": "The session ID of the chat. If empty, the current session ID parameter will be used.", + "title_case": false, + "type": "str", + "_input_type": "MessageTextInput" + }, + "should_store_message": { + "trace_as_metadata": true, + "list": false, + "required": false, + "placeholder": "", + "show": true, + "name": "should_store_message", + "value": true, + "display_name": "Store Messages", + "advanced": true, + "dynamic": false, + "info": "Store the message in the history.", + "title_case": false, + "type": "bool", + "_input_type": "BoolInput" + } + }, + "description": "Display a chat message in the Playground.", + "icon": "ChatOutput", + "base_classes": [ + "Message" + ], + "display_name": "Chat Output", + "documentation": "", + "custom_fields": {}, + "output_types": [], + "pinned": false, + "conditional_paths": [], + "frozen": false, + "outputs": [ + { + "types": [ + "Message" + ], + "selected": "Message", + "name": "message", + "display_name": "Message", + "method": "message_response", + "value": "__UNDEFINED__", + "cache": true + } + ], + "field_order": [ + "input_value", + "should_store_message", + "sender", + "sender_name", + "session_id", + "data_template" + ], + "beta": false, + "edited": false, + "lf_version": "1.0.17" + }, + "id": "ChatOutput-zBv53" + }, + "selected": false, + "width": 384, + "height": 302, + "positionAbsolute": { + "x": 4429.812566227955, + "y": 940.6072472757681 + }, + "dragging": false + }, + { + "id": "NotionUserList-wFEb1", + "type": "genericNode", + "position": { + "x": 2390.6365450681037, + "y": 694.4867003504073 + }, + "data": { + "type": "NotionUserList", + "node": { + "template": { + "_type": "Component", + "code": { + "type": "code", + "required": true, + "placeholder": "", + "list": false, + "show": true, + "multiline": true, + "value": "import requests\nfrom typing import List, Dict\nfrom pydantic import BaseModel\nfrom langflow.io import Output\nfrom langflow.base.langchain_utilities.model import LCToolComponent\nfrom langflow.inputs import SecretStrInput\nfrom langflow.schema import Data\nfrom langflow.field_typing import Tool\nfrom langchain.tools import StructuredTool\n\n\nclass NotionUserList(LCToolComponent):\n display_name = \"List Users \"\n description = \"Retrieve users from Notion.\"\n documentation = \"https://docs.langflow.org/integrations/notion/list-users\"\n icon = \"NotionDirectoryLoader\"\n\n inputs = [\n SecretStrInput(\n name=\"notion_secret\",\n display_name=\"Notion Secret\",\n info=\"The Notion integration token.\",\n required=True,\n ),\n ]\n outputs = [\n Output(name=\"example_output\", display_name=\"Data\", method=\"run_model\"),\n Output(name=\"example_tool_output\", display_name=\"Tool\", method=\"build_tool\"),\n ]\n\n class NotionUserListSchema(BaseModel):\n pass\n\n def run_model(self) -> List[Data]:\n users = self._list_users()\n records = []\n combined_text = \"\"\n\n for user in users:\n output = \"User:\\n\"\n for key, value in user.items():\n output += f\"{key.replace('_', ' ').title()}: {value}\\n\"\n output += \"________________________\\n\"\n\n combined_text += output\n records.append(Data(text=output, data=user))\n\n self.status = records\n return records\n\n def build_tool(self) -> Tool:\n return StructuredTool.from_function(\n name=\"notion_list_users\",\n description=\"Retrieve users from Notion.\",\n func=self._list_users,\n args_schema=self.NotionUserListSchema,\n )\n\n def _list_users(self) -> List[Dict]:\n url = \"https://api.notion.com/v1/users\"\n headers = {\n \"Authorization\": f\"Bearer {self.notion_secret}\",\n \"Notion-Version\": \"2022-06-28\",\n }\n\n response = requests.get(url, headers=headers)\n response.raise_for_status()\n\n data = response.json()\n results = data[\"results\"]\n\n users = []\n for user in results:\n user_data = {\n \"id\": user[\"id\"],\n \"type\": user[\"type\"],\n \"name\": user.get(\"name\", \"\"),\n \"avatar_url\": user.get(\"avatar_url\", \"\"),\n }\n users.append(user_data)\n\n return users\n", + "fileTypes": [], + "file_path": "", + "password": false, + "name": "code", + "advanced": true, + "dynamic": true, + "info": "", + "load_from_db": false, + "title_case": false + }, + "notion_secret": { + "load_from_db": false, + "required": true, + "placeholder": "", + "show": true, + "name": "notion_secret", + "value": "", + "display_name": "Notion Secret", + "advanced": false, + "input_types": [ + "Message" + ], + "dynamic": false, + "info": "The Notion integration token.", + "title_case": false, + "password": true, + "type": "str", + "_input_type": "SecretStrInput" + } + }, + "description": "Retrieve users from Notion.", + "icon": "NotionDirectoryLoader", + "base_classes": [ + "Data", + "Tool" + ], + "display_name": "List Users ", + "documentation": "https://docs.langflow.org/integrations/notion/list-users", + "custom_fields": {}, + "output_types": [], + "pinned": false, + "conditional_paths": [], + "frozen": false, + "outputs": [ + { + "types": [ + "Data" + ], + "selected": "Data", + "name": "example_output", + "display_name": "Data", + "method": "run_model", + "value": "__UNDEFINED__", + "cache": true + }, + { + "types": [ + "Tool" + ], + "selected": "Tool", + "name": "example_tool_output", + "display_name": "Tool", + "method": "build_tool", + "value": "__UNDEFINED__", + "cache": true, + "hidden": true + } + ], + "field_order": [ + "notion_secret" + ], + "beta": false, + "edited": true, + "lf_version": "1.0.17" + }, + "id": "NotionUserList-wFEb1", + "description": "Retrieve users from Notion.", + "display_name": "List Users " + }, + "selected": false, + "width": 384, + "height": 302, + "positionAbsolute": { + "x": 2390.6365450681037, + "y": 694.4867003504073 + }, + "dragging": false + }, + { + "id": "ParseData-WKjW6", + "type": "genericNode", + "position": { + "x": 2877.571533084884, + "y": 856.8480898893301 + }, + "data": { + "type": "ParseData", + "node": { + "template": { + "_type": "Component", + "data": { + "trace_as_metadata": true, + "list": false, + "trace_as_input": true, + "required": false, + "placeholder": "", + "show": true, + "name": "data", + "value": "", + "display_name": "Data", + "advanced": false, + "input_types": [ + "Data" + ], + "dynamic": false, + "info": "The data to convert to text.", + "title_case": false, + "type": "other", + "_input_type": "DataInput" + }, + "code": { + "type": "code", + "required": true, + "placeholder": "", + "list": false, + "show": true, + "multiline": true, + "value": "from langflow.custom import Component\nfrom langflow.helpers.data import data_to_text\nfrom langflow.io import DataInput, MultilineInput, Output, StrInput\nfrom langflow.schema.message import Message\n\n\nclass ParseDataComponent(Component):\n display_name = \"Parse Data\"\n description = \"Convert Data into plain text following a specified template.\"\n icon = \"braces\"\n name = \"ParseData\"\n\n inputs = [\n DataInput(name=\"data\", display_name=\"Data\", info=\"The data to convert to text.\"),\n MultilineInput(\n name=\"template\",\n display_name=\"Template\",\n info=\"The template to use for formatting the data. It can contain the keys {text}, {data} or any other key in the Data.\",\n value=\"{text}\",\n ),\n StrInput(name=\"sep\", display_name=\"Separator\", advanced=True, value=\"\\n\"),\n ]\n\n outputs = [\n Output(display_name=\"Text\", name=\"text\", method=\"parse_data\"),\n ]\n\n def parse_data(self) -> Message:\n data = self.data if isinstance(self.data, list) else [self.data]\n template = self.template\n\n result_string = data_to_text(template, data, sep=self.sep)\n self.status = result_string\n return Message(text=result_string)\n", + "fileTypes": [], + "file_path": "", + "password": false, + "name": "code", + "advanced": true, + "dynamic": true, + "info": "", + "load_from_db": false, + "title_case": false + }, + "sep": { + "trace_as_metadata": true, + "load_from_db": false, + "list": false, + "required": false, + "placeholder": "", + "show": true, + "name": "sep", + "value": "\n", + "display_name": "Separator", + "advanced": true, + "dynamic": false, + "info": "", + "title_case": false, + "type": "str", + "_input_type": "StrInput" + }, + "template": { + "trace_as_input": true, + "multiline": true, + "trace_as_metadata": true, + "load_from_db": false, + "list": false, + "required": false, + "placeholder": "", + "show": true, + "name": "template", + "value": "{text}", + "display_name": "Template", + "advanced": true, + "input_types": [ + "Message" + ], + "dynamic": false, + "info": "The template to use for formatting the data. It can contain the keys {text}, {data} or any other key in the Data.", + "title_case": false, + "type": "str", + "_input_type": "MultilineInput" + } + }, + "description": "Convert Data into plain text following a specified template.", + "icon": "braces", + "base_classes": [ + "Message" + ], + "display_name": "Parse Data", + "documentation": "", + "custom_fields": {}, + "output_types": [], + "pinned": false, + "conditional_paths": [], + "frozen": false, + "outputs": [ + { + "types": [ + "Message" + ], + "selected": "Message", + "name": "text", + "display_name": "Text", + "method": "parse_data", + "value": "__UNDEFINED__", + "cache": true + } + ], + "field_order": [ + "data", + "template", + "sep" + ], + "beta": false, + "edited": false, + "lf_version": "1.0.17" + }, + "id": "ParseData-WKjW6", + "showNode": false + }, + "selected": false, + "width": 96, + "height": 96, + "positionAbsolute": { + "x": 2877.571533084884, + "y": 856.8480898893301 + }, + "dragging": false + }, + { + "id": "CurrentDateComponent-WOwNq", + "type": "genericNode", + "position": { + "x": 536.7929500860405, + "y": 617.6055631700241 + }, + "data": { + "type": "CurrentDateComponent", + "node": { + "template": { + "_type": "Component", + "code": { + "type": "code", + "required": true, + "placeholder": "", + "list": false, + "show": true, + "multiline": true, + "value": "from datetime import datetime\r\nfrom zoneinfo import ZoneInfo\r\nfrom typing import List\r\n\r\nfrom langflow.custom import Component\r\nfrom langflow.io import DropdownInput, Output\r\nfrom langflow.schema.message import Message\r\n\r\nclass CurrentDateComponent(Component):\r\n display_name = \"Current Date 🕰️\"\r\n description = \"Returns the current date and time in the selected timezone.\"\r\n icon = \"clock\"\r\n\r\n inputs = [\r\n DropdownInput(\r\n name=\"timezone\",\r\n display_name=\"Timezone\",\r\n options=[\r\n \"UTC\",\r\n \"US/Eastern\",\r\n \"US/Central\",\r\n \"US/Mountain\",\r\n \"US/Pacific\",\r\n \"Europe/London\",\r\n \"Europe/Paris\",\r\n \"Asia/Tokyo\",\r\n \"Australia/Sydney\",\r\n \"America/Sao_Paulo\",\r\n \"America/Cuiaba\",\r\n ],\r\n value=\"UTC\",\r\n info=\"Select the timezone for the current date and time.\",\r\n ),\r\n ]\r\n\r\n outputs = [\r\n Output(display_name=\"Current Date\", name=\"current_date\", method=\"get_current_date\"),\r\n ]\r\n\r\n def get_current_date(self) -> Message:\r\n try:\r\n tz = ZoneInfo(self.timezone)\r\n current_date = datetime.now(tz).strftime(\"%Y-%m-%d %H:%M:%S %Z\")\r\n result = f\"Current date and time in {self.timezone}: {current_date}\"\r\n self.status = result\r\n return Message(text=result)\r\n except Exception as e:\r\n error_message = f\"Error: {str(e)}\"\r\n self.status = error_message\r\n return Message(text=error_message)", + "fileTypes": [], + "file_path": "", + "password": false, + "name": "code", + "advanced": true, + "dynamic": true, + "info": "", + "load_from_db": false, + "title_case": false + }, + "timezone": { + "trace_as_metadata": true, + "options": [ + "UTC", + "US/Eastern", + "US/Central", + "US/Mountain", + "US/Pacific", + "Europe/London", + "Europe/Paris", + "Asia/Tokyo", + "Australia/Sydney", + "America/Sao_Paulo", + "America/Cuiaba" + ], + "combobox": false, + "required": false, + "placeholder": "", + "show": true, + "name": "timezone", + "value": "UTC", + "display_name": "Timezone", + "advanced": false, + "dynamic": false, + "info": "Select the timezone for the current date and time.", + "title_case": false, + "type": "str", + "_input_type": "DropdownInput" + } + }, + "description": "Returns the current date and time in the selected timezone.", + "icon": "clock", + "base_classes": [ + "Message" + ], + "display_name": "Current Date", + "documentation": "", + "custom_fields": {}, + "output_types": [], + "pinned": false, + "conditional_paths": [], + "frozen": false, + "outputs": [ + { + "types": [ + "Message" + ], + "selected": "Message", + "name": "current_date", + "display_name": "Current Date", + "method": "get_current_date", + "value": "__UNDEFINED__", + "cache": true + } + ], + "field_order": [ + "timezone" + ], + "beta": false, + "edited": true + }, + "id": "CurrentDateComponent-WOwNq", + "showNode": false + }, + "selected": false, + "width": 96, + "height": 96, + "dragging": false, + "positionAbsolute": { + "x": 536.7929500860405, + "y": 617.6055631700241 + } + }, + { + "id": "CurrentDateComponent-PZ8xJ", + "type": "genericNode", + "position": { + "x": 2871.6341688682833, + "y": 453.3374434097356 + }, + "data": { + "type": "CurrentDateComponent", + "node": { + "template": { + "_type": "Component", + "code": { + "type": "code", + "required": true, + "placeholder": "", + "list": false, + "show": true, + "multiline": true, + "value": "from datetime import datetime\r\nfrom zoneinfo import ZoneInfo\r\nfrom typing import List\r\n\r\nfrom langflow.custom import Component\r\nfrom langflow.io import DropdownInput, Output\r\nfrom langflow.schema.message import Message\r\n\r\nclass CurrentDateComponent(Component):\r\n display_name = \"Current Date 🕰️\"\r\n description = \"Returns the current date and time in the selected timezone.\"\r\n icon = \"clock\"\r\n\r\n inputs = [\r\n DropdownInput(\r\n name=\"timezone\",\r\n display_name=\"Timezone\",\r\n options=[\r\n \"UTC\",\r\n \"US/Eastern\",\r\n \"US/Central\",\r\n \"US/Mountain\",\r\n \"US/Pacific\",\r\n \"Europe/London\",\r\n \"Europe/Paris\",\r\n \"Asia/Tokyo\",\r\n \"Australia/Sydney\",\r\n \"America/Sao_Paulo\",\r\n \"America/Cuiaba\",\r\n ],\r\n value=\"UTC\",\r\n info=\"Select the timezone for the current date and time.\",\r\n ),\r\n ]\r\n\r\n outputs = [\r\n Output(display_name=\"Current Date\", name=\"current_date\", method=\"get_current_date\"),\r\n ]\r\n\r\n def get_current_date(self) -> Message:\r\n try:\r\n tz = ZoneInfo(self.timezone)\r\n current_date = datetime.now(tz).strftime(\"%Y-%m-%d %H:%M:%S %Z\")\r\n result = f\"Current date and time in {self.timezone}: {current_date}\"\r\n self.status = result\r\n return Message(text=result)\r\n except Exception as e:\r\n error_message = f\"Error: {str(e)}\"\r\n self.status = error_message\r\n return Message(text=error_message)", + "fileTypes": [], + "file_path": "", + "password": false, + "name": "code", + "advanced": true, + "dynamic": true, + "info": "", + "load_from_db": false, + "title_case": false + }, + "timezone": { + "trace_as_metadata": true, + "options": [ + "UTC", + "US/Eastern", + "US/Central", + "US/Mountain", + "US/Pacific", + "Europe/London", + "Europe/Paris", + "Asia/Tokyo", + "Australia/Sydney", + "America/Sao_Paulo", + "America/Cuiaba" + ], + "combobox": false, + "required": false, + "placeholder": "", + "show": true, + "name": "timezone", + "value": "UTC", + "display_name": "Timezone", + "advanced": false, + "dynamic": false, + "info": "Select the timezone for the current date and time.", + "title_case": false, + "type": "str", + "_input_type": "DropdownInput" + } + }, + "description": "Returns the current date and time in the selected timezone.", + "icon": "clock", + "base_classes": [ + "Message" + ], + "display_name": "Current Date", + "documentation": "", + "custom_fields": {}, + "output_types": [], + "pinned": false, + "conditional_paths": [], + "frozen": false, + "outputs": [ + { + "types": [ + "Message" + ], + "selected": "Message", + "name": "current_date", + "display_name": "Current Date", + "method": "get_current_date", + "value": "__UNDEFINED__", + "cache": true + } + ], + "field_order": [ + "timezone" + ], + "beta": false, + "edited": true, + "official": false + }, + "id": "CurrentDateComponent-PZ8xJ", + "showNode": false + }, + "selected": false, + "width": 96, + "height": 96, + "dragging": false, + "positionAbsolute": { + "x": 2871.6341688682833, + "y": 453.3374434097356 + } + } + ], + "edges": [ + { + "source": "TextInput-iJPEJ", + "sourceHandle": "{œdataTypeœ:œTextInputœ,œidœ:œTextInput-iJPEJœ,œnameœ:œtextœ,œoutput_typesœ:[œMessageœ]}", + "target": "Prompt-19rub", + "targetHandle": "{œfieldNameœ:œTRANSCRIPTœ,œidœ:œPrompt-19rubœ,œinputTypesœ:[œMessageœ,œTextœ],œtypeœ:œstrœ}", + "data": { + "targetHandle": { + "fieldName": "TRANSCRIPT", + "id": "Prompt-19rub", + "inputTypes": [ + "Message", + "Text" + ], + "type": "str" + }, + "sourceHandle": { + "dataType": "TextInput", + "id": "TextInput-iJPEJ", + "name": "text", + "output_types": [ + "Message" + ] + } + }, + "id": "reactflow__edge-TextInput-iJPEJ{œdataTypeœ:œTextInputœ,œidœ:œTextInput-iJPEJœ,œnameœ:œtextœ,œoutput_typesœ:[œMessageœ]}-Prompt-19rub{œfieldNameœ:œTRANSCRIPTœ,œidœ:œPrompt-19rubœ,œinputTypesœ:[œMessageœ,œTextœ],œtypeœ:œstrœ}", + "selected": false, + "className": "" + }, + { + "source": "NotionUserList-TvIKS", + "sourceHandle": "{œdataTypeœ:œNotionUserListœ,œidœ:œNotionUserList-TvIKSœ,œnameœ:œexample_outputœ,œoutput_typesœ:[œDataœ]}", + "target": "ParseData-aNk1v", + "targetHandle": "{œfieldNameœ:œdataœ,œidœ:œParseData-aNk1vœ,œinputTypesœ:[œDataœ],œtypeœ:œotherœ}", + "data": { + "targetHandle": { + "fieldName": "data", + "id": "ParseData-aNk1v", + "inputTypes": [ + "Data" + ], + "type": "other" + }, + "sourceHandle": { + "dataType": "NotionUserList", + "id": "NotionUserList-TvIKS", + "name": "example_output", + "output_types": [ + "Data" + ] + } + }, + "id": "reactflow__edge-NotionUserList-TvIKS{œdataTypeœ:œNotionUserListœ,œidœ:œNotionUserList-TvIKSœ,œnameœ:œexample_outputœ,œoutput_typesœ:[œDataœ]}-ParseData-aNk1v{œfieldNameœ:œdataœ,œidœ:œParseData-aNk1vœ,œinputTypesœ:[œDataœ],œtypeœ:œotherœ}", + "selected": false, + "className": "" + }, + { + "source": "ParseData-aNk1v", + "sourceHandle": "{œdataTypeœ:œParseDataœ,œidœ:œParseData-aNk1vœ,œnameœ:œtextœ,œoutput_typesœ:[œMessageœ]}", + "target": "Prompt-19rub", + "targetHandle": "{œfieldNameœ:œUSERSœ,œidœ:œPrompt-19rubœ,œinputTypesœ:[œMessageœ,œTextœ],œtypeœ:œstrœ}", + "data": { + "targetHandle": { + "fieldName": "USERS", + "id": "Prompt-19rub", + "inputTypes": [ + "Message", + "Text" + ], + "type": "str" + }, + "sourceHandle": { + "dataType": "ParseData", + "id": "ParseData-aNk1v", + "name": "text", + "output_types": [ + "Message" + ] + } + }, + "id": "reactflow__edge-ParseData-aNk1v{œdataTypeœ:œParseDataœ,œidœ:œParseData-aNk1vœ,œnameœ:œtextœ,œoutput_typesœ:[œMessageœ]}-Prompt-19rub{œfieldNameœ:œUSERSœ,œidœ:œPrompt-19rubœ,œinputTypesœ:[œMessageœ,œTextœ],œtypeœ:œstrœ}", + "selected": false, + "className": "" + }, + { + "source": "Prompt-19rub", + "sourceHandle": "{œdataTypeœ:œPromptœ,œidœ:œPrompt-19rubœ,œnameœ:œpromptœ,œoutput_typesœ:[œMessageœ]}", + "target": "ToolCallingAgent-rVWeq", + "targetHandle": "{œfieldNameœ:œsystem_promptœ,œidœ:œToolCallingAgent-rVWeqœ,œinputTypesœ:[œMessageœ],œtypeœ:œstrœ}", + "data": { + "targetHandle": { + "fieldName": "system_prompt", + "id": "ToolCallingAgent-rVWeq", + "inputTypes": [ + "Message" + ], + "type": "str" + }, + "sourceHandle": { + "dataType": "Prompt", + "id": "Prompt-19rub", + "name": "prompt", + "output_types": [ + "Message" + ] + } + }, + "id": "reactflow__edge-Prompt-19rub{œdataTypeœ:œPromptœ,œidœ:œPrompt-19rubœ,œnameœ:œpromptœ,œoutput_typesœ:[œMessageœ]}-ToolCallingAgent-rVWeq{œfieldNameœ:œsystem_promptœ,œidœ:œToolCallingAgent-rVWeqœ,œinputTypesœ:[œMessageœ],œtypeœ:œstrœ}", + "selected": false, + "className": "" + }, + { + "source": "NotionSearch-M66HF", + "sourceHandle": "{œdataTypeœ:œNotionSearchœ,œidœ:œNotionSearch-M66HFœ,œnameœ:œexample_tool_outputœ,œoutput_typesœ:[œToolœ]}", + "target": "ToolCallingAgent-rVWeq", + "targetHandle": "{œfieldNameœ:œtoolsœ,œidœ:œToolCallingAgent-rVWeqœ,œinputTypesœ:[œToolœ,œBaseToolœ],œtypeœ:œotherœ}", + "data": { + "targetHandle": { + "fieldName": "tools", + "id": "ToolCallingAgent-rVWeq", + "inputTypes": [ + "Tool", + "BaseTool" + ], + "type": "other" + }, + "sourceHandle": { + "dataType": "NotionSearch", + "id": "NotionSearch-M66HF", + "name": "example_tool_output", + "output_types": [ + "Tool" + ] + } + }, + "id": "reactflow__edge-NotionSearch-M66HF{œdataTypeœ:œNotionSearchœ,œidœ:œNotionSearch-M66HFœ,œnameœ:œexample_tool_outputœ,œoutput_typesœ:[œToolœ]}-ToolCallingAgent-rVWeq{œfieldNameœ:œtoolsœ,œidœ:œToolCallingAgent-rVWeqœ,œinputTypesœ:[œToolœ,œBaseToolœ],œtypeœ:œotherœ}", + "selected": false, + "className": "" + }, + { + "source": "OpenAIModel-Ht8xI", + "sourceHandle": "{œdataTypeœ:œOpenAIModelœ,œidœ:œOpenAIModel-Ht8xIœ,œnameœ:œmodel_outputœ,œoutput_typesœ:[œLanguageModelœ]}", + "target": "ToolCallingAgent-rVWeq", + "targetHandle": "{œfieldNameœ:œllmœ,œidœ:œToolCallingAgent-rVWeqœ,œinputTypesœ:[œLanguageModelœ],œtypeœ:œotherœ}", + "data": { + "targetHandle": { + "fieldName": "llm", + "id": "ToolCallingAgent-rVWeq", + "inputTypes": [ + "LanguageModel" + ], + "type": "other" + }, + "sourceHandle": { + "dataType": "OpenAIModel", + "id": "OpenAIModel-Ht8xI", + "name": "model_output", + "output_types": [ + "LanguageModel" + ] + } + }, + "id": "reactflow__edge-OpenAIModel-Ht8xI{œdataTypeœ:œOpenAIModelœ,œidœ:œOpenAIModel-Ht8xIœ,œnameœ:œmodel_outputœ,œoutput_typesœ:[œLanguageModelœ]}-ToolCallingAgent-rVWeq{œfieldNameœ:œllmœ,œidœ:œToolCallingAgent-rVWeqœ,œinputTypesœ:[œLanguageModelœ],œtypeœ:œotherœ}", + "selected": false, + "className": "" + }, + { + "source": "ToolCallingAgent-rVWeq", + "sourceHandle": "{œdataTypeœ:œToolCallingAgentœ,œidœ:œToolCallingAgent-rVWeqœ,œnameœ:œresponseœ,œoutput_typesœ:[œMessageœ]}", + "target": "Prompt-Lbxk6", + "targetHandle": "{œfieldNameœ:œTASK_LISTœ,œidœ:œPrompt-Lbxk6œ,œinputTypesœ:[œMessageœ,œTextœ],œtypeœ:œstrœ}", + "data": { + "targetHandle": { + "fieldName": "TASK_LIST", + "id": "Prompt-Lbxk6", + "inputTypes": [ + "Message", + "Text" + ], + "type": "str" + }, + "sourceHandle": { + "dataType": "ToolCallingAgent", + "id": "ToolCallingAgent-rVWeq", + "name": "response", + "output_types": [ + "Message" + ] + } + }, + "id": "reactflow__edge-ToolCallingAgent-rVWeq{œdataTypeœ:œToolCallingAgentœ,œidœ:œToolCallingAgent-rVWeqœ,œnameœ:œresponseœ,œoutput_typesœ:[œMessageœ]}-Prompt-Lbxk6{œfieldNameœ:œTASK_LISTœ,œidœ:œPrompt-Lbxk6œ,œinputTypesœ:[œMessageœ,œTextœ],œtypeœ:œstrœ}", + "selected": false, + "className": "" + }, + { + "source": "OpenAIModel-OTfnt", + "sourceHandle": "{œdataTypeœ:œOpenAIModelœ,œidœ:œOpenAIModel-OTfntœ,œnameœ:œmodel_outputœ,œoutput_typesœ:[œLanguageModelœ]}", + "target": "ToolCallingAgent-GurdE", + "targetHandle": "{œfieldNameœ:œllmœ,œidœ:œToolCallingAgent-GurdEœ,œinputTypesœ:[œLanguageModelœ],œtypeœ:œotherœ}", + "data": { + "targetHandle": { + "fieldName": "llm", + "id": "ToolCallingAgent-GurdE", + "inputTypes": [ + "LanguageModel" + ], + "type": "other" + }, + "sourceHandle": { + "dataType": "OpenAIModel", + "id": "OpenAIModel-OTfnt", + "name": "model_output", + "output_types": [ + "LanguageModel" + ] + } + }, + "id": "reactflow__edge-OpenAIModel-OTfnt{œdataTypeœ:œOpenAIModelœ,œidœ:œOpenAIModel-OTfntœ,œnameœ:œmodel_outputœ,œoutput_typesœ:[œLanguageModelœ]}-ToolCallingAgent-GurdE{œfieldNameœ:œllmœ,œidœ:œToolCallingAgent-GurdEœ,œinputTypesœ:[œLanguageModelœ],œtypeœ:œotherœ}", + "selected": false, + "className": "" + }, + { + "source": "Prompt-Lbxk6", + "sourceHandle": "{œdataTypeœ:œPromptœ,œidœ:œPrompt-Lbxk6œ,œnameœ:œpromptœ,œoutput_typesœ:[œMessageœ]}", + "target": "ToolCallingAgent-GurdE", + "targetHandle": "{œfieldNameœ:œsystem_promptœ,œidœ:œToolCallingAgent-GurdEœ,œinputTypesœ:[œMessageœ],œtypeœ:œstrœ}", + "data": { + "targetHandle": { + "fieldName": "system_prompt", + "id": "ToolCallingAgent-GurdE", + "inputTypes": [ + "Message" + ], + "type": "str" + }, + "sourceHandle": { + "dataType": "Prompt", + "id": "Prompt-Lbxk6", + "name": "prompt", + "output_types": [ + "Message" + ] + } + }, + "id": "reactflow__edge-Prompt-Lbxk6{œdataTypeœ:œPromptœ,œidœ:œPrompt-Lbxk6œ,œnameœ:œpromptœ,œoutput_typesœ:[œMessageœ]}-ToolCallingAgent-GurdE{œfieldNameœ:œsystem_promptœ,œidœ:œToolCallingAgent-GurdEœ,œinputTypesœ:[œMessageœ],œtypeœ:œstrœ}", + "selected": false, + "className": "" + }, + { + "source": "AddContentToPage-vrAvx", + "sourceHandle": "{œdataTypeœ:œAddContentToPageœ,œidœ:œAddContentToPage-vrAvxœ,œnameœ:œexample_tool_outputœ,œoutput_typesœ:[œToolœ]}", + "target": "ToolCallingAgent-GurdE", + "targetHandle": "{œfieldNameœ:œtoolsœ,œidœ:œToolCallingAgent-GurdEœ,œinputTypesœ:[œToolœ,œBaseToolœ],œtypeœ:œotherœ}", + "data": { + "targetHandle": { + "fieldName": "tools", + "id": "ToolCallingAgent-GurdE", + "inputTypes": [ + "Tool", + "BaseTool" + ], + "type": "other" + }, + "sourceHandle": { + "dataType": "AddContentToPage", + "id": "AddContentToPage-vrAvx", + "name": "example_tool_output", + "output_types": [ + "Tool" + ] + } + }, + "id": "reactflow__edge-AddContentToPage-vrAvx{œdataTypeœ:œAddContentToPageœ,œidœ:œAddContentToPage-vrAvxœ,œnameœ:œexample_tool_outputœ,œoutput_typesœ:[œToolœ]}-ToolCallingAgent-GurdE{œfieldNameœ:œtoolsœ,œidœ:œToolCallingAgent-GurdEœ,œinputTypesœ:[œToolœ,œBaseToolœ],œtypeœ:œotherœ}", + "selected": false, + "className": "" + }, + { + "source": "NotionPageCreator-Exc7f", + "sourceHandle": "{œdataTypeœ:œNotionPageCreatorœ,œidœ:œNotionPageCreator-Exc7fœ,œnameœ:œexample_tool_outputœ,œoutput_typesœ:[œToolœ]}", + "target": "ToolCallingAgent-GurdE", + "targetHandle": "{œfieldNameœ:œtoolsœ,œidœ:œToolCallingAgent-GurdEœ,œinputTypesœ:[œToolœ,œBaseToolœ],œtypeœ:œotherœ}", + "data": { + "targetHandle": { + "fieldName": "tools", + "id": "ToolCallingAgent-GurdE", + "inputTypes": [ + "Tool", + "BaseTool" + ], + "type": "other" + }, + "sourceHandle": { + "dataType": "NotionPageCreator", + "id": "NotionPageCreator-Exc7f", + "name": "example_tool_output", + "output_types": [ + "Tool" + ] + } + }, + "id": "reactflow__edge-NotionPageCreator-Exc7f{œdataTypeœ:œNotionPageCreatorœ,œidœ:œNotionPageCreator-Exc7fœ,œnameœ:œexample_tool_outputœ,œoutput_typesœ:[œToolœ]}-ToolCallingAgent-GurdE{œfieldNameœ:œtoolsœ,œidœ:œToolCallingAgent-GurdEœ,œinputTypesœ:[œToolœ,œBaseToolœ],œtypeœ:œotherœ}", + "selected": false, + "className": "" + }, + { + "source": "NotionDatabaseProperties-IjzLV", + "sourceHandle": "{œdataTypeœ:œNotionDatabasePropertiesœ,œidœ:œNotionDatabaseProperties-IjzLVœ,œnameœ:œexample_tool_outputœ,œoutput_typesœ:[œToolœ]}", + "target": "ToolCallingAgent-GurdE", + "targetHandle": "{œfieldNameœ:œtoolsœ,œidœ:œToolCallingAgent-GurdEœ,œinputTypesœ:[œToolœ,œBaseToolœ],œtypeœ:œotherœ}", + "data": { + "targetHandle": { + "fieldName": "tools", + "id": "ToolCallingAgent-GurdE", + "inputTypes": [ + "Tool", + "BaseTool" + ], + "type": "other" + }, + "sourceHandle": { + "dataType": "NotionDatabaseProperties", + "id": "NotionDatabaseProperties-IjzLV", + "name": "example_tool_output", + "output_types": [ + "Tool" + ] + } + }, + "id": "reactflow__edge-NotionDatabaseProperties-IjzLV{œdataTypeœ:œNotionDatabasePropertiesœ,œidœ:œNotionDatabaseProperties-IjzLVœ,œnameœ:œexample_tool_outputœ,œoutput_typesœ:[œToolœ]}-ToolCallingAgent-GurdE{œfieldNameœ:œtoolsœ,œidœ:œToolCallingAgent-GurdEœ,œinputTypesœ:[œToolœ,œBaseToolœ],œtypeœ:œotherœ}", + "selected": false, + "className": "" + }, + { + "source": "NotionPageUpdate-bexvy", + "sourceHandle": "{œdataTypeœ:œNotionPageUpdateœ,œidœ:œNotionPageUpdate-bexvyœ,œnameœ:œexample_tool_outputœ,œoutput_typesœ:[œToolœ]}", + "target": "ToolCallingAgent-GurdE", + "targetHandle": "{œfieldNameœ:œtoolsœ,œidœ:œToolCallingAgent-GurdEœ,œinputTypesœ:[œToolœ,œBaseToolœ],œtypeœ:œotherœ}", + "data": { + "targetHandle": { + "fieldName": "tools", + "id": "ToolCallingAgent-GurdE", + "inputTypes": [ + "Tool", + "BaseTool" + ], + "type": "other" + }, + "sourceHandle": { + "dataType": "NotionPageUpdate", + "id": "NotionPageUpdate-bexvy", + "name": "example_tool_output", + "output_types": [ + "Tool" + ] + } + }, + "id": "reactflow__edge-NotionPageUpdate-bexvy{œdataTypeœ:œNotionPageUpdateœ,œidœ:œNotionPageUpdate-bexvyœ,œnameœ:œexample_tool_outputœ,œoutput_typesœ:[œToolœ]}-ToolCallingAgent-GurdE{œfieldNameœ:œtoolsœ,œidœ:œToolCallingAgent-GurdEœ,œinputTypesœ:[œToolœ,œBaseToolœ],œtypeœ:œotherœ}", + "selected": false, + "className": "" + }, + { + "source": "NotionSearch-EdSJb", + "sourceHandle": "{œdataTypeœ:œNotionSearchœ,œidœ:œNotionSearch-EdSJbœ,œnameœ:œexample_outputœ,œoutput_typesœ:[œDataœ]}", + "target": "ParseData-vYVwu", + "targetHandle": "{œfieldNameœ:œdataœ,œidœ:œParseData-vYVwuœ,œinputTypesœ:[œDataœ],œtypeœ:œotherœ}", + "data": { + "targetHandle": { + "fieldName": "data", + "id": "ParseData-vYVwu", + "inputTypes": [ + "Data" + ], + "type": "other" + }, + "sourceHandle": { + "dataType": "NotionSearch", + "id": "NotionSearch-EdSJb", + "name": "example_output", + "output_types": [ + "Data" + ] + } + }, + "id": "reactflow__edge-NotionSearch-EdSJb{œdataTypeœ:œNotionSearchœ,œidœ:œNotionSearch-EdSJbœ,œnameœ:œexample_outputœ,œoutput_typesœ:[œDataœ]}-ParseData-vYVwu{œfieldNameœ:œdataœ,œidœ:œParseData-vYVwuœ,œinputTypesœ:[œDataœ],œtypeœ:œotherœ}", + "selected": false, + "className": "" + }, + { + "source": "ParseData-vYVwu", + "sourceHandle": "{œdataTypeœ:œParseDataœ,œidœ:œParseData-vYVwuœ,œnameœ:œtextœ,œoutput_typesœ:[œMessageœ]}", + "target": "Prompt-Lbxk6", + "targetHandle": "{œfieldNameœ:œDATABASESœ,œidœ:œPrompt-Lbxk6œ,œinputTypesœ:[œMessageœ,œTextœ],œtypeœ:œstrœ}", + "data": { + "targetHandle": { + "fieldName": "DATABASES", + "id": "Prompt-Lbxk6", + "inputTypes": [ + "Message", + "Text" + ], + "type": "str" + }, + "sourceHandle": { + "dataType": "ParseData", + "id": "ParseData-vYVwu", + "name": "text", + "output_types": [ + "Message" + ] + } + }, + "id": "reactflow__edge-ParseData-vYVwu{œdataTypeœ:œParseDataœ,œidœ:œParseData-vYVwuœ,œnameœ:œtextœ,œoutput_typesœ:[œMessageœ]}-Prompt-Lbxk6{œfieldNameœ:œDATABASESœ,œidœ:œPrompt-Lbxk6œ,œinputTypesœ:[œMessageœ,œTextœ],œtypeœ:œstrœ}", + "selected": false, + "className": "" + }, + { + "source": "ToolCallingAgent-GurdE", + "sourceHandle": "{œdataTypeœ:œToolCallingAgentœ,œidœ:œToolCallingAgent-GurdEœ,œnameœ:œresponseœ,œoutput_typesœ:[œMessageœ]}", + "target": "ChatOutput-zBv53", + "targetHandle": "{œfieldNameœ:œinput_valueœ,œidœ:œChatOutput-zBv53œ,œinputTypesœ:[œMessageœ],œtypeœ:œstrœ}", + "data": { + "targetHandle": { + "fieldName": "input_value", + "id": "ChatOutput-zBv53", + "inputTypes": [ + "Message" + ], + "type": "str" + }, + "sourceHandle": { + "dataType": "ToolCallingAgent", + "id": "ToolCallingAgent-GurdE", + "name": "response", + "output_types": [ + "Message" + ] + } + }, + "id": "reactflow__edge-ToolCallingAgent-GurdE{œdataTypeœ:œToolCallingAgentœ,œidœ:œToolCallingAgent-GurdEœ,œnameœ:œresponseœ,œoutput_typesœ:[œMessageœ]}-ChatOutput-zBv53{œfieldNameœ:œinput_valueœ,œidœ:œChatOutput-zBv53œ,œinputTypesœ:[œMessageœ],œtypeœ:œstrœ}", + "selected": false, + "className": "" + }, + { + "source": "NotionUserList-wFEb1", + "sourceHandle": "{œdataTypeœ:œNotionUserListœ,œidœ:œNotionUserList-wFEb1œ,œnameœ:œexample_outputœ,œoutput_typesœ:[œDataœ]}", + "target": "ParseData-WKjW6", + "targetHandle": "{œfieldNameœ:œdataœ,œidœ:œParseData-WKjW6œ,œinputTypesœ:[œDataœ],œtypeœ:œotherœ}", + "data": { + "targetHandle": { + "fieldName": "data", + "id": "ParseData-WKjW6", + "inputTypes": [ + "Data" + ], + "type": "other" + }, + "sourceHandle": { + "dataType": "NotionUserList", + "id": "NotionUserList-wFEb1", + "name": "example_output", + "output_types": [ + "Data" + ] + } + }, + "id": "reactflow__edge-NotionUserList-wFEb1{œdataTypeœ:œNotionUserListœ,œidœ:œNotionUserList-wFEb1œ,œnameœ:œexample_outputœ,œoutput_typesœ:[œDataœ]}-ParseData-WKjW6{œfieldNameœ:œdataœ,œidœ:œParseData-WKjW6œ,œinputTypesœ:[œDataœ],œtypeœ:œotherœ}", + "className": "" + }, + { + "source": "ParseData-WKjW6", + "sourceHandle": "{œdataTypeœ:œParseDataœ,œidœ:œParseData-WKjW6œ,œnameœ:œtextœ,œoutput_typesœ:[œMessageœ]}", + "target": "Prompt-Lbxk6", + "targetHandle": "{œfieldNameœ:œUSERSœ,œidœ:œPrompt-Lbxk6œ,œinputTypesœ:[œMessageœ,œTextœ],œtypeœ:œstrœ}", + "data": { + "targetHandle": { + "fieldName": "USERS", + "id": "Prompt-Lbxk6", + "inputTypes": [ + "Message", + "Text" + ], + "type": "str" + }, + "sourceHandle": { + "dataType": "ParseData", + "id": "ParseData-WKjW6", + "name": "text", + "output_types": [ + "Message" + ] + } + }, + "id": "reactflow__edge-ParseData-WKjW6{œdataTypeœ:œParseDataœ,œidœ:œParseData-WKjW6œ,œnameœ:œtextœ,œoutput_typesœ:[œMessageœ]}-Prompt-Lbxk6{œfieldNameœ:œUSERSœ,œidœ:œPrompt-Lbxk6œ,œinputTypesœ:[œMessageœ,œTextœ],œtypeœ:œstrœ}", + "className": "" + }, + { + "source": "CurrentDateComponent-WOwNq", + "sourceHandle": "{œdataTypeœ:œCurrentDateComponentœ,œidœ:œCurrentDateComponent-WOwNqœ,œnameœ:œcurrent_dateœ,œoutput_typesœ:[œMessageœ]}", + "target": "Prompt-19rub", + "targetHandle": "{œfieldNameœ:œCURRENT_DATEœ,œidœ:œPrompt-19rubœ,œinputTypesœ:[œMessageœ,œTextœ],œtypeœ:œstrœ}", + "data": { + "targetHandle": { + "fieldName": "CURRENT_DATE", + "id": "Prompt-19rub", + "inputTypes": [ + "Message", + "Text" + ], + "type": "str" + }, + "sourceHandle": { + "dataType": "CurrentDateComponent", + "id": "CurrentDateComponent-WOwNq", + "name": "current_date", + "output_types": [ + "Message" + ] + } + }, + "id": "reactflow__edge-CurrentDateComponent-WOwNq{œdataTypeœ:œCurrentDateComponentœ,œidœ:œCurrentDateComponent-WOwNqœ,œnameœ:œcurrent_dateœ,œoutput_typesœ:[œMessageœ]}-Prompt-19rub{œfieldNameœ:œCURRENT_DATEœ,œidœ:œPrompt-19rubœ,œinputTypesœ:[œMessageœ,œTextœ],œtypeœ:œstrœ}", + "className": "" + }, + { + "source": "CurrentDateComponent-PZ8xJ", + "sourceHandle": "{œdataTypeœ:œCurrentDateComponentœ,œidœ:œCurrentDateComponent-PZ8xJœ,œnameœ:œcurrent_dateœ,œoutput_typesœ:[œMessageœ]}", + "target": "Prompt-Lbxk6", + "targetHandle": "{œfieldNameœ:œCURRENT_DATEœ,œidœ:œPrompt-Lbxk6œ,œinputTypesœ:[œMessageœ,œTextœ],œtypeœ:œstrœ}", + "data": { + "targetHandle": { + "fieldName": "CURRENT_DATE", + "id": "Prompt-Lbxk6", + "inputTypes": [ + "Message", + "Text" + ], + "type": "str" + }, + "sourceHandle": { + "dataType": "CurrentDateComponent", + "id": "CurrentDateComponent-PZ8xJ", + "name": "current_date", + "output_types": [ + "Message" + ] + } + }, + "id": "reactflow__edge-CurrentDateComponent-PZ8xJ{œdataTypeœ:œCurrentDateComponentœ,œidœ:œCurrentDateComponent-PZ8xJœ,œnameœ:œcurrent_dateœ,œoutput_typesœ:[œMessageœ]}-Prompt-Lbxk6{œfieldNameœ:œCURRENT_DATEœ,œidœ:œPrompt-Lbxk6œ,œinputTypesœ:[œMessageœ,œTextœ],œtypeœ:œstrœ}", + "className": "" + } + ], + "viewport": { + "x": -65.48833753518215, + "y": 119.49034539812101, + "zoom": 0.5588906662759379 + } + }, + "description": "The Notion Agent for Meeting Notes is an AI-powered tool that automatically processes meeting transcripts and updates your Notion workspace accordingly. It identifies tasks, action items, and key points from your meetings, then creates new tasks or updates existing ones in Notion without manual input.\n\nTo use it, simply add your API Keys and provide a meeting transcript. The agent will analyze it, interact with your Notion workspace to make necessary updates, and give you a summary of actions taken. This streamlines your workflow, ensuring important meeting outcomes are captured and organized in Notion effortlessly.", + "name": "Notion Agent - Meeting Notes ", + "last_tested_version": "1.0.17.dev8", + "endpoint_name": null, + "is_component": false +} \ No newline at end of file diff --git a/assets/js/18f3809a.30699dc9.js b/assets/js/18f3809a.41f624bc.js similarity index 99% rename from assets/js/18f3809a.30699dc9.js rename to assets/js/18f3809a.41f624bc.js index fa207786a5..0a7135dc72 100644 --- a/assets/js/18f3809a.30699dc9.js +++ b/assets/js/18f3809a.41f624bc.js @@ -1 +1 @@ -"use strict";(self.webpackChunklangflow_docs=self.webpackChunklangflow_docs||[]).push([[5475],{66662:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>a,contentTitle:()=>r,default:()=>h,frontMatter:()=>o,metadata:()=>l,toc:()=>d});var i=t(74848),s=t(28453);const o={title:"Notion Meeting Notes Agent",sidebar_position:1,slug:"/integrations/notion/notion-agent-meeting-notes"},r=void 0,l={id:"Integrations/Notion/notion-agent-meeting-notes",title:"Notion Meeting Notes Agent",description:"The Notion Agent for Meeting Notes is an AI-powered tool that automatically processes meeting transcripts and updates your Notion workspace. It identifies tasks, action items, and key points from your meetings, then creates new tasks or updates existing ones in Notion without manual input.",source:"@site/docs/Integrations/Notion/notion-agent-meeting-notes.md",sourceDirName:"Integrations/Notion",slug:"/integrations/notion/notion-agent-meeting-notes",permalink:"/integrations/notion/notion-agent-meeting-notes",draft:!1,unlisted:!1,tags:[],version:"current",sidebarPosition:1,frontMatter:{title:"Notion Meeting Notes Agent",sidebar_position:1,slug:"/integrations/notion/notion-agent-meeting-notes"},sidebar:"docs",previous:{title:"Notion Conversational Agent",permalink:"/integrations/notion/notion-agent-conversational"},next:{title:"Join the Langflow community",permalink:"/contributing-community"}},a={},d=[{value:"Prerequisites",id:"prerequisites",level:2},{value:"Components",id:"components",level:2},{value:"Meeting Transcript (Text Input)",id:"meeting-transcript-text-input",level:3},{value:"List Users (Notion Component)",id:"list-users-notion-component",level:3},{value:"List Databases (Notion Component)",id:"list-databases-notion-component",level:3},{value:"Prompt",id:"prompt",level:3},{value:"Meeting Summarizer (Tool Calling Agent)",id:"meeting-summarizer-tool-calling-agent",level:3},{value:"Notion Agent (Tool Calling Agent)",id:"notion-agent-tool-calling-agent",level:3},{value:"Notion Components (Tools)",id:"notion-components-tools",level:3},{value:"List Database Properties",id:"list-database-properties",level:4},{value:"Create Page",id:"create-page",level:4},{value:"Update Page Property",id:"update-page-property",level:4},{value:"Add Content to Page",id:"add-content-to-page",level:4},{value:"Chat Output",id:"chat-output",level:3},{value:"Flow Process",id:"flow-process",level:2},{value:"Run the Notion Meeting Notes flow",id:"run-the-notion-meeting-notes-flow",level:2},{value:"Customization",id:"customization",level:2},{value:"Troubleshooting",id:"troubleshooting",level:2}];function c(e){const n={a:"a",admonition:"admonition",h2:"h2",h3:"h3",h4:"h4",hr:"hr",img:"img",li:"li",ol:"ol",p:"p",strong:"strong",ul:"ul",...(0,s.R)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(n.p,{children:"The Notion Agent for Meeting Notes is an AI-powered tool that automatically processes meeting transcripts and updates your Notion workspace. It identifies tasks, action items, and key points from your meetings, then creates new tasks or updates existing ones in Notion without manual input."}),"\n",(0,i.jsx)(n.h2,{id:"prerequisites",children:"Prerequisites"}),"\n",(0,i.jsx)(n.hr,{}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsx)(n.li,{children:(0,i.jsx)(n.a,{href:"/integrations/notion/setup",children:"Notion App"})}),"\n",(0,i.jsx)(n.li,{children:(0,i.jsx)(n.a,{href:"https://www.notion.so/my-integrations",children:"Notion API key"})}),"\n",(0,i.jsx)(n.li,{children:(0,i.jsx)(n.a,{href:"https://platform.openai.com/account/api-keys",children:"OpenAI API key"})}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.a,{target:"_blank","data-noBrokenLinkCheck":!0,href:t(86924).A+"",children:"Download Flow Meeting Agent Flow"}),"(Download link)"]}),"\n"]}),"\n",(0,i.jsx)(n.admonition,{type:"warning",children:(0,i.jsx)(n.p,{children:"Before using this flow, ensure you have obtained the necessary API keys from Notion and OpenAI. These keys are essential for the flow to function properly. Keep them secure and do not share them publicly."})}),"\n",(0,i.jsx)(n.h2,{id:"components",children:"Components"}),"\n",(0,i.jsx)(n.hr,{}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.img,{alt:"Notion Meeting Agent Part 1",src:t(43725).A+"",width:"1427",height:"645"})}),"\n",(0,i.jsx)(n.h3,{id:"meeting-transcript-text-input",children:"Meeting Transcript (Text Input)"}),"\n",(0,i.jsx)(n.p,{children:"This component allows users to input the meeting transcript directly into the flow."}),"\n",(0,i.jsx)(n.h3,{id:"list-users-notion-component",children:"List Users (Notion Component)"}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.strong,{children:"Purpose"}),": Retrieves a list of users from the Notion workspace."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.strong,{children:"Input"}),": Notion Secret (API key)"]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.strong,{children:"Output"}),": List of user data"]}),"\n"]}),"\n",(0,i.jsx)(n.h3,{id:"list-databases-notion-component",children:"List Databases (Notion Component)"}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.strong,{children:"Purpose"}),": Searches and lists all databases in the Notion workspace."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.strong,{children:"Input"}),":","\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsx)(n.li,{children:"Notion Secret (API key)"}),"\n",(0,i.jsx)(n.li,{children:"Query (optional)"}),"\n",(0,i.jsx)(n.li,{children:"Filter Type (default: database)"}),"\n",(0,i.jsx)(n.li,{children:"Sort Direction"}),"\n"]}),"\n"]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.strong,{children:"Output"}),": List of database data"]}),"\n"]}),"\n",(0,i.jsx)(n.h3,{id:"prompt",children:"Prompt"}),"\n",(0,i.jsx)(n.p,{children:"This component creates a dynamic prompt template using the following inputs:"}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsx)(n.li,{children:"Meeting Transcript"}),"\n",(0,i.jsx)(n.li,{children:"List of Users"}),"\n",(0,i.jsx)(n.li,{children:"List of Databases"}),"\n",(0,i.jsx)(n.li,{children:"Current Date"}),"\n"]}),"\n",(0,i.jsx)(n.h3,{id:"meeting-summarizer-tool-calling-agent",children:"Meeting Summarizer (Tool Calling Agent)"}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.strong,{children:"Purpose"}),": Analyzes the meeting transcript and identifies tasks and action items."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.strong,{children:"Inputs"}),":","\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsx)(n.li,{children:"System Prompt (from the Prompt component)"}),"\n",(0,i.jsx)(n.li,{children:"Language Model (OpenAI)"}),"\n",(0,i.jsxs)(n.li,{children:["Tools:","\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsx)(n.li,{children:"Notion Search"}),"\n",(0,i.jsx)(n.li,{children:"List Database Properties"}),"\n",(0,i.jsx)(n.li,{children:"Create Page"}),"\n",(0,i.jsx)(n.li,{children:"Update Page Property"}),"\n",(0,i.jsx)(n.li,{children:"Add Content to Page"}),"\n"]}),"\n"]}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.img,{alt:"Notion Meeting Agent Part 2",src:t(29750).A+"",width:"1362",height:"819"})}),"\n",(0,i.jsx)(n.h3,{id:"notion-agent-tool-calling-agent",children:"Notion Agent (Tool Calling Agent)"}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.strong,{children:"Purpose"}),": Executes actions in Notion based on the meeting summary."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.strong,{children:"Inputs"}),":","\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsx)(n.li,{children:"System Prompt (from the second Prompt component)"}),"\n",(0,i.jsx)(n.li,{children:"Language Model (OpenAI)"}),"\n",(0,i.jsxs)(n.li,{children:["Tools:","\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsx)(n.li,{children:"List Database Properties"}),"\n",(0,i.jsx)(n.li,{children:"Create Page"}),"\n",(0,i.jsx)(n.li,{children:"Update Page Property"}),"\n",(0,i.jsx)(n.li,{children:"Add Content to Page"}),"\n"]}),"\n"]}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,i.jsx)(n.h3,{id:"notion-components-tools",children:"Notion Components (Tools)"}),"\n",(0,i.jsx)(n.h4,{id:"list-database-properties",children:"List Database Properties"}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.strong,{children:"Purpose"}),": Retrieves the properties of a specified Notion database."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.strong,{children:"Input"}),":","\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsx)(n.li,{children:"Database ID"}),"\n",(0,i.jsx)(n.li,{children:"Notion Secret (API key)"}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,i.jsx)(n.h4,{id:"create-page",children:"Create Page"}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.strong,{children:"Purpose"}),": Creates a new page in a Notion database."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.strong,{children:"Inputs"}),":","\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsx)(n.li,{children:"Database ID"}),"\n",(0,i.jsx)(n.li,{children:"Notion Secret (API key)"}),"\n",(0,i.jsx)(n.li,{children:"Properties (JSON)"}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,i.jsx)(n.h4,{id:"update-page-property",children:"Update Page Property"}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.strong,{children:"Purpose"}),": Updates the properties of an existing Notion page."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.strong,{children:"Inputs"}),":","\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsx)(n.li,{children:"Page ID"}),"\n",(0,i.jsx)(n.li,{children:"Notion Secret (API key)"}),"\n",(0,i.jsx)(n.li,{children:"Properties to update"}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,i.jsx)(n.h4,{id:"add-content-to-page",children:"Add Content to Page"}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.strong,{children:"Purpose"}),": Converts markdown text to Notion blocks and appends them to a specified Notion page."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.strong,{children:"Inputs"}),":","\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsx)(n.li,{children:"Page/Block ID"}),"\n",(0,i.jsx)(n.li,{children:"Notion Secret (API key)"}),"\n",(0,i.jsx)(n.li,{children:"Markdown text"}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,i.jsx)(n.h3,{id:"chat-output",children:"Chat Output"}),"\n",(0,i.jsx)(n.p,{children:"Displays the final output of the Notion Agent in the Playground."}),"\n",(0,i.jsx)(n.h2,{id:"flow-process",children:"Flow Process"}),"\n",(0,i.jsx)(n.hr,{}),"\n",(0,i.jsxs)(n.ol,{children:["\n",(0,i.jsx)(n.li,{children:"The user inputs a meeting transcript."}),"\n",(0,i.jsx)(n.li,{children:"The flow retrieves the list of Notion users and databases."}),"\n",(0,i.jsx)(n.li,{children:"A prompt is generated using the transcript, user list, database list, and current date."}),"\n",(0,i.jsx)(n.li,{children:"The Meeting Summarizer analyzes the transcript and identifies tasks and action items."}),"\n",(0,i.jsxs)(n.li,{children:["The Notion Agent uses the meeting summary to:","\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsx)(n.li,{children:"Create new pages for new tasks"}),"\n",(0,i.jsx)(n.li,{children:"Update existing pages for existing tasks"}),"\n",(0,i.jsx)(n.li,{children:"Add content to pages with meeting notes"}),"\n"]}),"\n"]}),"\n",(0,i.jsx)(n.li,{children:"The Chat Output displays a summary of actions taken in Notion."}),"\n"]}),"\n",(0,i.jsx)(n.h2,{id:"run-the-notion-meeting-notes-flow",children:"Run the Notion Meeting Notes flow"}),"\n",(0,i.jsx)(n.hr,{}),"\n",(0,i.jsx)(n.p,{children:"To run the Notion Agent for Meeting Notes:"}),"\n",(0,i.jsxs)(n.ol,{children:["\n",(0,i.jsx)(n.li,{children:"Open Langflow and create a new project."}),"\n",(0,i.jsxs)(n.li,{children:["Add the components listed above to your flow canvas, or download the ",(0,i.jsx)(n.a,{target:"_blank","data-noBrokenLinkCheck":!0,href:t(86924).A+"",children:"Flow Meeting Agent Flow"}),"(Download link) and ",(0,i.jsx)(n.strong,{children:"Import"})," the JSON file into Langflow."]}),"\n",(0,i.jsx)(n.li,{children:"Connect the components as shown in the flow diagram."}),"\n",(0,i.jsx)(n.li,{children:"Input the Notion and OpenAI API keys in their respective components."}),"\n",(0,i.jsx)(n.li,{children:"Paste your meeting transcript into the Meeting Transcript component."}),"\n",(0,i.jsxs)(n.li,{children:["Run the flow by clicking ",(0,i.jsx)(n.strong,{children:"Play"})," on the ",(0,i.jsx)(n.strong,{children:"Chat Output"})," component."]}),"\n",(0,i.jsx)(n.li,{children:"Review the output in the Chat Output component, which will summarize the actions taken in your Notion workspace."}),"\n"]}),"\n",(0,i.jsx)(n.p,{children:"For optimal results, use detailed meeting transcripts. The quality of the output depends on the comprehensiveness of the input provided."}),"\n",(0,i.jsx)(n.h2,{id:"customization",children:"Customization"}),"\n",(0,i.jsx)(n.hr,{}),"\n",(0,i.jsx)(n.p,{children:"The flow can be customized to meet your team's specific needs."}),"\n",(0,i.jsx)(n.p,{children:"Customize this flow by:"}),"\n",(0,i.jsxs)(n.ol,{children:["\n",(0,i.jsx)(n.li,{children:"Adjusting the system prompt to change the agent's behavior or knowledge base."}),"\n",(0,i.jsx)(n.li,{children:"Adding or removing Notion tools based on your specific needs."}),"\n",(0,i.jsx)(n.li,{children:"Modifying the OpenAI model parameters (e.g., temperature) to adjust the agent's response style."}),"\n"]}),"\n",(0,i.jsx)(n.h2,{id:"troubleshooting",children:"Troubleshooting"}),"\n",(0,i.jsx)(n.hr,{}),"\n",(0,i.jsx)(n.p,{children:"If you encounter issues:"}),"\n",(0,i.jsxs)(n.ol,{children:["\n",(0,i.jsx)(n.li,{children:"Ensure all API keys are correctly set and have the necessary permissions."}),"\n",(0,i.jsx)(n.li,{children:"Check that your Notion integration has access to the relevant pages and databases."}),"\n",(0,i.jsx)(n.li,{children:"Verify that all components are properly connected in the flow."}),"\n",(0,i.jsx)(n.li,{children:"Review the Langflow logs for any error messages."}),"\n"]}),"\n",(0,i.jsxs)(n.p,{children:["For more advanced usage and integration options, refer to the ",(0,i.jsx)(n.a,{href:"https://developers.notion.com/",children:"Notion API documentation"})," and ",(0,i.jsx)(n.a,{href:"/",children:"Langflow documentation"}),"."]})]})}function h(e={}){const{wrapper:n}={...(0,s.R)(),...e.components};return n?(0,i.jsx)(n,{...e,children:(0,i.jsx)(c,{...e})}):c(e)}},86924:(e,n,t)=>{t.d(n,{A:()=>i});const i=t.p+"assets/files/Meeting_Notes_Agent-3bf013ee192aba15c84d74cc91079a4a.json"},43725:(e,n,t)=>{t.d(n,{A:()=>i});const i=t.p+"assets/images/notion_meeting_agent_part_1-58b920a4f8129f18bbf4483b3e3255a5.png"},29750:(e,n,t)=>{t.d(n,{A:()=>i});const i=t.p+"assets/images/notion_meeting_agent_part_2-cbaa61a7a2dc7af1fc8541bfae8491ac.png"},28453:(e,n,t)=>{t.d(n,{R:()=>r,x:()=>l});var i=t(96540);const s={},o=i.createContext(s);function r(e){const n=i.useContext(o);return i.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function l(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:r(e.components),i.createElement(o.Provider,{value:n},e.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunklangflow_docs=self.webpackChunklangflow_docs||[]).push([[5475],{66662:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>a,contentTitle:()=>r,default:()=>h,frontMatter:()=>o,metadata:()=>l,toc:()=>d});var i=t(74848),s=t(28453);const o={title:"Notion Meeting Notes Agent",sidebar_position:1,slug:"/integrations/notion/notion-agent-meeting-notes"},r=void 0,l={id:"Integrations/Notion/notion-agent-meeting-notes",title:"Notion Meeting Notes Agent",description:"The Notion Agent for Meeting Notes is an AI-powered tool that automatically processes meeting transcripts and updates your Notion workspace. It identifies tasks, action items, and key points from your meetings, then creates new tasks or updates existing ones in Notion without manual input.",source:"@site/docs/Integrations/Notion/notion-agent-meeting-notes.md",sourceDirName:"Integrations/Notion",slug:"/integrations/notion/notion-agent-meeting-notes",permalink:"/integrations/notion/notion-agent-meeting-notes",draft:!1,unlisted:!1,tags:[],version:"current",sidebarPosition:1,frontMatter:{title:"Notion Meeting Notes Agent",sidebar_position:1,slug:"/integrations/notion/notion-agent-meeting-notes"},sidebar:"docs",previous:{title:"Notion Conversational Agent",permalink:"/integrations/notion/notion-agent-conversational"},next:{title:"Join the Langflow community",permalink:"/contributing-community"}},a={},d=[{value:"Prerequisites",id:"prerequisites",level:2},{value:"Components",id:"components",level:2},{value:"Meeting Transcript (Text Input)",id:"meeting-transcript-text-input",level:3},{value:"List Users (Notion Component)",id:"list-users-notion-component",level:3},{value:"List Databases (Notion Component)",id:"list-databases-notion-component",level:3},{value:"Prompt",id:"prompt",level:3},{value:"Meeting Summarizer (Tool Calling Agent)",id:"meeting-summarizer-tool-calling-agent",level:3},{value:"Notion Agent (Tool Calling Agent)",id:"notion-agent-tool-calling-agent",level:3},{value:"Notion Components (Tools)",id:"notion-components-tools",level:3},{value:"List Database Properties",id:"list-database-properties",level:4},{value:"Create Page",id:"create-page",level:4},{value:"Update Page Property",id:"update-page-property",level:4},{value:"Add Content to Page",id:"add-content-to-page",level:4},{value:"Chat Output",id:"chat-output",level:3},{value:"Flow Process",id:"flow-process",level:2},{value:"Run the Notion Meeting Notes flow",id:"run-the-notion-meeting-notes-flow",level:2},{value:"Customization",id:"customization",level:2},{value:"Troubleshooting",id:"troubleshooting",level:2}];function c(e){const n={a:"a",admonition:"admonition",h2:"h2",h3:"h3",h4:"h4",hr:"hr",img:"img",li:"li",ol:"ol",p:"p",strong:"strong",ul:"ul",...(0,s.R)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(n.p,{children:"The Notion Agent for Meeting Notes is an AI-powered tool that automatically processes meeting transcripts and updates your Notion workspace. It identifies tasks, action items, and key points from your meetings, then creates new tasks or updates existing ones in Notion without manual input."}),"\n",(0,i.jsx)(n.h2,{id:"prerequisites",children:"Prerequisites"}),"\n",(0,i.jsx)(n.hr,{}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsx)(n.li,{children:(0,i.jsx)(n.a,{href:"/integrations/notion/setup",children:"Notion App"})}),"\n",(0,i.jsx)(n.li,{children:(0,i.jsx)(n.a,{href:"https://www.notion.so/my-integrations",children:"Notion API key"})}),"\n",(0,i.jsx)(n.li,{children:(0,i.jsx)(n.a,{href:"https://platform.openai.com/account/api-keys",children:"OpenAI API key"})}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.a,{target:"_blank","data-noBrokenLinkCheck":!0,href:t(86924).A+"",children:"Download Flow Meeting Agent Flow"}),"(Download link)"]}),"\n"]}),"\n",(0,i.jsx)(n.admonition,{type:"warning",children:(0,i.jsx)(n.p,{children:"Before using this flow, ensure you have obtained the necessary API keys from Notion and OpenAI. These keys are essential for the flow to function properly. Keep them secure and do not share them publicly."})}),"\n",(0,i.jsx)(n.h2,{id:"components",children:"Components"}),"\n",(0,i.jsx)(n.hr,{}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.img,{alt:"Notion Meeting Agent Part 1",src:t(43725).A+"",width:"1427",height:"645"})}),"\n",(0,i.jsx)(n.h3,{id:"meeting-transcript-text-input",children:"Meeting Transcript (Text Input)"}),"\n",(0,i.jsx)(n.p,{children:"This component allows users to input the meeting transcript directly into the flow."}),"\n",(0,i.jsx)(n.h3,{id:"list-users-notion-component",children:"List Users (Notion Component)"}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.strong,{children:"Purpose"}),": Retrieves a list of users from the Notion workspace."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.strong,{children:"Input"}),": Notion Secret (API key)"]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.strong,{children:"Output"}),": List of user data"]}),"\n"]}),"\n",(0,i.jsx)(n.h3,{id:"list-databases-notion-component",children:"List Databases (Notion Component)"}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.strong,{children:"Purpose"}),": Searches and lists all databases in the Notion workspace."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.strong,{children:"Input"}),":","\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsx)(n.li,{children:"Notion Secret (API key)"}),"\n",(0,i.jsx)(n.li,{children:"Query (optional)"}),"\n",(0,i.jsx)(n.li,{children:"Filter Type (default: database)"}),"\n",(0,i.jsx)(n.li,{children:"Sort Direction"}),"\n"]}),"\n"]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.strong,{children:"Output"}),": List of database data"]}),"\n"]}),"\n",(0,i.jsx)(n.h3,{id:"prompt",children:"Prompt"}),"\n",(0,i.jsx)(n.p,{children:"This component creates a dynamic prompt template using the following inputs:"}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsx)(n.li,{children:"Meeting Transcript"}),"\n",(0,i.jsx)(n.li,{children:"List of Users"}),"\n",(0,i.jsx)(n.li,{children:"List of Databases"}),"\n",(0,i.jsx)(n.li,{children:"Current Date"}),"\n"]}),"\n",(0,i.jsx)(n.h3,{id:"meeting-summarizer-tool-calling-agent",children:"Meeting Summarizer (Tool Calling Agent)"}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.strong,{children:"Purpose"}),": Analyzes the meeting transcript and identifies tasks and action items."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.strong,{children:"Inputs"}),":","\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsx)(n.li,{children:"System Prompt (from the Prompt component)"}),"\n",(0,i.jsx)(n.li,{children:"Language Model (OpenAI)"}),"\n",(0,i.jsxs)(n.li,{children:["Tools:","\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsx)(n.li,{children:"Notion Search"}),"\n",(0,i.jsx)(n.li,{children:"List Database Properties"}),"\n",(0,i.jsx)(n.li,{children:"Create Page"}),"\n",(0,i.jsx)(n.li,{children:"Update Page Property"}),"\n",(0,i.jsx)(n.li,{children:"Add Content to Page"}),"\n"]}),"\n"]}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.img,{alt:"Notion Meeting Agent Part 2",src:t(29750).A+"",width:"1362",height:"819"})}),"\n",(0,i.jsx)(n.h3,{id:"notion-agent-tool-calling-agent",children:"Notion Agent (Tool Calling Agent)"}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.strong,{children:"Purpose"}),": Executes actions in Notion based on the meeting summary."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.strong,{children:"Inputs"}),":","\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsx)(n.li,{children:"System Prompt (from the second Prompt component)"}),"\n",(0,i.jsx)(n.li,{children:"Language Model (OpenAI)"}),"\n",(0,i.jsxs)(n.li,{children:["Tools:","\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsx)(n.li,{children:"List Database Properties"}),"\n",(0,i.jsx)(n.li,{children:"Create Page"}),"\n",(0,i.jsx)(n.li,{children:"Update Page Property"}),"\n",(0,i.jsx)(n.li,{children:"Add Content to Page"}),"\n"]}),"\n"]}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,i.jsx)(n.h3,{id:"notion-components-tools",children:"Notion Components (Tools)"}),"\n",(0,i.jsx)(n.h4,{id:"list-database-properties",children:"List Database Properties"}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.strong,{children:"Purpose"}),": Retrieves the properties of a specified Notion database."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.strong,{children:"Input"}),":","\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsx)(n.li,{children:"Database ID"}),"\n",(0,i.jsx)(n.li,{children:"Notion Secret (API key)"}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,i.jsx)(n.h4,{id:"create-page",children:"Create Page"}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.strong,{children:"Purpose"}),": Creates a new page in a Notion database."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.strong,{children:"Inputs"}),":","\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsx)(n.li,{children:"Database ID"}),"\n",(0,i.jsx)(n.li,{children:"Notion Secret (API key)"}),"\n",(0,i.jsx)(n.li,{children:"Properties (JSON)"}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,i.jsx)(n.h4,{id:"update-page-property",children:"Update Page Property"}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.strong,{children:"Purpose"}),": Updates the properties of an existing Notion page."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.strong,{children:"Inputs"}),":","\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsx)(n.li,{children:"Page ID"}),"\n",(0,i.jsx)(n.li,{children:"Notion Secret (API key)"}),"\n",(0,i.jsx)(n.li,{children:"Properties to update"}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,i.jsx)(n.h4,{id:"add-content-to-page",children:"Add Content to Page"}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.strong,{children:"Purpose"}),": Converts markdown text to Notion blocks and appends them to a specified Notion page."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.strong,{children:"Inputs"}),":","\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsx)(n.li,{children:"Page/Block ID"}),"\n",(0,i.jsx)(n.li,{children:"Notion Secret (API key)"}),"\n",(0,i.jsx)(n.li,{children:"Markdown text"}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,i.jsx)(n.h3,{id:"chat-output",children:"Chat Output"}),"\n",(0,i.jsx)(n.p,{children:"Displays the final output of the Notion Agent in the Playground."}),"\n",(0,i.jsx)(n.h2,{id:"flow-process",children:"Flow Process"}),"\n",(0,i.jsx)(n.hr,{}),"\n",(0,i.jsxs)(n.ol,{children:["\n",(0,i.jsx)(n.li,{children:"The user inputs a meeting transcript."}),"\n",(0,i.jsx)(n.li,{children:"The flow retrieves the list of Notion users and databases."}),"\n",(0,i.jsx)(n.li,{children:"A prompt is generated using the transcript, user list, database list, and current date."}),"\n",(0,i.jsx)(n.li,{children:"The Meeting Summarizer analyzes the transcript and identifies tasks and action items."}),"\n",(0,i.jsxs)(n.li,{children:["The Notion Agent uses the meeting summary to:","\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsx)(n.li,{children:"Create new pages for new tasks"}),"\n",(0,i.jsx)(n.li,{children:"Update existing pages for existing tasks"}),"\n",(0,i.jsx)(n.li,{children:"Add content to pages with meeting notes"}),"\n"]}),"\n"]}),"\n",(0,i.jsx)(n.li,{children:"The Chat Output displays a summary of actions taken in Notion."}),"\n"]}),"\n",(0,i.jsx)(n.h2,{id:"run-the-notion-meeting-notes-flow",children:"Run the Notion Meeting Notes flow"}),"\n",(0,i.jsx)(n.hr,{}),"\n",(0,i.jsx)(n.p,{children:"To run the Notion Agent for Meeting Notes:"}),"\n",(0,i.jsxs)(n.ol,{children:["\n",(0,i.jsx)(n.li,{children:"Open Langflow and create a new project."}),"\n",(0,i.jsxs)(n.li,{children:["Add the components listed above to your flow canvas, or download the ",(0,i.jsx)(n.a,{target:"_blank","data-noBrokenLinkCheck":!0,href:t(86924).A+"",children:"Flow Meeting Agent Flow"}),"(Download link) and ",(0,i.jsx)(n.strong,{children:"Import"})," the JSON file into Langflow."]}),"\n",(0,i.jsx)(n.li,{children:"Connect the components as shown in the flow diagram."}),"\n",(0,i.jsx)(n.li,{children:"Input the Notion and OpenAI API keys in their respective components."}),"\n",(0,i.jsx)(n.li,{children:"Paste your meeting transcript into the Meeting Transcript component."}),"\n",(0,i.jsxs)(n.li,{children:["Run the flow by clicking ",(0,i.jsx)(n.strong,{children:"Play"})," on the ",(0,i.jsx)(n.strong,{children:"Chat Output"})," component."]}),"\n",(0,i.jsx)(n.li,{children:"Review the output in the Chat Output component, which will summarize the actions taken in your Notion workspace."}),"\n"]}),"\n",(0,i.jsx)(n.p,{children:"For optimal results, use detailed meeting transcripts. The quality of the output depends on the comprehensiveness of the input provided."}),"\n",(0,i.jsx)(n.h2,{id:"customization",children:"Customization"}),"\n",(0,i.jsx)(n.hr,{}),"\n",(0,i.jsx)(n.p,{children:"The flow can be customized to meet your team's specific needs."}),"\n",(0,i.jsx)(n.p,{children:"Customize this flow by:"}),"\n",(0,i.jsxs)(n.ol,{children:["\n",(0,i.jsx)(n.li,{children:"Adjusting the system prompt to change the agent's behavior or knowledge base."}),"\n",(0,i.jsx)(n.li,{children:"Adding or removing Notion tools based on your specific needs."}),"\n",(0,i.jsx)(n.li,{children:"Modifying the OpenAI model parameters (e.g., temperature) to adjust the agent's response style."}),"\n"]}),"\n",(0,i.jsx)(n.h2,{id:"troubleshooting",children:"Troubleshooting"}),"\n",(0,i.jsx)(n.hr,{}),"\n",(0,i.jsx)(n.p,{children:"If you encounter issues:"}),"\n",(0,i.jsxs)(n.ol,{children:["\n",(0,i.jsx)(n.li,{children:"Ensure all API keys are correctly set and have the necessary permissions."}),"\n",(0,i.jsx)(n.li,{children:"Check that your Notion integration has access to the relevant pages and databases."}),"\n",(0,i.jsx)(n.li,{children:"Verify that all components are properly connected in the flow."}),"\n",(0,i.jsx)(n.li,{children:"Review the Langflow logs for any error messages."}),"\n"]}),"\n",(0,i.jsxs)(n.p,{children:["For more advanced usage and integration options, refer to the ",(0,i.jsx)(n.a,{href:"https://developers.notion.com/",children:"Notion API documentation"})," and ",(0,i.jsx)(n.a,{href:"/",children:"Langflow documentation"}),"."]})]})}function h(e={}){const{wrapper:n}={...(0,s.R)(),...e.components};return n?(0,i.jsx)(n,{...e,children:(0,i.jsx)(c,{...e})}):c(e)}},86924:(e,n,t)=>{t.d(n,{A:()=>i});const i=t.p+"assets/files/Meeting_Notes_Agent-b29188c0cb70736d19dd52965db5f352.json"},43725:(e,n,t)=>{t.d(n,{A:()=>i});const i=t.p+"assets/images/notion_meeting_agent_part_1-58b920a4f8129f18bbf4483b3e3255a5.png"},29750:(e,n,t)=>{t.d(n,{A:()=>i});const i=t.p+"assets/images/notion_meeting_agent_part_2-cbaa61a7a2dc7af1fc8541bfae8491ac.png"},28453:(e,n,t)=>{t.d(n,{R:()=>r,x:()=>l});var i=t(96540);const s={},o=i.createContext(s);function r(e){const n=i.useContext(o);return i.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function l(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:r(e.components),i.createElement(o.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/6a2beaac.87f20d44.js b/assets/js/6a2beaac.3dbd74ae.js similarity index 99% rename from assets/js/6a2beaac.87f20d44.js rename to assets/js/6a2beaac.3dbd74ae.js index 46117c256c..a9233a44f4 100644 --- a/assets/js/6a2beaac.87f20d44.js +++ b/assets/js/6a2beaac.3dbd74ae.js @@ -1 +1 @@ -"use strict";(self.webpackChunklangflow_docs=self.webpackChunklangflow_docs||[]).push([[3110],{601:(e,n,t)=>{t.r(n),t.d(n,{CH:()=>d,assets:()=>c,chCodeConfig:()=>h,contentTitle:()=>a,default:()=>u,frontMatter:()=>r,metadata:()=>l,toc:()=>p});var o=t(74848),s=t(28453),i=t(24754);const r={title:"Notion Conversational Agent",sidebar_position:2,slug:"/integrations/notion/notion-agent-conversational"},a=void 0,l={id:"Integrations/Notion/notion-agent-conversational",title:"Notion Conversational Agent",description:"The Notion Conversational Agent is an AI-powered assistant that interacts with your Notion workspace through natural language conversations. This flow performs Notion-related tasks like creating pages, searching for information, and managing content, all through a chat interface.",source:"@site/docs/Integrations/Notion/notion-agent-conversational.md",sourceDirName:"Integrations/Notion",slug:"/integrations/notion/notion-agent-conversational",permalink:"/integrations/notion/notion-agent-conversational",draft:!1,unlisted:!1,tags:[],version:"current",sidebarPosition:2,frontMatter:{title:"Notion Conversational Agent",sidebar_position:2,slug:"/integrations/notion/notion-agent-conversational"},sidebar:"docs",previous:{title:"Setup",permalink:"/integrations/notion/setup"},next:{title:"Notion Meeting Notes Agent",permalink:"/integrations/notion/notion-agent-meeting-notes"}},c={},d={annotations:i.hk,Code:i.Cy},h={staticMediaQuery:"not screen, (max-width: 768px)",lineNumbers:!0,showCopyButton:!0,themeName:"github-dark"},p=[{value:"Prerequisites",id:"prerequisites",level:2},{value:"Flow Components",id:"flow-components",level:2},{value:"Input and Output",id:"input-and-output",level:3},{value:"Language Model",id:"language-model",level:3},{value:"Agent and Tools",id:"agent-and-tools",level:3},{value:"Memory and Prompt",id:"memory-and-prompt",level:3},{value:"Run the Conversational Notion Agent",id:"run-the-conversational-notion-agent",level:2},{value:"Example Interactions",id:"example-interactions",level:2},{value:"Customization",id:"customization",level:2},{value:"Troubleshooting",id:"troubleshooting",level:2}];function g(e){const n={a:"a",h2:"h2",h3:"h3",hr:"hr",img:"img",li:"li",ol:"ol",p:"p",strong:"strong",ul:"ul",...(0,s.R)(),...e.components};return d||m("CH",!1),d.Code||m("CH.Code",!0),(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("style",{dangerouslySetInnerHTML:{__html:'[data-ch-theme="github-dark"] { --ch-t-colorScheme: dark;--ch-t-foreground: #c9d1d9;--ch-t-background: #0d1117;--ch-t-lighter-inlineBackground: #0d1117e6;--ch-t-editor-background: #0d1117;--ch-t-editor-foreground: #c9d1d9;--ch-t-editor-lineHighlightBackground: #6e76811a;--ch-t-editor-rangeHighlightBackground: #ffffff0b;--ch-t-editor-infoForeground: #3794FF;--ch-t-editor-selectionBackground: #264F78;--ch-t-focusBorder: #1f6feb;--ch-t-tab-activeBackground: #0d1117;--ch-t-tab-activeForeground: #c9d1d9;--ch-t-tab-inactiveBackground: #010409;--ch-t-tab-inactiveForeground: #8b949e;--ch-t-tab-border: #30363d;--ch-t-tab-activeBorder: #0d1117;--ch-t-editorGroup-border: #30363d;--ch-t-editorGroupHeader-tabsBackground: #010409;--ch-t-editorLineNumber-foreground: #6e7681;--ch-t-input-background: #0d1117;--ch-t-input-foreground: #c9d1d9;--ch-t-input-border: #30363d;--ch-t-icon-foreground: #8b949e;--ch-t-sideBar-background: #010409;--ch-t-sideBar-foreground: #c9d1d9;--ch-t-sideBar-border: #30363d;--ch-t-list-activeSelectionBackground: #6e768166;--ch-t-list-activeSelectionForeground: #c9d1d9;--ch-t-list-hoverBackground: #6e76811a;--ch-t-list-hoverForeground: #c9d1d9; }'}}),"\n",(0,o.jsx)(n.p,{children:"The Notion Conversational Agent is an AI-powered assistant that interacts with your Notion workspace through natural language conversations. This flow performs Notion-related tasks like creating pages, searching for information, and managing content, all through a chat interface."}),"\n",(0,o.jsx)(n.h2,{id:"prerequisites",children:"Prerequisites"}),"\n",(0,o.jsx)(n.hr,{}),"\n",(0,o.jsxs)(n.ul,{children:["\n",(0,o.jsx)(n.li,{children:(0,o.jsx)(n.a,{href:"/integrations/notion/setup",children:"Notion App"})}),"\n",(0,o.jsx)(n.li,{children:(0,o.jsx)(n.a,{href:"https://www.notion.so/my-integrations",children:"Notion account and API key"})}),"\n",(0,o.jsx)(n.li,{children:(0,o.jsx)(n.a,{href:"https://platform.openai.com/account/api-keys",children:"OpenAI API key"})}),"\n",(0,o.jsxs)(n.li,{children:[(0,o.jsx)(n.a,{target:"_blank","data-noBrokenLinkCheck":!0,href:t(54821).A+"",children:"Download Flow Conversation Agent Flow"}),"(Download link)"]}),"\n"]}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.img,{alt:"Notion Components Toolkit",src:t(84530).A+"",width:"1188",height:"793"})}),"\n",(0,o.jsx)(n.h2,{id:"flow-components",children:"Flow Components"}),"\n",(0,o.jsx)(n.hr,{}),"\n",(0,o.jsx)(n.h3,{id:"input-and-output",children:"Input and Output"}),"\n",(0,o.jsxs)(n.ul,{children:["\n",(0,o.jsxs)(n.li,{children:[(0,o.jsx)(n.strong,{children:"Chat Input"}),": Accepts user queries and commands"]}),"\n",(0,o.jsxs)(n.li,{children:[(0,o.jsx)(n.strong,{children:"Chat Output"}),": Displays the agent's responses"]}),"\n"]}),"\n",(0,o.jsx)(n.h3,{id:"language-model",children:"Language Model"}),"\n",(0,o.jsxs)(n.ul,{children:["\n",(0,o.jsxs)(n.li,{children:[(0,o.jsx)(n.strong,{children:"OpenAI Model"}),": Processes user input and generates responses"]}),"\n"]}),"\n",(0,o.jsx)(n.h3,{id:"agent-and-tools",children:"Agent and Tools"}),"\n",(0,o.jsxs)(n.ul,{children:["\n",(0,o.jsxs)(n.li,{children:[(0,o.jsx)(n.strong,{children:"Tool Calling Agent"}),": Coordinates the use of various Notion tools based on user input"]}),"\n",(0,o.jsxs)(n.li,{children:[(0,o.jsx)(n.strong,{children:"Toolkit"}),": Combines multiple Notion-specific tools into a single toolkit"]}),"\n",(0,o.jsxs)(n.li,{children:[(0,o.jsx)(n.strong,{children:"Notion Tools"}),": Various components for interacting with Notion, including:","\n",(0,o.jsxs)(n.ul,{children:["\n",(0,o.jsx)(n.li,{children:"List Users"}),"\n",(0,o.jsx)(n.li,{children:"List Database Properties"}),"\n",(0,o.jsx)(n.li,{children:"List Pages"}),"\n",(0,o.jsx)(n.li,{children:"Page Content Viewer"}),"\n",(0,o.jsx)(n.li,{children:"Create Page"}),"\n",(0,o.jsx)(n.li,{children:"Update Page Property"}),"\n",(0,o.jsx)(n.li,{children:"Add Content to Page"}),"\n",(0,o.jsx)(n.li,{children:"Search"}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,o.jsx)(n.h3,{id:"memory-and-prompt",children:"Memory and Prompt"}),"\n",(0,o.jsxs)(n.ul,{children:["\n",(0,o.jsxs)(n.li,{children:[(0,o.jsx)(n.strong,{children:"Chat Memory"}),": Stores conversation history"]}),"\n",(0,o.jsxs)(n.li,{children:[(0,o.jsx)(n.strong,{children:"Prompt"}),": Provides system instructions and context for the agent"]}),"\n",(0,o.jsxs)(n.li,{children:[(0,o.jsx)(n.strong,{children:"Current Date"}),": Supplies the current date and time for context"]}),"\n"]}),"\n",(0,o.jsx)(n.h2,{id:"run-the-conversational-notion-agent",children:"Run the Conversational Notion Agent"}),"\n",(0,o.jsx)(n.hr,{}),"\n",(0,o.jsxs)(n.ol,{children:["\n",(0,o.jsx)(n.li,{children:"Open Langflow and create a new project."}),"\n",(0,o.jsxs)(n.li,{children:["Add the components listed above to your flow canvas, or Download the ",(0,o.jsx)(n.a,{target:"_blank","data-noBrokenLinkCheck":!0,href:t(54821).A+"",children:"Conversation Agent Flow"}),"(Download link) and ",(0,o.jsx)(n.strong,{children:"Import"})," the JSON file into Langflow."]}),"\n",(0,o.jsx)(n.li,{children:"Connect the components as shown in the flow diagram."}),"\n",(0,o.jsx)(n.li,{children:"Input the Notion and OpenAI API keys in their respective components."}),"\n",(0,o.jsx)(n.li,{children:'To start the flow, click the "Play" button in Langflow.'}),"\n",(0,o.jsxs)(n.li,{children:["In the chat interface, enter a Notion-related request or question. For example:","\n",(0,o.jsxs)(n.ul,{children:["\n",(0,o.jsx)(n.li,{children:'"Create a new page in my task database"'}),"\n",(0,o.jsx)(n.li,{children:'"Search for pages about project management"'}),"\n",(0,o.jsx)(n.li,{children:'"List all users in my Notion workspace"'}),"\n"]}),"\n"]}),"\n",(0,o.jsx)(n.li,{children:"The agent will process your request, use the appropriate Notion tools, and provide a response."}),"\n",(0,o.jsx)(n.li,{children:"Continue the conversation, asking follow-up questions or giving new commands as needed."}),"\n"]}),"\n",(0,o.jsx)(n.h2,{id:"example-interactions",children:"Example Interactions"}),"\n",(0,o.jsx)(n.hr,{}),"\n",(0,o.jsx)(d.Code,{codeConfig:h,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"User: List all the users in my Notion workspace.",props:{}}]},{tokens:[{content:"",props:{}}]},{tokens:[{content:"Agent: Certainly! I'll use the Notion User List tool to retrieve that information for you. One moment please.",props:{}}]},{tokens:[{content:"",props:{}}]},{tokens:[{content:"[Agent uses the Notion User List tool]",props:{}}]},{tokens:[{content:"",props:{}}]},{tokens:[{content:"Here's a list of users in your Notion workspace:",props:{}}]},{tokens:[{content:"",props:{}}]},{tokens:[{content:"1. John Doe (john@example.com)",props:{}}]},{tokens:[{content:"2. Jane Smith (jane@example.com)",props:{}}]},{tokens:[{content:"3. Alex Johnson (alex@example.com)",props:{}}]},{tokens:[{content:"",props:{}}]},{tokens:[{content:"Is there anything specific you'd like to know about these users or any other Notion-related task I can help you with?",props:{}}]},{tokens:[{content:"",props:{}}]},{tokens:[{content:'User: Create a new page in my Projects database with the title "Website Redesign".',props:{}}]},{tokens:[{content:"",props:{}}]},{tokens:[{content:"Agent: Certainly! I'd be happy to create a new page in your Projects database with the title \"Website Redesign\". I'll use the Notion Page Creator tool to do this. First, let me check the properties of your Projects database to ensure we include all necessary information.",props:{}}]},{tokens:[{content:"",props:{}}]},{tokens:[{content:"[Agent uses the Notion Database Properties tool]",props:{}}]},{tokens:[{content:"",props:{}}]},{tokens:[{content:"I've retrieved the properties for your Projects database. Now, I'll create the new page with the title \"Website Redesign\". One moment please.",props:{}}]},{tokens:[{content:"",props:{}}]},{tokens:[{content:"[Agent uses the Notion Page Creator tool]",props:{}}]},{tokens:[{content:"",props:{}}]},{tokens:[{content:'Great news! I\'ve successfully created a new page in your Projects database with the title "Website Redesign". Here are the details:',props:{}}]},{tokens:[{content:"",props:{}}]},{tokens:[{content:"- Title: Website Redesign",props:{}}]},{tokens:[{content:"- Page ID: [page_id_here]",props:{}}]},{tokens:[{content:"- URL: [page_url_here]",props:{}}]},{tokens:[{content:"",props:{}}]},{tokens:[{content:"Is there any additional information you'd like me to add to this new project page, such as a description, due date, or assigned team members?",props:{}}]},{tokens:[{content:"",props:{}}]},{tokens:[{content:'User: Yes, please add a description: "Redesign company website to improve user experience and modernize the look."',props:{}}]},{tokens:[{content:"",props:{}}]},{tokens:[{content:"Agent: Certainly! I'd be happy to add that description to the \"Website Redesign\" project page. I'll use the Add Content to Page tool to update the page with this information.",props:{}}]},{tokens:[{content:"",props:{}}]},{tokens:[{content:"[Agent uses the Add Content to Page tool]",props:{}}]},{tokens:[{content:"",props:{}}]},{tokens:[{content:"I've successfully added the description to your \"Website Redesign\" project page. Here's a summary of what I've done:",props:{}}]},{tokens:[{content:"",props:{}}]},{tokens:[{content:'1. Located the "Website Redesign" page using the page ID from our previous interaction.',props:{}}]},{tokens:[{content:"2. Added the following content to the page:",props:{}}]},{tokens:[{content:"",props:{}}]},{tokens:[{content:" Description: Redesign company website to improve user experience and modernize the look.",props:{}}]},{tokens:[{content:"",props:{}}]},{tokens:[{content:"The description has been added as a new text block on the page. Is there anything else you'd like me to add or modify on this project page?",props:{}}]},{tokens:[{content:"",props:{}}]}],lang:"text"},annotations:[]}]}),"\n",(0,o.jsx)(n.h2,{id:"customization",children:"Customization"}),"\n",(0,o.jsx)(n.hr,{}),"\n",(0,o.jsx)(n.p,{children:"The flow can be customized to meet your team's specific needs."}),"\n",(0,o.jsx)(n.p,{children:"Customize this flow by:"}),"\n",(0,o.jsxs)(n.ol,{children:["\n",(0,o.jsx)(n.li,{children:"Adjusting the system prompt to change the agent's behavior or knowledge base."}),"\n",(0,o.jsx)(n.li,{children:"Adding or removing Notion tools based on your specific needs."}),"\n",(0,o.jsx)(n.li,{children:"Modifying the OpenAI model parameters (e.g., temperature) to adjust the agent's response style."}),"\n"]}),"\n",(0,o.jsx)(n.h2,{id:"troubleshooting",children:"Troubleshooting"}),"\n",(0,o.jsx)(n.hr,{}),"\n",(0,o.jsx)(n.p,{children:"If you encounter issues:"}),"\n",(0,o.jsxs)(n.ol,{children:["\n",(0,o.jsx)(n.li,{children:"Ensure all API keys are correctly set and have the necessary permissions."}),"\n",(0,o.jsx)(n.li,{children:"Check that your Notion integration has access to the relevant pages and databases."}),"\n",(0,o.jsx)(n.li,{children:"Verify that all components are properly connected in the flow."}),"\n",(0,o.jsx)(n.li,{children:"Review the Langflow logs for any error messages."}),"\n"]}),"\n",(0,o.jsxs)(n.p,{children:["For more advanced usage and integration options, refer to the ",(0,o.jsx)(n.a,{href:"https://developers.notion.com/",children:"Notion API documentation"})," and ",(0,o.jsx)(n.a,{href:"/",children:"Langflow documentation"}),"."]})]})}function u(e={}){const{wrapper:n}={...(0,s.R)(),...e.components};return n?(0,o.jsx)(n,{...e,children:(0,o.jsx)(g,{...e})}):g(e)}function m(e,n){throw new Error("Expected "+(n?"component":"object")+" `"+e+"` to be defined: you likely forgot to import, pass, or provide it.")}},54821:(e,n,t)=>{t.d(n,{A:()=>o});const o=t.p+"assets/files/Conversational_Notion_Agent-5aa96d840d4d38fe4b064400d06ac109.json"},84530:(e,n,t)=>{t.d(n,{A:()=>o});const o=t.p+"assets/images/notion_conversational_agent_tools-6952705eb98e10bd4a67b74500a6189d.png"}}]); \ No newline at end of file +"use strict";(self.webpackChunklangflow_docs=self.webpackChunklangflow_docs||[]).push([[3110],{601:(e,n,t)=>{t.r(n),t.d(n,{CH:()=>d,assets:()=>c,chCodeConfig:()=>h,contentTitle:()=>a,default:()=>u,frontMatter:()=>r,metadata:()=>l,toc:()=>p});var o=t(74848),s=t(28453),i=t(24754);const r={title:"Notion Conversational Agent",sidebar_position:2,slug:"/integrations/notion/notion-agent-conversational"},a=void 0,l={id:"Integrations/Notion/notion-agent-conversational",title:"Notion Conversational Agent",description:"The Notion Conversational Agent is an AI-powered assistant that interacts with your Notion workspace through natural language conversations. This flow performs Notion-related tasks like creating pages, searching for information, and managing content, all through a chat interface.",source:"@site/docs/Integrations/Notion/notion-agent-conversational.md",sourceDirName:"Integrations/Notion",slug:"/integrations/notion/notion-agent-conversational",permalink:"/integrations/notion/notion-agent-conversational",draft:!1,unlisted:!1,tags:[],version:"current",sidebarPosition:2,frontMatter:{title:"Notion Conversational Agent",sidebar_position:2,slug:"/integrations/notion/notion-agent-conversational"},sidebar:"docs",previous:{title:"Setup",permalink:"/integrations/notion/setup"},next:{title:"Notion Meeting Notes Agent",permalink:"/integrations/notion/notion-agent-meeting-notes"}},c={},d={annotations:i.hk,Code:i.Cy},h={staticMediaQuery:"not screen, (max-width: 768px)",lineNumbers:!0,showCopyButton:!0,themeName:"github-dark"},p=[{value:"Prerequisites",id:"prerequisites",level:2},{value:"Flow Components",id:"flow-components",level:2},{value:"Input and Output",id:"input-and-output",level:3},{value:"Language Model",id:"language-model",level:3},{value:"Agent and Tools",id:"agent-and-tools",level:3},{value:"Memory and Prompt",id:"memory-and-prompt",level:3},{value:"Run the Conversational Notion Agent",id:"run-the-conversational-notion-agent",level:2},{value:"Example Interactions",id:"example-interactions",level:2},{value:"Customization",id:"customization",level:2},{value:"Troubleshooting",id:"troubleshooting",level:2}];function g(e){const n={a:"a",h2:"h2",h3:"h3",hr:"hr",img:"img",li:"li",ol:"ol",p:"p",strong:"strong",ul:"ul",...(0,s.R)(),...e.components};return d||m("CH",!1),d.Code||m("CH.Code",!0),(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("style",{dangerouslySetInnerHTML:{__html:'[data-ch-theme="github-dark"] { --ch-t-colorScheme: dark;--ch-t-foreground: #c9d1d9;--ch-t-background: #0d1117;--ch-t-lighter-inlineBackground: #0d1117e6;--ch-t-editor-background: #0d1117;--ch-t-editor-foreground: #c9d1d9;--ch-t-editor-lineHighlightBackground: #6e76811a;--ch-t-editor-rangeHighlightBackground: #ffffff0b;--ch-t-editor-infoForeground: #3794FF;--ch-t-editor-selectionBackground: #264F78;--ch-t-focusBorder: #1f6feb;--ch-t-tab-activeBackground: #0d1117;--ch-t-tab-activeForeground: #c9d1d9;--ch-t-tab-inactiveBackground: #010409;--ch-t-tab-inactiveForeground: #8b949e;--ch-t-tab-border: #30363d;--ch-t-tab-activeBorder: #0d1117;--ch-t-editorGroup-border: #30363d;--ch-t-editorGroupHeader-tabsBackground: #010409;--ch-t-editorLineNumber-foreground: #6e7681;--ch-t-input-background: #0d1117;--ch-t-input-foreground: #c9d1d9;--ch-t-input-border: #30363d;--ch-t-icon-foreground: #8b949e;--ch-t-sideBar-background: #010409;--ch-t-sideBar-foreground: #c9d1d9;--ch-t-sideBar-border: #30363d;--ch-t-list-activeSelectionBackground: #6e768166;--ch-t-list-activeSelectionForeground: #c9d1d9;--ch-t-list-hoverBackground: #6e76811a;--ch-t-list-hoverForeground: #c9d1d9; }'}}),"\n",(0,o.jsx)(n.p,{children:"The Notion Conversational Agent is an AI-powered assistant that interacts with your Notion workspace through natural language conversations. This flow performs Notion-related tasks like creating pages, searching for information, and managing content, all through a chat interface."}),"\n",(0,o.jsx)(n.h2,{id:"prerequisites",children:"Prerequisites"}),"\n",(0,o.jsx)(n.hr,{}),"\n",(0,o.jsxs)(n.ul,{children:["\n",(0,o.jsx)(n.li,{children:(0,o.jsx)(n.a,{href:"/integrations/notion/setup",children:"Notion App"})}),"\n",(0,o.jsx)(n.li,{children:(0,o.jsx)(n.a,{href:"https://www.notion.so/my-integrations",children:"Notion account and API key"})}),"\n",(0,o.jsx)(n.li,{children:(0,o.jsx)(n.a,{href:"https://platform.openai.com/account/api-keys",children:"OpenAI API key"})}),"\n",(0,o.jsxs)(n.li,{children:[(0,o.jsx)(n.a,{target:"_blank","data-noBrokenLinkCheck":!0,href:t(54821).A+"",children:"Download Flow Conversation Agent Flow"}),"(Download link)"]}),"\n"]}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.img,{alt:"Notion Components Toolkit",src:t(84530).A+"",width:"1188",height:"793"})}),"\n",(0,o.jsx)(n.h2,{id:"flow-components",children:"Flow Components"}),"\n",(0,o.jsx)(n.hr,{}),"\n",(0,o.jsx)(n.h3,{id:"input-and-output",children:"Input and Output"}),"\n",(0,o.jsxs)(n.ul,{children:["\n",(0,o.jsxs)(n.li,{children:[(0,o.jsx)(n.strong,{children:"Chat Input"}),": Accepts user queries and commands"]}),"\n",(0,o.jsxs)(n.li,{children:[(0,o.jsx)(n.strong,{children:"Chat Output"}),": Displays the agent's responses"]}),"\n"]}),"\n",(0,o.jsx)(n.h3,{id:"language-model",children:"Language Model"}),"\n",(0,o.jsxs)(n.ul,{children:["\n",(0,o.jsxs)(n.li,{children:[(0,o.jsx)(n.strong,{children:"OpenAI Model"}),": Processes user input and generates responses"]}),"\n"]}),"\n",(0,o.jsx)(n.h3,{id:"agent-and-tools",children:"Agent and Tools"}),"\n",(0,o.jsxs)(n.ul,{children:["\n",(0,o.jsxs)(n.li,{children:[(0,o.jsx)(n.strong,{children:"Tool Calling Agent"}),": Coordinates the use of various Notion tools based on user input"]}),"\n",(0,o.jsxs)(n.li,{children:[(0,o.jsx)(n.strong,{children:"Toolkit"}),": Combines multiple Notion-specific tools into a single toolkit"]}),"\n",(0,o.jsxs)(n.li,{children:[(0,o.jsx)(n.strong,{children:"Notion Tools"}),": Various components for interacting with Notion, including:","\n",(0,o.jsxs)(n.ul,{children:["\n",(0,o.jsx)(n.li,{children:"List Users"}),"\n",(0,o.jsx)(n.li,{children:"List Database Properties"}),"\n",(0,o.jsx)(n.li,{children:"List Pages"}),"\n",(0,o.jsx)(n.li,{children:"Page Content Viewer"}),"\n",(0,o.jsx)(n.li,{children:"Create Page"}),"\n",(0,o.jsx)(n.li,{children:"Update Page Property"}),"\n",(0,o.jsx)(n.li,{children:"Add Content to Page"}),"\n",(0,o.jsx)(n.li,{children:"Search"}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,o.jsx)(n.h3,{id:"memory-and-prompt",children:"Memory and Prompt"}),"\n",(0,o.jsxs)(n.ul,{children:["\n",(0,o.jsxs)(n.li,{children:[(0,o.jsx)(n.strong,{children:"Chat Memory"}),": Stores conversation history"]}),"\n",(0,o.jsxs)(n.li,{children:[(0,o.jsx)(n.strong,{children:"Prompt"}),": Provides system instructions and context for the agent"]}),"\n",(0,o.jsxs)(n.li,{children:[(0,o.jsx)(n.strong,{children:"Current Date"}),": Supplies the current date and time for context"]}),"\n"]}),"\n",(0,o.jsx)(n.h2,{id:"run-the-conversational-notion-agent",children:"Run the Conversational Notion Agent"}),"\n",(0,o.jsx)(n.hr,{}),"\n",(0,o.jsxs)(n.ol,{children:["\n",(0,o.jsx)(n.li,{children:"Open Langflow and create a new project."}),"\n",(0,o.jsxs)(n.li,{children:["Add the components listed above to your flow canvas, or Download the ",(0,o.jsx)(n.a,{target:"_blank","data-noBrokenLinkCheck":!0,href:t(54821).A+"",children:"Conversation Agent Flow"}),"(Download link) and ",(0,o.jsx)(n.strong,{children:"Import"})," the JSON file into Langflow."]}),"\n",(0,o.jsx)(n.li,{children:"Connect the components as shown in the flow diagram."}),"\n",(0,o.jsx)(n.li,{children:"Input the Notion and OpenAI API keys in their respective components."}),"\n",(0,o.jsx)(n.li,{children:'To start the flow, click the "Play" button in Langflow.'}),"\n",(0,o.jsxs)(n.li,{children:["In the chat interface, enter a Notion-related request or question. For example:","\n",(0,o.jsxs)(n.ul,{children:["\n",(0,o.jsx)(n.li,{children:'"Create a new page in my task database"'}),"\n",(0,o.jsx)(n.li,{children:'"Search for pages about project management"'}),"\n",(0,o.jsx)(n.li,{children:'"List all users in my Notion workspace"'}),"\n"]}),"\n"]}),"\n",(0,o.jsx)(n.li,{children:"The agent will process your request, use the appropriate Notion tools, and provide a response."}),"\n",(0,o.jsx)(n.li,{children:"Continue the conversation, asking follow-up questions or giving new commands as needed."}),"\n"]}),"\n",(0,o.jsx)(n.h2,{id:"example-interactions",children:"Example Interactions"}),"\n",(0,o.jsx)(n.hr,{}),"\n",(0,o.jsx)(d.Code,{codeConfig:h,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"User: List all the users in my Notion workspace.",props:{}}]},{tokens:[{content:"",props:{}}]},{tokens:[{content:"Agent: Certainly! I'll use the Notion User List tool to retrieve that information for you. One moment please.",props:{}}]},{tokens:[{content:"",props:{}}]},{tokens:[{content:"[Agent uses the Notion User List tool]",props:{}}]},{tokens:[{content:"",props:{}}]},{tokens:[{content:"Here's a list of users in your Notion workspace:",props:{}}]},{tokens:[{content:"",props:{}}]},{tokens:[{content:"1. John Doe (john@example.com)",props:{}}]},{tokens:[{content:"2. Jane Smith (jane@example.com)",props:{}}]},{tokens:[{content:"3. Alex Johnson (alex@example.com)",props:{}}]},{tokens:[{content:"",props:{}}]},{tokens:[{content:"Is there anything specific you'd like to know about these users or any other Notion-related task I can help you with?",props:{}}]},{tokens:[{content:"",props:{}}]},{tokens:[{content:'User: Create a new page in my Projects database with the title "Website Redesign".',props:{}}]},{tokens:[{content:"",props:{}}]},{tokens:[{content:"Agent: Certainly! I'd be happy to create a new page in your Projects database with the title \"Website Redesign\". I'll use the Notion Page Creator tool to do this. First, let me check the properties of your Projects database to ensure we include all necessary information.",props:{}}]},{tokens:[{content:"",props:{}}]},{tokens:[{content:"[Agent uses the Notion Database Properties tool]",props:{}}]},{tokens:[{content:"",props:{}}]},{tokens:[{content:"I've retrieved the properties for your Projects database. Now, I'll create the new page with the title \"Website Redesign\". One moment please.",props:{}}]},{tokens:[{content:"",props:{}}]},{tokens:[{content:"[Agent uses the Notion Page Creator tool]",props:{}}]},{tokens:[{content:"",props:{}}]},{tokens:[{content:'Great news! I\'ve successfully created a new page in your Projects database with the title "Website Redesign". Here are the details:',props:{}}]},{tokens:[{content:"",props:{}}]},{tokens:[{content:"- Title: Website Redesign",props:{}}]},{tokens:[{content:"- Page ID: [page_id_here]",props:{}}]},{tokens:[{content:"- URL: [page_url_here]",props:{}}]},{tokens:[{content:"",props:{}}]},{tokens:[{content:"Is there any additional information you'd like me to add to this new project page, such as a description, due date, or assigned team members?",props:{}}]},{tokens:[{content:"",props:{}}]},{tokens:[{content:'User: Yes, please add a description: "Redesign company website to improve user experience and modernize the look."',props:{}}]},{tokens:[{content:"",props:{}}]},{tokens:[{content:"Agent: Certainly! I'd be happy to add that description to the \"Website Redesign\" project page. I'll use the Add Content to Page tool to update the page with this information.",props:{}}]},{tokens:[{content:"",props:{}}]},{tokens:[{content:"[Agent uses the Add Content to Page tool]",props:{}}]},{tokens:[{content:"",props:{}}]},{tokens:[{content:"I've successfully added the description to your \"Website Redesign\" project page. Here's a summary of what I've done:",props:{}}]},{tokens:[{content:"",props:{}}]},{tokens:[{content:'1. Located the "Website Redesign" page using the page ID from our previous interaction.',props:{}}]},{tokens:[{content:"2. Added the following content to the page:",props:{}}]},{tokens:[{content:"",props:{}}]},{tokens:[{content:" Description: Redesign company website to improve user experience and modernize the look.",props:{}}]},{tokens:[{content:"",props:{}}]},{tokens:[{content:"The description has been added as a new text block on the page. Is there anything else you'd like me to add or modify on this project page?",props:{}}]},{tokens:[{content:"",props:{}}]}],lang:"text"},annotations:[]}]}),"\n",(0,o.jsx)(n.h2,{id:"customization",children:"Customization"}),"\n",(0,o.jsx)(n.hr,{}),"\n",(0,o.jsx)(n.p,{children:"The flow can be customized to meet your team's specific needs."}),"\n",(0,o.jsx)(n.p,{children:"Customize this flow by:"}),"\n",(0,o.jsxs)(n.ol,{children:["\n",(0,o.jsx)(n.li,{children:"Adjusting the system prompt to change the agent's behavior or knowledge base."}),"\n",(0,o.jsx)(n.li,{children:"Adding or removing Notion tools based on your specific needs."}),"\n",(0,o.jsx)(n.li,{children:"Modifying the OpenAI model parameters (e.g., temperature) to adjust the agent's response style."}),"\n"]}),"\n",(0,o.jsx)(n.h2,{id:"troubleshooting",children:"Troubleshooting"}),"\n",(0,o.jsx)(n.hr,{}),"\n",(0,o.jsx)(n.p,{children:"If you encounter issues:"}),"\n",(0,o.jsxs)(n.ol,{children:["\n",(0,o.jsx)(n.li,{children:"Ensure all API keys are correctly set and have the necessary permissions."}),"\n",(0,o.jsx)(n.li,{children:"Check that your Notion integration has access to the relevant pages and databases."}),"\n",(0,o.jsx)(n.li,{children:"Verify that all components are properly connected in the flow."}),"\n",(0,o.jsx)(n.li,{children:"Review the Langflow logs for any error messages."}),"\n"]}),"\n",(0,o.jsxs)(n.p,{children:["For more advanced usage and integration options, refer to the ",(0,o.jsx)(n.a,{href:"https://developers.notion.com/",children:"Notion API documentation"})," and ",(0,o.jsx)(n.a,{href:"/",children:"Langflow documentation"}),"."]})]})}function u(e={}){const{wrapper:n}={...(0,s.R)(),...e.components};return n?(0,o.jsx)(n,{...e,children:(0,o.jsx)(g,{...e})}):g(e)}function m(e,n){throw new Error("Expected "+(n?"component":"object")+" `"+e+"` to be defined: you likely forgot to import, pass, or provide it.")}},54821:(e,n,t)=>{t.d(n,{A:()=>o});const o=t.p+"assets/files/Conversational_Notion_Agent-7d8e27bbde8676e7772af60972898335.json"},84530:(e,n,t)=>{t.d(n,{A:()=>o});const o=t.p+"assets/images/notion_conversational_agent_tools-6952705eb98e10bd4a67b74500a6189d.png"}}]); \ No newline at end of file diff --git a/assets/js/runtime~main.637dbf6f.js b/assets/js/runtime~main.a7e2cfe2.js similarity index 98% rename from assets/js/runtime~main.637dbf6f.js rename to assets/js/runtime~main.a7e2cfe2.js index 55b06930b1..c330989150 100644 --- a/assets/js/runtime~main.637dbf6f.js +++ b/assets/js/runtime~main.a7e2cfe2.js @@ -1 +1 @@ -(()=>{"use strict";var e,a,d,c,f,b={},t={};function r(e){var a=t[e];if(void 0!==a)return a.exports;var d=t[e]={id:e,loaded:!1,exports:{}};return b[e].call(d.exports,d,d.exports,r),d.loaded=!0,d.exports}r.m=b,r.c=t,e=[],r.O=(a,d,c,f)=>{if(!d){var b=1/0;for(i=0;i=f)&&Object.keys(r.O).every((e=>r.O[e](d[o])))?d.splice(o--,1):(t=!1,f0&&e[i-1][2]>f;i--)e[i]=e[i-1];e[i]=[d,c,f]},r.n=e=>{var a=e&&e.__esModule?()=>e.default:()=>e;return r.d(a,{a:a}),a},d=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,r.t=function(e,c){if(1&c&&(e=this(e)),8&c)return e;if("object"==typeof e&&e){if(4&c&&e.__esModule)return e;if(16&c&&"function"==typeof e.then)return e}var f=Object.create(null);r.r(f);var b={};a=a||[null,d({}),d([]),d(d)];for(var t=2&c&&e;"object"==typeof t&&!~a.indexOf(t);t=d(t))Object.getOwnPropertyNames(t).forEach((a=>b[a]=()=>e[a]));return b.default=()=>e,r.d(f,b),f},r.d=(e,a)=>{for(var d in a)r.o(a,d)&&!r.o(e,d)&&Object.defineProperty(e,d,{enumerable:!0,get:a[d]})},r.f={},r.e=e=>Promise.all(Object.keys(r.f).reduce(((a,d)=>(r.f[d](e,a),a)),[])),r.u=e=>"assets/js/"+({51:"b7251463",145:"0be1d5fe",191:"c643a6d5",230:"bc63ae25",417:"93e16042",768:"6d684b63",784:"fe965b62",787:"672a0eba",800:"a4c0ff01",868:"dc7b1ef3",964:"05d835b4",1022:"8a61012d",1035:"24d32e91",1039:"16d61ab3",1185:"c2de64b8",1227:"647965d5",1246:"1b523369",1258:"7da17ff3",1394:"8054effa",1488:"ac3cc3f5",1500:"1e9025f7",1563:"3ef76b56",1567:"22dd74f7",1625:"92852ade",1690:"41a97a99",1845:"2ab0d4f5",1917:"c3616f7f",1956:"fe6f9601",2073:"7b7db446",2097:"338a6f8e",2273:"e756fa26",2431:"c0d3c6ab",2624:"8ff68e6f",2657:"a3ab51d1",2691:"2efb9d3a",2777:"b3ba68b4",2818:"a9b73094",3040:"2148ae42",3110:"6a2beaac",3247:"bd7ab245",3327:"6aa941bb",3347:"b5257597",3391:"f66238ae",3576:"64045095",3694:"c2b1730c",3758:"a963b3cb",3859:"7679ca6e",3917:"c8dad5f1",3964:"829ff4d2",4028:"c2ebd62a",4046:"9ac856ad",4133:"5cf11f26",4429:"32cedcea",4633:"c563aec0",4645:"fef056e9",4778:"e189eece",4784:"438e4337",4841:"8298c1cb",4891:"ca67d85f",4930:"d2ad385b",4931:"a9b4f8aa",4954:"a71efd4a",4973:"2d2c4fcb",5138:"309383dc",5179:"41e3c105",5281:"a0511a5b",5284:"64ca91f1",5339:"9447891f",5425:"ee32130c",5467:"40d13080",5474:"d175aa8b",5475:"18f3809a",5513:"20d49d07",5514:"02955c09",5562:"20e9af62",5572:"873ebc27",5628:"a83bc7c0",5634:"9822a706",5673:"73af8c33",5716:"946d1cee",5718:"5ccf4833",5742:"aba21aa0",5772:"4e7126f8",5865:"e1766139",5866:"3b577cbb",5883:"61cfab8e",5923:"73d1a090",5979:"a3a1efc2",6003:"4d983c8e",6008:"445668ec",6053:"dfc50084",6080:"4d15791b",6147:"ab17fe15",6281:"c96ce3ed",6332:"873508e7",6350:"188ee668",6419:"96eb0e67",6445:"9fb9a766",6473:"4c5e977b",6559:"6f13807a",6668:"18988c08",6682:"5a6d6120",6890:"8b85e1d0",6920:"c817e236",6949:"b36bb719",7098:"a7bd4aaa",7108:"688feaef",7118:"4ce9199e",7165:"547df4a1",7211:"cacdc615",7258:"11478de3",7338:"c39b795e",7408:"3ae94ad4",7453:"fdefa9a8",7462:"921b5fc1",7472:"744aaf8b",7507:"be76515e",7713:"3a82b27e",7892:"790349b7",7894:"0f44198a",8031:"25bf2d67",8054:"85112c90",8064:"274fd934",8085:"cc44357e",8102:"019dbd1f",8188:"ecd67556",8196:"75a9e1e0",8208:"216e3ed7",8261:"474d53cd",8304:"3b356402",8356:"c6a5eaec",8401:"17896441",8504:"e6c6a4d2",8598:"44dfcf75",8661:"8f774222",8679:"3705a9c0",8921:"45476a69",8927:"ae68aa8b",8929:"172b3cfb",8953:"adef6868",9048:"a94703ab",9126:"ea3c040a",9141:"19136925",9304:"c329cc2b",9306:"667d0790",9371:"991799c5",9455:"54175a6c",9461:"23d0e682",9476:"57c9a2b8",9479:"4e038a6a",9483:"7823fa72",9555:"dedd5914",9580:"f81a91eb",9619:"29b8e27a",9642:"eae80ce0",9647:"5e95c892",9905:"43df3697"}[e]||e)+"."+{51:"170583e3",145:"79381adb",191:"5f273688",230:"04fbccf0",417:"099ab03e",768:"65469bf5",784:"b6a35b07",787:"7486d7e0",800:"9022588c",868:"dcdd6bc3",900:"f83a9a5d",964:"3893612e",1022:"11c801ab",1035:"1a6c2f56",1039:"69fae80f",1185:"9748a9a7",1227:"6e74c5d8",1246:"4186baef",1258:"a4bce530",1394:"e591c566",1488:"517c076b",1500:"6ea32b36",1563:"90358b4f",1567:"d3c893ba",1625:"14cdddbe",1690:"e0babedf",1845:"05da85d7",1917:"8eb62a8e",1956:"ba4da060",2073:"b3f8d739",2097:"ab549652",2237:"254217db",2273:"9499374f",2431:"c2a4a552",2624:"521e4384",2657:"0a14fc05",2691:"137f1b76",2777:"50ca02a1",2818:"807cd6bf",3040:"1a81b288",3110:"87f20d44",3247:"52c928ff",3327:"a94a2c25",3347:"a02e271f",3391:"a423a13f",3477:"5c645be2",3576:"da9c580a",3694:"af3527cf",3758:"8dca7900",3859:"51e75ae4",3917:"bdc0c146",3964:"0cd22fac",4028:"c46fe749",4046:"d82ce2df",4133:"709a34ca",4429:"d4f6479b",4633:"6fa1329f",4645:"e8d61841",4778:"88b91dab",4784:"942b7b69",4841:"ce23a523",4848:"03d25b14",4891:"b33e29f2",4930:"616ac30c",4931:"300ccd7e",4954:"e5b1d897",4973:"34d69ba4",5138:"8e4ae7ac",5179:"64e4c1f0",5281:"e84e8032",5284:"03bad459",5339:"a7de1f63",5425:"212e3898",5467:"1e54ecae",5474:"d264c1d9",5475:"30699dc9",5513:"5dafbef0",5514:"3b4a4736",5562:"88e5e3a2",5572:"2c03f163",5628:"5d209b33",5634:"91c6ae65",5673:"3b49b5ef",5716:"39697a86",5718:"36eb37b6",5742:"60b1d5b2",5772:"1fcd9acf",5865:"7ce0748f",5866:"82b75810",5883:"42922af9",5923:"929d7e31",5979:"16e1357e",6003:"61570841",6008:"adfa0d2f",6053:"da80e031",6080:"cbe50574",6147:"d40743e8",6281:"33a3c771",6332:"f2a4f3d5",6350:"620eb4c9",6419:"219b4ba9",6445:"48996318",6473:"f971cbc2",6559:"d1058175",6668:"73c6cd59",6682:"44a73ed9",6890:"1481bb90",6920:"02274d7b",6949:"f88bd12b",7098:"7a425922",7108:"685fe17f",7118:"05de067b",7165:"3ae4f8e5",7211:"9b6f5f2f",7258:"4eea06e3",7338:"3e8c79c0",7408:"c6de4fbc",7453:"9b7dd8c8",7462:"60236844",7472:"ce946c2a",7507:"cd4f7aad",7713:"cb6d0f3d",7892:"e97eef4c",7894:"5e157eb4",8031:"46f2eb17",8054:"a9dd4a34",8064:"c255462c",8085:"c3449534",8102:"d5229333",8188:"5e58698d",8196:"7af007ad",8208:"872c8aa4",8261:"6883b6d6",8304:"0f075a89",8356:"63481bd6",8401:"72b10a31",8504:"47593649",8598:"47a85797",8661:"098d5c8a",8679:"b99c1633",8921:"a78561cd",8927:"3a5836ad",8929:"27d12542",8953:"fda6291f",9048:"271808f7",9126:"108a0e55",9141:"89b0e034",9304:"31372bf9",9306:"203273db",9371:"4b41f654",9455:"7870fd22",9461:"5b63a573",9476:"d1729427",9479:"f58748d6",9483:"c57cc5af",9495:"b0827074",9555:"5269bca3",9580:"e76bfa8b",9619:"3d4e8dce",9642:"f8fc243a",9647:"7a7fae88",9905:"7d9e471a"}[e]+".js",r.miniCssF=e=>{},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,a)=>Object.prototype.hasOwnProperty.call(e,a),c={},f="langflow-docs:",r.l=(e,a,d,b)=>{if(c[e])c[e].push(a);else{var t,o;if(void 0!==d)for(var n=document.getElementsByTagName("script"),i=0;i{t.onerror=t.onload=null,clearTimeout(s);var f=c[e];if(delete c[e],t.parentNode&&t.parentNode.removeChild(t),f&&f.forEach((e=>e(d))),a)return a(d)},s=setTimeout(u.bind(null,void 0,{type:"timeout",target:t}),12e4);t.onerror=u.bind(null,t.onerror),t.onload=u.bind(null,t.onload),o&&document.head.appendChild(t)}},r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),r.p="/",r.gca=function(e){return e={17896441:"8401",19136925:"9141",64045095:"3576",b7251463:"51","0be1d5fe":"145",c643a6d5:"191",bc63ae25:"230","93e16042":"417","6d684b63":"768",fe965b62:"784","672a0eba":"787",a4c0ff01:"800",dc7b1ef3:"868","05d835b4":"964","8a61012d":"1022","24d32e91":"1035","16d61ab3":"1039",c2de64b8:"1185","647965d5":"1227","1b523369":"1246","7da17ff3":"1258","8054effa":"1394",ac3cc3f5:"1488","1e9025f7":"1500","3ef76b56":"1563","22dd74f7":"1567","92852ade":"1625","41a97a99":"1690","2ab0d4f5":"1845",c3616f7f:"1917",fe6f9601:"1956","7b7db446":"2073","338a6f8e":"2097",e756fa26:"2273",c0d3c6ab:"2431","8ff68e6f":"2624",a3ab51d1:"2657","2efb9d3a":"2691",b3ba68b4:"2777",a9b73094:"2818","2148ae42":"3040","6a2beaac":"3110",bd7ab245:"3247","6aa941bb":"3327",b5257597:"3347",f66238ae:"3391",c2b1730c:"3694",a963b3cb:"3758","7679ca6e":"3859",c8dad5f1:"3917","829ff4d2":"3964",c2ebd62a:"4028","9ac856ad":"4046","5cf11f26":"4133","32cedcea":"4429",c563aec0:"4633",fef056e9:"4645",e189eece:"4778","438e4337":"4784","8298c1cb":"4841",ca67d85f:"4891",d2ad385b:"4930",a9b4f8aa:"4931",a71efd4a:"4954","2d2c4fcb":"4973","309383dc":"5138","41e3c105":"5179",a0511a5b:"5281","64ca91f1":"5284","9447891f":"5339",ee32130c:"5425","40d13080":"5467",d175aa8b:"5474","18f3809a":"5475","20d49d07":"5513","02955c09":"5514","20e9af62":"5562","873ebc27":"5572",a83bc7c0:"5628","9822a706":"5634","73af8c33":"5673","946d1cee":"5716","5ccf4833":"5718",aba21aa0:"5742","4e7126f8":"5772",e1766139:"5865","3b577cbb":"5866","61cfab8e":"5883","73d1a090":"5923",a3a1efc2:"5979","4d983c8e":"6003","445668ec":"6008",dfc50084:"6053","4d15791b":"6080",ab17fe15:"6147",c96ce3ed:"6281","873508e7":"6332","188ee668":"6350","96eb0e67":"6419","9fb9a766":"6445","4c5e977b":"6473","6f13807a":"6559","18988c08":"6668","5a6d6120":"6682","8b85e1d0":"6890",c817e236:"6920",b36bb719:"6949",a7bd4aaa:"7098","688feaef":"7108","4ce9199e":"7118","547df4a1":"7165",cacdc615:"7211","11478de3":"7258",c39b795e:"7338","3ae94ad4":"7408",fdefa9a8:"7453","921b5fc1":"7462","744aaf8b":"7472",be76515e:"7507","3a82b27e":"7713","790349b7":"7892","0f44198a":"7894","25bf2d67":"8031","85112c90":"8054","274fd934":"8064",cc44357e:"8085","019dbd1f":"8102",ecd67556:"8188","75a9e1e0":"8196","216e3ed7":"8208","474d53cd":"8261","3b356402":"8304",c6a5eaec:"8356",e6c6a4d2:"8504","44dfcf75":"8598","8f774222":"8661","3705a9c0":"8679","45476a69":"8921",ae68aa8b:"8927","172b3cfb":"8929",adef6868:"8953",a94703ab:"9048",ea3c040a:"9126",c329cc2b:"9304","667d0790":"9306","991799c5":"9371","54175a6c":"9455","23d0e682":"9461","57c9a2b8":"9476","4e038a6a":"9479","7823fa72":"9483",dedd5914:"9555",f81a91eb:"9580","29b8e27a":"9619",eae80ce0:"9642","5e95c892":"9647","43df3697":"9905"}[e]||e,r.p+r.u(e)},(()=>{var e={5354:0,1869:0};r.f.j=(a,d)=>{var c=r.o(e,a)?e[a]:void 0;if(0!==c)if(c)d.push(c[2]);else if(/^(1869|5354)$/.test(a))e[a]=0;else{var f=new Promise(((d,f)=>c=e[a]=[d,f]));d.push(c[2]=f);var b=r.p+r.u(a),t=new Error;r.l(b,(d=>{if(r.o(e,a)&&(0!==(c=e[a])&&(e[a]=void 0),c)){var f=d&&("load"===d.type?"missing":d.type),b=d&&d.target&&d.target.src;t.message="Loading chunk "+a+" failed.\n("+f+": "+b+")",t.name="ChunkLoadError",t.type=f,t.request=b,c[1](t)}}),"chunk-"+a,a)}},r.O.j=a=>0===e[a];var a=(a,d)=>{var c,f,b=d[0],t=d[1],o=d[2],n=0;if(b.some((a=>0!==e[a]))){for(c in t)r.o(t,c)&&(r.m[c]=t[c]);if(o)var i=o(r)}for(a&&a(d);n{"use strict";var e,a,d,c,f,b={},t={};function r(e){var a=t[e];if(void 0!==a)return a.exports;var d=t[e]={id:e,loaded:!1,exports:{}};return b[e].call(d.exports,d,d.exports,r),d.loaded=!0,d.exports}r.m=b,r.c=t,e=[],r.O=(a,d,c,f)=>{if(!d){var b=1/0;for(i=0;i=f)&&Object.keys(r.O).every((e=>r.O[e](d[o])))?d.splice(o--,1):(t=!1,f0&&e[i-1][2]>f;i--)e[i]=e[i-1];e[i]=[d,c,f]},r.n=e=>{var a=e&&e.__esModule?()=>e.default:()=>e;return r.d(a,{a:a}),a},d=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,r.t=function(e,c){if(1&c&&(e=this(e)),8&c)return e;if("object"==typeof e&&e){if(4&c&&e.__esModule)return e;if(16&c&&"function"==typeof e.then)return e}var f=Object.create(null);r.r(f);var b={};a=a||[null,d({}),d([]),d(d)];for(var t=2&c&&e;"object"==typeof t&&!~a.indexOf(t);t=d(t))Object.getOwnPropertyNames(t).forEach((a=>b[a]=()=>e[a]));return b.default=()=>e,r.d(f,b),f},r.d=(e,a)=>{for(var d in a)r.o(a,d)&&!r.o(e,d)&&Object.defineProperty(e,d,{enumerable:!0,get:a[d]})},r.f={},r.e=e=>Promise.all(Object.keys(r.f).reduce(((a,d)=>(r.f[d](e,a),a)),[])),r.u=e=>"assets/js/"+({51:"b7251463",145:"0be1d5fe",191:"c643a6d5",230:"bc63ae25",417:"93e16042",768:"6d684b63",784:"fe965b62",787:"672a0eba",800:"a4c0ff01",868:"dc7b1ef3",964:"05d835b4",1022:"8a61012d",1035:"24d32e91",1039:"16d61ab3",1185:"c2de64b8",1227:"647965d5",1246:"1b523369",1258:"7da17ff3",1394:"8054effa",1488:"ac3cc3f5",1500:"1e9025f7",1563:"3ef76b56",1567:"22dd74f7",1625:"92852ade",1690:"41a97a99",1845:"2ab0d4f5",1917:"c3616f7f",1956:"fe6f9601",2073:"7b7db446",2097:"338a6f8e",2273:"e756fa26",2431:"c0d3c6ab",2624:"8ff68e6f",2657:"a3ab51d1",2691:"2efb9d3a",2777:"b3ba68b4",2818:"a9b73094",3040:"2148ae42",3110:"6a2beaac",3247:"bd7ab245",3327:"6aa941bb",3347:"b5257597",3391:"f66238ae",3576:"64045095",3694:"c2b1730c",3758:"a963b3cb",3859:"7679ca6e",3917:"c8dad5f1",3964:"829ff4d2",4028:"c2ebd62a",4046:"9ac856ad",4133:"5cf11f26",4429:"32cedcea",4633:"c563aec0",4645:"fef056e9",4778:"e189eece",4784:"438e4337",4841:"8298c1cb",4891:"ca67d85f",4930:"d2ad385b",4931:"a9b4f8aa",4954:"a71efd4a",4973:"2d2c4fcb",5138:"309383dc",5179:"41e3c105",5281:"a0511a5b",5284:"64ca91f1",5339:"9447891f",5425:"ee32130c",5467:"40d13080",5474:"d175aa8b",5475:"18f3809a",5513:"20d49d07",5514:"02955c09",5562:"20e9af62",5572:"873ebc27",5628:"a83bc7c0",5634:"9822a706",5673:"73af8c33",5716:"946d1cee",5718:"5ccf4833",5742:"aba21aa0",5772:"4e7126f8",5865:"e1766139",5866:"3b577cbb",5883:"61cfab8e",5923:"73d1a090",5979:"a3a1efc2",6003:"4d983c8e",6008:"445668ec",6053:"dfc50084",6080:"4d15791b",6147:"ab17fe15",6281:"c96ce3ed",6332:"873508e7",6350:"188ee668",6419:"96eb0e67",6445:"9fb9a766",6473:"4c5e977b",6559:"6f13807a",6668:"18988c08",6682:"5a6d6120",6890:"8b85e1d0",6920:"c817e236",6949:"b36bb719",7098:"a7bd4aaa",7108:"688feaef",7118:"4ce9199e",7165:"547df4a1",7211:"cacdc615",7258:"11478de3",7338:"c39b795e",7408:"3ae94ad4",7453:"fdefa9a8",7462:"921b5fc1",7472:"744aaf8b",7507:"be76515e",7713:"3a82b27e",7892:"790349b7",7894:"0f44198a",8031:"25bf2d67",8054:"85112c90",8064:"274fd934",8085:"cc44357e",8102:"019dbd1f",8188:"ecd67556",8196:"75a9e1e0",8208:"216e3ed7",8261:"474d53cd",8304:"3b356402",8356:"c6a5eaec",8401:"17896441",8504:"e6c6a4d2",8598:"44dfcf75",8661:"8f774222",8679:"3705a9c0",8921:"45476a69",8927:"ae68aa8b",8929:"172b3cfb",8953:"adef6868",9048:"a94703ab",9126:"ea3c040a",9141:"19136925",9304:"c329cc2b",9306:"667d0790",9371:"991799c5",9455:"54175a6c",9461:"23d0e682",9476:"57c9a2b8",9479:"4e038a6a",9483:"7823fa72",9555:"dedd5914",9580:"f81a91eb",9619:"29b8e27a",9642:"eae80ce0",9647:"5e95c892",9905:"43df3697"}[e]||e)+"."+{51:"170583e3",145:"79381adb",191:"5f273688",230:"04fbccf0",417:"099ab03e",768:"65469bf5",784:"b6a35b07",787:"7486d7e0",800:"9022588c",868:"dcdd6bc3",900:"f83a9a5d",964:"3893612e",1022:"11c801ab",1035:"1a6c2f56",1039:"69fae80f",1185:"9748a9a7",1227:"6e74c5d8",1246:"4186baef",1258:"a4bce530",1394:"e591c566",1488:"517c076b",1500:"6ea32b36",1563:"90358b4f",1567:"d3c893ba",1625:"14cdddbe",1690:"e0babedf",1845:"05da85d7",1917:"8eb62a8e",1956:"ba4da060",2073:"b3f8d739",2097:"ab549652",2237:"254217db",2273:"9499374f",2431:"c2a4a552",2624:"521e4384",2657:"0a14fc05",2691:"137f1b76",2777:"50ca02a1",2818:"807cd6bf",3040:"1a81b288",3110:"3dbd74ae",3247:"52c928ff",3327:"a94a2c25",3347:"a02e271f",3391:"a423a13f",3477:"5c645be2",3576:"da9c580a",3694:"af3527cf",3758:"8dca7900",3859:"51e75ae4",3917:"bdc0c146",3964:"0cd22fac",4028:"c46fe749",4046:"d82ce2df",4133:"709a34ca",4429:"d4f6479b",4633:"6fa1329f",4645:"e8d61841",4778:"88b91dab",4784:"942b7b69",4841:"ce23a523",4848:"03d25b14",4891:"b33e29f2",4930:"616ac30c",4931:"300ccd7e",4954:"e5b1d897",4973:"34d69ba4",5138:"8e4ae7ac",5179:"64e4c1f0",5281:"e84e8032",5284:"03bad459",5339:"a7de1f63",5425:"212e3898",5467:"1e54ecae",5474:"d264c1d9",5475:"41f624bc",5513:"5dafbef0",5514:"3b4a4736",5562:"88e5e3a2",5572:"2c03f163",5628:"5d209b33",5634:"91c6ae65",5673:"3b49b5ef",5716:"39697a86",5718:"36eb37b6",5742:"60b1d5b2",5772:"1fcd9acf",5865:"7ce0748f",5866:"82b75810",5883:"42922af9",5923:"929d7e31",5979:"16e1357e",6003:"61570841",6008:"adfa0d2f",6053:"da80e031",6080:"cbe50574",6147:"d40743e8",6281:"33a3c771",6332:"f2a4f3d5",6350:"620eb4c9",6419:"219b4ba9",6445:"48996318",6473:"f971cbc2",6559:"d1058175",6668:"73c6cd59",6682:"44a73ed9",6890:"1481bb90",6920:"02274d7b",6949:"f88bd12b",7098:"7a425922",7108:"685fe17f",7118:"05de067b",7165:"3ae4f8e5",7211:"9b6f5f2f",7258:"4eea06e3",7338:"3e8c79c0",7408:"c6de4fbc",7453:"9b7dd8c8",7462:"60236844",7472:"ce946c2a",7507:"cd4f7aad",7713:"cb6d0f3d",7892:"e97eef4c",7894:"5e157eb4",8031:"46f2eb17",8054:"a9dd4a34",8064:"c255462c",8085:"c3449534",8102:"d5229333",8188:"5e58698d",8196:"7af007ad",8208:"872c8aa4",8261:"6883b6d6",8304:"0f075a89",8356:"63481bd6",8401:"72b10a31",8504:"47593649",8598:"47a85797",8661:"098d5c8a",8679:"b99c1633",8921:"a78561cd",8927:"3a5836ad",8929:"27d12542",8953:"fda6291f",9048:"271808f7",9126:"108a0e55",9141:"89b0e034",9304:"31372bf9",9306:"203273db",9371:"4b41f654",9455:"7870fd22",9461:"5b63a573",9476:"d1729427",9479:"f58748d6",9483:"c57cc5af",9495:"b0827074",9555:"5269bca3",9580:"e76bfa8b",9619:"3d4e8dce",9642:"f8fc243a",9647:"7a7fae88",9905:"7d9e471a"}[e]+".js",r.miniCssF=e=>{},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,a)=>Object.prototype.hasOwnProperty.call(e,a),c={},f="langflow-docs:",r.l=(e,a,d,b)=>{if(c[e])c[e].push(a);else{var t,o;if(void 0!==d)for(var n=document.getElementsByTagName("script"),i=0;i{t.onerror=t.onload=null,clearTimeout(s);var f=c[e];if(delete c[e],t.parentNode&&t.parentNode.removeChild(t),f&&f.forEach((e=>e(d))),a)return a(d)},s=setTimeout(u.bind(null,void 0,{type:"timeout",target:t}),12e4);t.onerror=u.bind(null,t.onerror),t.onload=u.bind(null,t.onload),o&&document.head.appendChild(t)}},r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),r.p="/",r.gca=function(e){return e={17896441:"8401",19136925:"9141",64045095:"3576",b7251463:"51","0be1d5fe":"145",c643a6d5:"191",bc63ae25:"230","93e16042":"417","6d684b63":"768",fe965b62:"784","672a0eba":"787",a4c0ff01:"800",dc7b1ef3:"868","05d835b4":"964","8a61012d":"1022","24d32e91":"1035","16d61ab3":"1039",c2de64b8:"1185","647965d5":"1227","1b523369":"1246","7da17ff3":"1258","8054effa":"1394",ac3cc3f5:"1488","1e9025f7":"1500","3ef76b56":"1563","22dd74f7":"1567","92852ade":"1625","41a97a99":"1690","2ab0d4f5":"1845",c3616f7f:"1917",fe6f9601:"1956","7b7db446":"2073","338a6f8e":"2097",e756fa26:"2273",c0d3c6ab:"2431","8ff68e6f":"2624",a3ab51d1:"2657","2efb9d3a":"2691",b3ba68b4:"2777",a9b73094:"2818","2148ae42":"3040","6a2beaac":"3110",bd7ab245:"3247","6aa941bb":"3327",b5257597:"3347",f66238ae:"3391",c2b1730c:"3694",a963b3cb:"3758","7679ca6e":"3859",c8dad5f1:"3917","829ff4d2":"3964",c2ebd62a:"4028","9ac856ad":"4046","5cf11f26":"4133","32cedcea":"4429",c563aec0:"4633",fef056e9:"4645",e189eece:"4778","438e4337":"4784","8298c1cb":"4841",ca67d85f:"4891",d2ad385b:"4930",a9b4f8aa:"4931",a71efd4a:"4954","2d2c4fcb":"4973","309383dc":"5138","41e3c105":"5179",a0511a5b:"5281","64ca91f1":"5284","9447891f":"5339",ee32130c:"5425","40d13080":"5467",d175aa8b:"5474","18f3809a":"5475","20d49d07":"5513","02955c09":"5514","20e9af62":"5562","873ebc27":"5572",a83bc7c0:"5628","9822a706":"5634","73af8c33":"5673","946d1cee":"5716","5ccf4833":"5718",aba21aa0:"5742","4e7126f8":"5772",e1766139:"5865","3b577cbb":"5866","61cfab8e":"5883","73d1a090":"5923",a3a1efc2:"5979","4d983c8e":"6003","445668ec":"6008",dfc50084:"6053","4d15791b":"6080",ab17fe15:"6147",c96ce3ed:"6281","873508e7":"6332","188ee668":"6350","96eb0e67":"6419","9fb9a766":"6445","4c5e977b":"6473","6f13807a":"6559","18988c08":"6668","5a6d6120":"6682","8b85e1d0":"6890",c817e236:"6920",b36bb719:"6949",a7bd4aaa:"7098","688feaef":"7108","4ce9199e":"7118","547df4a1":"7165",cacdc615:"7211","11478de3":"7258",c39b795e:"7338","3ae94ad4":"7408",fdefa9a8:"7453","921b5fc1":"7462","744aaf8b":"7472",be76515e:"7507","3a82b27e":"7713","790349b7":"7892","0f44198a":"7894","25bf2d67":"8031","85112c90":"8054","274fd934":"8064",cc44357e:"8085","019dbd1f":"8102",ecd67556:"8188","75a9e1e0":"8196","216e3ed7":"8208","474d53cd":"8261","3b356402":"8304",c6a5eaec:"8356",e6c6a4d2:"8504","44dfcf75":"8598","8f774222":"8661","3705a9c0":"8679","45476a69":"8921",ae68aa8b:"8927","172b3cfb":"8929",adef6868:"8953",a94703ab:"9048",ea3c040a:"9126",c329cc2b:"9304","667d0790":"9306","991799c5":"9371","54175a6c":"9455","23d0e682":"9461","57c9a2b8":"9476","4e038a6a":"9479","7823fa72":"9483",dedd5914:"9555",f81a91eb:"9580","29b8e27a":"9619",eae80ce0:"9642","5e95c892":"9647","43df3697":"9905"}[e]||e,r.p+r.u(e)},(()=>{var e={5354:0,1869:0};r.f.j=(a,d)=>{var c=r.o(e,a)?e[a]:void 0;if(0!==c)if(c)d.push(c[2]);else if(/^(1869|5354)$/.test(a))e[a]=0;else{var f=new Promise(((d,f)=>c=e[a]=[d,f]));d.push(c[2]=f);var b=r.p+r.u(a),t=new Error;r.l(b,(d=>{if(r.o(e,a)&&(0!==(c=e[a])&&(e[a]=void 0),c)){var f=d&&("load"===d.type?"missing":d.type),b=d&&d.target&&d.target.src;t.message="Loading chunk "+a+" failed.\n("+f+": "+b+")",t.name="ChunkLoadError",t.type=f,t.request=b,c[1](t)}}),"chunk-"+a,a)}},r.O.j=a=>0===e[a];var a=(a,d)=>{var c,f,b=d[0],t=d[1],o=d[2],n=0;if(b.some((a=>0!==e[a]))){for(c in t)r.o(t,c)&&(r.m[c]=t[c]);if(o)var i=o(r)}for(a&&a(d);n - + diff --git a/components-custom-components.html b/components-custom-components.html index 0348960f23..f2dadf8d14 100644 --- a/components-custom-components.html +++ b/components-custom-components.html @@ -10,7 +10,7 @@ - + diff --git a/components-data.html b/components-data.html index 1d3f4f4e20..19f60d85c3 100644 --- a/components-data.html +++ b/components-data.html @@ -10,7 +10,7 @@ - + diff --git a/components-embedding-models.html b/components-embedding-models.html index f2a4337713..78a55a0358 100644 --- a/components-embedding-models.html +++ b/components-embedding-models.html @@ -10,7 +10,7 @@ - + diff --git a/components-helpers.html b/components-helpers.html index e5a85c561e..550006826e 100644 --- a/components-helpers.html +++ b/components-helpers.html @@ -10,7 +10,7 @@ - + diff --git a/components-io.html b/components-io.html index ad560ae376..ec32397f6a 100644 --- a/components-io.html +++ b/components-io.html @@ -10,7 +10,7 @@ - + diff --git a/components-loaders.html b/components-loaders.html index e0717fb584..ab5c0e54bf 100644 --- a/components-loaders.html +++ b/components-loaders.html @@ -10,7 +10,7 @@ - + diff --git a/components-logic.html b/components-logic.html index e343eb0376..5f2d8c0659 100644 --- a/components-logic.html +++ b/components-logic.html @@ -10,7 +10,7 @@ - + diff --git a/components-models.html b/components-models.html index ad325bec7e..f8ac6d410c 100644 --- a/components-models.html +++ b/components-models.html @@ -10,7 +10,7 @@ - + diff --git a/components-overview.html b/components-overview.html index 2cabd110e3..588a0641e2 100644 --- a/components-overview.html +++ b/components-overview.html @@ -10,7 +10,7 @@ - + diff --git a/components-prompts.html b/components-prompts.html index dba487acda..c2a0c054d6 100644 --- a/components-prompts.html +++ b/components-prompts.html @@ -10,7 +10,7 @@ - + diff --git a/components-rag.html b/components-rag.html index 6ec228eb56..1e19c946dd 100644 --- a/components-rag.html +++ b/components-rag.html @@ -10,7 +10,7 @@ - + diff --git a/components-vector-stores.html b/components-vector-stores.html index 7847f512c0..df4f8dbc0e 100644 --- a/components-vector-stores.html +++ b/components-vector-stores.html @@ -10,7 +10,7 @@ - + diff --git a/configuration-api-keys.html b/configuration-api-keys.html index 8f9e3091f2..188d7ced12 100644 --- a/configuration-api-keys.html +++ b/configuration-api-keys.html @@ -10,7 +10,7 @@ - + diff --git a/configuration-authentication.html b/configuration-authentication.html index cbe8ef1cac..f82e2e7273 100644 --- a/configuration-authentication.html +++ b/configuration-authentication.html @@ -10,7 +10,7 @@ - + diff --git a/configuration-auto-save.html b/configuration-auto-save.html index 53b20adac5..4041116dab 100644 --- a/configuration-auto-save.html +++ b/configuration-auto-save.html @@ -10,7 +10,7 @@ - + diff --git a/configuration-backend-only.html b/configuration-backend-only.html index 0d3ef38103..cca717b16a 100644 --- a/configuration-backend-only.html +++ b/configuration-backend-only.html @@ -10,7 +10,7 @@ - + diff --git a/configuration-cli.html b/configuration-cli.html index f3b85b2cf1..3ae11ec868 100644 --- a/configuration-cli.html +++ b/configuration-cli.html @@ -10,7 +10,7 @@ - + diff --git a/configuration-global-variables.html b/configuration-global-variables.html index 69194d70ea..8bda41b853 100644 --- a/configuration-global-variables.html +++ b/configuration-global-variables.html @@ -10,7 +10,7 @@ - + diff --git a/configuration-security-best-practices.html b/configuration-security-best-practices.html index 9c5cf43c56..a81047066a 100644 --- a/configuration-security-best-practices.html +++ b/configuration-security-best-practices.html @@ -10,7 +10,7 @@ - + diff --git a/contributing-community.html b/contributing-community.html index 70b91fc227..255352a207 100644 --- a/contributing-community.html +++ b/contributing-community.html @@ -10,7 +10,7 @@ - + diff --git a/contributing-components.html b/contributing-components.html index e2597dae1e..42c4444b89 100644 --- a/contributing-components.html +++ b/contributing-components.html @@ -10,7 +10,7 @@ - + diff --git a/contributing-github-discussions.html b/contributing-github-discussions.html index ad670af246..1be0b405f7 100644 --- a/contributing-github-discussions.html +++ b/contributing-github-discussions.html @@ -10,7 +10,7 @@ - + diff --git a/contributing-github-issues.html b/contributing-github-issues.html index f56e47017c..d5066f3d1c 100644 --- a/contributing-github-issues.html +++ b/contributing-github-issues.html @@ -10,7 +10,7 @@ - + diff --git a/contributing-how-to-contribute.html b/contributing-how-to-contribute.html index 895794cf0e..7faa17efd8 100644 --- a/contributing-how-to-contribute.html +++ b/contributing-how-to-contribute.html @@ -10,7 +10,7 @@ - + diff --git a/contributing-telemetry.html b/contributing-telemetry.html index 2324b2b1d1..8b0ef757da 100644 --- a/contributing-telemetry.html +++ b/contributing-telemetry.html @@ -10,7 +10,7 @@ - + diff --git a/deployment-docker.html b/deployment-docker.html index edf74f1445..c48eb7b0c3 100644 --- a/deployment-docker.html +++ b/deployment-docker.html @@ -10,7 +10,7 @@ - + diff --git a/deployment-gcp.html b/deployment-gcp.html index 702b11db85..8cce4f7e6e 100644 --- a/deployment-gcp.html +++ b/deployment-gcp.html @@ -10,7 +10,7 @@ - + diff --git a/deployment-hugging-face-spaces.html b/deployment-hugging-face-spaces.html index 0385d71e37..55111ef005 100644 --- a/deployment-hugging-face-spaces.html +++ b/deployment-hugging-face-spaces.html @@ -10,7 +10,7 @@ - + diff --git a/deployment-kubernetes.html b/deployment-kubernetes.html index 87e95e2eee..a4c458e458 100644 --- a/deployment-kubernetes.html +++ b/deployment-kubernetes.html @@ -10,7 +10,7 @@ - + diff --git a/deployment-railway.html b/deployment-railway.html index 03d2c00f89..25ab5d4c18 100644 --- a/deployment-railway.html +++ b/deployment-railway.html @@ -10,7 +10,7 @@ - + diff --git a/deployment-render.html b/deployment-render.html index 840b7351b0..80a68933e1 100644 --- a/deployment-render.html +++ b/deployment-render.html @@ -10,7 +10,7 @@ - + diff --git a/environment-variables.html b/environment-variables.html index 74feb89c4f..0de005c938 100644 --- a/environment-variables.html +++ b/environment-variables.html @@ -10,7 +10,7 @@ - + diff --git a/files/Google_Drive_Docs_Translations_Example.json b/files/Google_Drive_Docs_Translations_Example.json index 77e6fbda1b..ca3c6dc7bf 100644 --- a/files/Google_Drive_Docs_Translations_Example.json +++ b/files/Google_Drive_Docs_Translations_Example.json @@ -1 +1,1580 @@ -{"id":"bc2cbf16-ed92-4ef6-a4a5-1526af21d044","data":{"nodes":[{"id":"ParseData-LFq8b","type":"genericNode","position":{"x":1068.0112494649502,"y":237.00462961615915},"data":{"type":"ParseData","node":{"template":{"_type":"Component","data":{"trace_as_metadata":true,"list":false,"trace_as_input":true,"required":false,"placeholder":"","show":true,"name":"data","value":"","display_name":"Data","advanced":false,"input_types":["Data"],"dynamic":false,"info":"The data to convert to text.","title_case":false,"type":"other","_input_type":"DataInput"},"code":{"type":"code","required":true,"placeholder":"","list":false,"show":true,"multiline":true,"value":"from langflow.custom import Component\nfrom langflow.helpers.data import data_to_text\nfrom langflow.io import DataInput, MultilineInput, Output, StrInput\nfrom langflow.schema.message import Message\n\n\nclass ParseDataComponent(Component):\n display_name = \"Parse Data\"\n description = \"Convert Data into plain text following a specified template.\"\n icon = \"braces\"\n name = \"ParseData\"\n\n inputs = [\n DataInput(name=\"data\", display_name=\"Data\", info=\"The data to convert to text.\"),\n MultilineInput(\n name=\"template\",\n display_name=\"Template\",\n info=\"The template to use for formatting the data. \"\n \"It can contain the keys {text}, {data} or any other key in the Data.\",\n value=\"{text}\",\n ),\n StrInput(name=\"sep\", display_name=\"Separator\", advanced=True, value=\"\\n\"),\n ]\n\n outputs = [\n Output(display_name=\"Text\", name=\"text\", method=\"parse_data\"),\n ]\n\n def parse_data(self) -> Message:\n data = self.data if isinstance(self.data, list) else [self.data]\n template = self.template\n\n result_string = data_to_text(template, data, sep=self.sep)\n self.status = result_string\n return Message(text=result_string)\n","fileTypes":[],"file_path":"","password":false,"name":"code","advanced":true,"dynamic":true,"info":"","load_from_db":false,"title_case":false},"sep":{"trace_as_metadata":true,"load_from_db":false,"list":false,"required":false,"placeholder":"","show":true,"name":"sep","value":"\n","display_name":"Separator","advanced":true,"dynamic":false,"info":"","title_case":false,"type":"str","_input_type":"StrInput"},"template":{"trace_as_input":true,"multiline":true,"trace_as_metadata":true,"load_from_db":false,"list":false,"required":false,"placeholder":"","show":true,"name":"template","value":"{data}","display_name":"Template","advanced":false,"input_types":["Message"],"dynamic":false,"info":"The template to use for formatting the data. It can contain the keys {text}, {data} or any other key in the Data.","title_case":false,"type":"str","_input_type":"MultilineInput"}},"description":"Convert Data into plain text following a specified template.","icon":"braces","base_classes":["Message"],"display_name":"Parse Data","documentation":"","custom_fields":{},"output_types":[],"pinned":false,"conditional_paths":[],"frozen":false,"outputs":[{"types":["Message"],"selected":"Message","name":"text","display_name":"Text","method":"parse_data","value":"__UNDEFINED__","cache":true}],"field_order":["data","template","sep"],"beta":false,"edited":false,"metadata":{},"lf_version":"1.0.19.post2"},"id":"ParseData-LFq8b"},"selected":false,"width":384,"height":353,"positionAbsolute":{"x":1068.0112494649502,"y":237.00462961615915},"dragging":false},{"id":"GoogleDriveComponent-x1jHz","type":"genericNode","position":{"x":1919.003246541804,"y":230.60766717987485},"data":{"type":"GoogleDriveComponent","node":{"template":{"_type":"Component","code":{"type":"code","required":true,"placeholder":"","list":false,"show":true,"multiline":true,"value":"import json\nfrom json.decoder import JSONDecodeError\n\nfrom google.auth.exceptions import RefreshError\nfrom google.oauth2.credentials import Credentials\nfrom langchain_google_community import GoogleDriveLoader\n\nfrom langflow.custom import Component\nfrom langflow.helpers.data import docs_to_data\nfrom langflow.inputs import MessageTextInput\nfrom langflow.io import SecretStrInput\nfrom langflow.schema import Data\nfrom langflow.template import Output\n\n\nclass GoogleDriveComponent(Component):\n display_name = \"Google Drive Loader\"\n description = \"Loads documents from Google Drive using provided credentials.\"\n icon = \"Google\"\n\n inputs = [\n SecretStrInput(\n name=\"json_string\",\n display_name=\"JSON String of the Service Account Token\",\n info=\"JSON string containing OAuth 2.0 access token information for service account access\",\n required=True,\n ),\n MessageTextInput(\n name=\"document_id\", display_name=\"Document ID\", info=\"Single Google Drive document ID\", required=True\n ),\n ]\n\n outputs = [\n Output(display_name=\"Loaded Documents\", name=\"docs\", method=\"load_documents\"),\n ]\n\n def load_documents(self) -> Data:\n class CustomGoogleDriveLoader(GoogleDriveLoader):\n creds: Credentials | None = None\n \"\"\"Credentials object to be passed directly.\"\"\"\n\n def _load_credentials(self):\n \"\"\"Load credentials from the provided creds attribute or fallback to the original method.\"\"\"\n if self.creds:\n return self.creds\n msg = \"No credentials provided.\"\n raise ValueError(msg)\n\n class Config:\n arbitrary_types_allowed = True\n\n json_string = self.json_string\n\n document_ids = [self.document_id]\n if len(document_ids) != 1:\n msg = \"Expected a single document ID\"\n raise ValueError(msg)\n\n # TODO: Add validation to check if the document ID is valid\n\n # Load the token information from the JSON string\n try:\n token_info = json.loads(json_string)\n except JSONDecodeError as e:\n msg = \"Invalid JSON string\"\n raise ValueError(msg) from e\n\n # Initialize the custom loader with the provided credentials and document IDs\n loader = CustomGoogleDriveLoader(\n creds=Credentials.from_authorized_user_info(token_info), document_ids=document_ids\n )\n\n # Load the documents\n try:\n docs = loader.load()\n # catch google.auth.exceptions.RefreshError\n except RefreshError as e:\n msg = \"Authentication error: Unable to refresh authentication token. Please try to reauthenticate.\"\n raise ValueError(msg) from e\n except Exception as e:\n msg = f\"Error loading documents: {e}\"\n raise ValueError(msg) from e\n\n assert len(docs) == 1, \"Expected a single document to be loaded.\"\n\n data = docs_to_data(docs)\n # Return the loaded documents\n self.status = data\n return Data(data={\"text\": data})\n","fileTypes":[],"file_path":"","password":false,"name":"code","advanced":true,"dynamic":true,"info":"","load_from_db":false,"title_case":false},"document_id":{"trace_as_input":true,"trace_as_metadata":true,"load_from_db":false,"list":false,"required":true,"placeholder":"","show":true,"name":"document_id","value":"YOUR-DOCUMENT-ID-HERE","display_name":"Document ID","advanced":false,"input_types":["Message"],"dynamic":false,"info":"Single Google Drive document ID","title_case":false,"type":"str","_input_type":"MessageTextInput"},"json_string":{"load_from_db":true,"required":true,"placeholder":"","show":true,"name":"json_string","value":"","display_name":"JSON String of the Service Account Token","advanced":false,"input_types":["Message"],"dynamic":false,"info":"JSON string containing OAuth 2.0 access token information for service account access","title_case":false,"password":true,"type":"str","_input_type":"SecretStrInput"}},"description":"Loads documents from Google Drive using provided credentials.","icon":"Google","base_classes":["Data"],"display_name":"Google Drive Loader","documentation":"","custom_fields":{},"output_types":[],"pinned":false,"conditional_paths":[],"frozen":false,"outputs":[{"types":["Data"],"selected":"Data","name":"docs","display_name":"Loaded Documents","method":"load_documents","value":"__UNDEFINED__","cache":true}],"field_order":["json_string","document_id"],"beta":false,"edited":false,"metadata":{},"lf_version":"1.0.19.post2"},"id":"GoogleDriveComponent-x1jHz","description":"Loads documents from Google Drive using provided credentials.","display_name":"Google Drive Loader"},"selected":false,"width":384,"height":389,"positionAbsolute":{"x":1919.003246541804,"y":230.60766717987485},"dragging":false},{"id":"ParseData-7qhmP","type":"genericNode","position":{"x":2341.9094676839277,"y":249.73963276782303},"data":{"type":"ParseData","node":{"template":{"_type":"Component","data":{"trace_as_metadata":true,"list":false,"trace_as_input":true,"required":false,"placeholder":"","show":true,"name":"data","value":"","display_name":"Data","advanced":false,"input_types":["Data"],"dynamic":false,"info":"The data to convert to text.","title_case":false,"type":"other","_input_type":"DataInput"},"code":{"type":"code","required":true,"placeholder":"","list":false,"show":true,"multiline":true,"value":"from langflow.custom import Component\nfrom langflow.helpers.data import data_to_text\nfrom langflow.io import DataInput, MultilineInput, Output, StrInput\nfrom langflow.schema.message import Message\n\n\nclass ParseDataComponent(Component):\n display_name = \"Parse Data\"\n description = \"Convert Data into plain text following a specified template.\"\n icon = \"braces\"\n name = \"ParseData\"\n\n inputs = [\n DataInput(name=\"data\", display_name=\"Data\", info=\"The data to convert to text.\"),\n MultilineInput(\n name=\"template\",\n display_name=\"Template\",\n info=\"The template to use for formatting the data. \"\n \"It can contain the keys {text}, {data} or any other key in the Data.\",\n value=\"{text}\",\n ),\n StrInput(name=\"sep\", display_name=\"Separator\", advanced=True, value=\"\\n\"),\n ]\n\n outputs = [\n Output(display_name=\"Text\", name=\"text\", method=\"parse_data\"),\n ]\n\n def parse_data(self) -> Message:\n data = self.data if isinstance(self.data, list) else [self.data]\n template = self.template\n\n result_string = data_to_text(template, data, sep=self.sep)\n self.status = result_string\n return Message(text=result_string)\n","fileTypes":[],"file_path":"","password":false,"name":"code","advanced":true,"dynamic":true,"info":"","load_from_db":false,"title_case":false},"sep":{"trace_as_metadata":true,"load_from_db":false,"list":false,"required":false,"placeholder":"","show":true,"name":"sep","value":"\n","display_name":"Separator","advanced":true,"dynamic":false,"info":"","title_case":false,"type":"str","_input_type":"StrInput"},"template":{"trace_as_input":true,"multiline":true,"trace_as_metadata":true,"load_from_db":false,"list":false,"required":false,"placeholder":"","show":true,"name":"template","value":"{text}","display_name":"Template","advanced":false,"input_types":["Message"],"dynamic":false,"info":"The template to use for formatting the data. It can contain the keys {text}, {data} or any other key in the Data.","title_case":false,"type":"str","_input_type":"MultilineInput"}},"description":"Convert Data into plain text following a specified template.","icon":"braces","base_classes":["Message"],"display_name":"Parse Data","documentation":"","custom_fields":{},"output_types":[],"pinned":false,"conditional_paths":[],"frozen":false,"outputs":[{"types":["Message"],"selected":"Message","name":"text","display_name":"Text","method":"parse_data","value":"__UNDEFINED__","cache":true}],"field_order":["data","template","sep"],"beta":false,"edited":false,"metadata":{},"lf_version":"1.0.19.post2"},"id":"ParseData-7qhmP"},"selected":false,"width":384,"height":353,"positionAbsolute":{"x":2341.9094676839277,"y":249.73963276782303},"dragging":false},{"id":"OpenAIModel-YUM1a","type":"genericNode","position":{"x":3231.963340176361,"y":94.70653241512102},"data":{"type":"OpenAIModel","node":{"template":{"_type":"Component","output_parser":{"trace_as_metadata":true,"list":false,"required":false,"placeholder":"","show":true,"name":"output_parser","value":"","display_name":"Output Parser","advanced":true,"input_types":["OutputParser"],"dynamic":false,"info":"The parser to use to parse the output of the model","title_case":false,"type":"other","_input_type":"HandleInput"},"api_key":{"load_from_db":true,"required":false,"placeholder":"","show":true,"name":"api_key","value":"","display_name":"OpenAI API Key","advanced":false,"input_types":["Message"],"dynamic":false,"info":"The OpenAI API Key to use for the OpenAI model.","title_case":false,"password":true,"type":"str","_input_type":"SecretStrInput"},"code":{"type":"code","required":true,"placeholder":"","list":false,"show":true,"multiline":true,"value":"import operator\nfrom functools import reduce\n\nfrom langchain_openai import ChatOpenAI\nfrom pydantic.v1 import SecretStr\n\nfrom langflow.base.models.model import LCModelComponent\nfrom langflow.base.models.openai_constants import OPENAI_MODEL_NAMES\nfrom langflow.field_typing import LanguageModel\nfrom langflow.field_typing.range_spec import RangeSpec\nfrom langflow.inputs import (\n BoolInput,\n DictInput,\n DropdownInput,\n FloatInput,\n IntInput,\n SecretStrInput,\n StrInput,\n)\nfrom langflow.inputs.inputs import HandleInput\n\n\nclass OpenAIModelComponent(LCModelComponent):\n display_name = \"OpenAI\"\n description = \"Generates text using OpenAI LLMs.\"\n icon = \"OpenAI\"\n name = \"OpenAIModel\"\n\n inputs = [\n *LCModelComponent._base_inputs,\n IntInput(\n name=\"max_tokens\",\n display_name=\"Max Tokens\",\n advanced=True,\n info=\"The maximum number of tokens to generate. Set to 0 for unlimited tokens.\",\n range_spec=RangeSpec(min=0, max=128000),\n ),\n DictInput(name=\"model_kwargs\", display_name=\"Model Kwargs\", advanced=True),\n BoolInput(\n name=\"json_mode\",\n display_name=\"JSON Mode\",\n advanced=True,\n info=\"If True, it will output JSON regardless of passing a schema.\",\n ),\n DictInput(\n name=\"output_schema\",\n is_list=True,\n display_name=\"Schema\",\n advanced=True,\n info=\"The schema for the Output of the model. \"\n \"You must pass the word JSON in the prompt. \"\n \"If left blank, JSON mode will be disabled.\",\n ),\n DropdownInput(\n name=\"model_name\",\n display_name=\"Model Name\",\n advanced=False,\n options=OPENAI_MODEL_NAMES,\n value=OPENAI_MODEL_NAMES[0],\n ),\n StrInput(\n name=\"openai_api_base\",\n display_name=\"OpenAI API Base\",\n advanced=True,\n info=\"The base URL of the OpenAI API. \"\n \"Defaults to https://api.openai.com/v1. \"\n \"You can change this to use other APIs like JinaChat, LocalAI and Prem.\",\n ),\n SecretStrInput(\n name=\"api_key\",\n display_name=\"OpenAI API Key\",\n info=\"The OpenAI API Key to use for the OpenAI model.\",\n advanced=False,\n value=\"OPENAI_API_KEY\",\n ),\n FloatInput(name=\"temperature\", display_name=\"Temperature\", value=0.1),\n IntInput(\n name=\"seed\",\n display_name=\"Seed\",\n info=\"The seed controls the reproducibility of the job.\",\n advanced=True,\n value=1,\n ),\n HandleInput(\n name=\"output_parser\",\n display_name=\"Output Parser\",\n info=\"The parser to use to parse the output of the model\",\n advanced=True,\n input_types=[\"OutputParser\"],\n ),\n ]\n\n def build_model(self) -> LanguageModel: # type: ignore[type-var]\n # self.output_schema is a list of dictionaries\n # let's convert it to a dictionary\n output_schema_dict: dict[str, str] = reduce(operator.ior, self.output_schema or {}, {})\n openai_api_key = self.api_key\n temperature = self.temperature\n model_name: str = self.model_name\n max_tokens = self.max_tokens\n model_kwargs = self.model_kwargs or {}\n openai_api_base = self.openai_api_base or \"https://api.openai.com/v1\"\n json_mode = bool(output_schema_dict) or self.json_mode\n seed = self.seed\n\n api_key = SecretStr(openai_api_key) if openai_api_key else None\n output = ChatOpenAI(\n max_tokens=max_tokens or None,\n model_kwargs=model_kwargs,\n model=model_name,\n base_url=openai_api_base,\n api_key=api_key,\n temperature=temperature if temperature is not None else 0.1,\n seed=seed,\n )\n if json_mode:\n if output_schema_dict:\n output = output.with_structured_output(schema=output_schema_dict, method=\"json_mode\")\n else:\n output = output.bind(response_format={\"type\": \"json_object\"})\n\n return output\n\n def _get_exception_message(self, e: Exception):\n \"\"\"\n Get a message from an OpenAI exception.\n\n Args:\n exception (Exception): The exception to get the message from.\n\n Returns:\n str: The message from the exception.\n \"\"\"\n\n try:\n from openai import BadRequestError\n except ImportError:\n return None\n if isinstance(e, BadRequestError):\n message = e.body.get(\"message\")\n if message:\n return message\n return None\n","fileTypes":[],"file_path":"","password":false,"name":"code","advanced":true,"dynamic":true,"info":"","load_from_db":false,"title_case":false},"input_value":{"trace_as_input":true,"trace_as_metadata":true,"load_from_db":false,"list":false,"required":false,"placeholder":"","show":true,"name":"input_value","value":"","display_name":"Input","advanced":false,"input_types":["Message"],"dynamic":false,"info":"","title_case":false,"type":"str","_input_type":"MessageInput"},"json_mode":{"trace_as_metadata":true,"list":false,"required":false,"placeholder":"","show":true,"name":"json_mode","value":false,"display_name":"JSON Mode","advanced":true,"dynamic":false,"info":"If True, it will output JSON regardless of passing a schema.","title_case":false,"type":"bool","_input_type":"BoolInput"},"max_tokens":{"trace_as_metadata":true,"range_spec":{"step_type":"float","min":0,"max":128000,"step":0.1},"list":false,"required":false,"placeholder":"","show":true,"name":"max_tokens","value":"","display_name":"Max Tokens","advanced":true,"dynamic":false,"info":"The maximum number of tokens to generate. Set to 0 for unlimited tokens.","title_case":false,"type":"int","_input_type":"IntInput"},"model_kwargs":{"trace_as_input":true,"list":false,"required":false,"placeholder":"","show":true,"name":"model_kwargs","value":{},"display_name":"Model Kwargs","advanced":true,"dynamic":false,"info":"","title_case":false,"type":"dict","_input_type":"DictInput"},"model_name":{"trace_as_metadata":true,"options":["gpt-4o-mini","gpt-4o","gpt-4-turbo","gpt-4-turbo-preview","gpt-4","gpt-3.5-turbo","gpt-3.5-turbo-0125"],"combobox":false,"required":false,"placeholder":"","show":true,"name":"model_name","value":"gpt-4o-mini","display_name":"Model Name","advanced":false,"dynamic":false,"info":"","title_case":false,"type":"str","_input_type":"DropdownInput"},"openai_api_base":{"trace_as_metadata":true,"load_from_db":false,"list":false,"required":false,"placeholder":"","show":true,"name":"openai_api_base","value":"","display_name":"OpenAI API Base","advanced":true,"dynamic":false,"info":"The base URL of the OpenAI API. Defaults to https://api.openai.com/v1. You can change this to use other APIs like JinaChat, LocalAI and Prem.","title_case":false,"type":"str","_input_type":"StrInput"},"output_schema":{"trace_as_input":true,"list":true,"required":false,"placeholder":"","show":true,"name":"output_schema","value":{},"display_name":"Schema","advanced":true,"dynamic":false,"info":"The schema for the Output of the model. You must pass the word JSON in the prompt. If left blank, JSON mode will be disabled.","title_case":false,"type":"dict","_input_type":"DictInput"},"seed":{"trace_as_metadata":true,"list":false,"required":false,"placeholder":"","show":true,"name":"seed","value":1,"display_name":"Seed","advanced":true,"dynamic":false,"info":"The seed controls the reproducibility of the job.","title_case":false,"type":"int","_input_type":"IntInput"},"stream":{"trace_as_metadata":true,"list":false,"required":false,"placeholder":"","show":true,"name":"stream","value":false,"display_name":"Stream","advanced":true,"dynamic":false,"info":"Stream the response from the model. Streaming works only in Chat.","title_case":false,"type":"bool","_input_type":"BoolInput"},"system_message":{"trace_as_input":true,"trace_as_metadata":true,"load_from_db":false,"list":false,"required":false,"placeholder":"","show":true,"name":"system_message","value":"","display_name":"System Message","advanced":true,"input_types":["Message"],"dynamic":false,"info":"System message to pass to the model.","title_case":false,"type":"str","_input_type":"MessageTextInput"},"temperature":{"trace_as_metadata":true,"list":false,"required":false,"placeholder":"","show":true,"name":"temperature","value":0.1,"display_name":"Temperature","advanced":false,"dynamic":false,"info":"","title_case":false,"type":"float","_input_type":"FloatInput"}},"description":"Generates text using OpenAI LLMs.","icon":"OpenAI","base_classes":["LanguageModel","Message"],"display_name":"OpenAI","documentation":"","custom_fields":{},"output_types":[],"pinned":false,"conditional_paths":[],"frozen":false,"outputs":[{"types":["Message"],"selected":"Message","name":"text_output","display_name":"Text","method":"text_response","value":"__UNDEFINED__","cache":true,"required_inputs":["input_value","stream","system_message"]},{"types":["LanguageModel"],"selected":"LanguageModel","name":"model_output","display_name":"Language Model","method":"build_model","value":"__UNDEFINED__","cache":true,"required_inputs":["api_key","json_mode","max_tokens","model_kwargs","model_name","openai_api_base","output_schema","seed","temperature"]}],"field_order":["input_value","system_message","stream","max_tokens","model_kwargs","json_mode","output_schema","model_name","openai_api_base","api_key","temperature","seed","output_parser"],"beta":false,"edited":false,"metadata":{},"lf_version":"1.0.19.post2"},"id":"OpenAIModel-YUM1a","description":"Generates text using OpenAI LLMs.","display_name":"OpenAI"},"selected":false,"width":384,"height":587,"positionAbsolute":{"x":3231.963340176361,"y":94.70653241512102},"dragging":false},{"id":"ChatOutput-c4k0L","type":"genericNode","position":{"x":3669.141671875754,"y":248.4257650261032},"data":{"type":"ChatOutput","node":{"template":{"_type":"Component","code":{"type":"code","required":true,"placeholder":"","list":false,"show":true,"multiline":true,"value":"from langflow.base.io.chat import ChatComponent\nfrom langflow.inputs import BoolInput\nfrom langflow.io import DropdownInput, MessageTextInput, Output\nfrom langflow.memory import store_message\nfrom langflow.schema.message import Message\nfrom langflow.utils.constants import MESSAGE_SENDER_AI, MESSAGE_SENDER_NAME_AI, MESSAGE_SENDER_USER\n\n\nclass ChatOutput(ChatComponent):\n display_name = \"Chat Output\"\n description = \"Display a chat message in the Playground.\"\n icon = \"ChatOutput\"\n name = \"ChatOutput\"\n\n inputs = [\n MessageTextInput(\n name=\"input_value\",\n display_name=\"Text\",\n info=\"Message to be passed as output.\",\n ),\n BoolInput(\n name=\"should_store_message\",\n display_name=\"Store Messages\",\n info=\"Store the message in the history.\",\n value=True,\n advanced=True,\n ),\n DropdownInput(\n name=\"sender\",\n display_name=\"Sender Type\",\n options=[MESSAGE_SENDER_AI, MESSAGE_SENDER_USER],\n value=MESSAGE_SENDER_AI,\n advanced=True,\n info=\"Type of sender.\",\n ),\n MessageTextInput(\n name=\"sender_name\",\n display_name=\"Sender Name\",\n info=\"Name of the sender.\",\n value=MESSAGE_SENDER_NAME_AI,\n advanced=True,\n ),\n MessageTextInput(\n name=\"session_id\",\n display_name=\"Session ID\",\n info=\"The session ID of the chat. If empty, the current session ID parameter will be used.\",\n advanced=True,\n ),\n MessageTextInput(\n name=\"data_template\",\n display_name=\"Data Template\",\n value=\"{text}\",\n advanced=True,\n info=\"Template to convert Data to Text. If left empty, it will be dynamically set to the Data's text key.\",\n ),\n ]\n outputs = [\n Output(display_name=\"Message\", name=\"message\", method=\"message_response\"),\n ]\n\n def message_response(self) -> Message:\n message = Message(\n text=self.input_value,\n sender=self.sender,\n sender_name=self.sender_name,\n session_id=self.session_id,\n )\n if (\n self.session_id\n and isinstance(message, Message)\n and isinstance(message.text, str)\n and self.should_store_message\n ):\n store_message(\n message,\n flow_id=self.graph.flow_id,\n )\n self.message.value = message\n\n self.status = message\n return message\n","fileTypes":[],"file_path":"","password":false,"name":"code","advanced":true,"dynamic":true,"info":"","load_from_db":false,"title_case":false},"data_template":{"trace_as_input":true,"trace_as_metadata":true,"load_from_db":false,"list":false,"required":false,"placeholder":"","show":true,"name":"data_template","value":"{text}","display_name":"Data Template","advanced":true,"input_types":["Message"],"dynamic":false,"info":"Template to convert Data to Text. If left empty, it will be dynamically set to the Data's text key.","title_case":false,"type":"str","_input_type":"MessageTextInput"},"input_value":{"trace_as_input":true,"trace_as_metadata":true,"load_from_db":false,"list":false,"required":false,"placeholder":"","show":true,"name":"input_value","value":"","display_name":"Text","advanced":false,"input_types":["Message"],"dynamic":false,"info":"Message to be passed as output.","title_case":false,"type":"str","_input_type":"MessageTextInput"},"sender":{"trace_as_metadata":true,"options":["Machine","User"],"combobox":false,"required":false,"placeholder":"","show":true,"name":"sender","value":"Machine","display_name":"Sender Type","advanced":true,"dynamic":false,"info":"Type of sender.","title_case":false,"type":"str","_input_type":"DropdownInput"},"sender_name":{"trace_as_input":true,"trace_as_metadata":true,"load_from_db":false,"list":false,"required":false,"placeholder":"","show":true,"name":"sender_name","value":"AI","display_name":"Sender Name","advanced":true,"input_types":["Message"],"dynamic":false,"info":"Name of the sender.","title_case":false,"type":"str","_input_type":"MessageTextInput"},"session_id":{"trace_as_input":true,"trace_as_metadata":true,"load_from_db":false,"list":false,"required":false,"placeholder":"","show":true,"name":"session_id","value":"","display_name":"Session ID","advanced":true,"input_types":["Message"],"dynamic":false,"info":"The session ID of the chat. If empty, the current session ID parameter will be used.","title_case":false,"type":"str","_input_type":"MessageTextInput"},"should_store_message":{"trace_as_metadata":true,"list":false,"required":false,"placeholder":"","show":true,"name":"should_store_message","value":true,"display_name":"Store Messages","advanced":true,"dynamic":false,"info":"Store the message in the history.","title_case":false,"type":"bool","_input_type":"BoolInput"}},"description":"Display a chat message in the Playground.","icon":"ChatOutput","base_classes":["Message"],"display_name":"Chat Output","documentation":"","custom_fields":{},"output_types":[],"pinned":false,"conditional_paths":[],"frozen":false,"outputs":[{"types":["Message"],"selected":"Message","name":"message","display_name":"Message","method":"message_response","value":"__UNDEFINED__","cache":true}],"field_order":["input_value","should_store_message","sender","sender_name","session_id","data_template"],"beta":false,"edited":false,"metadata":{},"lf_version":"1.0.19.post2"},"id":"ChatOutput-c4k0L","description":"Display a chat message in the Playground.","display_name":"Chat Output"},"selected":false,"width":384,"height":289,"positionAbsolute":{"x":3669.141671875754,"y":248.4257650261032},"dragging":false},{"id":"note-9ynW0","type":"noteNode","position":{"x":-4,"y":38},"data":{"node":{"description":"**Google Drive Example Scopes**\n\n**Langflow - OAuth Integration Documentation**\n\n```\ndocs.langflow.org/integrations-setup-google-oauth-langflow\n```\n\n**Drive API Documentation**\n\nhttps://developers.google.com/drive/api/guides/api-specific-auth\n\n**Scope Used in This Example**\n\nPermission to view and download all your Drive files.\n\n```\nhttps://www.googleapis.com/auth/drive.readonly\n```\n\n**Example of How to Enter Scopes**\n\n```\nhttps://www.googleapis.com/auth/drive.apps.readonly, https://www.googleapis.com/auth/drive, https://www.googleapis.com/auth/drive.readonly, https://www.googleapis.com/auth/drive.activity\n```","display_name":"","documentation":"","template":{"backgroundColor":"indigo"}},"type":"note","id":"note-9ynW0"},"selected":false,"width":584,"height":673,"dragging":false,"style":{"width":584,"height":673},"resizing":false},{"id":"GoogleOAuthToken-piWFF","type":"genericNode","position":{"x":609.7629463431374,"y":218.39474366635045},"data":{"node":{"template":{"_type":"Component","oauth_credentials":{"trace_as_metadata":true,"file_path":"bc2cbf16-ed92-4ef6-a4a5-1526af21d044/2024-11-06_15-06-14_client_secret_998884801917-hsjq3alo0vfqih74fe635k01khqi74d3.apps.googleusercontent.com.json","fileTypes":["json"],"list":false,"required":true,"placeholder":"","show":true,"name":"oauth_credentials","value":"","display_name":"Credentials File","advanced":false,"dynamic":false,"info":"Input OAuth Credentials file (e.g. credentials.json).","title_case":false,"type":"file","_input_type":"FileInput"},"code":{"type":"code","required":true,"placeholder":"","list":false,"show":true,"multiline":true,"value":"import json\nimport re\nfrom pathlib import Path\n\nfrom google.auth.transport.requests import Request\nfrom google.oauth2.credentials import Credentials\nfrom google_auth_oauthlib.flow import InstalledAppFlow\n\nfrom langflow.custom import Component\nfrom langflow.io import FileInput, MultilineInput, Output\nfrom langflow.schema import Data\n\n\nclass GoogleOAuthToken(Component):\n display_name = \"Google OAuth Token\"\n description = \"Generates a JSON string with your Google OAuth token.\"\n documentation: str = \"https://developers.google.com/identity/protocols/oauth2/web-server?hl=pt-br#python_1\"\n icon = \"Google\"\n name = \"GoogleOAuthToken\"\n\n inputs = [\n MultilineInput(\n name=\"scopes\",\n display_name=\"Scopes\",\n info=\"Input scopes for your application.\",\n required=True,\n ),\n FileInput(\n name=\"oauth_credentials\",\n display_name=\"Credentials File\",\n info=\"Input OAuth Credentials file (e.g. credentials.json).\",\n file_types=[\"json\"],\n required=True,\n ),\n ]\n\n outputs = [\n Output(display_name=\"Output\", name=\"output\", method=\"build_output\"),\n ]\n\n def validate_scopes(self, scopes):\n pattern = (\n r\"^(https://www\\.googleapis\\.com/auth/[\\w\\.\\-]+\"\n r\"|mail\\.google\\.com/\"\n r\"|www\\.google\\.com/calendar/feeds\"\n r\"|www\\.google\\.com/m8/feeds)\"\n r\"(,\\s*https://www\\.googleapis\\.com/auth/[\\w\\.\\-]+\"\n r\"|mail\\.google\\.com/\"\n r\"|www\\.google\\.com/calendar/feeds\"\n r\"|www\\.google\\.com/m8/feeds)*$\"\n )\n if not re.match(pattern, scopes):\n error_message = \"Invalid scope format.\"\n raise ValueError(error_message)\n\n def build_output(self) -> Data:\n self.validate_scopes(self.scopes)\n\n user_scopes = [scope.strip() for scope in self.scopes.split(\",\")]\n if self.scopes:\n scopes = user_scopes\n else:\n error_message = \"Incorrect scope, check the scopes field.\"\n raise ValueError(error_message)\n\n creds = None\n token_path = Path(\"token.json\")\n\n if token_path.exists():\n with token_path.open(mode=\"r\", encoding=\"utf-8\") as token_file:\n creds = Credentials.from_authorized_user_file(\n str(token_path), scopes)\n\n if not creds or not creds.valid:\n if creds and creds.expired and creds.refresh_token:\n creds.refresh(Request())\n else:\n if self.oauth_credentials:\n client_secret_file = self.oauth_credentials\n else:\n error_message = \"OAuth 2.0 Credentials file not provided.\"\n raise ValueError(error_message)\n\n flow = InstalledAppFlow.from_client_secrets_file(\n client_secret_file, scopes)\n creds = flow.run_local_server(port=0)\n\n with token_path.open(mode=\"w\", encoding=\"utf-8\") as token_file:\n token_file.write(creds.to_json())\n\n creds_json = json.loads(creds.to_json())\n\n return Data(data=creds_json)\n","fileTypes":[],"file_path":"","password":false,"name":"code","advanced":true,"dynamic":true,"info":"","load_from_db":false,"title_case":false},"scopes":{"trace_as_input":true,"multiline":true,"trace_as_metadata":true,"load_from_db":false,"list":false,"required":true,"placeholder":"","show":true,"name":"scopes","value":"https://www.googleapis.com/auth/drive.readonly","display_name":"Scopes","advanced":false,"input_types":["Message"],"dynamic":false,"info":"Input scopes for your application.","title_case":false,"type":"str","_input_type":"MultilineInput"}},"description":"Generates a JSON string with your Google OAuth token.","icon":"Google","base_classes":["Data"],"display_name":"Google OAuth Token","documentation":"https://developers.google.com/identity/protocols/oauth2/web-server?hl=pt-br#python_1","custom_fields":{},"output_types":[],"pinned":false,"conditional_paths":[],"frozen":false,"outputs":[{"types":["Data"],"selected":"Data","name":"output","display_name":"Output","method":"build_output","value":"__UNDEFINED__","cache":true}],"field_order":["scopes","oauth_credentials"],"beta":false,"edited":true,"metadata":{},"lf_version":"1.0.19.post2"},"type":"GoogleOAuthToken","id":"GoogleOAuthToken-piWFF","description":"A component to generate a json string containing your Google OAuth token.","display_name":"Google OAuth Token"},"selected":true,"width":384,"height":391,"dragging":false,"positionAbsolute":{"x":609.7629463431374,"y":218.39474366635045}},{"id":"JSONCleaner-N4p7F","type":"genericNode","position":{"x":1484.3316811088714,"y":174.88328534754476},"data":{"node":{"template":{"_type":"Component","code":{"type":"code","required":true,"placeholder":"","list":false,"show":true,"multiline":true,"value":"import json\nimport re\nimport unicodedata\n\nfrom langflow.custom import Component\nfrom langflow.inputs import BoolInput, MessageTextInput\nfrom langflow.schema.message import Message\nfrom langflow.template import Output\n\n\nclass JSONCleaner(Component):\n display_name = \"JSON Cleaner\"\n description = (\n \"Cleans the messy and sometimes incorrect JSON strings produced by LLMs \"\n \"so that they are fully compliant with the JSON spec.\"\n )\n icon = \"custom_components\"\n\n inputs = [\n MessageTextInput(\n name=\"json_str\", display_name=\"JSON String\", info=\"The JSON string to be cleaned.\", required=True\n ),\n BoolInput(\n name=\"remove_control_chars\",\n display_name=\"Remove Control Characters\",\n info=\"Remove control characters from the JSON string.\",\n required=False,\n ),\n BoolInput(\n name=\"normalize_unicode\",\n display_name=\"Normalize Unicode\",\n info=\"Normalize Unicode characters in the JSON string.\",\n required=False,\n ),\n BoolInput(\n name=\"validate_json\",\n display_name=\"Validate JSON\",\n info=\"Validate the JSON string to ensure it is well-formed.\",\n required=False,\n ),\n ]\n\n outputs = [\n Output(display_name=\"Cleaned JSON String\", name=\"output\", method=\"clean_json\"),\n ]\n\n def clean_json(self) -> Message:\n try:\n from json_repair import repair_json\n except ImportError as e:\n msg = \"Could not import the json_repair package. Please install it with `pip install json_repair`.\"\n raise ImportError(msg) from e\n\n \"\"\"Clean the input JSON string based on provided options and return the cleaned JSON string.\"\"\"\n json_str = self.json_str\n remove_control_chars = self.remove_control_chars\n normalize_unicode = self.normalize_unicode\n validate_json = self.validate_json\n\n try:\n start = json_str.find(\"{\")\n end = json_str.rfind(\"}\")\n if start == -1 or end == -1:\n msg = \"Invalid JSON string: Missing '{' or '}'\"\n raise ValueError(msg)\n json_str = json_str[start : end + 1]\n\n if remove_control_chars:\n json_str = self._remove_control_characters(json_str)\n if normalize_unicode:\n json_str = self._normalize_unicode(json_str)\n if validate_json:\n json_str = self._validate_json(json_str)\n\n cleaned_json_str = repair_json(json_str)\n result = str(cleaned_json_str)\n\n self.status = result\n return Message(text=result)\n except Exception as e:\n msg = f\"Error cleaning JSON string: {e}\"\n raise ValueError(msg) from e\n\n def _remove_control_characters(self, s: str) -> str:\n \"\"\"Remove control characters from the string.\"\"\"\n return re.sub(r\"[\\x00-\\x1F\\x7F]\", \"\", s)\n\n def _normalize_unicode(self, s: str) -> str:\n \"\"\"Normalize Unicode characters in the string.\"\"\"\n return unicodedata.normalize(\"NFC\", s)\n\n def _validate_json(self, s: str) -> str:\n \"\"\"Validate the JSON string.\"\"\"\n try:\n json.loads(s)\n return s\n except json.JSONDecodeError as e:\n msg = f\"Invalid JSON string: {e}\"\n raise ValueError(msg) from e\n","fileTypes":[],"file_path":"","password":false,"name":"code","advanced":true,"dynamic":true,"info":"","load_from_db":false,"title_case":false},"json_str":{"trace_as_input":true,"trace_as_metadata":true,"load_from_db":false,"list":false,"required":true,"placeholder":"","show":true,"name":"json_str","value":"","display_name":"JSON String","advanced":false,"input_types":["Message"],"dynamic":false,"info":"The JSON string to be cleaned.","title_case":false,"type":"str","_input_type":"MessageTextInput"},"normalize_unicode":{"trace_as_metadata":true,"list":false,"required":false,"placeholder":"","show":true,"name":"normalize_unicode","value":true,"display_name":"Normalize Unicode","advanced":false,"dynamic":false,"info":"Normalize Unicode characters in the JSON string.","title_case":false,"type":"bool","_input_type":"BoolInput","load_from_db":false},"remove_control_chars":{"trace_as_metadata":true,"list":false,"required":false,"placeholder":"","show":true,"name":"remove_control_chars","value":false,"display_name":"Remove Control Characters","advanced":false,"dynamic":false,"info":"Remove control characters from the JSON string.","title_case":false,"type":"bool","_input_type":"BoolInput"},"validate_json":{"trace_as_metadata":true,"list":false,"required":false,"placeholder":"","show":true,"name":"validate_json","value":false,"display_name":"Validate JSON","advanced":false,"dynamic":false,"info":"Validate the JSON string to ensure it is well-formed.","title_case":false,"type":"bool","_input_type":"BoolInput"}},"description":"Cleans the messy and sometimes incorrect JSON strings produced by LLMs so that they are fully compliant with the JSON spec.","icon":"custom_components","base_classes":["Message"],"display_name":"JSON Cleaner","documentation":"","custom_fields":{},"output_types":[],"pinned":false,"conditional_paths":[],"frozen":false,"outputs":[{"types":["Message"],"selected":"Message","name":"output","display_name":"Cleaned JSON String","method":"clean_json","value":"__UNDEFINED__","cache":true}],"field_order":["json_str","remove_control_chars","normalize_unicode","validate_json"],"beta":false,"edited":false,"metadata":{},"lf_version":"1.0.19.post2"},"type":"JSONCleaner","id":"JSONCleaner-N4p7F","description":"Cleans the messy and sometimes incorrect JSON strings produced by LLMs so that they are fully compliant with the JSON spec.","display_name":"JSON Cleaner"},"selected":false,"width":384,"height":537,"positionAbsolute":{"x":1484.3316811088714,"y":174.88328534754476},"dragging":false},{"id":"Prompt-uk0Fr","type":"genericNode","position":{"x":2784.1158749493534,"y":225.01053782589702},"data":{"node":{"template":{"_type":"Component","code":{"type":"code","required":true,"placeholder":"","list":false,"show":true,"multiline":true,"value":"from langflow.base.prompts.api_utils import process_prompt_template\nfrom langflow.custom import Component\nfrom langflow.inputs.inputs import DefaultPromptField\nfrom langflow.io import Output, PromptInput\nfrom langflow.schema.message import Message\nfrom langflow.template.utils import update_template_values\n\n\nclass PromptComponent(Component):\n display_name: str = \"Prompt\"\n description: str = \"Create a prompt template with dynamic variables.\"\n icon = \"prompts\"\n trace_type = \"prompt\"\n name = \"Prompt\"\n\n inputs = [\n PromptInput(name=\"template\", display_name=\"Template\"),\n ]\n\n outputs = [\n Output(display_name=\"Prompt Message\", name=\"prompt\", method=\"build_prompt\"),\n ]\n\n async def build_prompt(\n self,\n ) -> Message:\n prompt = await Message.from_template_and_variables(**self._attributes)\n self.status = prompt.text\n return prompt\n\n def _update_template(self, frontend_node: dict):\n prompt_template = frontend_node[\"template\"][\"template\"][\"value\"]\n custom_fields = frontend_node[\"custom_fields\"]\n frontend_node_template = frontend_node[\"template\"]\n _ = process_prompt_template(\n template=prompt_template,\n name=\"template\",\n custom_fields=custom_fields,\n frontend_node_template=frontend_node_template,\n )\n return frontend_node\n\n def post_code_processing(self, new_frontend_node: dict, current_frontend_node: dict):\n \"\"\"\n This function is called after the code validation is done.\n \"\"\"\n frontend_node = super().post_code_processing(new_frontend_node, current_frontend_node)\n template = frontend_node[\"template\"][\"template\"][\"value\"]\n # Kept it duplicated for backwards compatibility\n _ = process_prompt_template(\n template=template,\n name=\"template\",\n custom_fields=frontend_node[\"custom_fields\"],\n frontend_node_template=frontend_node[\"template\"],\n )\n # Now that template is updated, we need to grab any values that were set in the current_frontend_node\n # and update the frontend_node with those values\n update_template_values(new_template=frontend_node, previous_template=current_frontend_node[\"template\"])\n return frontend_node\n\n def _get_fallback_input(self, **kwargs):\n return DefaultPromptField(**kwargs)\n","fileTypes":[],"file_path":"","password":false,"name":"code","advanced":true,"dynamic":true,"info":"","load_from_db":false,"title_case":false},"template":{"trace_as_input":true,"list":false,"required":false,"placeholder":"","show":true,"name":"template","value":"{context}\n\nTranslate the text you receive into Spanish!","display_name":"Template","advanced":false,"dynamic":false,"info":"","title_case":false,"type":"prompt","_input_type":"PromptInput","load_from_db":false},"context":{"field_type":"str","required":false,"placeholder":"","list":false,"show":true,"multiline":true,"value":"","fileTypes":[],"file_path":"","name":"context","display_name":"context","advanced":false,"input_types":["Message","Text"],"dynamic":false,"info":"","load_from_db":false,"title_case":false,"type":"str"}},"description":"Create a prompt template with dynamic variables.","icon":"prompts","base_classes":["Message"],"display_name":"Prompt","documentation":"","custom_fields":{"template":["context"]},"output_types":[],"pinned":false,"conditional_paths":[],"frozen":false,"outputs":[{"types":["Message"],"selected":"Message","name":"prompt","display_name":"Prompt Message","method":"build_prompt","value":"__UNDEFINED__","cache":true}],"field_order":["template"],"beta":false,"edited":false,"metadata":{},"lf_version":"1.0.19.post2"},"type":"Prompt","id":"Prompt-uk0Fr","description":"Create a prompt template with dynamic variables.","display_name":"Prompt"},"selected":false,"width":384,"height":391,"positionAbsolute":{"x":2784.1158749493534,"y":225.01053782589702},"dragging":false}],"edges":[{"source":"GoogleDriveComponent-x1jHz","target":"ParseData-7qhmP","sourceHandle":"{œdataTypeœ:œGoogleDriveComponentœ,œidœ:œGoogleDriveComponent-x1jHzœ,œnameœ:œdocsœ,œoutput_typesœ:[œDataœ]}","targetHandle":"{œfieldNameœ:œdataœ,œidœ:œParseData-7qhmPœ,œinputTypesœ:[œDataœ],œtypeœ:œotherœ}","id":"reactflow__edge-GoogleDriveComponent-x1jHz{œdataTypeœ:œGoogleDriveComponentœ,œidœ:œGoogleDriveComponent-x1jHzœ,œnameœ:œdocsœ,œoutput_typesœ:[œDataœ]}-ParseData-7qhmP{œfieldNameœ:œdataœ,œidœ:œParseData-7qhmPœ,œinputTypesœ:[œDataœ],œtypeœ:œotherœ}","data":{"targetHandle":{"fieldName":"data","id":"ParseData-7qhmP","inputTypes":["Data"],"type":"other"},"sourceHandle":{"dataType":"GoogleDriveComponent","id":"GoogleDriveComponent-x1jHz","name":"docs","output_types":["Data"]}},"selected":false,"animated":false,"className":""},{"source":"OpenAIModel-YUM1a","target":"ChatOutput-c4k0L","sourceHandle":"{œdataTypeœ:œOpenAIModelœ,œidœ:œOpenAIModel-YUM1aœ,œnameœ:œtext_outputœ,œoutput_typesœ:[œMessageœ]}","targetHandle":"{œfieldNameœ:œinput_valueœ,œidœ:œChatOutput-c4k0Lœ,œinputTypesœ:[œMessageœ],œtypeœ:œstrœ}","id":"reactflow__edge-OpenAIModel-YUM1a{œdataTypeœ:œOpenAIModelœ,œidœ:œOpenAIModel-YUM1aœ,œnameœ:œtext_outputœ,œoutput_typesœ:[œMessageœ]}-ChatOutput-c4k0L{œfieldNameœ:œinput_valueœ,œidœ:œChatOutput-c4k0Lœ,œinputTypesœ:[œMessageœ],œtypeœ:œstrœ}","data":{"targetHandle":{"fieldName":"input_value","id":"ChatOutput-c4k0L","inputTypes":["Message"],"type":"str"},"sourceHandle":{"dataType":"OpenAIModel","id":"OpenAIModel-YUM1a","name":"text_output","output_types":["Message"]}},"selected":false,"animated":false,"className":""},{"source":"GoogleOAuthToken-piWFF","sourceHandle":"{œdataTypeœ:œGoogleOAuthTokenœ,œidœ:œGoogleOAuthToken-piWFFœ,œnameœ:œoutputœ,œoutput_typesœ:[œDataœ]}","target":"ParseData-LFq8b","targetHandle":"{œfieldNameœ:œdataœ,œidœ:œParseData-LFq8bœ,œinputTypesœ:[œDataœ],œtypeœ:œotherœ}","data":{"targetHandle":{"fieldName":"data","id":"ParseData-LFq8b","inputTypes":["Data"],"type":"other"},"sourceHandle":{"dataType":"GoogleOAuthToken","id":"GoogleOAuthToken-piWFF","name":"output","output_types":["Data"]}},"id":"reactflow__edge-GoogleOAuthToken-piWFF{œdataTypeœ:œGoogleOAuthTokenœ,œidœ:œGoogleOAuthToken-piWFFœ,œnameœ:œoutputœ,œoutput_typesœ:[œDataœ]}-ParseData-LFq8b{œfieldNameœ:œdataœ,œidœ:œParseData-LFq8bœ,œinputTypesœ:[œDataœ],œtypeœ:œotherœ}","animated":false,"className":""},{"source":"ParseData-LFq8b","sourceHandle":"{œdataTypeœ:œParseDataœ,œidœ:œParseData-LFq8bœ,œnameœ:œtextœ,œoutput_typesœ:[œMessageœ]}","target":"JSONCleaner-N4p7F","targetHandle":"{œfieldNameœ:œjson_strœ,œidœ:œJSONCleaner-N4p7Fœ,œinputTypesœ:[œMessageœ],œtypeœ:œstrœ}","data":{"targetHandle":{"fieldName":"json_str","id":"JSONCleaner-N4p7F","inputTypes":["Message"],"type":"str"},"sourceHandle":{"dataType":"ParseData","id":"ParseData-LFq8b","name":"text","output_types":["Message"]}},"id":"reactflow__edge-ParseData-LFq8b{œdataTypeœ:œParseDataœ,œidœ:œParseData-LFq8bœ,œnameœ:œtextœ,œoutput_typesœ:[œMessageœ]}-JSONCleaner-N4p7F{œfieldNameœ:œjson_strœ,œidœ:œJSONCleaner-N4p7Fœ,œinputTypesœ:[œMessageœ],œtypeœ:œstrœ}","animated":false,"className":""},{"source":"JSONCleaner-N4p7F","sourceHandle":"{œdataTypeœ:œJSONCleanerœ,œidœ:œJSONCleaner-N4p7Fœ,œnameœ:œoutputœ,œoutput_typesœ:[œMessageœ]}","target":"GoogleDriveComponent-x1jHz","targetHandle":"{œfieldNameœ:œjson_stringœ,œidœ:œGoogleDriveComponent-x1jHzœ,œinputTypesœ:[œMessageœ],œtypeœ:œstrœ}","data":{"targetHandle":{"fieldName":"json_string","id":"GoogleDriveComponent-x1jHz","inputTypes":["Message"],"type":"str"},"sourceHandle":{"dataType":"JSONCleaner","id":"JSONCleaner-N4p7F","name":"output","output_types":["Message"]}},"id":"reactflow__edge-JSONCleaner-N4p7F{œdataTypeœ:œJSONCleanerœ,œidœ:œJSONCleaner-N4p7Fœ,œnameœ:œoutputœ,œoutput_typesœ:[œMessageœ]}-GoogleDriveComponent-x1jHz{œfieldNameœ:œjson_stringœ,œidœ:œGoogleDriveComponent-x1jHzœ,œinputTypesœ:[œMessageœ],œtypeœ:œstrœ}","animated":false,"className":""},{"source":"ParseData-7qhmP","sourceHandle":"{œdataTypeœ:œParseDataœ,œidœ:œParseData-7qhmPœ,œnameœ:œtextœ,œoutput_typesœ:[œMessageœ]}","target":"Prompt-uk0Fr","targetHandle":"{œfieldNameœ:œcontextœ,œidœ:œPrompt-uk0Frœ,œinputTypesœ:[œMessageœ,œTextœ],œtypeœ:œstrœ}","data":{"targetHandle":{"fieldName":"context","id":"Prompt-uk0Fr","inputTypes":["Message","Text"],"type":"str"},"sourceHandle":{"dataType":"ParseData","id":"ParseData-7qhmP","name":"text","output_types":["Message"]}},"id":"reactflow__edge-ParseData-7qhmP{œdataTypeœ:œParseDataœ,œidœ:œParseData-7qhmPœ,œnameœ:œtextœ,œoutput_typesœ:[œMessageœ]}-Prompt-uk0Fr{œfieldNameœ:œcontextœ,œidœ:œPrompt-uk0Frœ,œinputTypesœ:[œMessageœ,œTextœ],œtypeœ:œstrœ}","animated":false,"className":""},{"source":"Prompt-uk0Fr","sourceHandle":"{œdataTypeœ:œPromptœ,œidœ:œPrompt-uk0Frœ,œnameœ:œpromptœ,œoutput_typesœ:[œMessageœ]}","target":"OpenAIModel-YUM1a","targetHandle":"{œfieldNameœ:œinput_valueœ,œidœ:œOpenAIModel-YUM1aœ,œinputTypesœ:[œMessageœ],œtypeœ:œstrœ}","data":{"targetHandle":{"fieldName":"input_value","id":"OpenAIModel-YUM1a","inputTypes":["Message"],"type":"str"},"sourceHandle":{"dataType":"Prompt","id":"Prompt-uk0Fr","name":"prompt","output_types":["Message"]}},"id":"reactflow__edge-Prompt-uk0Fr{œdataTypeœ:œPromptœ,œidœ:œPrompt-uk0Frœ,œnameœ:œpromptœ,œoutput_typesœ:[œMessageœ]}-OpenAIModel-YUM1a{œfieldNameœ:œinput_valueœ,œidœ:œOpenAIModel-YUM1aœ,œinputTypesœ:[œMessageœ],œtypeœ:œstrœ}","animated":false,"className":""}],"viewport":{"x":-1019.4126433636247,"y":197.09015595775952,"zoom":0.6352002867729776}},"description":"An example of a flow that connects to Google Drive to access a text document, reads the content, translates it into the desired language, and returns the translated text in the chat, allowing for quick and efficient automation of the Google Docs file translation process.","name":"Google Drive Docs Translations Example","last_tested_version":"1.0.19.post2","endpoint_name":null,"is_component":false} +{ + "id": "bc2cbf16-ed92-4ef6-a4a5-1526af21d044", + "data": { + "nodes": [ + { + "id": "ParseData-LFq8b", + "type": "genericNode", + "position": { + "x": 1068.0112494649502, + "y": 237.00462961615915 + }, + "data": { + "type": "ParseData", + "node": { + "template": { + "_type": "Component", + "data": { + "trace_as_metadata": true, + "list": false, + "trace_as_input": true, + "required": false, + "placeholder": "", + "show": true, + "name": "data", + "value": "", + "display_name": "Data", + "advanced": false, + "input_types": [ + "Data" + ], + "dynamic": false, + "info": "The data to convert to text.", + "title_case": false, + "type": "other", + "_input_type": "DataInput" + }, + "code": { + "type": "code", + "required": true, + "placeholder": "", + "list": false, + "show": true, + "multiline": true, + "value": "from langflow.custom import Component\nfrom langflow.helpers.data import data_to_text\nfrom langflow.io import DataInput, MultilineInput, Output, StrInput\nfrom langflow.schema.message import Message\n\n\nclass ParseDataComponent(Component):\n display_name = \"Parse Data\"\n description = \"Convert Data into plain text following a specified template.\"\n icon = \"braces\"\n name = \"ParseData\"\n\n inputs = [\n DataInput(name=\"data\", display_name=\"Data\", info=\"The data to convert to text.\"),\n MultilineInput(\n name=\"template\",\n display_name=\"Template\",\n info=\"The template to use for formatting the data. \"\n \"It can contain the keys {text}, {data} or any other key in the Data.\",\n value=\"{text}\",\n ),\n StrInput(name=\"sep\", display_name=\"Separator\", advanced=True, value=\"\\n\"),\n ]\n\n outputs = [\n Output(display_name=\"Text\", name=\"text\", method=\"parse_data\"),\n ]\n\n def parse_data(self) -> Message:\n data = self.data if isinstance(self.data, list) else [self.data]\n template = self.template\n\n result_string = data_to_text(template, data, sep=self.sep)\n self.status = result_string\n return Message(text=result_string)\n", + "fileTypes": [], + "file_path": "", + "password": false, + "name": "code", + "advanced": true, + "dynamic": true, + "info": "", + "load_from_db": false, + "title_case": false + }, + "sep": { + "trace_as_metadata": true, + "load_from_db": false, + "list": false, + "required": false, + "placeholder": "", + "show": true, + "name": "sep", + "value": "\n", + "display_name": "Separator", + "advanced": true, + "dynamic": false, + "info": "", + "title_case": false, + "type": "str", + "_input_type": "StrInput" + }, + "template": { + "trace_as_input": true, + "multiline": true, + "trace_as_metadata": true, + "load_from_db": false, + "list": false, + "required": false, + "placeholder": "", + "show": true, + "name": "template", + "value": "{data}", + "display_name": "Template", + "advanced": false, + "input_types": [ + "Message" + ], + "dynamic": false, + "info": "The template to use for formatting the data. It can contain the keys {text}, {data} or any other key in the Data.", + "title_case": false, + "type": "str", + "_input_type": "MultilineInput" + } + }, + "description": "Convert Data into plain text following a specified template.", + "icon": "braces", + "base_classes": [ + "Message" + ], + "display_name": "Parse Data", + "documentation": "", + "custom_fields": {}, + "output_types": [], + "pinned": false, + "conditional_paths": [], + "frozen": false, + "outputs": [ + { + "types": [ + "Message" + ], + "selected": "Message", + "name": "text", + "display_name": "Text", + "method": "parse_data", + "value": "__UNDEFINED__", + "cache": true + } + ], + "field_order": [ + "data", + "template", + "sep" + ], + "beta": false, + "edited": false, + "metadata": {}, + "lf_version": "1.0.19.post2" + }, + "id": "ParseData-LFq8b" + }, + "selected": false, + "width": 384, + "height": 353, + "positionAbsolute": { + "x": 1068.0112494649502, + "y": 237.00462961615915 + }, + "dragging": false + }, + { + "id": "GoogleDriveComponent-x1jHz", + "type": "genericNode", + "position": { + "x": 1919.003246541804, + "y": 230.60766717987485 + }, + "data": { + "type": "GoogleDriveComponent", + "node": { + "template": { + "_type": "Component", + "code": { + "type": "code", + "required": true, + "placeholder": "", + "list": false, + "show": true, + "multiline": true, + "value": "import json\nfrom json.decoder import JSONDecodeError\n\nfrom google.auth.exceptions import RefreshError\nfrom google.oauth2.credentials import Credentials\nfrom langchain_google_community import GoogleDriveLoader\n\nfrom langflow.custom import Component\nfrom langflow.helpers.data import docs_to_data\nfrom langflow.inputs import MessageTextInput\nfrom langflow.io import SecretStrInput\nfrom langflow.schema import Data\nfrom langflow.template import Output\n\n\nclass GoogleDriveComponent(Component):\n display_name = \"Google Drive Loader\"\n description = \"Loads documents from Google Drive using provided credentials.\"\n icon = \"Google\"\n\n inputs = [\n SecretStrInput(\n name=\"json_string\",\n display_name=\"JSON String of the Service Account Token\",\n info=\"JSON string containing OAuth 2.0 access token information for service account access\",\n required=True,\n ),\n MessageTextInput(\n name=\"document_id\", display_name=\"Document ID\", info=\"Single Google Drive document ID\", required=True\n ),\n ]\n\n outputs = [\n Output(display_name=\"Loaded Documents\", name=\"docs\", method=\"load_documents\"),\n ]\n\n def load_documents(self) -> Data:\n class CustomGoogleDriveLoader(GoogleDriveLoader):\n creds: Credentials | None = None\n \"\"\"Credentials object to be passed directly.\"\"\"\n\n def _load_credentials(self):\n \"\"\"Load credentials from the provided creds attribute or fallback to the original method.\"\"\"\n if self.creds:\n return self.creds\n msg = \"No credentials provided.\"\n raise ValueError(msg)\n\n class Config:\n arbitrary_types_allowed = True\n\n json_string = self.json_string\n\n document_ids = [self.document_id]\n if len(document_ids) != 1:\n msg = \"Expected a single document ID\"\n raise ValueError(msg)\n\n # TODO: Add validation to check if the document ID is valid\n\n # Load the token information from the JSON string\n try:\n token_info = json.loads(json_string)\n except JSONDecodeError as e:\n msg = \"Invalid JSON string\"\n raise ValueError(msg) from e\n\n # Initialize the custom loader with the provided credentials and document IDs\n loader = CustomGoogleDriveLoader(\n creds=Credentials.from_authorized_user_info(token_info), document_ids=document_ids\n )\n\n # Load the documents\n try:\n docs = loader.load()\n # catch google.auth.exceptions.RefreshError\n except RefreshError as e:\n msg = \"Authentication error: Unable to refresh authentication token. Please try to reauthenticate.\"\n raise ValueError(msg) from e\n except Exception as e:\n msg = f\"Error loading documents: {e}\"\n raise ValueError(msg) from e\n\n assert len(docs) == 1, \"Expected a single document to be loaded.\"\n\n data = docs_to_data(docs)\n # Return the loaded documents\n self.status = data\n return Data(data={\"text\": data})\n", + "fileTypes": [], + "file_path": "", + "password": false, + "name": "code", + "advanced": true, + "dynamic": true, + "info": "", + "load_from_db": false, + "title_case": false + }, + "document_id": { + "trace_as_input": true, + "trace_as_metadata": true, + "load_from_db": false, + "list": false, + "required": true, + "placeholder": "", + "show": true, + "name": "document_id", + "value": "YOUR-DOCUMENT-ID-HERE", + "display_name": "Document ID", + "advanced": false, + "input_types": [ + "Message" + ], + "dynamic": false, + "info": "Single Google Drive document ID", + "title_case": false, + "type": "str", + "_input_type": "MessageTextInput" + }, + "json_string": { + "load_from_db": true, + "required": true, + "placeholder": "", + "show": true, + "name": "json_string", + "value": "", + "display_name": "JSON String of the Service Account Token", + "advanced": false, + "input_types": [ + "Message" + ], + "dynamic": false, + "info": "JSON string containing OAuth 2.0 access token information for service account access", + "title_case": false, + "password": true, + "type": "str", + "_input_type": "SecretStrInput" + } + }, + "description": "Loads documents from Google Drive using provided credentials.", + "icon": "Google", + "base_classes": [ + "Data" + ], + "display_name": "Google Drive Loader", + "documentation": "", + "custom_fields": {}, + "output_types": [], + "pinned": false, + "conditional_paths": [], + "frozen": false, + "outputs": [ + { + "types": [ + "Data" + ], + "selected": "Data", + "name": "docs", + "display_name": "Loaded Documents", + "method": "load_documents", + "value": "__UNDEFINED__", + "cache": true + } + ], + "field_order": [ + "json_string", + "document_id" + ], + "beta": false, + "edited": false, + "metadata": {}, + "lf_version": "1.0.19.post2" + }, + "id": "GoogleDriveComponent-x1jHz", + "description": "Loads documents from Google Drive using provided credentials.", + "display_name": "Google Drive Loader" + }, + "selected": false, + "width": 384, + "height": 389, + "positionAbsolute": { + "x": 1919.003246541804, + "y": 230.60766717987485 + }, + "dragging": false + }, + { + "id": "ParseData-7qhmP", + "type": "genericNode", + "position": { + "x": 2341.9094676839277, + "y": 249.73963276782303 + }, + "data": { + "type": "ParseData", + "node": { + "template": { + "_type": "Component", + "data": { + "trace_as_metadata": true, + "list": false, + "trace_as_input": true, + "required": false, + "placeholder": "", + "show": true, + "name": "data", + "value": "", + "display_name": "Data", + "advanced": false, + "input_types": [ + "Data" + ], + "dynamic": false, + "info": "The data to convert to text.", + "title_case": false, + "type": "other", + "_input_type": "DataInput" + }, + "code": { + "type": "code", + "required": true, + "placeholder": "", + "list": false, + "show": true, + "multiline": true, + "value": "from langflow.custom import Component\nfrom langflow.helpers.data import data_to_text\nfrom langflow.io import DataInput, MultilineInput, Output, StrInput\nfrom langflow.schema.message import Message\n\n\nclass ParseDataComponent(Component):\n display_name = \"Parse Data\"\n description = \"Convert Data into plain text following a specified template.\"\n icon = \"braces\"\n name = \"ParseData\"\n\n inputs = [\n DataInput(name=\"data\", display_name=\"Data\", info=\"The data to convert to text.\"),\n MultilineInput(\n name=\"template\",\n display_name=\"Template\",\n info=\"The template to use for formatting the data. \"\n \"It can contain the keys {text}, {data} or any other key in the Data.\",\n value=\"{text}\",\n ),\n StrInput(name=\"sep\", display_name=\"Separator\", advanced=True, value=\"\\n\"),\n ]\n\n outputs = [\n Output(display_name=\"Text\", name=\"text\", method=\"parse_data\"),\n ]\n\n def parse_data(self) -> Message:\n data = self.data if isinstance(self.data, list) else [self.data]\n template = self.template\n\n result_string = data_to_text(template, data, sep=self.sep)\n self.status = result_string\n return Message(text=result_string)\n", + "fileTypes": [], + "file_path": "", + "password": false, + "name": "code", + "advanced": true, + "dynamic": true, + "info": "", + "load_from_db": false, + "title_case": false + }, + "sep": { + "trace_as_metadata": true, + "load_from_db": false, + "list": false, + "required": false, + "placeholder": "", + "show": true, + "name": "sep", + "value": "\n", + "display_name": "Separator", + "advanced": true, + "dynamic": false, + "info": "", + "title_case": false, + "type": "str", + "_input_type": "StrInput" + }, + "template": { + "trace_as_input": true, + "multiline": true, + "trace_as_metadata": true, + "load_from_db": false, + "list": false, + "required": false, + "placeholder": "", + "show": true, + "name": "template", + "value": "{text}", + "display_name": "Template", + "advanced": false, + "input_types": [ + "Message" + ], + "dynamic": false, + "info": "The template to use for formatting the data. It can contain the keys {text}, {data} or any other key in the Data.", + "title_case": false, + "type": "str", + "_input_type": "MultilineInput" + } + }, + "description": "Convert Data into plain text following a specified template.", + "icon": "braces", + "base_classes": [ + "Message" + ], + "display_name": "Parse Data", + "documentation": "", + "custom_fields": {}, + "output_types": [], + "pinned": false, + "conditional_paths": [], + "frozen": false, + "outputs": [ + { + "types": [ + "Message" + ], + "selected": "Message", + "name": "text", + "display_name": "Text", + "method": "parse_data", + "value": "__UNDEFINED__", + "cache": true + } + ], + "field_order": [ + "data", + "template", + "sep" + ], + "beta": false, + "edited": false, + "metadata": {}, + "lf_version": "1.0.19.post2" + }, + "id": "ParseData-7qhmP" + }, + "selected": false, + "width": 384, + "height": 353, + "positionAbsolute": { + "x": 2341.9094676839277, + "y": 249.73963276782303 + }, + "dragging": false + }, + { + "id": "OpenAIModel-YUM1a", + "type": "genericNode", + "position": { + "x": 3231.963340176361, + "y": 94.70653241512102 + }, + "data": { + "type": "OpenAIModel", + "node": { + "template": { + "_type": "Component", + "output_parser": { + "trace_as_metadata": true, + "list": false, + "required": false, + "placeholder": "", + "show": true, + "name": "output_parser", + "value": "", + "display_name": "Output Parser", + "advanced": true, + "input_types": [ + "OutputParser" + ], + "dynamic": false, + "info": "The parser to use to parse the output of the model", + "title_case": false, + "type": "other", + "_input_type": "HandleInput" + }, + "api_key": { + "load_from_db": true, + "required": false, + "placeholder": "", + "show": true, + "name": "api_key", + "value": "", + "display_name": "OpenAI API Key", + "advanced": false, + "input_types": [ + "Message" + ], + "dynamic": false, + "info": "The OpenAI API Key to use for the OpenAI model.", + "title_case": false, + "password": true, + "type": "str", + "_input_type": "SecretStrInput" + }, + "code": { + "type": "code", + "required": true, + "placeholder": "", + "list": false, + "show": true, + "multiline": true, + "value": "import operator\nfrom functools import reduce\n\nfrom langchain_openai import ChatOpenAI\nfrom pydantic.v1 import SecretStr\n\nfrom langflow.base.models.model import LCModelComponent\nfrom langflow.base.models.openai_constants import OPENAI_MODEL_NAMES\nfrom langflow.field_typing import LanguageModel\nfrom langflow.field_typing.range_spec import RangeSpec\nfrom langflow.inputs import (\n BoolInput,\n DictInput,\n DropdownInput,\n FloatInput,\n IntInput,\n SecretStrInput,\n StrInput,\n)\nfrom langflow.inputs.inputs import HandleInput\n\n\nclass OpenAIModelComponent(LCModelComponent):\n display_name = \"OpenAI\"\n description = \"Generates text using OpenAI LLMs.\"\n icon = \"OpenAI\"\n name = \"OpenAIModel\"\n\n inputs = [\n *LCModelComponent._base_inputs,\n IntInput(\n name=\"max_tokens\",\n display_name=\"Max Tokens\",\n advanced=True,\n info=\"The maximum number of tokens to generate. Set to 0 for unlimited tokens.\",\n range_spec=RangeSpec(min=0, max=128000),\n ),\n DictInput(name=\"model_kwargs\", display_name=\"Model Kwargs\", advanced=True),\n BoolInput(\n name=\"json_mode\",\n display_name=\"JSON Mode\",\n advanced=True,\n info=\"If True, it will output JSON regardless of passing a schema.\",\n ),\n DictInput(\n name=\"output_schema\",\n is_list=True,\n display_name=\"Schema\",\n advanced=True,\n info=\"The schema for the Output of the model. \"\n \"You must pass the word JSON in the prompt. \"\n \"If left blank, JSON mode will be disabled.\",\n ),\n DropdownInput(\n name=\"model_name\",\n display_name=\"Model Name\",\n advanced=False,\n options=OPENAI_MODEL_NAMES,\n value=OPENAI_MODEL_NAMES[0],\n ),\n StrInput(\n name=\"openai_api_base\",\n display_name=\"OpenAI API Base\",\n advanced=True,\n info=\"The base URL of the OpenAI API. \"\n \"Defaults to https://api.openai.com/v1. \"\n \"You can change this to use other APIs like JinaChat, LocalAI and Prem.\",\n ),\n SecretStrInput(\n name=\"api_key\",\n display_name=\"OpenAI API Key\",\n info=\"The OpenAI API Key to use for the OpenAI model.\",\n advanced=False,\n value=\"OPENAI_API_KEY\",\n ),\n FloatInput(name=\"temperature\", display_name=\"Temperature\", value=0.1),\n IntInput(\n name=\"seed\",\n display_name=\"Seed\",\n info=\"The seed controls the reproducibility of the job.\",\n advanced=True,\n value=1,\n ),\n HandleInput(\n name=\"output_parser\",\n display_name=\"Output Parser\",\n info=\"The parser to use to parse the output of the model\",\n advanced=True,\n input_types=[\"OutputParser\"],\n ),\n ]\n\n def build_model(self) -> LanguageModel: # type: ignore[type-var]\n # self.output_schema is a list of dictionaries\n # let's convert it to a dictionary\n output_schema_dict: dict[str, str] = reduce(operator.ior, self.output_schema or {}, {})\n openai_api_key = self.api_key\n temperature = self.temperature\n model_name: str = self.model_name\n max_tokens = self.max_tokens\n model_kwargs = self.model_kwargs or {}\n openai_api_base = self.openai_api_base or \"https://api.openai.com/v1\"\n json_mode = bool(output_schema_dict) or self.json_mode\n seed = self.seed\n\n api_key = SecretStr(openai_api_key) if openai_api_key else None\n output = ChatOpenAI(\n max_tokens=max_tokens or None,\n model_kwargs=model_kwargs,\n model=model_name,\n base_url=openai_api_base,\n api_key=api_key,\n temperature=temperature if temperature is not None else 0.1,\n seed=seed,\n )\n if json_mode:\n if output_schema_dict:\n output = output.with_structured_output(schema=output_schema_dict, method=\"json_mode\")\n else:\n output = output.bind(response_format={\"type\": \"json_object\"})\n\n return output\n\n def _get_exception_message(self, e: Exception):\n \"\"\"\n Get a message from an OpenAI exception.\n\n Args:\n exception (Exception): The exception to get the message from.\n\n Returns:\n str: The message from the exception.\n \"\"\"\n\n try:\n from openai import BadRequestError\n except ImportError:\n return None\n if isinstance(e, BadRequestError):\n message = e.body.get(\"message\")\n if message:\n return message\n return None\n", + "fileTypes": [], + "file_path": "", + "password": false, + "name": "code", + "advanced": true, + "dynamic": true, + "info": "", + "load_from_db": false, + "title_case": false + }, + "input_value": { + "trace_as_input": true, + "trace_as_metadata": true, + "load_from_db": false, + "list": false, + "required": false, + "placeholder": "", + "show": true, + "name": "input_value", + "value": "", + "display_name": "Input", + "advanced": false, + "input_types": [ + "Message" + ], + "dynamic": false, + "info": "", + "title_case": false, + "type": "str", + "_input_type": "MessageInput" + }, + "json_mode": { + "trace_as_metadata": true, + "list": false, + "required": false, + "placeholder": "", + "show": true, + "name": "json_mode", + "value": false, + "display_name": "JSON Mode", + "advanced": true, + "dynamic": false, + "info": "If True, it will output JSON regardless of passing a schema.", + "title_case": false, + "type": "bool", + "_input_type": "BoolInput" + }, + "max_tokens": { + "trace_as_metadata": true, + "range_spec": { + "step_type": "float", + "min": 0, + "max": 128000, + "step": 0.1 + }, + "list": false, + "required": false, + "placeholder": "", + "show": true, + "name": "max_tokens", + "value": "", + "display_name": "Max Tokens", + "advanced": true, + "dynamic": false, + "info": "The maximum number of tokens to generate. Set to 0 for unlimited tokens.", + "title_case": false, + "type": "int", + "_input_type": "IntInput" + }, + "model_kwargs": { + "trace_as_input": true, + "list": false, + "required": false, + "placeholder": "", + "show": true, + "name": "model_kwargs", + "value": {}, + "display_name": "Model Kwargs", + "advanced": true, + "dynamic": false, + "info": "", + "title_case": false, + "type": "dict", + "_input_type": "DictInput" + }, + "model_name": { + "trace_as_metadata": true, + "options": [ + "gpt-4o-mini", + "gpt-4o", + "gpt-4-turbo", + "gpt-4-turbo-preview", + "gpt-4", + "gpt-3.5-turbo", + "gpt-3.5-turbo-0125" + ], + "combobox": false, + "required": false, + "placeholder": "", + "show": true, + "name": "model_name", + "value": "gpt-4o-mini", + "display_name": "Model Name", + "advanced": false, + "dynamic": false, + "info": "", + "title_case": false, + "type": "str", + "_input_type": "DropdownInput" + }, + "openai_api_base": { + "trace_as_metadata": true, + "load_from_db": false, + "list": false, + "required": false, + "placeholder": "", + "show": true, + "name": "openai_api_base", + "value": "", + "display_name": "OpenAI API Base", + "advanced": true, + "dynamic": false, + "info": "The base URL of the OpenAI API. Defaults to https://api.openai.com/v1. You can change this to use other APIs like JinaChat, LocalAI and Prem.", + "title_case": false, + "type": "str", + "_input_type": "StrInput" + }, + "output_schema": { + "trace_as_input": true, + "list": true, + "required": false, + "placeholder": "", + "show": true, + "name": "output_schema", + "value": {}, + "display_name": "Schema", + "advanced": true, + "dynamic": false, + "info": "The schema for the Output of the model. You must pass the word JSON in the prompt. If left blank, JSON mode will be disabled.", + "title_case": false, + "type": "dict", + "_input_type": "DictInput" + }, + "seed": { + "trace_as_metadata": true, + "list": false, + "required": false, + "placeholder": "", + "show": true, + "name": "seed", + "value": 1, + "display_name": "Seed", + "advanced": true, + "dynamic": false, + "info": "The seed controls the reproducibility of the job.", + "title_case": false, + "type": "int", + "_input_type": "IntInput" + }, + "stream": { + "trace_as_metadata": true, + "list": false, + "required": false, + "placeholder": "", + "show": true, + "name": "stream", + "value": false, + "display_name": "Stream", + "advanced": true, + "dynamic": false, + "info": "Stream the response from the model. Streaming works only in Chat.", + "title_case": false, + "type": "bool", + "_input_type": "BoolInput" + }, + "system_message": { + "trace_as_input": true, + "trace_as_metadata": true, + "load_from_db": false, + "list": false, + "required": false, + "placeholder": "", + "show": true, + "name": "system_message", + "value": "", + "display_name": "System Message", + "advanced": true, + "input_types": [ + "Message" + ], + "dynamic": false, + "info": "System message to pass to the model.", + "title_case": false, + "type": "str", + "_input_type": "MessageTextInput" + }, + "temperature": { + "trace_as_metadata": true, + "list": false, + "required": false, + "placeholder": "", + "show": true, + "name": "temperature", + "value": 0.1, + "display_name": "Temperature", + "advanced": false, + "dynamic": false, + "info": "", + "title_case": false, + "type": "float", + "_input_type": "FloatInput" + } + }, + "description": "Generates text using OpenAI LLMs.", + "icon": "OpenAI", + "base_classes": [ + "LanguageModel", + "Message" + ], + "display_name": "OpenAI", + "documentation": "", + "custom_fields": {}, + "output_types": [], + "pinned": false, + "conditional_paths": [], + "frozen": false, + "outputs": [ + { + "types": [ + "Message" + ], + "selected": "Message", + "name": "text_output", + "display_name": "Text", + "method": "text_response", + "value": "__UNDEFINED__", + "cache": true, + "required_inputs": [ + "input_value", + "stream", + "system_message" + ] + }, + { + "types": [ + "LanguageModel" + ], + "selected": "LanguageModel", + "name": "model_output", + "display_name": "Language Model", + "method": "build_model", + "value": "__UNDEFINED__", + "cache": true, + "required_inputs": [ + "api_key", + "json_mode", + "max_tokens", + "model_kwargs", + "model_name", + "openai_api_base", + "output_schema", + "seed", + "temperature" + ] + } + ], + "field_order": [ + "input_value", + "system_message", + "stream", + "max_tokens", + "model_kwargs", + "json_mode", + "output_schema", + "model_name", + "openai_api_base", + "api_key", + "temperature", + "seed", + "output_parser" + ], + "beta": false, + "edited": false, + "metadata": {}, + "lf_version": "1.0.19.post2" + }, + "id": "OpenAIModel-YUM1a", + "description": "Generates text using OpenAI LLMs.", + "display_name": "OpenAI" + }, + "selected": false, + "width": 384, + "height": 587, + "positionAbsolute": { + "x": 3231.963340176361, + "y": 94.70653241512102 + }, + "dragging": false + }, + { + "id": "ChatOutput-c4k0L", + "type": "genericNode", + "position": { + "x": 3669.141671875754, + "y": 248.4257650261032 + }, + "data": { + "type": "ChatOutput", + "node": { + "template": { + "_type": "Component", + "code": { + "type": "code", + "required": true, + "placeholder": "", + "list": false, + "show": true, + "multiline": true, + "value": "from langflow.base.io.chat import ChatComponent\nfrom langflow.inputs import BoolInput\nfrom langflow.io import DropdownInput, MessageTextInput, Output\nfrom langflow.memory import store_message\nfrom langflow.schema.message import Message\nfrom langflow.utils.constants import MESSAGE_SENDER_AI, MESSAGE_SENDER_NAME_AI, MESSAGE_SENDER_USER\n\n\nclass ChatOutput(ChatComponent):\n display_name = \"Chat Output\"\n description = \"Display a chat message in the Playground.\"\n icon = \"ChatOutput\"\n name = \"ChatOutput\"\n\n inputs = [\n MessageTextInput(\n name=\"input_value\",\n display_name=\"Text\",\n info=\"Message to be passed as output.\",\n ),\n BoolInput(\n name=\"should_store_message\",\n display_name=\"Store Messages\",\n info=\"Store the message in the history.\",\n value=True,\n advanced=True,\n ),\n DropdownInput(\n name=\"sender\",\n display_name=\"Sender Type\",\n options=[MESSAGE_SENDER_AI, MESSAGE_SENDER_USER],\n value=MESSAGE_SENDER_AI,\n advanced=True,\n info=\"Type of sender.\",\n ),\n MessageTextInput(\n name=\"sender_name\",\n display_name=\"Sender Name\",\n info=\"Name of the sender.\",\n value=MESSAGE_SENDER_NAME_AI,\n advanced=True,\n ),\n MessageTextInput(\n name=\"session_id\",\n display_name=\"Session ID\",\n info=\"The session ID of the chat. If empty, the current session ID parameter will be used.\",\n advanced=True,\n ),\n MessageTextInput(\n name=\"data_template\",\n display_name=\"Data Template\",\n value=\"{text}\",\n advanced=True,\n info=\"Template to convert Data to Text. If left empty, it will be dynamically set to the Data's text key.\",\n ),\n ]\n outputs = [\n Output(display_name=\"Message\", name=\"message\", method=\"message_response\"),\n ]\n\n def message_response(self) -> Message:\n message = Message(\n text=self.input_value,\n sender=self.sender,\n sender_name=self.sender_name,\n session_id=self.session_id,\n )\n if (\n self.session_id\n and isinstance(message, Message)\n and isinstance(message.text, str)\n and self.should_store_message\n ):\n store_message(\n message,\n flow_id=self.graph.flow_id,\n )\n self.message.value = message\n\n self.status = message\n return message\n", + "fileTypes": [], + "file_path": "", + "password": false, + "name": "code", + "advanced": true, + "dynamic": true, + "info": "", + "load_from_db": false, + "title_case": false + }, + "data_template": { + "trace_as_input": true, + "trace_as_metadata": true, + "load_from_db": false, + "list": false, + "required": false, + "placeholder": "", + "show": true, + "name": "data_template", + "value": "{text}", + "display_name": "Data Template", + "advanced": true, + "input_types": [ + "Message" + ], + "dynamic": false, + "info": "Template to convert Data to Text. If left empty, it will be dynamically set to the Data's text key.", + "title_case": false, + "type": "str", + "_input_type": "MessageTextInput" + }, + "input_value": { + "trace_as_input": true, + "trace_as_metadata": true, + "load_from_db": false, + "list": false, + "required": false, + "placeholder": "", + "show": true, + "name": "input_value", + "value": "", + "display_name": "Text", + "advanced": false, + "input_types": [ + "Message" + ], + "dynamic": false, + "info": "Message to be passed as output.", + "title_case": false, + "type": "str", + "_input_type": "MessageTextInput" + }, + "sender": { + "trace_as_metadata": true, + "options": [ + "Machine", + "User" + ], + "combobox": false, + "required": false, + "placeholder": "", + "show": true, + "name": "sender", + "value": "Machine", + "display_name": "Sender Type", + "advanced": true, + "dynamic": false, + "info": "Type of sender.", + "title_case": false, + "type": "str", + "_input_type": "DropdownInput" + }, + "sender_name": { + "trace_as_input": true, + "trace_as_metadata": true, + "load_from_db": false, + "list": false, + "required": false, + "placeholder": "", + "show": true, + "name": "sender_name", + "value": "AI", + "display_name": "Sender Name", + "advanced": true, + "input_types": [ + "Message" + ], + "dynamic": false, + "info": "Name of the sender.", + "title_case": false, + "type": "str", + "_input_type": "MessageTextInput" + }, + "session_id": { + "trace_as_input": true, + "trace_as_metadata": true, + "load_from_db": false, + "list": false, + "required": false, + "placeholder": "", + "show": true, + "name": "session_id", + "value": "", + "display_name": "Session ID", + "advanced": true, + "input_types": [ + "Message" + ], + "dynamic": false, + "info": "The session ID of the chat. If empty, the current session ID parameter will be used.", + "title_case": false, + "type": "str", + "_input_type": "MessageTextInput" + }, + "should_store_message": { + "trace_as_metadata": true, + "list": false, + "required": false, + "placeholder": "", + "show": true, + "name": "should_store_message", + "value": true, + "display_name": "Store Messages", + "advanced": true, + "dynamic": false, + "info": "Store the message in the history.", + "title_case": false, + "type": "bool", + "_input_type": "BoolInput" + } + }, + "description": "Display a chat message in the Playground.", + "icon": "ChatOutput", + "base_classes": [ + "Message" + ], + "display_name": "Chat Output", + "documentation": "", + "custom_fields": {}, + "output_types": [], + "pinned": false, + "conditional_paths": [], + "frozen": false, + "outputs": [ + { + "types": [ + "Message" + ], + "selected": "Message", + "name": "message", + "display_name": "Message", + "method": "message_response", + "value": "__UNDEFINED__", + "cache": true + } + ], + "field_order": [ + "input_value", + "should_store_message", + "sender", + "sender_name", + "session_id", + "data_template" + ], + "beta": false, + "edited": false, + "metadata": {}, + "lf_version": "1.0.19.post2" + }, + "id": "ChatOutput-c4k0L", + "description": "Display a chat message in the Playground.", + "display_name": "Chat Output" + }, + "selected": false, + "width": 384, + "height": 289, + "positionAbsolute": { + "x": 3669.141671875754, + "y": 248.4257650261032 + }, + "dragging": false + }, + { + "id": "note-9ynW0", + "type": "noteNode", + "position": { + "x": -4, + "y": 38 + }, + "data": { + "node": { + "description": "**Google Drive Example Scopes**\n\n**Langflow - OAuth Integration Documentation**\n\n```\ndocs.langflow.org/integrations-setup-google-oauth-langflow\n```\n\n**Drive API Documentation**\n\nhttps://developers.google.com/drive/api/guides/api-specific-auth\n\n**Scope Used in This Example**\n\nPermission to view and download all your Drive files.\n\n```\nhttps://www.googleapis.com/auth/drive.readonly\n```\n\n**Example of How to Enter Scopes**\n\n```\nhttps://www.googleapis.com/auth/drive.apps.readonly, https://www.googleapis.com/auth/drive, https://www.googleapis.com/auth/drive.readonly, https://www.googleapis.com/auth/drive.activity\n```", + "display_name": "", + "documentation": "", + "template": { + "backgroundColor": "indigo" + } + }, + "type": "note", + "id": "note-9ynW0" + }, + "selected": false, + "width": 584, + "height": 673, + "dragging": false, + "style": { + "width": 584, + "height": 673 + }, + "resizing": false + }, + { + "id": "GoogleOAuthToken-piWFF", + "type": "genericNode", + "position": { + "x": 609.7629463431374, + "y": 218.39474366635045 + }, + "data": { + "node": { + "template": { + "_type": "Component", + "oauth_credentials": { + "trace_as_metadata": true, + "file_path": "bc2cbf16-ed92-4ef6-a4a5-1526af21d044/2024-11-06_15-06-14_client_secret_998884801917-hsjq3alo0vfqih74fe635k01khqi74d3.apps.googleusercontent.com.json", + "fileTypes": [ + "json" + ], + "list": false, + "required": true, + "placeholder": "", + "show": true, + "name": "oauth_credentials", + "value": "", + "display_name": "Credentials File", + "advanced": false, + "dynamic": false, + "info": "Input OAuth Credentials file (e.g. credentials.json).", + "title_case": false, + "type": "file", + "_input_type": "FileInput" + }, + "code": { + "type": "code", + "required": true, + "placeholder": "", + "list": false, + "show": true, + "multiline": true, + "value": "import json\nimport re\nfrom pathlib import Path\n\nfrom google.auth.transport.requests import Request\nfrom google.oauth2.credentials import Credentials\nfrom google_auth_oauthlib.flow import InstalledAppFlow\n\nfrom langflow.custom import Component\nfrom langflow.io import FileInput, MultilineInput, Output\nfrom langflow.schema import Data\n\n\nclass GoogleOAuthToken(Component):\n display_name = \"Google OAuth Token\"\n description = \"Generates a JSON string with your Google OAuth token.\"\n documentation: str = \"https://developers.google.com/identity/protocols/oauth2/web-server?hl=pt-br#python_1\"\n icon = \"Google\"\n name = \"GoogleOAuthToken\"\n\n inputs = [\n MultilineInput(\n name=\"scopes\",\n display_name=\"Scopes\",\n info=\"Input scopes for your application.\",\n required=True,\n ),\n FileInput(\n name=\"oauth_credentials\",\n display_name=\"Credentials File\",\n info=\"Input OAuth Credentials file (e.g. credentials.json).\",\n file_types=[\"json\"],\n required=True,\n ),\n ]\n\n outputs = [\n Output(display_name=\"Output\", name=\"output\", method=\"build_output\"),\n ]\n\n def validate_scopes(self, scopes):\n pattern = (\n r\"^(https://www\\.googleapis\\.com/auth/[\\w\\.\\-]+\"\n r\"|mail\\.google\\.com/\"\n r\"|www\\.google\\.com/calendar/feeds\"\n r\"|www\\.google\\.com/m8/feeds)\"\n r\"(,\\s*https://www\\.googleapis\\.com/auth/[\\w\\.\\-]+\"\n r\"|mail\\.google\\.com/\"\n r\"|www\\.google\\.com/calendar/feeds\"\n r\"|www\\.google\\.com/m8/feeds)*$\"\n )\n if not re.match(pattern, scopes):\n error_message = \"Invalid scope format.\"\n raise ValueError(error_message)\n\n def build_output(self) -> Data:\n self.validate_scopes(self.scopes)\n\n user_scopes = [scope.strip() for scope in self.scopes.split(\",\")]\n if self.scopes:\n scopes = user_scopes\n else:\n error_message = \"Incorrect scope, check the scopes field.\"\n raise ValueError(error_message)\n\n creds = None\n token_path = Path(\"token.json\")\n\n if token_path.exists():\n with token_path.open(mode=\"r\", encoding=\"utf-8\") as token_file:\n creds = Credentials.from_authorized_user_file(\n str(token_path), scopes)\n\n if not creds or not creds.valid:\n if creds and creds.expired and creds.refresh_token:\n creds.refresh(Request())\n else:\n if self.oauth_credentials:\n client_secret_file = self.oauth_credentials\n else:\n error_message = \"OAuth 2.0 Credentials file not provided.\"\n raise ValueError(error_message)\n\n flow = InstalledAppFlow.from_client_secrets_file(\n client_secret_file, scopes)\n creds = flow.run_local_server(port=0)\n\n with token_path.open(mode=\"w\", encoding=\"utf-8\") as token_file:\n token_file.write(creds.to_json())\n\n creds_json = json.loads(creds.to_json())\n\n return Data(data=creds_json)\n", + "fileTypes": [], + "file_path": "", + "password": false, + "name": "code", + "advanced": true, + "dynamic": true, + "info": "", + "load_from_db": false, + "title_case": false + }, + "scopes": { + "trace_as_input": true, + "multiline": true, + "trace_as_metadata": true, + "load_from_db": false, + "list": false, + "required": true, + "placeholder": "", + "show": true, + "name": "scopes", + "value": "https://www.googleapis.com/auth/drive.readonly", + "display_name": "Scopes", + "advanced": false, + "input_types": [ + "Message" + ], + "dynamic": false, + "info": "Input scopes for your application.", + "title_case": false, + "type": "str", + "_input_type": "MultilineInput" + } + }, + "description": "Generates a JSON string with your Google OAuth token.", + "icon": "Google", + "base_classes": [ + "Data" + ], + "display_name": "Google OAuth Token", + "documentation": "https://developers.google.com/identity/protocols/oauth2/web-server?hl=pt-br#python_1", + "custom_fields": {}, + "output_types": [], + "pinned": false, + "conditional_paths": [], + "frozen": false, + "outputs": [ + { + "types": [ + "Data" + ], + "selected": "Data", + "name": "output", + "display_name": "Output", + "method": "build_output", + "value": "__UNDEFINED__", + "cache": true + } + ], + "field_order": [ + "scopes", + "oauth_credentials" + ], + "beta": false, + "edited": true, + "metadata": {}, + "lf_version": "1.0.19.post2" + }, + "type": "GoogleOAuthToken", + "id": "GoogleOAuthToken-piWFF", + "description": "A component to generate a json string containing your Google OAuth token.", + "display_name": "Google OAuth Token" + }, + "selected": true, + "width": 384, + "height": 391, + "dragging": false, + "positionAbsolute": { + "x": 609.7629463431374, + "y": 218.39474366635045 + } + }, + { + "id": "JSONCleaner-N4p7F", + "type": "genericNode", + "position": { + "x": 1484.3316811088714, + "y": 174.88328534754476 + }, + "data": { + "node": { + "template": { + "_type": "Component", + "code": { + "type": "code", + "required": true, + "placeholder": "", + "list": false, + "show": true, + "multiline": true, + "value": "import json\nimport re\nimport unicodedata\n\nfrom langflow.custom import Component\nfrom langflow.inputs import BoolInput, MessageTextInput\nfrom langflow.schema.message import Message\nfrom langflow.template import Output\n\n\nclass JSONCleaner(Component):\n display_name = \"JSON Cleaner\"\n description = (\n \"Cleans the messy and sometimes incorrect JSON strings produced by LLMs \"\n \"so that they are fully compliant with the JSON spec.\"\n )\n icon = \"custom_components\"\n\n inputs = [\n MessageTextInput(\n name=\"json_str\", display_name=\"JSON String\", info=\"The JSON string to be cleaned.\", required=True\n ),\n BoolInput(\n name=\"remove_control_chars\",\n display_name=\"Remove Control Characters\",\n info=\"Remove control characters from the JSON string.\",\n required=False,\n ),\n BoolInput(\n name=\"normalize_unicode\",\n display_name=\"Normalize Unicode\",\n info=\"Normalize Unicode characters in the JSON string.\",\n required=False,\n ),\n BoolInput(\n name=\"validate_json\",\n display_name=\"Validate JSON\",\n info=\"Validate the JSON string to ensure it is well-formed.\",\n required=False,\n ),\n ]\n\n outputs = [\n Output(display_name=\"Cleaned JSON String\", name=\"output\", method=\"clean_json\"),\n ]\n\n def clean_json(self) -> Message:\n try:\n from json_repair import repair_json\n except ImportError as e:\n msg = \"Could not import the json_repair package. Please install it with `pip install json_repair`.\"\n raise ImportError(msg) from e\n\n \"\"\"Clean the input JSON string based on provided options and return the cleaned JSON string.\"\"\"\n json_str = self.json_str\n remove_control_chars = self.remove_control_chars\n normalize_unicode = self.normalize_unicode\n validate_json = self.validate_json\n\n try:\n start = json_str.find(\"{\")\n end = json_str.rfind(\"}\")\n if start == -1 or end == -1:\n msg = \"Invalid JSON string: Missing '{' or '}'\"\n raise ValueError(msg)\n json_str = json_str[start : end + 1]\n\n if remove_control_chars:\n json_str = self._remove_control_characters(json_str)\n if normalize_unicode:\n json_str = self._normalize_unicode(json_str)\n if validate_json:\n json_str = self._validate_json(json_str)\n\n cleaned_json_str = repair_json(json_str)\n result = str(cleaned_json_str)\n\n self.status = result\n return Message(text=result)\n except Exception as e:\n msg = f\"Error cleaning JSON string: {e}\"\n raise ValueError(msg) from e\n\n def _remove_control_characters(self, s: str) -> str:\n \"\"\"Remove control characters from the string.\"\"\"\n return re.sub(r\"[\\x00-\\x1F\\x7F]\", \"\", s)\n\n def _normalize_unicode(self, s: str) -> str:\n \"\"\"Normalize Unicode characters in the string.\"\"\"\n return unicodedata.normalize(\"NFC\", s)\n\n def _validate_json(self, s: str) -> str:\n \"\"\"Validate the JSON string.\"\"\"\n try:\n json.loads(s)\n return s\n except json.JSONDecodeError as e:\n msg = f\"Invalid JSON string: {e}\"\n raise ValueError(msg) from e\n", + "fileTypes": [], + "file_path": "", + "password": false, + "name": "code", + "advanced": true, + "dynamic": true, + "info": "", + "load_from_db": false, + "title_case": false + }, + "json_str": { + "trace_as_input": true, + "trace_as_metadata": true, + "load_from_db": false, + "list": false, + "required": true, + "placeholder": "", + "show": true, + "name": "json_str", + "value": "", + "display_name": "JSON String", + "advanced": false, + "input_types": [ + "Message" + ], + "dynamic": false, + "info": "The JSON string to be cleaned.", + "title_case": false, + "type": "str", + "_input_type": "MessageTextInput" + }, + "normalize_unicode": { + "trace_as_metadata": true, + "list": false, + "required": false, + "placeholder": "", + "show": true, + "name": "normalize_unicode", + "value": true, + "display_name": "Normalize Unicode", + "advanced": false, + "dynamic": false, + "info": "Normalize Unicode characters in the JSON string.", + "title_case": false, + "type": "bool", + "_input_type": "BoolInput", + "load_from_db": false + }, + "remove_control_chars": { + "trace_as_metadata": true, + "list": false, + "required": false, + "placeholder": "", + "show": true, + "name": "remove_control_chars", + "value": false, + "display_name": "Remove Control Characters", + "advanced": false, + "dynamic": false, + "info": "Remove control characters from the JSON string.", + "title_case": false, + "type": "bool", + "_input_type": "BoolInput" + }, + "validate_json": { + "trace_as_metadata": true, + "list": false, + "required": false, + "placeholder": "", + "show": true, + "name": "validate_json", + "value": false, + "display_name": "Validate JSON", + "advanced": false, + "dynamic": false, + "info": "Validate the JSON string to ensure it is well-formed.", + "title_case": false, + "type": "bool", + "_input_type": "BoolInput" + } + }, + "description": "Cleans the messy and sometimes incorrect JSON strings produced by LLMs so that they are fully compliant with the JSON spec.", + "icon": "custom_components", + "base_classes": [ + "Message" + ], + "display_name": "JSON Cleaner", + "documentation": "", + "custom_fields": {}, + "output_types": [], + "pinned": false, + "conditional_paths": [], + "frozen": false, + "outputs": [ + { + "types": [ + "Message" + ], + "selected": "Message", + "name": "output", + "display_name": "Cleaned JSON String", + "method": "clean_json", + "value": "__UNDEFINED__", + "cache": true + } + ], + "field_order": [ + "json_str", + "remove_control_chars", + "normalize_unicode", + "validate_json" + ], + "beta": false, + "edited": false, + "metadata": {}, + "lf_version": "1.0.19.post2" + }, + "type": "JSONCleaner", + "id": "JSONCleaner-N4p7F", + "description": "Cleans the messy and sometimes incorrect JSON strings produced by LLMs so that they are fully compliant with the JSON spec.", + "display_name": "JSON Cleaner" + }, + "selected": false, + "width": 384, + "height": 537, + "positionAbsolute": { + "x": 1484.3316811088714, + "y": 174.88328534754476 + }, + "dragging": false + }, + { + "id": "Prompt-uk0Fr", + "type": "genericNode", + "position": { + "x": 2784.1158749493534, + "y": 225.01053782589702 + }, + "data": { + "node": { + "template": { + "_type": "Component", + "code": { + "type": "code", + "required": true, + "placeholder": "", + "list": false, + "show": true, + "multiline": true, + "value": "from langflow.base.prompts.api_utils import process_prompt_template\nfrom langflow.custom import Component\nfrom langflow.inputs.inputs import DefaultPromptField\nfrom langflow.io import Output, PromptInput\nfrom langflow.schema.message import Message\nfrom langflow.template.utils import update_template_values\n\n\nclass PromptComponent(Component):\n display_name: str = \"Prompt\"\n description: str = \"Create a prompt template with dynamic variables.\"\n icon = \"prompts\"\n trace_type = \"prompt\"\n name = \"Prompt\"\n\n inputs = [\n PromptInput(name=\"template\", display_name=\"Template\"),\n ]\n\n outputs = [\n Output(display_name=\"Prompt Message\", name=\"prompt\", method=\"build_prompt\"),\n ]\n\n async def build_prompt(\n self,\n ) -> Message:\n prompt = await Message.from_template_and_variables(**self._attributes)\n self.status = prompt.text\n return prompt\n\n def _update_template(self, frontend_node: dict):\n prompt_template = frontend_node[\"template\"][\"template\"][\"value\"]\n custom_fields = frontend_node[\"custom_fields\"]\n frontend_node_template = frontend_node[\"template\"]\n _ = process_prompt_template(\n template=prompt_template,\n name=\"template\",\n custom_fields=custom_fields,\n frontend_node_template=frontend_node_template,\n )\n return frontend_node\n\n def post_code_processing(self, new_frontend_node: dict, current_frontend_node: dict):\n \"\"\"\n This function is called after the code validation is done.\n \"\"\"\n frontend_node = super().post_code_processing(new_frontend_node, current_frontend_node)\n template = frontend_node[\"template\"][\"template\"][\"value\"]\n # Kept it duplicated for backwards compatibility\n _ = process_prompt_template(\n template=template,\n name=\"template\",\n custom_fields=frontend_node[\"custom_fields\"],\n frontend_node_template=frontend_node[\"template\"],\n )\n # Now that template is updated, we need to grab any values that were set in the current_frontend_node\n # and update the frontend_node with those values\n update_template_values(new_template=frontend_node, previous_template=current_frontend_node[\"template\"])\n return frontend_node\n\n def _get_fallback_input(self, **kwargs):\n return DefaultPromptField(**kwargs)\n", + "fileTypes": [], + "file_path": "", + "password": false, + "name": "code", + "advanced": true, + "dynamic": true, + "info": "", + "load_from_db": false, + "title_case": false + }, + "template": { + "trace_as_input": true, + "list": false, + "required": false, + "placeholder": "", + "show": true, + "name": "template", + "value": "{context}\n\nTranslate the text you receive into Spanish!", + "display_name": "Template", + "advanced": false, + "dynamic": false, + "info": "", + "title_case": false, + "type": "prompt", + "_input_type": "PromptInput", + "load_from_db": false + }, + "context": { + "field_type": "str", + "required": false, + "placeholder": "", + "list": false, + "show": true, + "multiline": true, + "value": "", + "fileTypes": [], + "file_path": "", + "name": "context", + "display_name": "context", + "advanced": false, + "input_types": [ + "Message", + "Text" + ], + "dynamic": false, + "info": "", + "load_from_db": false, + "title_case": false, + "type": "str" + } + }, + "description": "Create a prompt template with dynamic variables.", + "icon": "prompts", + "base_classes": [ + "Message" + ], + "display_name": "Prompt", + "documentation": "", + "custom_fields": { + "template": [ + "context" + ] + }, + "output_types": [], + "pinned": false, + "conditional_paths": [], + "frozen": false, + "outputs": [ + { + "types": [ + "Message" + ], + "selected": "Message", + "name": "prompt", + "display_name": "Prompt Message", + "method": "build_prompt", + "value": "__UNDEFINED__", + "cache": true + } + ], + "field_order": [ + "template" + ], + "beta": false, + "edited": false, + "metadata": {}, + "lf_version": "1.0.19.post2" + }, + "type": "Prompt", + "id": "Prompt-uk0Fr", + "description": "Create a prompt template with dynamic variables.", + "display_name": "Prompt" + }, + "selected": false, + "width": 384, + "height": 391, + "positionAbsolute": { + "x": 2784.1158749493534, + "y": 225.01053782589702 + }, + "dragging": false + } + ], + "edges": [ + { + "source": "GoogleDriveComponent-x1jHz", + "target": "ParseData-7qhmP", + "sourceHandle": "{œdataTypeœ:œGoogleDriveComponentœ,œidœ:œGoogleDriveComponent-x1jHzœ,œnameœ:œdocsœ,œoutput_typesœ:[œDataœ]}", + "targetHandle": "{œfieldNameœ:œdataœ,œidœ:œParseData-7qhmPœ,œinputTypesœ:[œDataœ],œtypeœ:œotherœ}", + "id": "reactflow__edge-GoogleDriveComponent-x1jHz{œdataTypeœ:œGoogleDriveComponentœ,œidœ:œGoogleDriveComponent-x1jHzœ,œnameœ:œdocsœ,œoutput_typesœ:[œDataœ]}-ParseData-7qhmP{œfieldNameœ:œdataœ,œidœ:œParseData-7qhmPœ,œinputTypesœ:[œDataœ],œtypeœ:œotherœ}", + "data": { + "targetHandle": { + "fieldName": "data", + "id": "ParseData-7qhmP", + "inputTypes": [ + "Data" + ], + "type": "other" + }, + "sourceHandle": { + "dataType": "GoogleDriveComponent", + "id": "GoogleDriveComponent-x1jHz", + "name": "docs", + "output_types": [ + "Data" + ] + } + }, + "selected": false, + "animated": false, + "className": "" + }, + { + "source": "OpenAIModel-YUM1a", + "target": "ChatOutput-c4k0L", + "sourceHandle": "{œdataTypeœ:œOpenAIModelœ,œidœ:œOpenAIModel-YUM1aœ,œnameœ:œtext_outputœ,œoutput_typesœ:[œMessageœ]}", + "targetHandle": "{œfieldNameœ:œinput_valueœ,œidœ:œChatOutput-c4k0Lœ,œinputTypesœ:[œMessageœ],œtypeœ:œstrœ}", + "id": "reactflow__edge-OpenAIModel-YUM1a{œdataTypeœ:œOpenAIModelœ,œidœ:œOpenAIModel-YUM1aœ,œnameœ:œtext_outputœ,œoutput_typesœ:[œMessageœ]}-ChatOutput-c4k0L{œfieldNameœ:œinput_valueœ,œidœ:œChatOutput-c4k0Lœ,œinputTypesœ:[œMessageœ],œtypeœ:œstrœ}", + "data": { + "targetHandle": { + "fieldName": "input_value", + "id": "ChatOutput-c4k0L", + "inputTypes": [ + "Message" + ], + "type": "str" + }, + "sourceHandle": { + "dataType": "OpenAIModel", + "id": "OpenAIModel-YUM1a", + "name": "text_output", + "output_types": [ + "Message" + ] + } + }, + "selected": false, + "animated": false, + "className": "" + }, + { + "source": "GoogleOAuthToken-piWFF", + "sourceHandle": "{œdataTypeœ:œGoogleOAuthTokenœ,œidœ:œGoogleOAuthToken-piWFFœ,œnameœ:œoutputœ,œoutput_typesœ:[œDataœ]}", + "target": "ParseData-LFq8b", + "targetHandle": "{œfieldNameœ:œdataœ,œidœ:œParseData-LFq8bœ,œinputTypesœ:[œDataœ],œtypeœ:œotherœ}", + "data": { + "targetHandle": { + "fieldName": "data", + "id": "ParseData-LFq8b", + "inputTypes": [ + "Data" + ], + "type": "other" + }, + "sourceHandle": { + "dataType": "GoogleOAuthToken", + "id": "GoogleOAuthToken-piWFF", + "name": "output", + "output_types": [ + "Data" + ] + } + }, + "id": "reactflow__edge-GoogleOAuthToken-piWFF{œdataTypeœ:œGoogleOAuthTokenœ,œidœ:œGoogleOAuthToken-piWFFœ,œnameœ:œoutputœ,œoutput_typesœ:[œDataœ]}-ParseData-LFq8b{œfieldNameœ:œdataœ,œidœ:œParseData-LFq8bœ,œinputTypesœ:[œDataœ],œtypeœ:œotherœ}", + "animated": false, + "className": "" + }, + { + "source": "ParseData-LFq8b", + "sourceHandle": "{œdataTypeœ:œParseDataœ,œidœ:œParseData-LFq8bœ,œnameœ:œtextœ,œoutput_typesœ:[œMessageœ]}", + "target": "JSONCleaner-N4p7F", + "targetHandle": "{œfieldNameœ:œjson_strœ,œidœ:œJSONCleaner-N4p7Fœ,œinputTypesœ:[œMessageœ],œtypeœ:œstrœ}", + "data": { + "targetHandle": { + "fieldName": "json_str", + "id": "JSONCleaner-N4p7F", + "inputTypes": [ + "Message" + ], + "type": "str" + }, + "sourceHandle": { + "dataType": "ParseData", + "id": "ParseData-LFq8b", + "name": "text", + "output_types": [ + "Message" + ] + } + }, + "id": "reactflow__edge-ParseData-LFq8b{œdataTypeœ:œParseDataœ,œidœ:œParseData-LFq8bœ,œnameœ:œtextœ,œoutput_typesœ:[œMessageœ]}-JSONCleaner-N4p7F{œfieldNameœ:œjson_strœ,œidœ:œJSONCleaner-N4p7Fœ,œinputTypesœ:[œMessageœ],œtypeœ:œstrœ}", + "animated": false, + "className": "" + }, + { + "source": "JSONCleaner-N4p7F", + "sourceHandle": "{œdataTypeœ:œJSONCleanerœ,œidœ:œJSONCleaner-N4p7Fœ,œnameœ:œoutputœ,œoutput_typesœ:[œMessageœ]}", + "target": "GoogleDriveComponent-x1jHz", + "targetHandle": "{œfieldNameœ:œjson_stringœ,œidœ:œGoogleDriveComponent-x1jHzœ,œinputTypesœ:[œMessageœ],œtypeœ:œstrœ}", + "data": { + "targetHandle": { + "fieldName": "json_string", + "id": "GoogleDriveComponent-x1jHz", + "inputTypes": [ + "Message" + ], + "type": "str" + }, + "sourceHandle": { + "dataType": "JSONCleaner", + "id": "JSONCleaner-N4p7F", + "name": "output", + "output_types": [ + "Message" + ] + } + }, + "id": "reactflow__edge-JSONCleaner-N4p7F{œdataTypeœ:œJSONCleanerœ,œidœ:œJSONCleaner-N4p7Fœ,œnameœ:œoutputœ,œoutput_typesœ:[œMessageœ]}-GoogleDriveComponent-x1jHz{œfieldNameœ:œjson_stringœ,œidœ:œGoogleDriveComponent-x1jHzœ,œinputTypesœ:[œMessageœ],œtypeœ:œstrœ}", + "animated": false, + "className": "" + }, + { + "source": "ParseData-7qhmP", + "sourceHandle": "{œdataTypeœ:œParseDataœ,œidœ:œParseData-7qhmPœ,œnameœ:œtextœ,œoutput_typesœ:[œMessageœ]}", + "target": "Prompt-uk0Fr", + "targetHandle": "{œfieldNameœ:œcontextœ,œidœ:œPrompt-uk0Frœ,œinputTypesœ:[œMessageœ,œTextœ],œtypeœ:œstrœ}", + "data": { + "targetHandle": { + "fieldName": "context", + "id": "Prompt-uk0Fr", + "inputTypes": [ + "Message", + "Text" + ], + "type": "str" + }, + "sourceHandle": { + "dataType": "ParseData", + "id": "ParseData-7qhmP", + "name": "text", + "output_types": [ + "Message" + ] + } + }, + "id": "reactflow__edge-ParseData-7qhmP{œdataTypeœ:œParseDataœ,œidœ:œParseData-7qhmPœ,œnameœ:œtextœ,œoutput_typesœ:[œMessageœ]}-Prompt-uk0Fr{œfieldNameœ:œcontextœ,œidœ:œPrompt-uk0Frœ,œinputTypesœ:[œMessageœ,œTextœ],œtypeœ:œstrœ}", + "animated": false, + "className": "" + }, + { + "source": "Prompt-uk0Fr", + "sourceHandle": "{œdataTypeœ:œPromptœ,œidœ:œPrompt-uk0Frœ,œnameœ:œpromptœ,œoutput_typesœ:[œMessageœ]}", + "target": "OpenAIModel-YUM1a", + "targetHandle": "{œfieldNameœ:œinput_valueœ,œidœ:œOpenAIModel-YUM1aœ,œinputTypesœ:[œMessageœ],œtypeœ:œstrœ}", + "data": { + "targetHandle": { + "fieldName": "input_value", + "id": "OpenAIModel-YUM1a", + "inputTypes": [ + "Message" + ], + "type": "str" + }, + "sourceHandle": { + "dataType": "Prompt", + "id": "Prompt-uk0Fr", + "name": "prompt", + "output_types": [ + "Message" + ] + } + }, + "id": "reactflow__edge-Prompt-uk0Fr{œdataTypeœ:œPromptœ,œidœ:œPrompt-uk0Frœ,œnameœ:œpromptœ,œoutput_typesœ:[œMessageœ]}-OpenAIModel-YUM1a{œfieldNameœ:œinput_valueœ,œidœ:œOpenAIModel-YUM1aœ,œinputTypesœ:[œMessageœ],œtypeœ:œstrœ}", + "animated": false, + "className": "" + } + ], + "viewport": { + "x": -1019.4126433636247, + "y": 197.09015595775952, + "zoom": 0.6352002867729776 + } + }, + "description": "An example of a flow that connects to Google Drive to access a text document, reads the content, translates it into the desired language, and returns the translated text in the chat, allowing for quick and efficient automation of the Google Docs file translation process.", + "name": "Google Drive Docs Translations Example", + "last_tested_version": "1.0.19.post2", + "endpoint_name": null, + "is_component": false +} \ No newline at end of file diff --git a/get-started-installation.html b/get-started-installation.html index 906bd2ccdb..174978e5fd 100644 --- a/get-started-installation.html +++ b/get-started-installation.html @@ -10,7 +10,7 @@ - + diff --git a/get-started-quickstart.html b/get-started-quickstart.html index 80ac9a10fa..06d02e0997 100644 --- a/get-started-quickstart.html +++ b/get-started-quickstart.html @@ -10,7 +10,7 @@ - + diff --git a/guides-chat-memory.html b/guides-chat-memory.html index d725764d0a..4bcf012e89 100644 --- a/guides-chat-memory.html +++ b/guides-chat-memory.html @@ -10,7 +10,7 @@ - + diff --git a/guides-data-message.html b/guides-data-message.html index 606db553e0..e339825157 100644 --- a/guides-data-message.html +++ b/guides-data-message.html @@ -10,7 +10,7 @@ - + diff --git a/guides-new-to-llms.html b/guides-new-to-llms.html index f2e38f8c21..ea43979650 100644 --- a/guides-new-to-llms.html +++ b/guides-new-to-llms.html @@ -10,7 +10,7 @@ - + diff --git a/index.html b/index.html index b3bb936eeb..61509b6a6d 100644 --- a/index.html +++ b/index.html @@ -10,7 +10,7 @@ - + diff --git a/integrations-assemblyai.html b/integrations-assemblyai.html index e97a790c2c..9dd9709185 100644 --- a/integrations-assemblyai.html +++ b/integrations-assemblyai.html @@ -10,7 +10,7 @@ - + diff --git a/integrations-langfuse.html b/integrations-langfuse.html index 6663d9fb18..8601756ec4 100644 --- a/integrations-langfuse.html +++ b/integrations-langfuse.html @@ -10,7 +10,7 @@ - + diff --git a/integrations-langsmith.html b/integrations-langsmith.html index d60857e94b..7d917539a2 100644 --- a/integrations-langsmith.html +++ b/integrations-langsmith.html @@ -10,7 +10,7 @@ - + diff --git a/integrations-langwatch.html b/integrations-langwatch.html index c6ce5c6e73..30028a0652 100644 --- a/integrations-langwatch.html +++ b/integrations-langwatch.html @@ -10,7 +10,7 @@ - + diff --git a/integrations-setup-google-cloud-vertex-ai-langflow.html b/integrations-setup-google-cloud-vertex-ai-langflow.html index 0ea4edb931..6c8b36b425 100644 --- a/integrations-setup-google-cloud-vertex-ai-langflow.html +++ b/integrations-setup-google-cloud-vertex-ai-langflow.html @@ -10,7 +10,7 @@ - + diff --git a/integrations-setup-google-oauth-langflow.html b/integrations-setup-google-oauth-langflow.html index 94a5d3f91f..6e6cec6be8 100644 --- a/integrations-setup-google-oauth-langflow.html +++ b/integrations-setup-google-oauth-langflow.html @@ -10,7 +10,7 @@ - + diff --git a/integrations/notion/notion-agent-conversational.html b/integrations/notion/notion-agent-conversational.html index f5048e4a15..b3022843c4 100644 --- a/integrations/notion/notion-agent-conversational.html +++ b/integrations/notion/notion-agent-conversational.html @@ -10,7 +10,7 @@ - + @@ -26,7 +26,7 @@
  • Notion App
  • Notion account and API key
  • OpenAI API key
  • -
  • Download Flow Conversation Agent Flow(Download link)
  • +
  • Download Flow Conversation Agent Flow(Download link)
  • Notion Components Toolkit

    Flow Components

    @@ -67,7 +67,7 @@
    1. Open Langflow and create a new project.
    2. -
    3. Add the components listed above to your flow canvas, or Download the Conversation Agent Flow(Download link) and Import the JSON file into Langflow.
    4. +
    5. Add the components listed above to your flow canvas, or Download the Conversation Agent Flow(Download link) and Import the JSON file into Langflow.
    6. Connect the components as shown in the flow diagram.
    7. Input the Notion and OpenAI API keys in their respective components.
    8. To start the flow, click the "Play" button in Langflow.
    9. diff --git a/integrations/notion/notion-agent-meeting-notes.html b/integrations/notion/notion-agent-meeting-notes.html index b12227d50c..cbf4d41797 100644 --- a/integrations/notion/notion-agent-meeting-notes.html +++ b/integrations/notion/notion-agent-meeting-notes.html @@ -10,7 +10,7 @@ - + @@ -25,7 +25,7 @@
    10. Notion App
    11. Notion API key
    12. OpenAI API key
    13. -
    14. Download Flow Meeting Agent Flow(Download link)
    15. +
    16. Download Flow Meeting Agent Flow(Download link)
    17. warning

      Before using this flow, ensure you have obtained the necessary API keys from Notion and OpenAI. These keys are essential for the flow to function properly. Keep them secure and do not share them publicly.

      Components

      @@ -165,7 +165,7 @@

      To run the Notion Agent for Meeting Notes:

      1. Open Langflow and create a new project.
      2. -
      3. Add the components listed above to your flow canvas, or download the Flow Meeting Agent Flow(Download link) and Import the JSON file into Langflow.
      4. +
      5. Add the components listed above to your flow canvas, or download the Flow Meeting Agent Flow(Download link) and Import the JSON file into Langflow.
      6. Connect the components as shown in the flow diagram.
      7. Input the Notion and OpenAI API keys in their respective components.
      8. Paste your meeting transcript into the Meeting Transcript component.
      9. diff --git a/integrations/notion/setup.html b/integrations/notion/setup.html index bf70d951a6..4135947162 100644 --- a/integrations/notion/setup.html +++ b/integrations/notion/setup.html @@ -10,7 +10,7 @@ - + diff --git a/sitemap.xml b/sitemap.xml index 671d4d167f..be538f6aea 100644 --- a/sitemap.xml +++ b/sitemap.xml @@ -1 +1 @@ -https://docs.langflow.org/apihttps://docs.langflow.org/api/add-userhttps://docs.langflow.org/api/auto-loginhttps://docs.langflow.org/api/build-flowhttps://docs.langflow.org/api/build-vertexhttps://docs.langflow.org/api/build-vertex-streamhttps://docs.langflow.org/api/check-if-store-has-api-keyhttps://docs.langflow.org/api/check-if-store-is-enabledhttps://docs.langflow.org/api/create-api-key-routehttps://docs.langflow.org/api/create-flowhttps://docs.langflow.org/api/create-flowshttps://docs.langflow.org/api/create-folderhttps://docs.langflow.org/api/create-upload-filehttps://docs.langflow.org/api/create-variablehttps://docs.langflow.org/api/custom-componenthttps://docs.langflow.org/api/custom-component-updatehttps://docs.langflow.org/api/delete-api-key-routehttps://docs.langflow.org/api/delete-filehttps://docs.langflow.org/api/delete-flowhttps://docs.langflow.org/api/delete-folderhttps://docs.langflow.org/api/delete-messageshttps://docs.langflow.org/api/delete-messages-sessionhttps://docs.langflow.org/api/delete-multiple-flowshttps://docs.langflow.org/api/delete-userhttps://docs.langflow.org/api/delete-variablehttps://docs.langflow.org/api/delete-vertex-buildshttps://docs.langflow.org/api/download-componenthttps://docs.langflow.org/api/download-filehttps://docs.langflow.org/api/download-file-1https://docs.langflow.org/api/download-imagehttps://docs.langflow.org/api/download-multiple-filehttps://docs.langflow.org/api/download-profile-picturehttps://docs.langflow.org/api/experimental-run-flowhttps://docs.langflow.org/api/get-allhttps://docs.langflow.org/api/get-api-keys-routehttps://docs.langflow.org/api/get-componentshttps://docs.langflow.org/api/get-confighttps://docs.langflow.org/api/get-list-of-components-liked-by-userhttps://docs.langflow.org/api/get-messageshttps://docs.langflow.org/api/get-starter-projectshttps://docs.langflow.org/api/get-tagshttps://docs.langflow.org/api/get-task-statushttps://docs.langflow.org/api/get-transactionshttps://docs.langflow.org/api/get-versionhttps://docs.langflow.org/api/get-vertex-buildshttps://docs.langflow.org/api/healthhttps://docs.langflow.org/api/health-checkhttps://docs.langflow.org/api/like-componenthttps://docs.langflow.org/api/list-fileshttps://docs.langflow.org/api/list-profile-pictureshttps://docs.langflow.org/api/login-to-get-access-tokenhttps://docs.langflow.org/api/logouthttps://docs.langflow.org/api/logshttps://docs.langflow.org/api/patch-userhttps://docs.langflow.org/api/post-validate-codehttps://docs.langflow.org/api/post-validate-prompthttps://docs.langflow.org/api/processhttps://docs.langflow.org/api/process-1https://docs.langflow.org/api/read-all-usershttps://docs.langflow.org/api/read-basic-exampleshttps://docs.langflow.org/api/read-current-userhttps://docs.langflow.org/api/read-flowhttps://docs.langflow.org/api/read-flowshttps://docs.langflow.org/api/read-folderhttps://docs.langflow.org/api/read-foldershttps://docs.langflow.org/api/read-variableshttps://docs.langflow.org/api/refresh-tokenhttps://docs.langflow.org/api/reset-passwordhttps://docs.langflow.org/api/retrieve-vertices-orderhttps://docs.langflow.org/api/save-store-api-keyhttps://docs.langflow.org/api/share-componenthttps://docs.langflow.org/api/simplified-run-flowhttps://docs.langflow.org/api/stream-logshttps://docs.langflow.org/api/update-flowhttps://docs.langflow.org/api/update-folderhttps://docs.langflow.org/api/update-messagehttps://docs.langflow.org/api/update-session-idhttps://docs.langflow.org/api/update-shared-componenthttps://docs.langflow.org/api/update-variablehttps://docs.langflow.org/api/upload-filehttps://docs.langflow.org/api/upload-file-1https://docs.langflow.org/api/upload-file-2https://docs.langflow.org/api/webhook-run-flowhttps://docs.langflow.org/agents-overview2024-12-06T22:35:27.000Zhttps://docs.langflow.org/agents-tool-calling-agent-component2024-12-06T22:35:27.000Zhttps://docs.langflow.org/components-agents2024-12-06T22:35:27.000Zhttps://docs.langflow.org/components-custom-components2024-12-06T22:35:27.000Zhttps://docs.langflow.org/components-data2024-12-06T22:35:27.000Zhttps://docs.langflow.org/components-embedding-models2024-12-06T22:35:27.000Zhttps://docs.langflow.org/components-helpers2024-12-06T22:35:27.000Zhttps://docs.langflow.org/components-io2024-12-06T22:35:27.000Zhttps://docs.langflow.org/components-loaders2024-12-06T22:35:27.000Zhttps://docs.langflow.org/components-logic2024-12-06T22:35:27.000Zhttps://docs.langflow.org/components-models2024-12-06T22:35:27.000Zhttps://docs.langflow.org/components-overview2024-12-06T22:35:27.000Zhttps://docs.langflow.org/components-prompts2024-12-06T22:35:27.000Zhttps://docs.langflow.org/components-rag2024-12-06T22:35:27.000Zhttps://docs.langflow.org/components-vector-stores2024-12-06T22:35:27.000Zhttps://docs.langflow.org/Components/components-memories2024-12-06T22:35:27.000Zhttps://docs.langflow.org/Components/components-tools2024-12-06T22:35:27.000Zhttps://docs.langflow.org/configuration-api-keys2024-12-06T22:35:27.000Zhttps://docs.langflow.org/configuration-authentication2024-12-06T22:35:27.000Zhttps://docs.langflow.org/configuration-auto-save2024-12-06T22:35:27.000Zhttps://docs.langflow.org/configuration-backend-only2024-12-06T22:35:27.000Zhttps://docs.langflow.org/configuration-cli2024-12-06T22:35:27.000Zhttps://docs.langflow.org/configuration-global-variables2024-12-06T22:35:27.000Zhttps://docs.langflow.org/configuration-security-best-practices2024-12-06T22:35:27.000Zhttps://docs.langflow.org/Configuration/configuration-custom-database2024-12-06T22:35:27.000Zhttps://docs.langflow.org/contributing-community2024-12-06T22:35:27.000Zhttps://docs.langflow.org/contributing-components2024-12-06T22:35:27.000Zhttps://docs.langflow.org/contributing-github-discussions2024-12-06T22:35:27.000Zhttps://docs.langflow.org/contributing-github-issues2024-12-06T22:35:27.000Zhttps://docs.langflow.org/contributing-how-to-contribute2024-12-06T22:35:27.000Zhttps://docs.langflow.org/contributing-telemetry2024-12-06T22:35:27.000Zhttps://docs.langflow.org/deployment-docker2024-12-06T22:35:27.000Zhttps://docs.langflow.org/deployment-gcp2024-12-06T22:35:27.000Zhttps://docs.langflow.org/deployment-hugging-face-spaces2024-12-06T22:35:27.000Zhttps://docs.langflow.org/deployment-kubernetes2024-12-06T22:35:27.000Zhttps://docs.langflow.org/deployment-railway2024-12-06T22:35:27.000Zhttps://docs.langflow.org/deployment-render2024-12-06T22:35:27.000Zhttps://docs.langflow.org/environment-variables2024-12-06T22:35:27.000Zhttps://docs.langflow.org/get-started-installation2024-12-06T22:35:27.000Zhttps://docs.langflow.org/get-started-quickstart2024-12-06T22:35:27.000Zhttps://docs.langflow.org/guides-chat-memory2024-12-06T22:35:27.000Zhttps://docs.langflow.org/guides-data-message2024-12-06T22:35:27.000Zhttps://docs.langflow.org/guides-new-to-llms2024-12-06T22:35:27.000Zhttps://docs.langflow.org/integrations-assemblyai2024-12-06T22:35:27.000Zhttps://docs.langflow.org/integrations-langfuse2024-12-06T22:35:27.000Zhttps://docs.langflow.org/integrations-langsmith2024-12-06T22:35:27.000Zhttps://docs.langflow.org/integrations-langwatch2024-12-06T22:35:27.000Zhttps://docs.langflow.org/integrations-setup-google-cloud-vertex-ai-langflow2024-12-06T22:35:27.000Zhttps://docs.langflow.org/integrations-setup-google-oauth-langflow2024-12-06T22:35:27.000Zhttps://docs.langflow.org/integrations/notion/notion-agent-conversational2024-12-06T22:35:27.000Zhttps://docs.langflow.org/integrations/notion/notion-agent-meeting-notes2024-12-06T22:35:27.000Zhttps://docs.langflow.org/integrations/notion/setup2024-12-06T22:35:27.000Zhttps://docs.langflow.org/starter-projects-basic-prompting2024-12-06T22:35:27.000Zhttps://docs.langflow.org/starter-projects-blog-writer2024-12-06T22:35:27.000Zhttps://docs.langflow.org/starter-projects-document-qa2024-12-06T22:35:27.000Zhttps://docs.langflow.org/starter-projects-memory-chatbot2024-12-06T22:35:27.000Zhttps://docs.langflow.org/starter-projects-sequential-agent2024-12-06T22:35:27.000Zhttps://docs.langflow.org/starter-projects-simple-agent2024-12-06T22:35:27.000Zhttps://docs.langflow.org/starter-projects-travel-planning-agent2024-12-06T22:35:27.000Zhttps://docs.langflow.org/starter-projects-vector-store-rag2024-12-06T22:35:27.000Zhttps://docs.langflow.org/workspace-api2024-12-06T22:35:27.000Zhttps://docs.langflow.org/workspace-logs2024-12-06T22:35:27.000Zhttps://docs.langflow.org/workspace-overview2024-12-06T22:35:27.000Zhttps://docs.langflow.org/workspace-playground2024-12-06T22:35:27.000Zhttps://docs.langflow.org/2024-12-06T22:35:27.000Z \ No newline at end of file +https://docs.langflow.org/apihttps://docs.langflow.org/api/add-userhttps://docs.langflow.org/api/auto-loginhttps://docs.langflow.org/api/build-flowhttps://docs.langflow.org/api/build-vertexhttps://docs.langflow.org/api/build-vertex-streamhttps://docs.langflow.org/api/check-if-store-has-api-keyhttps://docs.langflow.org/api/check-if-store-is-enabledhttps://docs.langflow.org/api/create-api-key-routehttps://docs.langflow.org/api/create-flowhttps://docs.langflow.org/api/create-flowshttps://docs.langflow.org/api/create-folderhttps://docs.langflow.org/api/create-upload-filehttps://docs.langflow.org/api/create-variablehttps://docs.langflow.org/api/custom-componenthttps://docs.langflow.org/api/custom-component-updatehttps://docs.langflow.org/api/delete-api-key-routehttps://docs.langflow.org/api/delete-filehttps://docs.langflow.org/api/delete-flowhttps://docs.langflow.org/api/delete-folderhttps://docs.langflow.org/api/delete-messageshttps://docs.langflow.org/api/delete-messages-sessionhttps://docs.langflow.org/api/delete-multiple-flowshttps://docs.langflow.org/api/delete-userhttps://docs.langflow.org/api/delete-variablehttps://docs.langflow.org/api/delete-vertex-buildshttps://docs.langflow.org/api/download-componenthttps://docs.langflow.org/api/download-filehttps://docs.langflow.org/api/download-file-1https://docs.langflow.org/api/download-imagehttps://docs.langflow.org/api/download-multiple-filehttps://docs.langflow.org/api/download-profile-picturehttps://docs.langflow.org/api/experimental-run-flowhttps://docs.langflow.org/api/get-allhttps://docs.langflow.org/api/get-api-keys-routehttps://docs.langflow.org/api/get-componentshttps://docs.langflow.org/api/get-confighttps://docs.langflow.org/api/get-list-of-components-liked-by-userhttps://docs.langflow.org/api/get-messageshttps://docs.langflow.org/api/get-starter-projectshttps://docs.langflow.org/api/get-tagshttps://docs.langflow.org/api/get-task-statushttps://docs.langflow.org/api/get-transactionshttps://docs.langflow.org/api/get-versionhttps://docs.langflow.org/api/get-vertex-buildshttps://docs.langflow.org/api/healthhttps://docs.langflow.org/api/health-checkhttps://docs.langflow.org/api/like-componenthttps://docs.langflow.org/api/list-fileshttps://docs.langflow.org/api/list-profile-pictureshttps://docs.langflow.org/api/login-to-get-access-tokenhttps://docs.langflow.org/api/logouthttps://docs.langflow.org/api/logshttps://docs.langflow.org/api/patch-userhttps://docs.langflow.org/api/post-validate-codehttps://docs.langflow.org/api/post-validate-prompthttps://docs.langflow.org/api/processhttps://docs.langflow.org/api/process-1https://docs.langflow.org/api/read-all-usershttps://docs.langflow.org/api/read-basic-exampleshttps://docs.langflow.org/api/read-current-userhttps://docs.langflow.org/api/read-flowhttps://docs.langflow.org/api/read-flowshttps://docs.langflow.org/api/read-folderhttps://docs.langflow.org/api/read-foldershttps://docs.langflow.org/api/read-variableshttps://docs.langflow.org/api/refresh-tokenhttps://docs.langflow.org/api/reset-passwordhttps://docs.langflow.org/api/retrieve-vertices-orderhttps://docs.langflow.org/api/save-store-api-keyhttps://docs.langflow.org/api/share-componenthttps://docs.langflow.org/api/simplified-run-flowhttps://docs.langflow.org/api/stream-logshttps://docs.langflow.org/api/update-flowhttps://docs.langflow.org/api/update-folderhttps://docs.langflow.org/api/update-messagehttps://docs.langflow.org/api/update-session-idhttps://docs.langflow.org/api/update-shared-componenthttps://docs.langflow.org/api/update-variablehttps://docs.langflow.org/api/upload-filehttps://docs.langflow.org/api/upload-file-1https://docs.langflow.org/api/upload-file-2https://docs.langflow.org/api/webhook-run-flowhttps://docs.langflow.org/agents-overview2024-12-09T23:50:08.000Zhttps://docs.langflow.org/agents-tool-calling-agent-component2024-12-09T23:50:08.000Zhttps://docs.langflow.org/components-agents2024-12-09T23:50:08.000Zhttps://docs.langflow.org/components-custom-components2024-12-09T23:50:08.000Zhttps://docs.langflow.org/components-data2024-12-09T23:50:08.000Zhttps://docs.langflow.org/components-embedding-models2024-12-09T23:50:08.000Zhttps://docs.langflow.org/components-helpers2024-12-09T23:50:08.000Zhttps://docs.langflow.org/components-io2024-12-09T23:50:08.000Zhttps://docs.langflow.org/components-loaders2024-12-09T23:50:08.000Zhttps://docs.langflow.org/components-logic2024-12-09T23:50:08.000Zhttps://docs.langflow.org/components-models2024-12-09T23:50:08.000Zhttps://docs.langflow.org/components-overview2024-12-09T23:50:08.000Zhttps://docs.langflow.org/components-prompts2024-12-09T23:50:08.000Zhttps://docs.langflow.org/components-rag2024-12-09T23:50:08.000Zhttps://docs.langflow.org/components-vector-stores2024-12-09T23:50:08.000Zhttps://docs.langflow.org/Components/components-memories2024-12-09T23:50:08.000Zhttps://docs.langflow.org/Components/components-tools2024-12-09T23:50:08.000Zhttps://docs.langflow.org/configuration-api-keys2024-12-09T23:50:08.000Zhttps://docs.langflow.org/configuration-authentication2024-12-09T23:50:08.000Zhttps://docs.langflow.org/configuration-auto-save2024-12-09T23:50:08.000Zhttps://docs.langflow.org/configuration-backend-only2024-12-09T23:50:08.000Zhttps://docs.langflow.org/configuration-cli2024-12-09T23:50:08.000Zhttps://docs.langflow.org/configuration-global-variables2024-12-09T23:50:08.000Zhttps://docs.langflow.org/configuration-security-best-practices2024-12-09T23:50:08.000Zhttps://docs.langflow.org/Configuration/configuration-custom-database2024-12-09T23:50:08.000Zhttps://docs.langflow.org/contributing-community2024-12-09T23:50:08.000Zhttps://docs.langflow.org/contributing-components2024-12-09T23:50:08.000Zhttps://docs.langflow.org/contributing-github-discussions2024-12-09T23:50:08.000Zhttps://docs.langflow.org/contributing-github-issues2024-12-09T23:50:08.000Zhttps://docs.langflow.org/contributing-how-to-contribute2024-12-09T23:50:08.000Zhttps://docs.langflow.org/contributing-telemetry2024-12-09T23:50:08.000Zhttps://docs.langflow.org/deployment-docker2024-12-09T23:50:08.000Zhttps://docs.langflow.org/deployment-gcp2024-12-09T23:50:08.000Zhttps://docs.langflow.org/deployment-hugging-face-spaces2024-12-09T23:50:08.000Zhttps://docs.langflow.org/deployment-kubernetes2024-12-09T23:50:08.000Zhttps://docs.langflow.org/deployment-railway2024-12-09T23:50:08.000Zhttps://docs.langflow.org/deployment-render2024-12-09T23:50:08.000Zhttps://docs.langflow.org/environment-variables2024-12-09T23:50:08.000Zhttps://docs.langflow.org/get-started-installation2024-12-09T23:50:08.000Zhttps://docs.langflow.org/get-started-quickstart2024-12-09T23:50:08.000Zhttps://docs.langflow.org/guides-chat-memory2024-12-09T23:50:08.000Zhttps://docs.langflow.org/guides-data-message2024-12-09T23:50:08.000Zhttps://docs.langflow.org/guides-new-to-llms2024-12-09T23:50:08.000Zhttps://docs.langflow.org/integrations-assemblyai2024-12-09T23:50:08.000Zhttps://docs.langflow.org/integrations-langfuse2024-12-09T23:50:08.000Zhttps://docs.langflow.org/integrations-langsmith2024-12-09T23:50:08.000Zhttps://docs.langflow.org/integrations-langwatch2024-12-09T23:50:08.000Zhttps://docs.langflow.org/integrations-setup-google-cloud-vertex-ai-langflow2024-12-09T23:50:08.000Zhttps://docs.langflow.org/integrations-setup-google-oauth-langflow2024-12-09T23:50:08.000Zhttps://docs.langflow.org/integrations/notion/notion-agent-conversational2024-12-09T23:50:08.000Zhttps://docs.langflow.org/integrations/notion/notion-agent-meeting-notes2024-12-09T23:50:08.000Zhttps://docs.langflow.org/integrations/notion/setup2024-12-09T23:50:08.000Zhttps://docs.langflow.org/starter-projects-basic-prompting2024-12-09T23:50:08.000Zhttps://docs.langflow.org/starter-projects-blog-writer2024-12-09T23:50:08.000Zhttps://docs.langflow.org/starter-projects-document-qa2024-12-09T23:50:08.000Zhttps://docs.langflow.org/starter-projects-memory-chatbot2024-12-09T23:50:08.000Zhttps://docs.langflow.org/starter-projects-sequential-agent2024-12-09T23:50:08.000Zhttps://docs.langflow.org/starter-projects-simple-agent2024-12-09T23:50:08.000Zhttps://docs.langflow.org/starter-projects-travel-planning-agent2024-12-09T23:50:08.000Zhttps://docs.langflow.org/starter-projects-vector-store-rag2024-12-09T23:50:08.000Zhttps://docs.langflow.org/workspace-api2024-12-09T23:50:08.000Zhttps://docs.langflow.org/workspace-logs2024-12-09T23:50:08.000Zhttps://docs.langflow.org/workspace-overview2024-12-09T23:50:08.000Zhttps://docs.langflow.org/workspace-playground2024-12-09T23:50:08.000Zhttps://docs.langflow.org/2024-12-09T23:50:08.000Z \ No newline at end of file diff --git a/starter-projects-basic-prompting.html b/starter-projects-basic-prompting.html index a0b072d216..bbc619e242 100644 --- a/starter-projects-basic-prompting.html +++ b/starter-projects-basic-prompting.html @@ -10,7 +10,7 @@ - + diff --git a/starter-projects-blog-writer.html b/starter-projects-blog-writer.html index 9613eb6e17..36137a86f2 100644 --- a/starter-projects-blog-writer.html +++ b/starter-projects-blog-writer.html @@ -10,7 +10,7 @@ - + diff --git a/starter-projects-document-qa.html b/starter-projects-document-qa.html index 244f69f092..f68376745c 100644 --- a/starter-projects-document-qa.html +++ b/starter-projects-document-qa.html @@ -10,7 +10,7 @@ - + diff --git a/starter-projects-memory-chatbot.html b/starter-projects-memory-chatbot.html index d1732d8d41..53f52b0179 100644 --- a/starter-projects-memory-chatbot.html +++ b/starter-projects-memory-chatbot.html @@ -10,7 +10,7 @@ - + diff --git a/starter-projects-sequential-agent.html b/starter-projects-sequential-agent.html index 763440aef2..f1afc80e9f 100644 --- a/starter-projects-sequential-agent.html +++ b/starter-projects-sequential-agent.html @@ -10,7 +10,7 @@ - + diff --git a/starter-projects-simple-agent.html b/starter-projects-simple-agent.html index ce3b116b2e..d33e6b21eb 100644 --- a/starter-projects-simple-agent.html +++ b/starter-projects-simple-agent.html @@ -10,7 +10,7 @@ - + diff --git a/starter-projects-travel-planning-agent.html b/starter-projects-travel-planning-agent.html index de7831843d..a7976155e4 100644 --- a/starter-projects-travel-planning-agent.html +++ b/starter-projects-travel-planning-agent.html @@ -10,7 +10,7 @@ - + diff --git a/starter-projects-vector-store-rag.html b/starter-projects-vector-store-rag.html index 08d9dfd65f..9bfcb48c52 100644 --- a/starter-projects-vector-store-rag.html +++ b/starter-projects-vector-store-rag.html @@ -10,7 +10,7 @@ - + diff --git a/workspace-api.html b/workspace-api.html index 0920c8f266..7575cab846 100644 --- a/workspace-api.html +++ b/workspace-api.html @@ -10,7 +10,7 @@ - + diff --git a/workspace-logs.html b/workspace-logs.html index 356aed7341..a487c81cde 100644 --- a/workspace-logs.html +++ b/workspace-logs.html @@ -10,7 +10,7 @@ - + diff --git a/workspace-overview.html b/workspace-overview.html index 78bfb47c55..6e4bb180d6 100644 --- a/workspace-overview.html +++ b/workspace-overview.html @@ -10,7 +10,7 @@ - + diff --git a/workspace-playground.html b/workspace-playground.html index 05604062b6..2d74407bdd 100644 --- a/workspace-playground.html +++ b/workspace-playground.html @@ -10,7 +10,7 @@ - +