langflow-base-nightly 0.5.0.dev36__py3-none-any.whl → 0.5.0.dev38__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/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 +19 -12
- langflow/api/v1/mcp.py +12 -12
- langflow/api/v1/mcp_projects.py +45 -81
- langflow/api/v1/mcp_utils.py +8 -8
- langflow/api/v1/schemas.py +1 -5
- 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 +5 -3
- 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/data/kb_utils.py +33 -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/models/model.py +3 -3
- 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/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 +3 -3
- langflow/components/agents/mcp_component.py +54 -69
- 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/data/file.py +575 -55
- langflow/components/data/kb_ingest.py +116 -43
- langflow/components/data/kb_retrieval.py +24 -26
- langflow/components/data/url.py +1 -1
- 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/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/nvidia/nvidia.py +3 -3
- langflow/components/olivya/olivya.py +7 -7
- langflow/components/ollama/ollama.py +8 -6
- 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/processing/save_file.py +6 -32
- langflow/components/prototypes/python_function.py +2 -3
- langflow/components/serpapi/serp.py +1 -1
- 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/vectorstores/astradb.py +30 -19
- langflow/components/vectorstores/local_db.py +1 -1
- 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/directory_reader/directory_reader.py +7 -7
- langflow/custom/directory_reader/utils.py +1 -2
- langflow/custom/utils.py +30 -30
- langflow/events/event_manager.py +1 -1
- langflow/frontend/assets/{SlackIcon-B260Qg_R.js → SlackIcon-BhW6H3JR.js} +1 -1
- langflow/frontend/assets/{Wikipedia-BB2mbgyd.js → Wikipedia-Dx5jbiy3.js} +1 -1
- langflow/frontend/assets/{Wolfram-DytXC9hF.js → Wolfram-CIyonzwo.js} +1 -1
- langflow/frontend/assets/{index-DPX6X_bw.js → index-0XQqYgdG.js} +1 -1
- langflow/frontend/assets/{index-DtJyCbzF.js → index-1Q3VBqKn.js} +1 -1
- langflow/frontend/assets/{index-DztLFiip.js → index-35sspuLu.js} +1 -1
- langflow/frontend/assets/{index-BeNby7qF.js → index-7hzXChQz.js} +1 -1
- langflow/frontend/assets/{index-BOEf7-ty.js → index-8cuhogZP.js} +1 -1
- langflow/frontend/assets/{index-D0s9f6Re.js → index-B0m53xKd.js} +1 -1
- langflow/frontend/assets/{index-DpJiH-Rk.js → index-B1XqWJhG.js} +1 -1
- langflow/frontend/assets/{index-DuAeoC-H.js → index-B3KCdQ91.js} +1 -1
- langflow/frontend/assets/{index-Bxml6wXu.js → index-B7uEuOPK.js} +1 -1
- langflow/frontend/assets/{index-CDFLVFB4.js → index-B8UR8v-Q.js} +1 -1
- langflow/frontend/assets/{index-ci4XHjbJ.js → index-BD7Io1hL.js} +6 -6
- langflow/frontend/assets/{index-DasrI03Y.js → index-BDQrd7Tj.js} +1 -1
- langflow/frontend/assets/{index-CkQ-bJ4G.js → index-BDuk0d7P.js} +1 -1
- langflow/frontend/assets/{index-C_1RBTul.js → index-BFQ8KFK0.js} +1 -1
- langflow/frontend/assets/{index-DqSH4x-R.js → index-BFf0HTFI.js} +1 -1
- langflow/frontend/assets/{index-BXMhmvTj.js → index-BHhnpSkW.js} +1 -1
- langflow/frontend/assets/{index-Uq2ij_SS.js → index-BKKrUElc.js} +1 -1
- langflow/frontend/assets/{index-3TJWUdmx.js → index-BKeZt2hQ.js} +1 -1
- langflow/frontend/assets/{index-DHlEwAxb.js → index-BKlQbl-6.js} +1 -1
- langflow/frontend/assets/{index-Bisa4IQF.js → index-BLYw9MK2.js} +1 -1
- langflow/frontend/assets/{index-GODbXlHC.js → index-BLsVo9iW.js} +1 -1
- langflow/frontend/assets/{index-CHFO5O4g.js → index-BNQIbda3.js} +1 -1
- langflow/frontend/assets/{index-3uOAA_XX.js → index-BPR2mEFC.js} +1 -1
- langflow/frontend/assets/{index-3qMh9x6K.js → index-BPfdqCc_.js} +1 -1
- langflow/frontend/assets/{index-rcdQpNcU.js → index-BQrVDjR1.js} +1 -1
- langflow/frontend/assets/{index-4eRtaV45.js → index-BRmSeoWR.js} +1 -1
- langflow/frontend/assets/{index-Ct9_T9ox.js → index-BUse-kxM.js} +1 -1
- langflow/frontend/assets/{index-BdYgKk1d.js → index-BVFaF7HW.js} +1 -1
- langflow/frontend/assets/{index-CWWo2zOA.js → index-BWgIWfv2.js} +1 -1
- langflow/frontend/assets/{index-Du9aJK7m.js → index-BWt5xGeA.js} +1 -1
- langflow/frontend/assets/{index-Baka5dKE.js → index-BYhcGLTV.js} +1 -1
- langflow/frontend/assets/{index-BWq9GTzt.js → index-BYjw7Gk3.js} +1 -1
- langflow/frontend/assets/{index-r1LZg-PY.js → index-BZFljdMa.js} +1 -1
- langflow/frontend/assets/index-BcAgItH4.js +1 -0
- langflow/frontend/assets/{index-B8TlNgn-.js → index-Bct1s6__.js} +1 -1
- langflow/frontend/assets/{index-DZzbmg3J.js → index-Bhv79Zso.js} +1 -1
- langflow/frontend/assets/{index-CqDUqHfd.js → index-Bj3lSwvZ.js} +1 -1
- langflow/frontend/assets/{index-dkS0ek2S.js → index-Bk4mTwnI.js} +1 -1
- langflow/frontend/assets/{index-tOy_uloT.js → index-BmIx1cws.js} +1 -1
- langflow/frontend/assets/{index-BVtf6m9S.js → index-BmYJJ5YS.js} +1 -1
- langflow/frontend/assets/{index-mBjJYD9q.js → index-BnAFhkSN.js} +1 -1
- langflow/frontend/assets/{index-Ba3RTMXI.js → index-Bo-ww0Bb.js} +1 -1
- langflow/frontend/assets/{index-BsBWP-Dh.js → index-BpmqDOeZ.js} +1 -1
- langflow/frontend/assets/{index-BqUeOc7Y.js → index-BrVhdPZb.js} +1 -1
- langflow/frontend/assets/{index-DWkMJnbd.js → index-BvGQfVBD.js} +1 -1
- langflow/frontend/assets/{index-DdzVmJHE.js → index-Bwi4flFg.js} +1 -1
- langflow/frontend/assets/{index-Ccb5B8zG.js → index-BzoRPtTY.js} +1 -1
- langflow/frontend/assets/{index-Ym6gz0T6.js → index-C--IDAyc.js} +1 -1
- langflow/frontend/assets/{index-CvQ0w8Pj.js → index-C0E3_MIK.js} +1 -1
- langflow/frontend/assets/{index-DxIs8VSp.js → index-C27Jj_26.js} +1 -1
- langflow/frontend/assets/{index-BxWXWRmZ.js → index-C2eQmQsn.js} +1 -1
- langflow/frontend/assets/{index-B536IPXH.js → index-C8K0r39B.js} +1 -1
- langflow/frontend/assets/{index-BEDxAk3N.js → index-CEJNWPhA.js} +1 -1
- langflow/frontend/assets/{index-G_U_kPAd.js → index-CFNTYfFK.js} +1 -1
- langflow/frontend/assets/{index-CMGZGIx_.js → index-CMHpjHZl.js} +1 -1
- langflow/frontend/assets/{index-C76aBV_h.js → index-CSu8KHOi.js} +1 -1
- langflow/frontend/assets/{index-B-c82Fnu.js → index-CUKmGsI6.js} +1 -1
- langflow/frontend/assets/{index-DX7XsAcx.js → index-CWYiSeWV.js} +1 -1
- langflow/frontend/assets/{index-COL0eiWI.js → index-CY7_TBTC.js} +1 -1
- langflow/frontend/assets/{index-BlBl2tvQ.js → index-CbnWRlYY.js} +1 -1
- langflow/frontend/assets/{index-BQB-iDYl.js → index-CfPBgkqg.js} +1 -1
- langflow/frontend/assets/{index-DWr_zPkx.js → index-Cg53lrYh.js} +1 -1
- langflow/frontend/assets/{index-BcgB3rXH.js → index-CgU7KF4I.js} +1 -1
- langflow/frontend/assets/{index-CkSzjCqM.js → index-CgwykVGh.js} +1 -1
- langflow/frontend/assets/{index-BbsND1Qg.js → index-Ch5r0oW6.js} +1 -1
- langflow/frontend/assets/{index-AY5Dm2mG.js → index-CjsommIr.js} +1 -1
- langflow/frontend/assets/{index-BtJ2o21k.js → index-CkK25zZO.js} +1 -1
- langflow/frontend/assets/{index-BKvKC-12.js → index-CkjwSTSM.js} +1 -1
- langflow/frontend/assets/{index-BVHvIhT5.js → index-CmSFKgiD.js} +1 -1
- langflow/frontend/assets/{index-D-zkHcob.js → index-Cr5v2ave.js} +1 -1
- langflow/frontend/assets/{index-js8ceOaP.js → index-CrAF-31Y.js} +1 -1
- langflow/frontend/assets/{index-BNbWMmAV.js → index-CsLQiWNf.js} +1 -1
- langflow/frontend/assets/{index-VcXZzovW.js → index-CuCM7Wu7.js} +1 -1
- langflow/frontend/assets/{index-DzeIsaBm.js → index-Cxy9sEpy.js} +1 -1
- langflow/frontend/assets/{index-LrMzDsq9.js → index-CyP3py8K.js} +1 -1
- langflow/frontend/assets/{index-C8KD3LPb.js → index-CzHzeZuA.js} +1 -1
- langflow/frontend/assets/{index-DS1EgA10.js → index-D1oynC8a.js} +1 -1
- langflow/frontend/assets/{index-ByFXr9Iq.js → index-D4tjMhfY.js} +1 -1
- langflow/frontend/assets/{index-DyJDHm2D.js → index-D6CSIrp1.js} +1 -1
- langflow/frontend/assets/{index-DIqSyDVO.js → index-D9kwEzPB.js} +1 -1
- langflow/frontend/assets/{index-D5PeCofu.js → index-DDXsm8tz.js} +1 -1
- langflow/frontend/assets/{index-CJwYfDBz.js → index-DDhJVVel.js} +1 -1
- langflow/frontend/assets/{index-C7x9R_Yo.js → index-DH6o91_s.js} +1 -1
- langflow/frontend/assets/{index-DpQKtcXu.js → index-DHngW1k8.js} +1 -1
- langflow/frontend/assets/{index-VZnN0P6C.js → index-DIKUsGLF.js} +1 -1
- langflow/frontend/assets/{index-VHmUHUUU.js → index-DJESSNJi.js} +1 -1
- langflow/frontend/assets/{index-BdIWbCEL.js → index-DMCWDJOl.js} +1 -1
- langflow/frontend/assets/{index-DK8vNpXK.js → index-DOEvKC2X.js} +1 -1
- langflow/frontend/assets/{index-C7V5U9yH.js → index-DOQDkSoK.js} +1 -1
- langflow/frontend/assets/{index-D0HmkH0H.js → index-DXAfIEvs.js} +1 -1
- langflow/frontend/assets/{index-C9N80hP8.js → index-DZP_SaHb.js} +1 -1
- langflow/frontend/assets/{index-B2ggrBuR.js → index-DZxUIhWh.js} +1 -1
- langflow/frontend/assets/{index-DS9I4y48.js → index-Dda2u_yz.js} +1 -1
- langflow/frontend/assets/{index-BLROcaSz.js → index-Dg8N3NSO.js} +1 -1
- langflow/frontend/assets/{index-Dpz3oBf5.js → index-DkGhPNeA.js} +1 -1
- langflow/frontend/assets/{index-BnLT29qW.js → index-Dka_Rk4-.js} +1 -1
- langflow/frontend/assets/{index-B5ed-sAv.js → index-DljpLeCW.js} +1 -1
- langflow/frontend/assets/{index-Cx__T92e.js → index-DnVYJtVO.js} +1 -1
- langflow/frontend/assets/{index-hOkEW3JP.js → index-DqbzUcI5.js} +1 -1
- langflow/frontend/assets/{index-BxkZkBgQ.js → index-Dr6pVDPI.js} +1 -1
- langflow/frontend/assets/{index-BIkqesA-.js → index-DsoX2o1S.js} +1 -1
- langflow/frontend/assets/{index-Cpgkb0Q3.js → index-DwfHWnX7.js} +1 -1
- langflow/frontend/assets/{index-B9Mo3ndZ.js → index-Dx-Z87KT.js} +1 -1
- langflow/frontend/assets/{index-R7q8cAek.js → index-DyqITq51.js} +1 -1
- langflow/frontend/assets/{index-DKEXZFUO.js → index-DzIv3RyR.js} +1 -1
- langflow/frontend/assets/{index-BJrY2Fiu.js → index-G4ro0MjT.js} +1 -1
- langflow/frontend/assets/{index-IFGgPiye.js → index-H7J7w7fa.js} +1 -1
- langflow/frontend/assets/{index-lKEJpUsF.js → index-KWY77KfV.js} +1 -1
- langflow/frontend/assets/{index-DDNNv4C0.js → index-U9GWm1eH.js} +1 -1
- langflow/frontend/assets/{index-BRWNIt9F.js → index-Un9pWxnP.js} +1 -1
- langflow/frontend/assets/{index-BCK-ZyIh.js → index-Xi4TplbI.js} +1 -1
- langflow/frontend/assets/{index-BEKoRwsX.js → index-_cbGmjF4.js} +1 -1
- langflow/frontend/assets/{index-7xXgqu09.js → index-cEXY6V06.js} +1 -1
- langflow/frontend/assets/{index-D87Zw62M.js → index-dyXKnkMi.js} +1 -1
- langflow/frontend/assets/{index-CG7cp0nD.js → index-eUkS6iJM.js} +1 -1
- langflow/frontend/assets/{index-CoUlHbtg.js → index-ekfMOqrF.js} +1 -1
- langflow/frontend/assets/{index-DhzEUXfr.js → index-gdb7XMS8.js} +1 -1
- langflow/frontend/assets/{index-D9eflZfP.js → index-hZUcL0MZ.js} +1 -1
- langflow/frontend/assets/{index-CwIxqYlT.js → index-kkA-qHB_.js} +1 -1
- langflow/frontend/assets/{index-sS6XLk3j.js → index-mzl9ULw5.js} +1 -1
- langflow/frontend/assets/{index-BjENqyKe.js → index-oxHBZk2v.js} +1 -1
- langflow/frontend/assets/{index-BejHxU5W.js → index-p2kStSPe.js} +1 -1
- langflow/frontend/assets/{index-BOYTBrh9.js → index-paQEWYGT.js} +1 -1
- langflow/frontend/assets/{index-Cd5zuUUK.js → index-r_8gs4nL.js} +1 -1
- langflow/frontend/assets/{index-AlJ7td-D.js → index-uiKla4UR.js} +1 -1
- langflow/frontend/assets/{index-B8y58M9b.js → index-vJOO5U8M.js} +1 -1
- langflow/frontend/assets/{index-CF4dtI6S.js → index-w72fDjpG.js} +1 -1
- langflow/frontend/assets/{index-C2Xd7UkR.js → index-zV82kQ6k.js} +1 -1
- langflow/frontend/assets/lazyIconImports-DTNgvPE-.js +2 -0
- langflow/frontend/assets/{use-post-add-user-HN0rRnhv.js → use-post-add-user-CvtuazTg.js} +1 -1
- langflow/frontend/index.html +1 -1
- langflow/graph/edge/base.py +2 -3
- langflow/graph/graph/base.py +14 -12
- 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/Blog Writer.json +2 -2
- langflow/initial_setup/starter_projects/Custom Component Generator.json +2 -2
- langflow/initial_setup/starter_projects/Document Q&A.json +1 -1
- langflow/initial_setup/starter_projects/Hybrid Search RAG.json +2 -2
- langflow/initial_setup/starter_projects/Instagram Copywriter.json +3 -3
- langflow/initial_setup/starter_projects/Invoice Summarizer.json +1 -1
- langflow/initial_setup/starter_projects/Knowledge Ingestion.json +4 -4
- langflow/initial_setup/starter_projects/Knowledge Retrieval.json +2 -2
- langflow/initial_setup/starter_projects/Market Research.json +3 -3
- langflow/initial_setup/starter_projects/Meeting Summary.json +6 -6
- langflow/initial_setup/starter_projects/Memory Chatbot.json +2 -2
- langflow/initial_setup/starter_projects/News Aggregator.json +5 -22
- langflow/initial_setup/starter_projects/Nvidia Remix.json +3 -20
- langflow/initial_setup/starter_projects/Pok/303/251dex Agent.json" +1 -1
- langflow/initial_setup/starter_projects/Portfolio Website Code Generator.json +1 -1
- langflow/initial_setup/starter_projects/Price Deal Finder.json +5 -5
- langflow/initial_setup/starter_projects/Research Agent.json +3 -3
- langflow/initial_setup/starter_projects/SaaS Pricing.json +1 -1
- langflow/initial_setup/starter_projects/Search agent.json +1 -1
- langflow/initial_setup/starter_projects/Sequential Tasks Agents.json +7 -7
- langflow/initial_setup/starter_projects/Simple Agent.json +3 -3
- langflow/initial_setup/starter_projects/Social Media Agent.json +1 -1
- langflow/initial_setup/starter_projects/Text Sentiment Analysis.json +1 -1
- langflow/initial_setup/starter_projects/Travel Planning Agents.json +3 -3
- langflow/initial_setup/starter_projects/Vector Store RAG.json +5 -5
- langflow/initial_setup/starter_projects/Youtube Analysis.json +3 -3
- 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 +4 -4
- 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/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/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.dev36.dist-info → langflow_base_nightly-0.5.0.dev38.dist-info}/METADATA +2 -1
- {langflow_base_nightly-0.5.0.dev36.dist-info → langflow_base_nightly-0.5.0.dev38.dist-info}/RECORD +342 -340
- langflow/frontend/assets/lazyIconImports-Bh1TFfvH.js +0 -2
- {langflow_base_nightly-0.5.0.dev36.dist-info → langflow_base_nightly-0.5.0.dev38.dist-info}/WHEEL +0 -0
- {langflow_base_nightly-0.5.0.dev36.dist-info → langflow_base_nightly-0.5.0.dev38.dist-info}/entry_points.txt +0 -0
|
@@ -245,11 +245,13 @@ class ChatOllamaComponent(LCModelComponent):
|
|
|
245
245
|
if field_name in {"model_name", "base_url", "tool_model_enabled"}:
|
|
246
246
|
if await self.is_valid_ollama_url(self.base_url):
|
|
247
247
|
tool_model_enabled = build_config["tool_model_enabled"].get("value", False) or self.tool_model_enabled
|
|
248
|
-
build_config["model_name"]["options"] = await self.get_models(
|
|
248
|
+
build_config["model_name"]["options"] = await self.get_models(
|
|
249
|
+
self.base_url, tool_model_enabled=tool_model_enabled
|
|
250
|
+
)
|
|
249
251
|
elif await self.is_valid_ollama_url(build_config["base_url"].get("value", "")):
|
|
250
252
|
tool_model_enabled = build_config["tool_model_enabled"].get("value", False) or self.tool_model_enabled
|
|
251
253
|
build_config["model_name"]["options"] = await self.get_models(
|
|
252
|
-
build_config["base_url"].get("value", ""), tool_model_enabled
|
|
254
|
+
build_config["base_url"].get("value", ""), tool_model_enabled=tool_model_enabled
|
|
253
255
|
)
|
|
254
256
|
else:
|
|
255
257
|
build_config["model_name"]["options"] = []
|
|
@@ -265,7 +267,7 @@ class ChatOllamaComponent(LCModelComponent):
|
|
|
265
267
|
|
|
266
268
|
return build_config
|
|
267
269
|
|
|
268
|
-
async def get_models(self, base_url_value: str, tool_model_enabled: bool | None = None) -> list[str]:
|
|
270
|
+
async def get_models(self, base_url_value: str, *, tool_model_enabled: bool | None = None) -> list[str]:
|
|
269
271
|
"""Fetches a list of models from the Ollama API that do not have the "embedding" capability.
|
|
270
272
|
|
|
271
273
|
Args:
|
|
@@ -298,13 +300,13 @@ class ChatOllamaComponent(LCModelComponent):
|
|
|
298
300
|
models = tags_response.json()
|
|
299
301
|
if asyncio.iscoroutine(models):
|
|
300
302
|
models = await models
|
|
301
|
-
logger.
|
|
303
|
+
await logger.adebug(f"Available models: {models}")
|
|
302
304
|
|
|
303
305
|
# Filter models that are NOT embedding models
|
|
304
306
|
model_ids = []
|
|
305
307
|
for model in models[self.JSON_MODELS_KEY]:
|
|
306
308
|
model_name = model[self.JSON_NAME_KEY]
|
|
307
|
-
logger.
|
|
309
|
+
await logger.adebug(f"Checking model: {model_name}")
|
|
308
310
|
|
|
309
311
|
payload = {"model": model_name}
|
|
310
312
|
show_response = await client.post(show_url, json=payload)
|
|
@@ -313,7 +315,7 @@ class ChatOllamaComponent(LCModelComponent):
|
|
|
313
315
|
if asyncio.iscoroutine(json_data):
|
|
314
316
|
json_data = await json_data
|
|
315
317
|
capabilities = json_data.get(self.JSON_CAPABILITIES_KEY, [])
|
|
316
|
-
logger.
|
|
318
|
+
await logger.adebug(f"Model: {model_name}, Capabilities: {capabilities}")
|
|
317
319
|
|
|
318
320
|
if self.DESIRED_CAPABILITY in capabilities and (
|
|
319
321
|
not tool_model_enabled or self.TOOL_CALLING_CAPABILITY in capabilities
|
|
@@ -3,10 +3,10 @@ from __future__ import annotations
|
|
|
3
3
|
from typing import TYPE_CHECKING, Any, cast
|
|
4
4
|
|
|
5
5
|
import toml # type: ignore[import-untyped]
|
|
6
|
-
from loguru import logger
|
|
7
6
|
|
|
8
7
|
from langflow.custom.custom_component.component import Component
|
|
9
8
|
from langflow.io import BoolInput, DataFrameInput, HandleInput, MessageTextInput, MultilineInput, Output
|
|
9
|
+
from langflow.logging.logger import logger
|
|
10
10
|
from langflow.schema.dataframe import DataFrame
|
|
11
11
|
|
|
12
12
|
if TYPE_CHECKING:
|
|
@@ -144,11 +144,11 @@ class BatchRunComponent(Component):
|
|
|
144
144
|
user_texts = df[col_name].astype(str).tolist()
|
|
145
145
|
else:
|
|
146
146
|
user_texts = [
|
|
147
|
-
self._format_row_as_toml(cast(dict[str, Any], row)) for row in df.to_dict(orient="records")
|
|
147
|
+
self._format_row_as_toml(cast("dict[str, Any]", row)) for row in df.to_dict(orient="records")
|
|
148
148
|
]
|
|
149
149
|
|
|
150
150
|
total_rows = len(user_texts)
|
|
151
|
-
logger.
|
|
151
|
+
await logger.ainfo(f"Processing {total_rows} rows with batch run")
|
|
152
152
|
|
|
153
153
|
# Prepare the batch of conversations
|
|
154
154
|
conversations = [
|
|
@@ -185,21 +185,21 @@ class BatchRunComponent(Component):
|
|
|
185
185
|
):
|
|
186
186
|
response_text = response[1].content if hasattr(response[1], "content") else str(response[1])
|
|
187
187
|
row = self._create_base_row(
|
|
188
|
-
cast(dict[str, Any], original_row), model_response=response_text, batch_index=idx
|
|
188
|
+
cast("dict[str, Any]", original_row), model_response=response_text, batch_index=idx
|
|
189
189
|
)
|
|
190
190
|
self._add_metadata(row, success=True, system_msg=system_msg)
|
|
191
191
|
rows.append(row)
|
|
192
192
|
|
|
193
193
|
# Log progress
|
|
194
194
|
if (idx + 1) % max(1, total_rows // 10) == 0:
|
|
195
|
-
logger.
|
|
195
|
+
await logger.ainfo(f"Processed {idx + 1}/{total_rows} rows")
|
|
196
196
|
|
|
197
|
-
logger.
|
|
197
|
+
await logger.ainfo("Batch processing completed successfully")
|
|
198
198
|
return DataFrame(rows)
|
|
199
199
|
|
|
200
200
|
except (KeyError, AttributeError) as e:
|
|
201
201
|
# Handle data structure and attribute access errors
|
|
202
|
-
logger.
|
|
203
|
-
error_row = self._create_base_row(
|
|
202
|
+
await logger.aerror(f"Data processing error: {e!s}")
|
|
203
|
+
error_row = self._create_base_row(dict.fromkeys(df.columns, ""), model_response="", batch_index=-1)
|
|
204
204
|
self._add_metadata(error_row, success=False, error=str(e))
|
|
205
205
|
return DataFrame([error_row])
|
|
@@ -181,7 +181,7 @@ class DataOperationsComponent(Component):
|
|
|
181
181
|
raise ValueError(msg)
|
|
182
182
|
|
|
183
183
|
# Data transformation operations
|
|
184
|
-
def select_keys(self, evaluate: bool | None = None) -> Data:
|
|
184
|
+
def select_keys(self, *, evaluate: bool | None = None) -> Data:
|
|
185
185
|
"""Select specific keys from the data dictionary."""
|
|
186
186
|
self.validate_single_data("Select Keys")
|
|
187
187
|
data_dict = self.get_normalized_data()
|
|
@@ -266,7 +266,7 @@ class DataOperationsComponent(Component):
|
|
|
266
266
|
logger.info("evaluating data")
|
|
267
267
|
return Data(**self.recursive_eval(self.get_data_dict()))
|
|
268
268
|
|
|
269
|
-
def combine_data(self, evaluate: bool | None = None) -> Data:
|
|
269
|
+
def combine_data(self, *, evaluate: bool | None = None) -> Data:
|
|
270
270
|
"""Combine multiple data objects into one."""
|
|
271
271
|
logger.info("combining data")
|
|
272
272
|
if not self.data_is_list():
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
from enum import Enum
|
|
2
2
|
from typing import cast
|
|
3
3
|
|
|
4
|
-
from loguru import logger
|
|
5
|
-
|
|
6
4
|
from langflow.custom.custom_component.component import Component
|
|
7
5
|
from langflow.io import DataInput, DropdownInput, Output
|
|
6
|
+
from langflow.logging.logger import logger
|
|
8
7
|
from langflow.schema.dataframe import DataFrame
|
|
9
8
|
|
|
10
9
|
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
from loguru import logger
|
|
2
|
-
|
|
3
1
|
from langflow.custom.custom_component.component import Component
|
|
4
2
|
from langflow.io import MessageInput, Output
|
|
3
|
+
from langflow.logging.logger import logger
|
|
5
4
|
from langflow.schema.data import Data
|
|
6
5
|
from langflow.schema.message import Message
|
|
7
6
|
|
|
@@ -32,6 +31,6 @@ class MessageToDataComponent(Component):
|
|
|
32
31
|
return Data(data=self.message.data)
|
|
33
32
|
|
|
34
33
|
msg = "Error converting Message to Data: Input must be a Message object"
|
|
35
|
-
logger.
|
|
34
|
+
logger.debug(msg, exc_info=True)
|
|
36
35
|
self.status = msg
|
|
37
36
|
return Data(data={"error": msg})
|
|
@@ -3,11 +3,11 @@ from json import JSONDecodeError
|
|
|
3
3
|
|
|
4
4
|
import jq
|
|
5
5
|
from json_repair import repair_json
|
|
6
|
-
from loguru import logger
|
|
7
6
|
|
|
8
7
|
from langflow.custom.custom_component.component import Component
|
|
9
8
|
from langflow.inputs.inputs import HandleInput, MessageTextInput
|
|
10
9
|
from langflow.io import Output
|
|
10
|
+
from langflow.logging.logger import logger
|
|
11
11
|
from langflow.schema.data import Data
|
|
12
12
|
from langflow.schema.message import Message
|
|
13
13
|
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import json
|
|
2
2
|
from collections.abc import AsyncIterator, Iterator
|
|
3
3
|
from pathlib import Path
|
|
4
|
-
from typing import TYPE_CHECKING
|
|
5
4
|
|
|
6
5
|
import orjson
|
|
7
6
|
import pandas as pd
|
|
@@ -10,16 +9,12 @@ from fastapi.encoders import jsonable_encoder
|
|
|
10
9
|
|
|
11
10
|
from langflow.api.v2.files import upload_user_file
|
|
12
11
|
from langflow.custom import Component
|
|
13
|
-
from langflow.io import DropdownInput, HandleInput,
|
|
12
|
+
from langflow.io import DropdownInput, HandleInput, StrInput
|
|
14
13
|
from langflow.schema import Data, DataFrame, Message
|
|
15
|
-
from langflow.services.auth.utils import create_user_longterm_token, get_current_user
|
|
16
14
|
from langflow.services.database.models.user.crud import get_user_by_id
|
|
17
|
-
from langflow.services.deps import
|
|
15
|
+
from langflow.services.deps import get_settings_service, get_storage_service, session_scope
|
|
18
16
|
from langflow.template.field.base import Output
|
|
19
17
|
|
|
20
|
-
if TYPE_CHECKING:
|
|
21
|
-
from langflow.services.database.models.user.model import User
|
|
22
|
-
|
|
23
18
|
|
|
24
19
|
class SaveToFileComponent(Component):
|
|
25
20
|
display_name = "Save File"
|
|
@@ -55,13 +50,6 @@ class SaveToFileComponent(Component):
|
|
|
55
50
|
value="",
|
|
56
51
|
advanced=True,
|
|
57
52
|
),
|
|
58
|
-
SecretStrInput(
|
|
59
|
-
name="api_key",
|
|
60
|
-
display_name="Langflow API Key",
|
|
61
|
-
info="Langflow API key for authentication when saving the file.",
|
|
62
|
-
required=False,
|
|
63
|
-
advanced=True,
|
|
64
|
-
),
|
|
65
53
|
]
|
|
66
54
|
|
|
67
55
|
outputs = [Output(display_name="File Path", name="message", method="save_to_file")]
|
|
@@ -148,25 +136,11 @@ class SaveToFileComponent(Component):
|
|
|
148
136
|
raise FileNotFoundError(msg)
|
|
149
137
|
|
|
150
138
|
with file_path.open("rb") as f:
|
|
151
|
-
async
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
current_user: User | None = None
|
|
155
|
-
if self.api_key:
|
|
156
|
-
current_user = await get_current_user(
|
|
157
|
-
token="",
|
|
158
|
-
query_param=self.api_key,
|
|
159
|
-
header_param="",
|
|
160
|
-
db=db,
|
|
161
|
-
)
|
|
162
|
-
else:
|
|
163
|
-
user_id, _ = await create_user_longterm_token(db)
|
|
164
|
-
current_user = await get_user_by_id(db, user_id)
|
|
165
|
-
|
|
166
|
-
# Fail if the user is not found
|
|
167
|
-
if not current_user:
|
|
168
|
-
msg = "User not found. Please provide a valid API key or ensure the user exists."
|
|
139
|
+
async with session_scope() as db:
|
|
140
|
+
if not self.user_id:
|
|
141
|
+
msg = "User ID is required for file saving."
|
|
169
142
|
raise ValueError(msg)
|
|
143
|
+
current_user = await get_user_by_id(db, self.user_id)
|
|
170
144
|
|
|
171
145
|
await upload_user_file(
|
|
172
146
|
file=UploadFile(filename=file_path.name, file=f, size=file_path.stat().st_size),
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
from collections.abc import Callable
|
|
2
2
|
|
|
3
|
-
from loguru import logger
|
|
4
|
-
|
|
5
3
|
from langflow.custom.custom_component.component import Component
|
|
6
4
|
from langflow.custom.utils import get_function
|
|
7
5
|
from langflow.io import CodeInput, Output
|
|
6
|
+
from langflow.logging.logger import logger
|
|
8
7
|
from langflow.schema.data import Data
|
|
9
8
|
from langflow.schema.dotdict import dotdict
|
|
10
9
|
from langflow.schema.message import Message
|
|
@@ -58,7 +57,7 @@ class PythonFunctionComponent(Component):
|
|
|
58
57
|
func = get_function(function_code)
|
|
59
58
|
return func()
|
|
60
59
|
except Exception as e: # noqa: BLE001
|
|
61
|
-
logger.
|
|
60
|
+
logger.debug("Error executing function", exc_info=True)
|
|
62
61
|
return f"Error executing function: {e}"
|
|
63
62
|
|
|
64
63
|
def execute_function_data(self) -> list[Data]:
|
|
@@ -2,12 +2,12 @@ from typing import Any
|
|
|
2
2
|
|
|
3
3
|
from langchain_community.utilities.serpapi import SerpAPIWrapper
|
|
4
4
|
from langchain_core.tools import ToolException
|
|
5
|
-
from loguru import logger
|
|
6
5
|
from pydantic import BaseModel, Field
|
|
7
6
|
|
|
8
7
|
from langflow.custom.custom_component.component import Component
|
|
9
8
|
from langflow.inputs.inputs import DictInput, IntInput, MultilineInput, SecretStrInput
|
|
10
9
|
from langflow.io import Output
|
|
10
|
+
from langflow.logging.logger import logger
|
|
11
11
|
from langflow.schema.data import Data
|
|
12
12
|
from langflow.schema.message import Message
|
|
13
13
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import httpx
|
|
2
|
-
from loguru import logger
|
|
3
2
|
|
|
4
3
|
from langflow.custom import Component
|
|
5
4
|
from langflow.io import BoolInput, DropdownInput, MessageTextInput, Output, SecretStrInput
|
|
5
|
+
from langflow.logging.logger import logger
|
|
6
6
|
from langflow.schema import Data
|
|
7
7
|
from langflow.schema.dataframe import DataFrame
|
|
8
8
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import httpx
|
|
2
|
-
from loguru import logger
|
|
3
2
|
|
|
4
3
|
from langflow.custom.custom_component.component import Component
|
|
5
4
|
from langflow.inputs.inputs import BoolInput, DropdownInput, IntInput, MessageTextInput, SecretStrInput
|
|
5
|
+
from langflow.logging.logger import logger
|
|
6
6
|
from langflow.schema.data import Data
|
|
7
7
|
from langflow.schema.dataframe import DataFrame
|
|
8
8
|
from langflow.template.field.base import Output
|
|
@@ -3,12 +3,12 @@ import operator
|
|
|
3
3
|
|
|
4
4
|
from langchain.tools import StructuredTool
|
|
5
5
|
from langchain_core.tools import ToolException
|
|
6
|
-
from loguru import logger
|
|
7
6
|
from pydantic import BaseModel, Field
|
|
8
7
|
|
|
9
8
|
from langflow.base.langchain_utilities.model import LCToolComponent
|
|
10
9
|
from langflow.field_typing import Tool
|
|
11
10
|
from langflow.inputs.inputs import MessageTextInput
|
|
11
|
+
from langflow.logging.logger import logger
|
|
12
12
|
from langflow.schema.data import Data
|
|
13
13
|
|
|
14
14
|
|
|
@@ -87,7 +87,7 @@ class CalculatorToolComponent(LCToolComponent):
|
|
|
87
87
|
self.status = error_message
|
|
88
88
|
return [Data(data={"error": error_message, "input": expression})]
|
|
89
89
|
except Exception as e: # noqa: BLE001
|
|
90
|
-
logger.
|
|
90
|
+
logger.debug("Error evaluating expression", exc_info=True)
|
|
91
91
|
error_message = f"Error: {e}"
|
|
92
92
|
self.status = error_message
|
|
93
93
|
return [Data(data={"error": error_message, "input": expression})]
|
|
@@ -4,21 +4,14 @@ from typing import Any
|
|
|
4
4
|
|
|
5
5
|
from langchain.agents import Tool
|
|
6
6
|
from langchain_core.tools import StructuredTool
|
|
7
|
-
from loguru import logger
|
|
8
7
|
from pydantic.v1 import Field, create_model
|
|
9
8
|
from pydantic.v1.fields import Undefined
|
|
10
9
|
from typing_extensions import override
|
|
11
10
|
|
|
12
11
|
from langflow.base.langchain_utilities.model import LCToolComponent
|
|
13
|
-
from langflow.inputs.inputs import
|
|
14
|
-
BoolInput,
|
|
15
|
-
DropdownInput,
|
|
16
|
-
FieldTypes,
|
|
17
|
-
HandleInput,
|
|
18
|
-
MessageTextInput,
|
|
19
|
-
MultilineInput,
|
|
20
|
-
)
|
|
12
|
+
from langflow.inputs.inputs import BoolInput, DropdownInput, FieldTypes, HandleInput, MessageTextInput, MultilineInput
|
|
21
13
|
from langflow.io import Output
|
|
14
|
+
from langflow.logging.logger import logger
|
|
22
15
|
from langflow.schema.data import Data
|
|
23
16
|
from langflow.schema.dotdict import dotdict
|
|
24
17
|
|
|
@@ -139,7 +132,7 @@ class PythonCodeStructuredTool(LCToolComponent):
|
|
|
139
132
|
build_config["tool_function"]["options"] = names
|
|
140
133
|
except Exception as e: # noqa: BLE001
|
|
141
134
|
self.status = f"Failed to extract names: {e}"
|
|
142
|
-
logger.
|
|
135
|
+
logger.debug(self.status, exc_info=True)
|
|
143
136
|
build_config["tool_function"]["options"] = ["Failed to parse", str(e)]
|
|
144
137
|
return build_config
|
|
145
138
|
|
|
@@ -3,12 +3,12 @@ import importlib
|
|
|
3
3
|
from langchain.tools import StructuredTool
|
|
4
4
|
from langchain_core.tools import ToolException
|
|
5
5
|
from langchain_experimental.utilities import PythonREPL
|
|
6
|
-
from loguru import logger
|
|
7
6
|
from pydantic import BaseModel, Field
|
|
8
7
|
|
|
9
8
|
from langflow.base.langchain_utilities.model import LCToolComponent
|
|
10
9
|
from langflow.field_typing import Tool
|
|
11
10
|
from langflow.inputs.inputs import StrInput
|
|
11
|
+
from langflow.logging.logger import logger
|
|
12
12
|
from langflow.schema.data import Data
|
|
13
13
|
|
|
14
14
|
|
|
@@ -78,7 +78,7 @@ class PythonREPLToolComponent(LCToolComponent):
|
|
|
78
78
|
try:
|
|
79
79
|
return python_repl.run(code)
|
|
80
80
|
except Exception as e:
|
|
81
|
-
logger.
|
|
81
|
+
logger.debug("Error running Python code", exc_info=True)
|
|
82
82
|
raise ToolException(str(e)) from e
|
|
83
83
|
|
|
84
84
|
tool = StructuredTool.from_function(
|
|
@@ -5,12 +5,12 @@ from typing import Any
|
|
|
5
5
|
import requests
|
|
6
6
|
from langchain.agents import Tool
|
|
7
7
|
from langchain_core.tools import StructuredTool
|
|
8
|
-
from loguru import logger
|
|
9
8
|
from pydantic.v1 import Field, create_model
|
|
10
9
|
|
|
11
10
|
from langflow.base.langchain_utilities.model import LCToolComponent
|
|
12
11
|
from langflow.inputs.inputs import DropdownInput, IntInput, MessageTextInput, MultiselectInput
|
|
13
12
|
from langflow.io import Output
|
|
13
|
+
from langflow.logging.logger import logger
|
|
14
14
|
from langflow.schema.dotdict import dotdict
|
|
15
15
|
|
|
16
16
|
|
|
@@ -76,7 +76,7 @@ class SearXNGToolComponent(LCToolComponent):
|
|
|
76
76
|
build_config["language"]["options"] = languages.copy()
|
|
77
77
|
except Exception as e: # noqa: BLE001
|
|
78
78
|
self.status = f"Failed to extract names: {e}"
|
|
79
|
-
logger.
|
|
79
|
+
logger.debug(self.status, exc_info=True)
|
|
80
80
|
build_config["categories"]["options"] = ["Failed to parse", str(e)]
|
|
81
81
|
return build_config
|
|
82
82
|
|
|
@@ -112,7 +112,7 @@ class SearXNGToolComponent(LCToolComponent):
|
|
|
112
112
|
num_results = min(SearxSearch._max_results, len(response["results"]))
|
|
113
113
|
return [response["results"][i] for i in range(num_results)]
|
|
114
114
|
except Exception as e: # noqa: BLE001
|
|
115
|
-
logger.
|
|
115
|
+
logger.debug("Error running SearXNG Search", exc_info=True)
|
|
116
116
|
return [f"Failed to search: {e}"]
|
|
117
117
|
|
|
118
118
|
SearxSearch._url = self.url
|
|
@@ -3,12 +3,12 @@ from typing import Any
|
|
|
3
3
|
from langchain.tools import StructuredTool
|
|
4
4
|
from langchain_community.utilities.serpapi import SerpAPIWrapper
|
|
5
5
|
from langchain_core.tools import ToolException
|
|
6
|
-
from loguru import logger
|
|
7
6
|
from pydantic import BaseModel, Field
|
|
8
7
|
|
|
9
8
|
from langflow.base.langchain_utilities.model import LCToolComponent
|
|
10
9
|
from langflow.field_typing import Tool
|
|
11
10
|
from langflow.inputs.inputs import DictInput, IntInput, MultilineInput, SecretStrInput
|
|
11
|
+
from langflow.logging.logger import logger
|
|
12
12
|
from langflow.schema.data import Data
|
|
13
13
|
|
|
14
14
|
|
|
@@ -111,7 +111,7 @@ class SerpAPIComponent(LCToolComponent):
|
|
|
111
111
|
data_list = [Data(data=result, text=result.get("snippet", "")) for result in results]
|
|
112
112
|
|
|
113
113
|
except Exception as e: # noqa: BLE001
|
|
114
|
-
logger.
|
|
114
|
+
logger.debug("Error running SerpAPI", exc_info=True)
|
|
115
115
|
self.status = f"Error: {e}"
|
|
116
116
|
return [Data(data={"error": str(e)}, text=str(e))]
|
|
117
117
|
|
|
@@ -3,12 +3,12 @@ from enum import Enum
|
|
|
3
3
|
import httpx
|
|
4
4
|
from langchain.tools import StructuredTool
|
|
5
5
|
from langchain_core.tools import ToolException
|
|
6
|
-
from loguru import logger
|
|
7
6
|
from pydantic import BaseModel, Field
|
|
8
7
|
|
|
9
8
|
from langflow.base.langchain_utilities.model import LCToolComponent
|
|
10
9
|
from langflow.field_typing import Tool
|
|
11
10
|
from langflow.inputs.inputs import BoolInput, DropdownInput, IntInput, MessageTextInput, SecretStrInput
|
|
11
|
+
from langflow.logging.logger import logger
|
|
12
12
|
from langflow.schema.data import Data
|
|
13
13
|
|
|
14
14
|
# Add at the top with other constants
|
|
@@ -338,7 +338,7 @@ Note: Check 'Advanced' for all options.
|
|
|
338
338
|
raise ToolException(error_message) from e
|
|
339
339
|
except Exception as e:
|
|
340
340
|
error_message = f"Unexpected error: {e}"
|
|
341
|
-
logger.
|
|
341
|
+
logger.debug("Error running Tavily Search", exc_info=True)
|
|
342
342
|
self.status = error_message
|
|
343
343
|
raise ToolException(error_message) from e
|
|
344
344
|
return data_results
|
|
@@ -5,12 +5,12 @@ from enum import Enum
|
|
|
5
5
|
import yfinance as yf
|
|
6
6
|
from langchain.tools import StructuredTool
|
|
7
7
|
from langchain_core.tools import ToolException
|
|
8
|
-
from loguru import logger
|
|
9
8
|
from pydantic import BaseModel, Field
|
|
10
9
|
|
|
11
10
|
from langflow.base.langchain_utilities.model import LCToolComponent
|
|
12
11
|
from langflow.field_typing import Tool
|
|
13
12
|
from langflow.inputs.inputs import DropdownInput, IntInput, MessageTextInput
|
|
13
|
+
from langflow.logging.logger import logger
|
|
14
14
|
from langflow.schema.data import Data
|
|
15
15
|
|
|
16
16
|
|
|
@@ -29,9 +29,9 @@ class TwelveLabsVideoEmbeddings(Embeddings):
|
|
|
29
29
|
|
|
30
30
|
# First try to use video embedding, then fall back to clip embedding if available
|
|
31
31
|
if result["video_embedding"] is not None:
|
|
32
|
-
embeddings.append(cast(list[float], result["video_embedding"]))
|
|
32
|
+
embeddings.append(cast("list[float]", result["video_embedding"]))
|
|
33
33
|
elif result["clip_embeddings"] and len(result["clip_embeddings"]) > 0:
|
|
34
|
-
embeddings.append(cast(list[float], result["clip_embeddings"][0]))
|
|
34
|
+
embeddings.append(cast("list[float]", result["clip_embeddings"][0]))
|
|
35
35
|
else:
|
|
36
36
|
# If neither is available, raise an error
|
|
37
37
|
error_msg = "No embeddings were generated for the video"
|
|
@@ -45,9 +45,9 @@ class TwelveLabsVideoEmbeddings(Embeddings):
|
|
|
45
45
|
|
|
46
46
|
# First try to use video embedding, then fall back to clip embedding if available
|
|
47
47
|
if result["video_embedding"] is not None:
|
|
48
|
-
return cast(list[float], result["video_embedding"])
|
|
48
|
+
return cast("list[float]", result["video_embedding"])
|
|
49
49
|
if result["clip_embeddings"] and len(result["clip_embeddings"]) > 0:
|
|
50
|
-
return cast(list[float], result["clip_embeddings"][0])
|
|
50
|
+
return cast("list[float]", result["clip_embeddings"][0])
|
|
51
51
|
# If neither is available, raise an error
|
|
52
52
|
error_msg = "No embeddings were generated for the video"
|
|
53
53
|
raise ValueError(error_msg)
|
|
@@ -161,11 +161,11 @@ class AstraDBVectorStoreComponent(LCVectorStoreComponent):
|
|
|
161
161
|
dialog_inputs=asdict(NewDatabaseInput()),
|
|
162
162
|
combobox=True,
|
|
163
163
|
),
|
|
164
|
-
|
|
164
|
+
DropdownInput(
|
|
165
165
|
name="api_endpoint",
|
|
166
166
|
display_name="Astra DB API Endpoint",
|
|
167
167
|
info="The API Endpoint for the Astra DB instance. Supercedes database selection.",
|
|
168
|
-
|
|
168
|
+
advanced=True,
|
|
169
169
|
),
|
|
170
170
|
DropdownInput(
|
|
171
171
|
name="keyspace",
|
|
@@ -224,7 +224,6 @@ class AstraDBVectorStoreComponent(LCVectorStoreComponent):
|
|
|
224
224
|
separator=" ",
|
|
225
225
|
show=False,
|
|
226
226
|
value="",
|
|
227
|
-
advanced=True,
|
|
228
227
|
),
|
|
229
228
|
IntInput(
|
|
230
229
|
name="number_of_results",
|
|
@@ -448,14 +447,14 @@ class AstraDBVectorStoreComponent(LCVectorStoreComponent):
|
|
|
448
447
|
for db in db_list:
|
|
449
448
|
try:
|
|
450
449
|
# Get the API endpoint for the database
|
|
451
|
-
|
|
450
|
+
api_endpoints = [db_reg.api_endpoint for db_reg in db.regions]
|
|
452
451
|
|
|
453
452
|
# Get the number of collections
|
|
454
453
|
try:
|
|
455
454
|
# Get the number of collections in the database
|
|
456
455
|
num_collections = len(
|
|
457
456
|
client.get_database(
|
|
458
|
-
|
|
457
|
+
api_endpoints[0],
|
|
459
458
|
token=token,
|
|
460
459
|
).list_collection_names()
|
|
461
460
|
)
|
|
@@ -466,7 +465,7 @@ class AstraDBVectorStoreComponent(LCVectorStoreComponent):
|
|
|
466
465
|
|
|
467
466
|
# Add the database to the dictionary
|
|
468
467
|
db_info_dict[db.name] = {
|
|
469
|
-
"
|
|
468
|
+
"api_endpoints": api_endpoints,
|
|
470
469
|
"keyspaces": db.keyspaces,
|
|
471
470
|
"collections": num_collections,
|
|
472
471
|
"status": db.status if db.status != "ACTIVE" else None,
|
|
@@ -509,7 +508,8 @@ class AstraDBVectorStoreComponent(LCVectorStoreComponent):
|
|
|
509
508
|
return None
|
|
510
509
|
|
|
511
510
|
# Otherwise, get the URL from the database list
|
|
512
|
-
|
|
511
|
+
endpoints = db.get("api_endpoints") or []
|
|
512
|
+
return endpoints[0] if endpoints else None
|
|
513
513
|
|
|
514
514
|
def get_api_endpoint(self):
|
|
515
515
|
return self.get_api_endpoint_static(
|
|
@@ -577,7 +577,7 @@ class AstraDBVectorStoreComponent(LCVectorStoreComponent):
|
|
|
577
577
|
"name": name,
|
|
578
578
|
"status": info["status"],
|
|
579
579
|
"collections": info["collections"],
|
|
580
|
-
"
|
|
580
|
+
"api_endpoints": info["api_endpoints"],
|
|
581
581
|
"keyspaces": info["keyspaces"],
|
|
582
582
|
"org_id": info["org_id"],
|
|
583
583
|
}
|
|
@@ -773,6 +773,7 @@ class AstraDBVectorStoreComponent(LCVectorStoreComponent):
|
|
|
773
773
|
# Reset selections if value not in options
|
|
774
774
|
if database_config["value"] not in database_config["options"]:
|
|
775
775
|
database_config["value"] = ""
|
|
776
|
+
build_config["api_endpoint"]["options"] = []
|
|
776
777
|
build_config["api_endpoint"]["value"] = ""
|
|
777
778
|
build_config["collection_name"]["show"] = False
|
|
778
779
|
|
|
@@ -786,6 +787,7 @@ class AstraDBVectorStoreComponent(LCVectorStoreComponent):
|
|
|
786
787
|
# Reset database configuration
|
|
787
788
|
database_config = build_config["database_name"]
|
|
788
789
|
database_config.update({"options": [], "options_metadata": [], "value": "", "show": False})
|
|
790
|
+
build_config["api_endpoint"]["options"] = []
|
|
789
791
|
build_config["api_endpoint"]["value"] = ""
|
|
790
792
|
|
|
791
793
|
# Reset collection configuration
|
|
@@ -828,13 +830,6 @@ class AstraDBVectorStoreComponent(LCVectorStoreComponent):
|
|
|
828
830
|
build_config["search_method"]["options"] = ["Vector Search"]
|
|
829
831
|
build_config["search_method"]["value"] = "Vector Search"
|
|
830
832
|
|
|
831
|
-
# Set reranker and lexical terms options based on search method
|
|
832
|
-
build_config["reranker"]["toggle_value"] = True
|
|
833
|
-
build_config["reranker"]["show"] = build_config["search_method"]["value"] == "Hybrid Search"
|
|
834
|
-
build_config["reranker"]["toggle_disable"] = build_config["search_method"]["value"] == "Hybrid Search"
|
|
835
|
-
if build_config["reranker"]["show"]:
|
|
836
|
-
build_config["search_type"]["value"] = "Similarity"
|
|
837
|
-
|
|
838
833
|
return build_config
|
|
839
834
|
|
|
840
835
|
async def update_build_config(self, build_config: dict, field_value: str, field_name: str | None = None) -> dict:
|
|
@@ -892,6 +887,7 @@ class AstraDBVectorStoreComponent(LCVectorStoreComponent):
|
|
|
892
887
|
build_config["lexical_terms"]["value"] = "" if is_vector_search else build_config["lexical_terms"]["value"]
|
|
893
888
|
|
|
894
889
|
# Disable reranker disabling if hybrid search is selected
|
|
890
|
+
build_config["reranker"]["show"] = not is_vector_search
|
|
895
891
|
build_config["reranker"]["toggle_disable"] = not is_vector_search
|
|
896
892
|
build_config["reranker"]["toggle_value"] = True
|
|
897
893
|
build_config["reranker"]["value"] = build_config["reranker"]["options"][0]
|
|
@@ -926,7 +922,7 @@ class AstraDBVectorStoreComponent(LCVectorStoreComponent):
|
|
|
926
922
|
{
|
|
927
923
|
"status": "PENDING",
|
|
928
924
|
"collections": 0,
|
|
929
|
-
"
|
|
925
|
+
"api_endpoints": [],
|
|
930
926
|
"keyspaces": [self.get_keyspace()],
|
|
931
927
|
"org_id": None,
|
|
932
928
|
}
|
|
@@ -999,7 +995,12 @@ class AstraDBVectorStoreComponent(LCVectorStoreComponent):
|
|
|
999
995
|
|
|
1000
996
|
# Get the api endpoint for the selected database
|
|
1001
997
|
index = build_config["database_name"]["options"].index(field_value)
|
|
1002
|
-
build_config["api_endpoint"]["
|
|
998
|
+
build_config["api_endpoint"]["options"] = build_config["database_name"]["options_metadata"][index][
|
|
999
|
+
"api_endpoints"
|
|
1000
|
+
]
|
|
1001
|
+
build_config["api_endpoint"]["value"] = build_config["database_name"]["options_metadata"][index][
|
|
1002
|
+
"api_endpoints"
|
|
1003
|
+
][0]
|
|
1003
1004
|
|
|
1004
1005
|
# Get the org_id for the selected database
|
|
1005
1006
|
org_id = build_config["database_name"]["options_metadata"][index]["org_id"]
|
|
@@ -1077,8 +1078,18 @@ class AstraDBVectorStoreComponent(LCVectorStoreComponent):
|
|
|
1077
1078
|
lex_enabled = col_options.lexical and col_options.lexical.enabled
|
|
1078
1079
|
user_hyb_enabled = build_config["search_method"]["value"] == "Hybrid Search"
|
|
1079
1080
|
|
|
1080
|
-
#
|
|
1081
|
-
|
|
1081
|
+
# Reranker visible when both the collection supports it and the user selected Hybrid
|
|
1082
|
+
hybrid_active = bool(hyb_enabled and user_hyb_enabled)
|
|
1083
|
+
build_config["reranker"]["show"] = hybrid_active
|
|
1084
|
+
build_config["reranker"]["toggle_value"] = hybrid_active
|
|
1085
|
+
build_config["reranker"]["toggle_disable"] = False # allow user to toggle if visible
|
|
1086
|
+
|
|
1087
|
+
# If hybrid is active, lock search_type to "Similarity"
|
|
1088
|
+
if hybrid_active:
|
|
1089
|
+
build_config["search_type"]["value"] = "Similarity"
|
|
1090
|
+
|
|
1091
|
+
# Show the lexical terms option only if the collection enables lexical search
|
|
1092
|
+
build_config["lexical_terms"]["show"] = bool(lex_enabled)
|
|
1082
1093
|
|
|
1083
1094
|
return build_config
|
|
1084
1095
|
|