langflow-base-nightly 0.5.0.dev37__py3-none-any.whl → 0.5.0.dev39__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- langflow/__main__.py +1 -1
- langflow/alembic/versions/0882f9657f22_encrypt_existing_mcp_auth_settings_.py +122 -0
- langflow/alembic/versions/4e5980a44eaa_fix_date_times_again.py +24 -30
- langflow/alembic/versions/58b28437a398_modify_nullable.py +6 -6
- langflow/alembic/versions/79e675cb6752_change_datetime_type.py +24 -30
- langflow/alembic/versions/b2fa308044b5_add_unique_constraints.py +12 -13
- langflow/api/build.py +21 -26
- langflow/api/health_check_router.py +3 -3
- langflow/api/utils.py +3 -3
- langflow/api/v1/callback.py +2 -2
- langflow/api/v1/chat.py +19 -31
- langflow/api/v1/endpoints.py +10 -10
- langflow/api/v1/flows.py +1 -1
- langflow/api/v1/knowledge_bases.py +3 -3
- langflow/api/v1/mcp.py +12 -12
- langflow/api/v1/mcp_projects.py +405 -120
- langflow/api/v1/mcp_utils.py +8 -8
- langflow/api/v1/schemas.py +2 -7
- langflow/api/v1/store.py +1 -1
- langflow/api/v1/validate.py +2 -2
- langflow/api/v1/voice_mode.py +58 -62
- langflow/api/v2/files.py +2 -2
- langflow/api/v2/mcp.py +10 -9
- langflow/base/composio/composio_base.py +21 -2
- langflow/base/data/docling_utils.py +194 -0
- langflow/base/embeddings/aiml_embeddings.py +1 -1
- langflow/base/flow_processing/utils.py +1 -2
- langflow/base/io/__init__.py +0 -1
- langflow/base/langwatch/utils.py +2 -1
- langflow/base/mcp/util.py +49 -47
- langflow/base/prompts/api_utils.py +1 -1
- langflow/base/tools/flow_tool.py +2 -2
- langflow/base/tools/run_flow.py +2 -6
- langflow/components/FAISS/__init__.py +34 -0
- langflow/components/Notion/add_content_to_page.py +2 -2
- langflow/components/Notion/list_database_properties.py +2 -2
- langflow/components/Notion/list_pages.py +2 -2
- langflow/components/Notion/page_content_viewer.py +2 -2
- langflow/components/Notion/update_page_property.py +1 -1
- langflow/components/agentql/agentql_api.py +2 -10
- langflow/components/agents/agent.py +249 -55
- langflow/components/agents/mcp_component.py +14 -14
- langflow/components/anthropic/anthropic.py +5 -4
- langflow/components/assemblyai/assemblyai_get_subtitles.py +2 -2
- langflow/components/assemblyai/assemblyai_lemur.py +2 -2
- langflow/components/assemblyai/assemblyai_list_transcripts.py +2 -2
- langflow/components/assemblyai/assemblyai_poll_transcript.py +2 -2
- langflow/components/assemblyai/assemblyai_start_transcript.py +2 -2
- langflow/components/cassandra/__init__.py +40 -0
- langflow/components/chroma/__init__.py +34 -0
- langflow/components/clickhouse/__init__.py +34 -0
- langflow/components/couchbase/__init__.py +34 -0
- langflow/components/data/file.py +575 -55
- langflow/components/data/url.py +1 -1
- langflow/components/datastax/__init__.py +3 -3
- langflow/components/datastax/astra_assistant_manager.py +3 -3
- langflow/components/datastax/create_assistant.py +1 -2
- langflow/components/deactivated/merge_data.py +1 -2
- langflow/components/deactivated/sub_flow.py +6 -7
- langflow/components/deactivated/vectara_self_query.py +3 -3
- langflow/components/docling/__init__.py +0 -198
- langflow/components/docling/docling_inline.py +1 -1
- langflow/components/elastic/__init__.py +37 -0
- langflow/components/embeddings/text_embedder.py +3 -3
- langflow/components/firecrawl/firecrawl_extract_api.py +2 -9
- langflow/components/google/gmail.py +1 -1
- langflow/components/google/google_generative_ai.py +5 -11
- langflow/components/groq/groq.py +4 -3
- langflow/components/helpers/current_date.py +2 -3
- langflow/components/helpers/memory.py +1 -1
- langflow/components/ibm/watsonx.py +1 -1
- langflow/components/ibm/watsonx_embeddings.py +1 -1
- langflow/components/langwatch/langwatch.py +3 -3
- langflow/components/logic/flow_tool.py +2 -2
- langflow/components/logic/notify.py +1 -1
- langflow/components/logic/run_flow.py +2 -3
- langflow/components/logic/sub_flow.py +4 -5
- langflow/components/mem0/mem0_chat_memory.py +2 -8
- langflow/components/milvus/__init__.py +34 -0
- langflow/components/mongodb/__init__.py +34 -0
- langflow/components/nvidia/nvidia.py +3 -3
- langflow/components/olivya/olivya.py +7 -7
- langflow/components/ollama/ollama.py +9 -6
- langflow/components/perplexity/perplexity.py +3 -13
- langflow/components/pgvector/__init__.py +34 -0
- langflow/components/pinecone/__init__.py +34 -0
- langflow/components/processing/batch_run.py +8 -8
- langflow/components/processing/data_operations.py +2 -2
- langflow/components/processing/merge_data.py +1 -2
- langflow/components/processing/message_to_data.py +2 -3
- langflow/components/processing/parse_json_data.py +1 -1
- langflow/components/prototypes/python_function.py +2 -3
- langflow/components/qdrant/__init__.py +34 -0
- langflow/components/redis/__init__.py +36 -2
- langflow/components/redis/redis.py +75 -29
- langflow/components/redis/redis_chat.py +43 -0
- langflow/components/serpapi/serp.py +1 -1
- langflow/components/supabase/__init__.py +37 -0
- langflow/components/tavily/tavily_extract.py +1 -1
- langflow/components/tavily/tavily_search.py +1 -1
- langflow/components/tools/calculator.py +2 -2
- langflow/components/tools/python_code_structured_tool.py +3 -10
- langflow/components/tools/python_repl.py +2 -2
- langflow/components/tools/searxng.py +3 -3
- langflow/components/tools/serp_api.py +2 -2
- langflow/components/tools/tavily_search_tool.py +2 -2
- langflow/components/tools/yahoo_finance.py +1 -1
- langflow/components/twelvelabs/video_embeddings.py +4 -4
- langflow/components/upstash/__init__.py +34 -0
- langflow/components/vectara/__init__.py +37 -0
- langflow/components/vectorstores/__init__.py +0 -69
- langflow/components/vectorstores/local_db.py +2 -1
- langflow/components/weaviate/__init__.py +34 -0
- langflow/components/yahoosearch/yahoo.py +1 -1
- langflow/components/youtube/trending.py +3 -4
- langflow/custom/attributes.py +2 -1
- langflow/custom/code_parser/code_parser.py +1 -1
- langflow/custom/custom_component/base_component.py +1 -1
- langflow/custom/custom_component/component.py +16 -2
- langflow/custom/dependency_analyzer.py +165 -0
- langflow/custom/directory_reader/directory_reader.py +7 -7
- langflow/custom/directory_reader/utils.py +1 -2
- langflow/custom/utils.py +63 -45
- langflow/events/event_manager.py +1 -1
- langflow/frontend/assets/{SlackIcon-CnvyOamQ.js → SlackIcon-Cr3Q15Px.js} +1 -1
- langflow/frontend/assets/{Wikipedia-nyTEXdr2.js → Wikipedia-GxM5sPdM.js} +1 -1
- langflow/frontend/assets/{Wolfram-BYMQkNSq.js → Wolfram-BN3-VOCA.js} +1 -1
- langflow/frontend/assets/{index-DZTC5pdT.js → index-28oOcafk.js} +1 -1
- langflow/frontend/assets/{index-ChXJpBz4.js → index-2wSXqBtB.js} +1 -1
- langflow/frontend/assets/{index-BB15_iOb.js → index-3wW7BClE.js} +1 -1
- langflow/frontend/assets/{index-DKHNourL.js → index-6pyH3ZJB.js} +1 -1
- langflow/frontend/assets/{index-BvwZfF2i.js → index-AWCSdofD.js} +1 -1
- langflow/frontend/assets/{index-Bvxg4_ux.js → index-B2Zgv_xv.js} +1 -1
- langflow/frontend/assets/{index-Bd6WtbKA.js → index-B2ptVQGM.js} +1 -1
- langflow/frontend/assets/{index-C7QWbnLK.js → index-B3TANVes.js} +1 -1
- langflow/frontend/assets/{index-CpvYQ0ug.js → index-B4yCvZKV.js} +1 -1
- langflow/frontend/assets/{index-Dg-63Si_.js → index-BC65VuWx.js} +1 -1
- langflow/frontend/assets/{index-C6jri9Wm.js → index-BCDSei1q.js} +1 -1
- langflow/frontend/assets/{index-OazXJdEl.js → index-BJy50PvP.js} +1 -1
- langflow/frontend/assets/{index-CWdkbVsd.js → index-BKseQQ2I.js} +1 -1
- langflow/frontend/assets/{index-CaQ_H9ww.js → index-BLTxEeTi.js} +1 -1
- langflow/frontend/assets/{index-DGRMNe9n.js → index-BRg1f4Mu.js} +1 -1
- langflow/frontend/assets/{index-D8lOi1GI.js → index-BS8Vo8nc.js} +1 -1
- langflow/frontend/assets/{index-B748uLP1.js → index-BTKOU4xC.js} +1 -1
- langflow/frontend/assets/{index-Dqd4RjYA.js → index-BVwJDmw-.js} +1 -1
- langflow/frontend/assets/{index-DbMFlnHE.js → index-BWYuQ2Sj.js} +1 -1
- langflow/frontend/assets/{index-BEMw2Np8.js → index-BWdLILDG.js} +1 -1
- langflow/frontend/assets/{index-BmX5CoED.js → index-BZcw4827.js} +1 -1
- langflow/frontend/assets/{index-CyPvTB63.js → index-Bbi87Ve4.js} +1 -1
- langflow/frontend/assets/{index-BTEW9e8P.js → index-Bf0IYKLd.js} +1 -1
- langflow/frontend/assets/{index-BZgXW854.js → index-Bg5nrMRh.js} +1 -1
- langflow/frontend/assets/{index-BBxAPk1y.js → index-BiC280Nx.js} +1 -1
- langflow/frontend/assets/{index-BR0bkVqX.js → index-BiKKN6FR.js} +1 -1
- langflow/frontend/assets/{index-CTrt1Q_j.js → index-Bief6eyJ.js} +1 -1
- langflow/frontend/assets/{index-D5_DsUJc.js → index-BkXec1Yf.js} +1 -1
- langflow/frontend/assets/{index-CZQ9rXNa.js → index-Bnl6QHtP.js} +1 -1
- langflow/frontend/assets/{index-BChjg6Az.js → index-BpxbUiZD.js} +1979 -1979
- langflow/frontend/assets/{index-BOeo01QB.js → index-BrJV8psX.js} +1 -1
- langflow/frontend/assets/{index-DysKpOuj.js → index-BwLWcUXL.js} +1 -1
- langflow/frontend/assets/{index-Bnqod3vk.js → index-Bx7dBY26.js} +1 -1
- langflow/frontend/assets/{index-D3DDfngy.js → index-C-EdnFdA.js} +1 -1
- langflow/frontend/assets/{index-Bsa0xZyL.js → index-C-Xfg4cD.js} +1 -1
- langflow/frontend/assets/{index-BTrsh9LS.js → index-C1f2wMat.js} +1 -1
- langflow/frontend/assets/index-C1xroOlH.css +1 -0
- langflow/frontend/assets/{index-B1YN7oMV.js → index-C3KequvP.js} +1 -1
- langflow/frontend/assets/{index-DzW2mfkK.js → index-C3ZjKdCD.js} +1 -1
- langflow/frontend/assets/{index-ajRge-Mg.js → index-C3l0zYn0.js} +1 -1
- langflow/frontend/assets/{index-cvZdgWHQ.js → index-C3yvArUT.js} +1 -1
- langflow/frontend/assets/{index-C-2hghRJ.js → index-C9Cxnkl8.js} +1 -1
- langflow/frontend/assets/{index-BhIOhlCH.js → index-CBc8fEAE.js} +1 -1
- langflow/frontend/assets/{index-B3Sur4Z3.js → index-CBvrGgID.js} +1 -1
- langflow/frontend/assets/{index-CCePCqkT.js → index-CD-PqGCY.js} +1 -1
- langflow/frontend/assets/{index-8yMsjVV2.js → index-CGO1CiUr.js} +1 -1
- langflow/frontend/assets/{index-DF5VwgU6.js → index-CH5UVA9b.js} +1 -1
- langflow/frontend/assets/{index-dcnYpT9N.js → index-CLJeJYjH.js} +1 -1
- langflow/frontend/assets/{index-DfxYyS3M.js → index-CMZ79X-Y.js} +1 -1
- langflow/frontend/assets/{index-ya2uXE8v.js → index-CMzfJKiW.js} +1 -1
- langflow/frontend/assets/{index-DkelbYy7.js → index-CNw1H-Wc.js} +1 -1
- langflow/frontend/assets/{index-DytJENYD.js → index-CPHEscq9.js} +1 -1
- langflow/frontend/assets/{index-Bv8h2Z-q.js → index-CRPKJZw9.js} +1 -1
- langflow/frontend/assets/{index-D-9TI74R.js → index-CRPyCfYy.js} +1 -1
- langflow/frontend/assets/{index-BLGYN-9b.js → index-CRcMqCIj.js} +1 -1
- langflow/frontend/assets/{index-tVYiABdp.js → index-CUVDws8F.js} +1 -1
- langflow/frontend/assets/{index-CpcbQZIF.js → index-CVWQfRYZ.js} +1 -1
- langflow/frontend/assets/{index-DPCzHdsC.js → index-CVl6MbaM.js} +1 -1
- langflow/frontend/assets/{index-DkXy1WFo.js → index-CVwWoX99.js} +1 -1
- langflow/frontend/assets/{index-DK1Ptcc4.js → index-CWPzZtSx.js} +1 -1
- langflow/frontend/assets/{index-DHq8TQPB.js → index-CZqRL9DE.js} +1 -1
- langflow/frontend/assets/{index-DnEGCgih.js → index-CdIf07Rw.js} +1 -1
- langflow/frontend/assets/{index-BIQQCMvz.js → index-Cewy7JZE.js} +1 -1
- langflow/frontend/assets/{index-D8GJngXa.js → index-CfwLpbMM.js} +1 -1
- langflow/frontend/assets/{index-C_TdzfAn.js → index-CiR1dxI4.js} +1 -1
- langflow/frontend/assets/{index-BzL_EoKd.js → index-CiixOzDG.js} +1 -1
- langflow/frontend/assets/{index-Boso-xEw.js → index-ClsuDmR6.js} +1 -1
- langflow/frontend/assets/{index-8WdfSTTz.js → index-CmEYYRN1.js} +1 -1
- langflow/frontend/assets/{index-FUxmznS-.js → index-Co20d-eQ.js} +1 -1
- langflow/frontend/assets/{index-C82JjCPD.js → index-CpzXS6md.js} +1 -1
- langflow/frontend/assets/{index-DIDDfmlJ.js → index-Cqpzl1J4.js} +1 -1
- langflow/frontend/assets/{index-_UcqeEjm.js → index-CtVIONP2.js} +1 -1
- langflow/frontend/assets/{index-Gkrq-vzm.js → index-CuFXdTx4.js} +1 -1
- langflow/frontend/assets/{index-WPFivmdQ.js → index-Cyd2HtHK.js} +1 -1
- langflow/frontend/assets/{index-BFp_O-c9.js → index-D-1tA8Dt.js} +1 -1
- langflow/frontend/assets/{index-BqPpO6KG.js → index-D-KY3kkq.js} +1 -1
- langflow/frontend/assets/{index-Db71w3lq.js → index-D-_B1a8v.js} +1 -1
- langflow/frontend/assets/{index-BIzTEqFh.js → index-D14EWPyZ.js} +1 -1
- langflow/frontend/assets/{index-BbJjt5m4.js → index-D2N3l-cw.js} +1 -1
- langflow/frontend/assets/{index-DCRk27Tp.js → index-D5ETnvJa.js} +1 -1
- langflow/frontend/assets/{index-CvcEzq4x.js → index-D7kquVv2.js} +1 -1
- langflow/frontend/assets/{index-Q9vDw0Xl.js → index-DA6-bvgN.js} +1 -1
- langflow/frontend/assets/{index-l7bzB8Ex.js → index-DDWBeudF.js} +1 -1
- langflow/frontend/assets/{index-BCCGvqay.js → index-DDcMAaG4.js} +1 -1
- langflow/frontend/assets/{index-pCQ_yw8m.js → index-DHgomBdh.js} +1 -1
- langflow/frontend/assets/{index-BxEuHa76.js → index-DJP-ss47.js} +1 -1
- langflow/frontend/assets/{index-BbRm7beF.js → index-DQ7VYqQc.js} +1 -1
- langflow/frontend/assets/{index-Car-zdor.js → index-DTqbvGC0.js} +1 -1
- langflow/frontend/assets/{index-BRxvproo.js → index-DUpri6zF.js} +1 -1
- langflow/frontend/assets/{index-BQ6NUdMY.js → index-DV3utZDZ.js} +1 -1
- langflow/frontend/assets/{index-DjQETUy8.js → index-DXRfN4HV.js} +1 -1
- langflow/frontend/assets/{index-DfngcQxO.js → index-Db9dYSzy.js} +1 -1
- langflow/frontend/assets/{index-rXV1G1aB.js → index-DdtMEn6I.js} +1 -1
- langflow/frontend/assets/{index-DmMDPoi0.js → index-DfDhMHgQ.js} +1 -1
- langflow/frontend/assets/{index-DJB12jIC.js → index-Dfe7qfvf.js} +1 -1
- langflow/frontend/assets/{index-C_veJlEb.js → index-DhtZ5hx8.js} +1 -1
- langflow/frontend/assets/{index-CQMoqLAu.js → index-DiB3CTo8.js} +1 -1
- langflow/frontend/assets/{index-DVlceYFD.js → index-DiGWASY5.js} +1 -1
- langflow/frontend/assets/{index-Du_18NCU.js → index-Dl5amdBz.js} +1 -1
- langflow/frontend/assets/{index-CYDAYm-i.js → index-DlD4dXlZ.js} +1 -1
- langflow/frontend/assets/{index-CLPdN-q6.js → index-DmeiHnfl.js} +1 -1
- langflow/frontend/assets/index-Dmu-X5-4.js +1 -0
- langflow/frontend/assets/{index-BzEUlaw_.js → index-DpVWih90.js} +1 -1
- langflow/frontend/assets/{index-D6PSjHxP.js → index-DrDrcajG.js} +1 -1
- langflow/frontend/assets/{index-Dq5ilsem.js → index-Du-pc0KE.js} +1 -1
- langflow/frontend/assets/{index-CYe8Ipef.js → index-DwPkMTaY.js} +1 -1
- langflow/frontend/assets/{index-BVEZDXxS.js → index-DwQEZe3C.js} +1 -1
- langflow/frontend/assets/{index-BvT7L317.js → index-DyJFTK24.js} +1 -1
- langflow/frontend/assets/{index-HK3bVMYA.js → index-J38wh62w.js} +1 -1
- langflow/frontend/assets/{index-CCxGSSTT.js → index-Kwdl-e29.js} +1 -1
- langflow/frontend/assets/{index-BOB_zsjl.js → index-OwPvCmpW.js} +1 -1
- langflow/frontend/assets/{index-Dsps-jKu.js → index-Tw3Os-DN.js} +1 -1
- langflow/frontend/assets/{index-CFDvOtKC.js → index-X0guhYF8.js} +1 -1
- langflow/frontend/assets/{index-BX5D-USa.js → index-dJWNxIRH.js} +1 -1
- langflow/frontend/assets/{index-BRYjyhAd.js → index-dcJ8-agu.js} +1 -1
- langflow/frontend/assets/{index-Ui4xUImO.js → index-eo2mAtL-.js} +1 -1
- langflow/frontend/assets/{index-CxvP91st.js → index-hG24k5xJ.js} +1 -1
- langflow/frontend/assets/{index-CVQmT7ZL.js → index-h_aSZHf3.js} +1 -1
- langflow/frontend/assets/{index-BIXaW2aY.js → index-hbndqB9B.js} +1 -1
- langflow/frontend/assets/{index-DIkNW9Cd.js → index-iJngutFo.js} +1 -1
- langflow/frontend/assets/{index-BWmPX4iQ.js → index-lTpteg8t.js} +1 -1
- langflow/frontend/assets/{index-xuIrH2Dq.js → index-lZX9AvZW.js} +1 -1
- langflow/frontend/assets/{index-yCHsaqs8.js → index-m8QA6VNM.js} +1 -1
- langflow/frontend/assets/{index-BkPYpfgw.js → index-o0D2S7xW.js} +1 -1
- langflow/frontend/assets/{index-DpClkXIV.js → index-ovFJ_0J6.js} +1 -1
- langflow/frontend/assets/{index-CmplyEaa.js → index-pYJJOcma.js} +1 -1
- langflow/frontend/assets/{index-CJo_cyWW.js → index-sI75DsdM.js} +1 -1
- langflow/frontend/assets/{index-nVwHLjuV.js → index-xvFOmxx4.js} +1 -1
- langflow/frontend/assets/{index-LbYjHKkn.js → index-z3SRY-mX.js} +1 -1
- langflow/frontend/assets/lazyIconImports-D97HEZkE.js +2 -0
- langflow/frontend/assets/{use-post-add-user-BrBYH9eR.js → use-post-add-user-C0MdTpQ5.js} +1 -1
- langflow/frontend/index.html +2 -2
- langflow/graph/edge/base.py +2 -3
- langflow/graph/graph/base.py +15 -13
- langflow/graph/graph/constants.py +3 -0
- langflow/graph/utils.py +6 -6
- langflow/graph/vertex/base.py +4 -5
- langflow/graph/vertex/param_handler.py +1 -1
- langflow/graph/vertex/vertex_types.py +2 -2
- langflow/helpers/flow.py +1 -1
- langflow/initial_setup/setup.py +32 -30
- langflow/initial_setup/starter_projects/Basic Prompt Chaining.json +26 -0
- langflow/initial_setup/starter_projects/Basic Prompting.json +26 -0
- langflow/initial_setup/starter_projects/Blog Writer.json +58 -2
- langflow/initial_setup/starter_projects/Custom Component Generator.json +37 -2
- langflow/initial_setup/starter_projects/Document Q&A.json +27 -1
- langflow/initial_setup/starter_projects/Financial Report Parser.json +43 -0
- langflow/initial_setup/starter_projects/Hybrid Search RAG.json +83 -1
- langflow/initial_setup/starter_projects/Image Sentiment Analysis.json +43 -0
- langflow/initial_setup/starter_projects/Instagram Copywriter.json +51 -3
- langflow/initial_setup/starter_projects/Invoice Summarizer.json +40 -1
- langflow/initial_setup/starter_projects/Knowledge Ingestion.json +73 -2
- langflow/initial_setup/starter_projects/Knowledge Retrieval.json +63 -0
- langflow/initial_setup/starter_projects/Market Research.json +59 -3
- langflow/initial_setup/starter_projects/Meeting Summary.json +101 -6
- langflow/initial_setup/starter_projects/Memory Chatbot.json +37 -2
- langflow/initial_setup/starter_projects/News Aggregator.json +63 -3
- langflow/initial_setup/starter_projects/Nvidia Remix.json +69 -4
- langflow/initial_setup/starter_projects/Pok/303/251dex Agent.json" +48 -1
- langflow/initial_setup/starter_projects/Portfolio Website Code Generator.json +44 -1
- langflow/initial_setup/starter_projects/Price Deal Finder.json +57 -5
- langflow/initial_setup/starter_projects/Research Agent.json +42 -3
- langflow/initial_setup/starter_projects/Research Translation Loop.json +66 -0
- langflow/initial_setup/starter_projects/SEO Keyword Generator.json +17 -0
- langflow/initial_setup/starter_projects/SaaS Pricing.json +27 -1
- langflow/initial_setup/starter_projects/Search agent.json +40 -1
- langflow/initial_setup/starter_projects/Sequential Tasks Agents.json +76 -7
- langflow/initial_setup/starter_projects/Simple Agent.json +59 -3
- langflow/initial_setup/starter_projects/Social Media Agent.json +77 -1
- langflow/initial_setup/starter_projects/Text Sentiment Analysis.json +35 -1
- langflow/initial_setup/starter_projects/Travel Planning Agents.json +51 -3
- langflow/initial_setup/starter_projects/Twitter Thread Generator.json +80 -0
- langflow/initial_setup/starter_projects/Vector Store RAG.json +110 -3
- langflow/initial_setup/starter_projects/Youtube Analysis.json +84 -3
- langflow/initial_setup/starter_projects/vector_store_rag.py +1 -1
- langflow/interface/components.py +23 -22
- langflow/interface/initialize/loading.py +5 -5
- langflow/interface/run.py +1 -1
- langflow/interface/utils.py +1 -1
- langflow/io/__init__.py +0 -1
- langflow/langflow_launcher.py +1 -1
- langflow/load/load.py +2 -7
- langflow/logging/__init__.py +0 -1
- langflow/logging/logger.py +191 -115
- langflow/logging/setup.py +1 -1
- langflow/main.py +37 -52
- langflow/memory.py +7 -7
- langflow/middleware.py +1 -1
- langflow/processing/process.py +6 -3
- langflow/schema/artifact.py +2 -2
- langflow/schema/data.py +10 -2
- langflow/schema/dataframe.py +1 -1
- langflow/schema/message.py +1 -1
- langflow/serialization/serialization.py +1 -1
- langflow/services/auth/mcp_encryption.py +104 -0
- langflow/services/auth/utils.py +2 -2
- langflow/services/cache/disk.py +1 -1
- langflow/services/cache/service.py +3 -3
- langflow/services/database/models/flow/model.py +2 -7
- langflow/services/database/models/transactions/crud.py +2 -2
- langflow/services/database/models/user/crud.py +2 -2
- langflow/services/database/service.py +8 -8
- langflow/services/database/utils.py +6 -5
- langflow/services/deps.py +2 -3
- langflow/services/factory.py +1 -1
- langflow/services/flow/flow_runner.py +7 -12
- langflow/services/job_queue/service.py +16 -15
- langflow/services/manager.py +3 -4
- langflow/services/settings/auth.py +1 -1
- langflow/services/settings/base.py +3 -8
- langflow/services/settings/feature_flags.py +1 -1
- langflow/services/settings/manager.py +1 -1
- langflow/services/settings/utils.py +1 -1
- langflow/services/socket/__init__.py +0 -1
- langflow/services/socket/service.py +3 -3
- langflow/services/socket/utils.py +4 -4
- langflow/services/state/service.py +1 -2
- langflow/services/storage/factory.py +1 -1
- langflow/services/storage/local.py +9 -8
- langflow/services/storage/s3.py +11 -10
- langflow/services/store/service.py +3 -3
- langflow/services/store/utils.py +3 -2
- langflow/services/task/temp_flow_cleanup.py +7 -7
- langflow/services/telemetry/service.py +10 -10
- langflow/services/tracing/arize_phoenix.py +2 -2
- langflow/services/tracing/langfuse.py +1 -1
- langflow/services/tracing/langsmith.py +1 -1
- langflow/services/tracing/langwatch.py +1 -1
- langflow/services/tracing/opik.py +1 -1
- langflow/services/tracing/service.py +25 -6
- langflow/services/tracing/traceloop.py +245 -0
- langflow/services/utils.py +7 -7
- langflow/services/variable/kubernetes.py +3 -3
- langflow/services/variable/kubernetes_secrets.py +2 -1
- langflow/services/variable/service.py +5 -5
- langflow/utils/component_utils.py +9 -6
- langflow/utils/util.py +5 -5
- langflow/utils/validate.py +3 -3
- langflow/utils/voice_utils.py +2 -2
- {langflow_base_nightly-0.5.0.dev37.dist-info → langflow_base_nightly-0.5.0.dev39.dist-info}/METADATA +2 -1
- {langflow_base_nightly-0.5.0.dev37.dist-info → langflow_base_nightly-0.5.0.dev39.dist-info}/RECORD +393 -374
- langflow/components/vectorstores/redis.py +0 -89
- langflow/frontend/assets/index-C26RqKWL.js +0 -1
- langflow/frontend/assets/index-CqS7zir1.css +0 -1
- langflow/frontend/assets/lazyIconImports-t6wEndt1.js +0 -2
- /langflow/components/{vectorstores → FAISS}/faiss.py +0 -0
- /langflow/components/{vectorstores → cassandra}/cassandra.py +0 -0
- /langflow/components/{datastax/cassandra.py → cassandra/cassandra_chat.py} +0 -0
- /langflow/components/{vectorstores → cassandra}/cassandra_graph.py +0 -0
- /langflow/components/{vectorstores → chroma}/chroma.py +0 -0
- /langflow/components/{vectorstores → clickhouse}/clickhouse.py +0 -0
- /langflow/components/{vectorstores → couchbase}/couchbase.py +0 -0
- /langflow/components/{vectorstores → datastax}/astradb.py +0 -0
- /langflow/components/{vectorstores → datastax}/astradb_graph.py +0 -0
- /langflow/components/{vectorstores → datastax}/graph_rag.py +0 -0
- /langflow/components/{vectorstores → datastax}/hcd.py +0 -0
- /langflow/components/{vectorstores → elastic}/elasticsearch.py +0 -0
- /langflow/components/{vectorstores → elastic}/opensearch.py +0 -0
- /langflow/components/{vectorstores → milvus}/milvus.py +0 -0
- /langflow/components/{vectorstores → mongodb}/mongodb_atlas.py +0 -0
- /langflow/components/{vectorstores → pgvector}/pgvector.py +0 -0
- /langflow/components/{vectorstores → pinecone}/pinecone.py +0 -0
- /langflow/components/{vectorstores → qdrant}/qdrant.py +0 -0
- /langflow/components/{vectorstores → supabase}/supabase.py +0 -0
- /langflow/components/{vectorstores → upstash}/upstash.py +0 -0
- /langflow/components/{vectorstores → vectara}/vectara.py +0 -0
- /langflow/components/{vectorstores → vectara}/vectara_rag.py +0 -0
- /langflow/components/{vectorstores → weaviate}/weaviate.py +0 -0
- {langflow_base_nightly-0.5.0.dev37.dist-info → langflow_base_nightly-0.5.0.dev39.dist-info}/WHEEL +0 -0
- {langflow_base_nightly-0.5.0.dev37.dist-info → langflow_base_nightly-0.5.0.dev39.dist-info}/entry_points.txt +0 -0
langflow/components/data/url.py
CHANGED
|
@@ -3,12 +3,12 @@ import re
|
|
|
3
3
|
import requests
|
|
4
4
|
from bs4 import BeautifulSoup
|
|
5
5
|
from langchain_community.document_loaders import RecursiveUrlLoader
|
|
6
|
-
from loguru import logger
|
|
7
6
|
|
|
8
7
|
from langflow.custom.custom_component.component import Component
|
|
9
8
|
from langflow.field_typing.range_spec import RangeSpec
|
|
10
9
|
from langflow.helpers.data import safe_convert
|
|
11
10
|
from langflow.io import BoolInput, DropdownInput, IntInput, MessageTextInput, Output, SliderInput, TableInput
|
|
11
|
+
from langflow.logging.logger import logger
|
|
12
12
|
from langflow.schema.dataframe import DataFrame
|
|
13
13
|
from langflow.schema.message import Message
|
|
14
14
|
from langflow.services.deps import get_settings_service
|
|
@@ -8,9 +8,9 @@ if TYPE_CHECKING:
|
|
|
8
8
|
from .astra_assistant_manager import AstraAssistantManager
|
|
9
9
|
from .astra_db import AstraDBChatMemory
|
|
10
10
|
from .astra_vectorize import AstraVectorizeComponent
|
|
11
|
+
from .astradb import AstraDBVectorStoreComponent
|
|
11
12
|
from .astradb_cql import AstraDBCQLToolComponent
|
|
12
13
|
from .astradb_tool import AstraDBToolComponent
|
|
13
|
-
from .cassandra import CassandraChatMemory
|
|
14
14
|
from .create_assistant import AssistantsCreateAssistant
|
|
15
15
|
from .create_thread import AssistantsCreateThread
|
|
16
16
|
from .dotenv import Dotenv
|
|
@@ -29,8 +29,8 @@ _dynamic_imports = {
|
|
|
29
29
|
"AstraDBCQLToolComponent": "astradb_cql",
|
|
30
30
|
"AstraDBChatMemory": "astra_db",
|
|
31
31
|
"AstraDBToolComponent": "astradb_tool",
|
|
32
|
+
"AstraDBVectorStoreComponent": "astradb",
|
|
32
33
|
"AstraVectorizeComponent": "astra_vectorize",
|
|
33
|
-
"CassandraChatMemory": "cassandra",
|
|
34
34
|
"Dotenv": "dotenv",
|
|
35
35
|
"GetEnvVar": "getenvvar",
|
|
36
36
|
}
|
|
@@ -45,8 +45,8 @@ __all__ = [
|
|
|
45
45
|
"AstraDBCQLToolComponent",
|
|
46
46
|
"AstraDBChatMemory",
|
|
47
47
|
"AstraDBToolComponent",
|
|
48
|
+
"AstraDBVectorStoreComponent",
|
|
48
49
|
"AstraVectorizeComponent",
|
|
49
|
-
"CassandraChatMemory",
|
|
50
50
|
"Dotenv",
|
|
51
51
|
"GetEnvVar",
|
|
52
52
|
]
|
|
@@ -4,7 +4,6 @@ from typing import TYPE_CHECKING, Any, cast
|
|
|
4
4
|
|
|
5
5
|
from astra_assistants.astra_assistants_manager import AssistantManager
|
|
6
6
|
from langchain_core.agents import AgentFinish
|
|
7
|
-
from loguru import logger
|
|
8
7
|
|
|
9
8
|
from langflow.base.agents.events import ExceptionWithMessageError, process_agent_events
|
|
10
9
|
from langflow.base.astra_assistants.util import (
|
|
@@ -15,6 +14,7 @@ from langflow.base.astra_assistants.util import (
|
|
|
15
14
|
)
|
|
16
15
|
from langflow.custom.custom_component.component_with_cache import ComponentWithCache
|
|
17
16
|
from langflow.inputs.inputs import DropdownInput, FileInput, HandleInput, MultilineInput
|
|
17
|
+
from langflow.logging.logger import logger
|
|
18
18
|
from langflow.memory import delete_message
|
|
19
19
|
from langflow.schema.content_block import ContentBlock
|
|
20
20
|
from langflow.schema.message import Message
|
|
@@ -186,8 +186,8 @@ class AstraAssistantManager(ComponentWithCache):
|
|
|
186
186
|
self.initialized = True
|
|
187
187
|
|
|
188
188
|
async def process_inputs(self) -> None:
|
|
189
|
-
logger.
|
|
190
|
-
logger.
|
|
189
|
+
await logger.ainfo(f"env_set is {self.env_set}")
|
|
190
|
+
await logger.ainfo(self.input_tools)
|
|
191
191
|
tools = []
|
|
192
192
|
tool_obj = None
|
|
193
193
|
if self.input_tools is None:
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
from loguru import logger
|
|
2
|
-
|
|
3
1
|
from langflow.base.astra_assistants.util import get_patched_openai_client
|
|
4
2
|
from langflow.custom.custom_component.component_with_cache import ComponentWithCache
|
|
5
3
|
from langflow.inputs.inputs import MultilineInput, StrInput
|
|
4
|
+
from langflow.logging.logger import logger
|
|
6
5
|
from langflow.schema.message import Message
|
|
7
6
|
from langflow.template.field.base import Output
|
|
8
7
|
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
from typing import TYPE_CHECKING, Any
|
|
2
2
|
|
|
3
|
-
from loguru import logger
|
|
4
|
-
|
|
5
3
|
from langflow.base.flow_processing.utils import build_data_from_result_data
|
|
6
4
|
from langflow.custom.custom_component.custom_component import CustomComponent
|
|
7
5
|
from langflow.graph.graph.base import Graph
|
|
8
6
|
from langflow.graph.vertex.base import Vertex
|
|
9
7
|
from langflow.helpers.flow import get_flow_inputs
|
|
8
|
+
from langflow.logging.logger import logger
|
|
10
9
|
from langflow.schema.data import Data
|
|
11
10
|
from langflow.schema.dotdict import dotdict
|
|
12
11
|
from langflow.template.field.base import Input
|
|
@@ -36,7 +35,7 @@ class SubFlowComponent(CustomComponent):
|
|
|
36
35
|
return None
|
|
37
36
|
|
|
38
37
|
async def update_build_config(self, build_config: dotdict, field_value: Any, field_name: str | None = None):
|
|
39
|
-
logger.
|
|
38
|
+
await logger.adebug(f"Updating build config with field value {field_value} and field name {field_name}")
|
|
40
39
|
if field_name == "flow_name":
|
|
41
40
|
build_config["flow_name"]["options"] = await self.get_flow_names()
|
|
42
41
|
# Clean up the build config
|
|
@@ -47,11 +46,11 @@ class SubFlowComponent(CustomComponent):
|
|
|
47
46
|
try:
|
|
48
47
|
flow_data = await self.get_flow(field_value)
|
|
49
48
|
except Exception: # noqa: BLE001
|
|
50
|
-
logger.
|
|
49
|
+
await logger.aexception(f"Error getting flow {field_value}")
|
|
51
50
|
else:
|
|
52
51
|
if not flow_data:
|
|
53
52
|
msg = f"Flow {field_value} not found."
|
|
54
|
-
logger.
|
|
53
|
+
await logger.aerror(msg)
|
|
55
54
|
else:
|
|
56
55
|
try:
|
|
57
56
|
graph = Graph.from_payload(flow_data.data["data"])
|
|
@@ -60,7 +59,7 @@ class SubFlowComponent(CustomComponent):
|
|
|
60
59
|
# Add inputs to the build config
|
|
61
60
|
build_config = self.add_inputs_to_build_config(inputs, build_config)
|
|
62
61
|
except Exception: # noqa: BLE001
|
|
63
|
-
logger.
|
|
62
|
+
await logger.aexception(f"Error building graph for flow {field_value}")
|
|
64
63
|
|
|
65
64
|
return build_config
|
|
66
65
|
|
|
@@ -121,5 +120,5 @@ class SubFlowComponent(CustomComponent):
|
|
|
121
120
|
data.extend(build_data_from_result_data(output))
|
|
122
121
|
|
|
123
122
|
self.status = data
|
|
124
|
-
logger.
|
|
123
|
+
await logger.adebug(data)
|
|
125
124
|
return data
|
|
@@ -68,9 +68,9 @@ class VectaraSelfQueryRetriverComponent(CustomComponent):
|
|
|
68
68
|
metadata_field_obj.append(attribute_info)
|
|
69
69
|
|
|
70
70
|
return SelfQueryRetriever.from_llm(
|
|
71
|
-
self.llm, #
|
|
72
|
-
self.vectorstore, #
|
|
73
|
-
self.document_content_description, #
|
|
71
|
+
self.llm, # type: ignore[attr-defined]
|
|
72
|
+
self.vectorstore, # type: ignore[attr-defined]
|
|
73
|
+
self.document_content_description, # type: ignore[attr-defined]
|
|
74
74
|
metadata_field_obj,
|
|
75
75
|
verbose=True,
|
|
76
76
|
)
|
|
@@ -1,13 +1,7 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
|
|
3
|
-
import signal
|
|
4
|
-
import sys
|
|
5
|
-
import traceback
|
|
6
|
-
from contextlib import suppress
|
|
7
3
|
from typing import TYPE_CHECKING, Any
|
|
8
4
|
|
|
9
|
-
from loguru import logger
|
|
10
|
-
|
|
11
5
|
from langflow.components._importing import import_mod
|
|
12
6
|
|
|
13
7
|
if TYPE_CHECKING:
|
|
@@ -47,195 +41,3 @@ def __getattr__(attr_name: str) -> Any:
|
|
|
47
41
|
|
|
48
42
|
def __dir__() -> list[str]:
|
|
49
43
|
return list(__all__)
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
def docling_worker(file_paths: list[str], queue, pipeline: str, ocr_engine: str):
|
|
53
|
-
"""Worker function for processing files with Docling in a separate process."""
|
|
54
|
-
# Signal handling for graceful shutdown
|
|
55
|
-
shutdown_requested = False
|
|
56
|
-
|
|
57
|
-
def signal_handler(signum: int, frame) -> None: # noqa: ARG001
|
|
58
|
-
"""Handle shutdown signals gracefully."""
|
|
59
|
-
nonlocal shutdown_requested
|
|
60
|
-
signal_names: dict[int, str] = {signal.SIGTERM: "SIGTERM", signal.SIGINT: "SIGINT"}
|
|
61
|
-
signal_name = signal_names.get(signum, f"signal {signum}")
|
|
62
|
-
|
|
63
|
-
logger.debug(f"Docling worker received {signal_name}, initiating graceful shutdown...")
|
|
64
|
-
shutdown_requested = True
|
|
65
|
-
|
|
66
|
-
# Send shutdown notification to parent process
|
|
67
|
-
with suppress(Exception):
|
|
68
|
-
queue.put({"error": f"Worker interrupted by {signal_name}", "shutdown": True})
|
|
69
|
-
|
|
70
|
-
# Exit gracefully
|
|
71
|
-
sys.exit(0)
|
|
72
|
-
|
|
73
|
-
def check_shutdown() -> None:
|
|
74
|
-
"""Check if shutdown was requested and exit if so."""
|
|
75
|
-
if shutdown_requested:
|
|
76
|
-
logger.info("Shutdown requested, exiting worker...")
|
|
77
|
-
|
|
78
|
-
with suppress(Exception):
|
|
79
|
-
queue.put({"error": "Worker shutdown requested", "shutdown": True})
|
|
80
|
-
|
|
81
|
-
sys.exit(0)
|
|
82
|
-
|
|
83
|
-
# Register signal handlers early
|
|
84
|
-
try:
|
|
85
|
-
signal.signal(signal.SIGTERM, signal_handler)
|
|
86
|
-
signal.signal(signal.SIGINT, signal_handler)
|
|
87
|
-
logger.debug("Signal handlers registered for graceful shutdown")
|
|
88
|
-
except (OSError, ValueError) as e:
|
|
89
|
-
# Some signals might not be available on all platforms
|
|
90
|
-
logger.warning(f"Warning: Could not register signal handlers: {e}")
|
|
91
|
-
|
|
92
|
-
# Check for shutdown before heavy imports
|
|
93
|
-
check_shutdown()
|
|
94
|
-
|
|
95
|
-
try:
|
|
96
|
-
from docling.datamodel.base_models import ConversionStatus, InputFormat
|
|
97
|
-
from docling.datamodel.pipeline_options import (
|
|
98
|
-
OcrOptions,
|
|
99
|
-
PdfPipelineOptions,
|
|
100
|
-
VlmPipelineOptions,
|
|
101
|
-
)
|
|
102
|
-
from docling.document_converter import DocumentConverter, FormatOption, PdfFormatOption
|
|
103
|
-
from docling.models.factories import get_ocr_factory
|
|
104
|
-
from docling.pipeline.vlm_pipeline import VlmPipeline
|
|
105
|
-
|
|
106
|
-
# Check for shutdown after imports
|
|
107
|
-
check_shutdown()
|
|
108
|
-
logger.debug("Docling dependencies loaded successfully")
|
|
109
|
-
|
|
110
|
-
except ModuleNotFoundError:
|
|
111
|
-
msg = (
|
|
112
|
-
"Docling is an optional dependency of Langflow. "
|
|
113
|
-
"Install with `uv pip install 'langflow[docling]'` "
|
|
114
|
-
"or refer to the documentation"
|
|
115
|
-
)
|
|
116
|
-
queue.put({"error": msg})
|
|
117
|
-
return
|
|
118
|
-
except ImportError as e:
|
|
119
|
-
# A different import failed (e.g., a transitive dependency); preserve details.
|
|
120
|
-
queue.put({"error": f"Failed to import a Docling dependency: {e}"})
|
|
121
|
-
return
|
|
122
|
-
except KeyboardInterrupt:
|
|
123
|
-
logger.warning("KeyboardInterrupt during imports, exiting...")
|
|
124
|
-
queue.put({"error": "Worker interrupted during imports", "shutdown": True})
|
|
125
|
-
return
|
|
126
|
-
|
|
127
|
-
# Configure the standard PDF pipeline
|
|
128
|
-
def _get_standard_opts() -> PdfPipelineOptions:
|
|
129
|
-
check_shutdown() # Check before heavy operations
|
|
130
|
-
|
|
131
|
-
pipeline_options = PdfPipelineOptions()
|
|
132
|
-
pipeline_options.do_ocr = ocr_engine != ""
|
|
133
|
-
if pipeline_options.do_ocr:
|
|
134
|
-
ocr_factory = get_ocr_factory(
|
|
135
|
-
allow_external_plugins=False,
|
|
136
|
-
)
|
|
137
|
-
|
|
138
|
-
ocr_options: OcrOptions = ocr_factory.create_options(
|
|
139
|
-
kind=ocr_engine,
|
|
140
|
-
)
|
|
141
|
-
pipeline_options.ocr_options = ocr_options
|
|
142
|
-
return pipeline_options
|
|
143
|
-
|
|
144
|
-
# Configure the VLM pipeline
|
|
145
|
-
def _get_vlm_opts() -> VlmPipelineOptions:
|
|
146
|
-
check_shutdown() # Check before heavy operations
|
|
147
|
-
return VlmPipelineOptions()
|
|
148
|
-
|
|
149
|
-
# Configure the main format options and create the DocumentConverter()
|
|
150
|
-
def _get_converter() -> DocumentConverter:
|
|
151
|
-
check_shutdown() # Check before heavy operations
|
|
152
|
-
|
|
153
|
-
if pipeline == "standard":
|
|
154
|
-
pdf_format_option = PdfFormatOption(
|
|
155
|
-
pipeline_options=_get_standard_opts(),
|
|
156
|
-
)
|
|
157
|
-
elif pipeline == "vlm":
|
|
158
|
-
pdf_format_option = PdfFormatOption(pipeline_cls=VlmPipeline, pipeline_options=_get_vlm_opts())
|
|
159
|
-
else:
|
|
160
|
-
msg = f"Unknown pipeline: {pipeline!r}"
|
|
161
|
-
raise ValueError(msg)
|
|
162
|
-
|
|
163
|
-
format_options: dict[InputFormat, FormatOption] = {
|
|
164
|
-
InputFormat.PDF: pdf_format_option,
|
|
165
|
-
InputFormat.IMAGE: pdf_format_option,
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
return DocumentConverter(format_options=format_options)
|
|
169
|
-
|
|
170
|
-
try:
|
|
171
|
-
# Check for shutdown before creating converter (can be slow)
|
|
172
|
-
check_shutdown()
|
|
173
|
-
logger.info(f"Initializing {pipeline} pipeline with OCR: {ocr_engine or 'disabled'}")
|
|
174
|
-
|
|
175
|
-
converter = _get_converter()
|
|
176
|
-
|
|
177
|
-
# Check for shutdown before processing files
|
|
178
|
-
check_shutdown()
|
|
179
|
-
logger.info(f"Starting to process {len(file_paths)} files...")
|
|
180
|
-
|
|
181
|
-
# Process files with periodic shutdown checks
|
|
182
|
-
results = []
|
|
183
|
-
for i, file_path in enumerate(file_paths):
|
|
184
|
-
# Check for shutdown before processing each file
|
|
185
|
-
check_shutdown()
|
|
186
|
-
|
|
187
|
-
logger.debug(f"Processing file {i + 1}/{len(file_paths)}: {file_path}")
|
|
188
|
-
|
|
189
|
-
try:
|
|
190
|
-
# Process single file (we can't easily interrupt convert_all)
|
|
191
|
-
single_result = converter.convert_all([file_path])
|
|
192
|
-
results.extend(single_result)
|
|
193
|
-
|
|
194
|
-
# Check for shutdown after each file
|
|
195
|
-
check_shutdown()
|
|
196
|
-
|
|
197
|
-
except (OSError, ValueError, RuntimeError, ImportError) as file_error:
|
|
198
|
-
# Handle specific file processing errors
|
|
199
|
-
logger.error(f"Error processing file {file_path}: {file_error}")
|
|
200
|
-
# Continue with other files, but check for shutdown
|
|
201
|
-
check_shutdown()
|
|
202
|
-
except Exception as file_error: # noqa: BLE001
|
|
203
|
-
# Catch any other unexpected errors to prevent worker crash
|
|
204
|
-
logger.error(f"Unexpected error processing file {file_path}: {file_error}")
|
|
205
|
-
# Continue with other files, but check for shutdown
|
|
206
|
-
check_shutdown()
|
|
207
|
-
|
|
208
|
-
# Final shutdown check before sending results
|
|
209
|
-
check_shutdown()
|
|
210
|
-
|
|
211
|
-
# Process the results while maintaining the original structure
|
|
212
|
-
processed_data = [
|
|
213
|
-
{"document": res.document, "file_path": str(res.input.file), "status": res.status.name}
|
|
214
|
-
if res.status == ConversionStatus.SUCCESS
|
|
215
|
-
else None
|
|
216
|
-
for res in results
|
|
217
|
-
]
|
|
218
|
-
|
|
219
|
-
logger.info(f"Successfully processed {len([d for d in processed_data if d])} files")
|
|
220
|
-
queue.put(processed_data)
|
|
221
|
-
|
|
222
|
-
except KeyboardInterrupt:
|
|
223
|
-
logger.warning("KeyboardInterrupt during processing, exiting gracefully...")
|
|
224
|
-
queue.put({"error": "Worker interrupted during processing", "shutdown": True})
|
|
225
|
-
return
|
|
226
|
-
except Exception as e: # noqa: BLE001
|
|
227
|
-
if shutdown_requested:
|
|
228
|
-
logger.exception("Exception occurred during shutdown, exiting...")
|
|
229
|
-
return
|
|
230
|
-
|
|
231
|
-
# Send any processing error to the main process with traceback
|
|
232
|
-
error_info = {"error": str(e), "traceback": traceback.format_exc()}
|
|
233
|
-
logger.error(f"Error in worker: {error_info}")
|
|
234
|
-
queue.put(error_info)
|
|
235
|
-
finally:
|
|
236
|
-
logger.info("Docling worker finishing...")
|
|
237
|
-
# Ensure we don't leave any hanging processes
|
|
238
|
-
if shutdown_requested:
|
|
239
|
-
logger.debug("Worker shutdown completed")
|
|
240
|
-
else:
|
|
241
|
-
logger.debug("Worker completed normally")
|
|
@@ -3,7 +3,7 @@ from multiprocessing import Queue, get_context
|
|
|
3
3
|
from queue import Empty
|
|
4
4
|
|
|
5
5
|
from langflow.base.data import BaseFileComponent
|
|
6
|
-
from langflow.
|
|
6
|
+
from langflow.base.data.docling_utils import docling_worker
|
|
7
7
|
from langflow.inputs import DropdownInput
|
|
8
8
|
from langflow.schema import Data
|
|
9
9
|
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from typing import TYPE_CHECKING, Any
|
|
4
|
+
|
|
5
|
+
from langflow.components._importing import import_mod
|
|
6
|
+
|
|
7
|
+
if TYPE_CHECKING:
|
|
8
|
+
from .elasticsearch import ElasticsearchVectorStoreComponent
|
|
9
|
+
from .opensearch import OpenSearchVectorStoreComponent
|
|
10
|
+
|
|
11
|
+
_dynamic_imports = {
|
|
12
|
+
"ElasticsearchVectorStoreComponent": "elasticsearch",
|
|
13
|
+
"OpenSearchVectorStoreComponent": "opensearch",
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
__all__ = [
|
|
17
|
+
"ElasticsearchVectorStoreComponent",
|
|
18
|
+
"OpenSearchVectorStoreComponent",
|
|
19
|
+
]
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
def __getattr__(attr_name: str) -> Any:
|
|
23
|
+
"""Lazily import Elastic components on attribute access."""
|
|
24
|
+
if attr_name not in _dynamic_imports:
|
|
25
|
+
msg = f"module '{__name__}' has no attribute '{attr_name}'"
|
|
26
|
+
raise AttributeError(msg)
|
|
27
|
+
try:
|
|
28
|
+
result = import_mod(attr_name, _dynamic_imports[attr_name], __spec__.parent)
|
|
29
|
+
except (ModuleNotFoundError, ImportError, AttributeError) as e:
|
|
30
|
+
msg = f"Could not import '{attr_name}' from '{__name__}': {e}"
|
|
31
|
+
raise AttributeError(msg) from e
|
|
32
|
+
globals()[attr_name] = result
|
|
33
|
+
return result
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
def __dir__() -> list[str]:
|
|
37
|
+
return list(__all__)
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import logging
|
|
2
1
|
from typing import TYPE_CHECKING
|
|
3
2
|
|
|
4
3
|
from langflow.custom.custom_component.component import Component
|
|
5
4
|
from langflow.io import HandleInput, MessageInput, Output
|
|
5
|
+
from langflow.logging.logger import logger
|
|
6
6
|
from langflow.schema.data import Data
|
|
7
7
|
|
|
8
8
|
if TYPE_CHECKING:
|
|
@@ -57,8 +57,8 @@ class TextEmbedderComponent(Component):
|
|
|
57
57
|
embedding_vector = embeddings[0]
|
|
58
58
|
self.status = {"text": text_content, "embeddings": embedding_vector}
|
|
59
59
|
return Data(data={"text": text_content, "embeddings": embedding_vector})
|
|
60
|
-
except Exception as e:
|
|
61
|
-
|
|
60
|
+
except Exception as e: # noqa: BLE001
|
|
61
|
+
logger.exception("Error generating embeddings")
|
|
62
62
|
error_data = Data(data={"text": "", "embeddings": [], "error": str(e)})
|
|
63
63
|
self.status = {"error": str(e)}
|
|
64
64
|
return error_data
|
|
@@ -1,13 +1,6 @@
|
|
|
1
|
-
from loguru import logger
|
|
2
|
-
|
|
3
1
|
from langflow.custom.custom_component.component import Component
|
|
4
|
-
from langflow.io import
|
|
5
|
-
|
|
6
|
-
DataInput,
|
|
7
|
-
MultilineInput,
|
|
8
|
-
Output,
|
|
9
|
-
SecretStrInput,
|
|
10
|
-
)
|
|
2
|
+
from langflow.io import BoolInput, DataInput, MultilineInput, Output, SecretStrInput
|
|
3
|
+
from langflow.logging.logger import logger
|
|
11
4
|
from langflow.schema.data import Data
|
|
12
5
|
|
|
13
6
|
|
|
@@ -11,11 +11,11 @@ from googleapiclient.discovery import build
|
|
|
11
11
|
from langchain_core.chat_sessions import ChatSession
|
|
12
12
|
from langchain_core.messages import HumanMessage
|
|
13
13
|
from langchain_google_community.gmail.loader import GMailLoader
|
|
14
|
-
from loguru import logger
|
|
15
14
|
|
|
16
15
|
from langflow.custom.custom_component.component import Component
|
|
17
16
|
from langflow.inputs.inputs import MessageTextInput
|
|
18
17
|
from langflow.io import SecretStrInput
|
|
18
|
+
from langflow.logging.logger import logger
|
|
19
19
|
from langflow.schema.data import Data
|
|
20
20
|
from langflow.template.field.base import Output
|
|
21
21
|
|
|
@@ -1,21 +1,14 @@
|
|
|
1
1
|
from typing import Any
|
|
2
2
|
|
|
3
3
|
import requests
|
|
4
|
-
from loguru import logger
|
|
5
4
|
from pydantic.v1 import SecretStr
|
|
6
5
|
|
|
7
6
|
from langflow.base.models.google_generative_ai_constants import GOOGLE_GENERATIVE_AI_MODELS
|
|
8
7
|
from langflow.base.models.model import LCModelComponent
|
|
9
8
|
from langflow.field_typing import LanguageModel
|
|
10
9
|
from langflow.field_typing.range_spec import RangeSpec
|
|
11
|
-
from langflow.inputs.inputs import
|
|
12
|
-
|
|
13
|
-
DropdownInput,
|
|
14
|
-
FloatInput,
|
|
15
|
-
IntInput,
|
|
16
|
-
SecretStrInput,
|
|
17
|
-
SliderInput,
|
|
18
|
-
)
|
|
10
|
+
from langflow.inputs.inputs import BoolInput, DropdownInput, FloatInput, IntInput, SecretStrInput, SliderInput
|
|
11
|
+
from langflow.logging.logger import logger
|
|
19
12
|
from langflow.schema.dotdict import dotdict
|
|
20
13
|
|
|
21
14
|
|
|
@@ -105,7 +98,7 @@ class GoogleGenerativeAIComponent(LCModelComponent):
|
|
|
105
98
|
google_api_key=SecretStr(google_api_key).get_secret_value(),
|
|
106
99
|
)
|
|
107
100
|
|
|
108
|
-
def get_models(self, tool_model_enabled: bool | None = None) -> list[str]:
|
|
101
|
+
def get_models(self, *, tool_model_enabled: bool | None = None) -> list[str]:
|
|
109
102
|
try:
|
|
110
103
|
import google.generativeai as genai
|
|
111
104
|
|
|
@@ -145,8 +138,9 @@ class GoogleGenerativeAIComponent(LCModelComponent):
|
|
|
145
138
|
except (ImportError, ValueError, requests.exceptions.RequestException) as e:
|
|
146
139
|
logger.exception(f"Error getting model names: {e}")
|
|
147
140
|
ids = GOOGLE_GENERATIVE_AI_MODELS
|
|
141
|
+
build_config.setdefault("model_name", {})
|
|
148
142
|
build_config["model_name"]["options"] = ids
|
|
149
|
-
build_config["model_name"]
|
|
143
|
+
build_config["model_name"].setdefault("value", ids[0])
|
|
150
144
|
except Exception as e:
|
|
151
145
|
msg = f"Error getting model names: {e}"
|
|
152
146
|
raise ValueError(msg) from e
|
langflow/components/groq/groq.py
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import requests
|
|
2
|
-
from loguru import logger
|
|
3
2
|
from pydantic.v1 import SecretStr
|
|
4
3
|
|
|
5
4
|
from langflow.base.models.groq_constants import (
|
|
@@ -11,6 +10,7 @@ from langflow.base.models.model import LCModelComponent
|
|
|
11
10
|
from langflow.field_typing import LanguageModel
|
|
12
11
|
from langflow.field_typing.range_spec import RangeSpec
|
|
13
12
|
from langflow.io import BoolInput, DropdownInput, IntInput, MessageTextInput, SecretStrInput, SliderInput
|
|
13
|
+
from langflow.logging.logger import logger
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
class GroqModel(LCModelComponent):
|
|
@@ -74,7 +74,7 @@ class GroqModel(LCModelComponent):
|
|
|
74
74
|
),
|
|
75
75
|
]
|
|
76
76
|
|
|
77
|
-
def get_models(self, tool_model_enabled: bool | None = None) -> list[str]:
|
|
77
|
+
def get_models(self, *, tool_model_enabled: bool | None = None) -> list[str]:
|
|
78
78
|
try:
|
|
79
79
|
url = f"{self.base_url}/openai/v1/models"
|
|
80
80
|
headers = {"Authorization": f"Bearer {self.api_key}", "Content-Type": "application/json"}
|
|
@@ -114,8 +114,9 @@ class GroqModel(LCModelComponent):
|
|
|
114
114
|
except (ImportError, ValueError, requests.exceptions.RequestException) as e:
|
|
115
115
|
logger.exception(f"Error getting model names: {e}")
|
|
116
116
|
ids = GROQ_MODELS
|
|
117
|
+
build_config.setdefault("model_name", {})
|
|
117
118
|
build_config["model_name"]["options"] = ids
|
|
118
|
-
build_config["model_name"]
|
|
119
|
+
build_config["model_name"].setdefault("value", ids[0])
|
|
119
120
|
except Exception as e:
|
|
120
121
|
msg = f"Error getting model names: {e}"
|
|
121
122
|
raise ValueError(msg) from e
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
from datetime import datetime
|
|
2
2
|
from zoneinfo import ZoneInfo, available_timezones
|
|
3
3
|
|
|
4
|
-
from loguru import logger
|
|
5
|
-
|
|
6
4
|
from langflow.custom.custom_component.component import Component
|
|
7
5
|
from langflow.io import DropdownInput, Output
|
|
6
|
+
from langflow.logging.logger import logger
|
|
8
7
|
from langflow.schema.message import Message
|
|
9
8
|
|
|
10
9
|
|
|
@@ -37,7 +36,7 @@ class CurrentDateComponent(Component):
|
|
|
37
36
|
self.status = result
|
|
38
37
|
return Message(text=result)
|
|
39
38
|
except Exception as e: # noqa: BLE001
|
|
40
|
-
logger.
|
|
39
|
+
logger.debug("Error getting current date", exc_info=True)
|
|
41
40
|
error_message = f"Error: {e}"
|
|
42
41
|
self.status = error_message
|
|
43
42
|
return Message(text=error_message)
|
|
@@ -220,7 +220,7 @@ class MemoryComponent(Component):
|
|
|
220
220
|
stored = stored[-n_messages:] if order == "ASC" else stored[:n_messages]
|
|
221
221
|
|
|
222
222
|
# self.status = stored
|
|
223
|
-
return cast(Data, stored)
|
|
223
|
+
return cast("Data", stored)
|
|
224
224
|
|
|
225
225
|
async def retrieve_messages_as_text(self) -> Message:
|
|
226
226
|
stored_text = data_to_text(self.template, await self.retrieve_messages())
|
|
@@ -3,13 +3,13 @@ from typing import Any
|
|
|
3
3
|
|
|
4
4
|
import requests
|
|
5
5
|
from langchain_ibm import ChatWatsonx
|
|
6
|
-
from loguru import logger
|
|
7
6
|
from pydantic.v1 import SecretStr
|
|
8
7
|
|
|
9
8
|
from langflow.base.models.model import LCModelComponent
|
|
10
9
|
from langflow.field_typing import LanguageModel
|
|
11
10
|
from langflow.field_typing.range_spec import RangeSpec
|
|
12
11
|
from langflow.inputs.inputs import BoolInput, DropdownInput, IntInput, SecretStrInput, SliderInput, StrInput
|
|
12
|
+
from langflow.logging.logger import logger
|
|
13
13
|
from langflow.schema.dotdict import dotdict
|
|
14
14
|
|
|
15
15
|
|
|
@@ -4,12 +4,12 @@ import requests
|
|
|
4
4
|
from ibm_watsonx_ai import APIClient, Credentials
|
|
5
5
|
from ibm_watsonx_ai.metanames import EmbedTextParamsMetaNames
|
|
6
6
|
from langchain_ibm import WatsonxEmbeddings
|
|
7
|
-
from loguru import logger
|
|
8
7
|
from pydantic.v1 import SecretStr
|
|
9
8
|
|
|
10
9
|
from langflow.base.embeddings.model import LCEmbeddingsModel
|
|
11
10
|
from langflow.field_typing import Embeddings
|
|
12
11
|
from langflow.io import BoolInput, DropdownInput, IntInput, SecretStrInput, StrInput
|
|
12
|
+
from langflow.logging.logger import logger
|
|
13
13
|
from langflow.schema.dotdict import dotdict
|
|
14
14
|
|
|
15
15
|
|
|
@@ -3,7 +3,6 @@ import os
|
|
|
3
3
|
from typing import Any
|
|
4
4
|
|
|
5
5
|
import httpx
|
|
6
|
-
from loguru import logger
|
|
7
6
|
|
|
8
7
|
from langflow.base.langwatch.utils import get_cached_evaluators
|
|
9
8
|
from langflow.custom.custom_component.component import Component
|
|
@@ -18,6 +17,7 @@ from langflow.io import (
|
|
|
18
17
|
Output,
|
|
19
18
|
SecretStrInput,
|
|
20
19
|
)
|
|
20
|
+
from langflow.logging.logger import logger
|
|
21
21
|
from langflow.schema.data import Data
|
|
22
22
|
from langflow.schema.dotdict import dotdict
|
|
23
23
|
|
|
@@ -226,7 +226,7 @@ class LangWatchComponent(Component):
|
|
|
226
226
|
if not evaluator_name:
|
|
227
227
|
if self.evaluators:
|
|
228
228
|
evaluator_name = next(iter(self.evaluators))
|
|
229
|
-
logger.
|
|
229
|
+
await logger.ainfo(f"No evaluator was selected. Using default: {evaluator_name}")
|
|
230
230
|
else:
|
|
231
231
|
return Data(
|
|
232
232
|
data={"error": "No evaluator selected and no evaluators available. Please choose an evaluator."}
|
|
@@ -237,7 +237,7 @@ class LangWatchComponent(Component):
|
|
|
237
237
|
if not evaluator:
|
|
238
238
|
return Data(data={"error": f"Selected evaluator '{evaluator_name}' not found."})
|
|
239
239
|
|
|
240
|
-
logger.
|
|
240
|
+
await logger.ainfo(f"Evaluating with evaluator: {evaluator_name}")
|
|
241
241
|
|
|
242
242
|
endpoint = f"/api/evaluations/{evaluator_name}/evaluate"
|
|
243
243
|
url = f"{os.getenv('LANGWATCH_ENDPOINT', 'https://app.langwatch.ai')}{endpoint}"
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
from typing import Any
|
|
2
2
|
|
|
3
|
-
from loguru import logger
|
|
4
3
|
from typing_extensions import override
|
|
5
4
|
|
|
6
5
|
from langflow.base.langchain_utilities.model import LCToolComponent
|
|
@@ -9,6 +8,7 @@ from langflow.field_typing import Tool
|
|
|
9
8
|
from langflow.graph.graph.base import Graph
|
|
10
9
|
from langflow.helpers.flow import get_flow_inputs
|
|
11
10
|
from langflow.io import BoolInput, DropdownInput, Output, StrInput
|
|
11
|
+
from langflow.logging.logger import logger
|
|
12
12
|
from langflow.schema.data import Data
|
|
13
13
|
from langflow.schema.dotdict import dotdict
|
|
14
14
|
|
|
@@ -91,7 +91,7 @@ class FlowToolComponent(LCToolComponent):
|
|
|
91
91
|
try:
|
|
92
92
|
graph.set_run_id(self.graph.run_id)
|
|
93
93
|
except Exception: # noqa: BLE001
|
|
94
|
-
logger.
|
|
94
|
+
logger.warning("Failed to set run_id", exc_info=True)
|
|
95
95
|
inputs = get_flow_inputs(graph)
|
|
96
96
|
tool_description = self.tool_description.strip() or flow_data.description
|
|
97
97
|
tool = FlowTool(
|