lfx-nightly 0.1.11.dev6__py3-none-any.whl → 0.1.12.dev0__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.
@@ -133,7 +133,7 @@ def docling_worker(file_paths: list[str], queue, pipeline: str, ocr_engine: str)
133
133
  check_shutdown() # Check before heavy operations
134
134
 
135
135
  pipeline_options = PdfPipelineOptions()
136
- pipeline_options.do_ocr = ocr_engine != ""
136
+ pipeline_options.do_ocr = ocr_engine not in {"", "None"}
137
137
  if pipeline_options.do_ocr:
138
138
  ocr_factory = get_ocr_factory(
139
139
  allow_external_plugins=False,
lfx/custom/validate.py CHANGED
@@ -298,6 +298,28 @@ def create_type_ignore_class():
298
298
  return TypeIgnore
299
299
 
300
300
 
301
+ def _import_module_with_warnings(module_name):
302
+ """Import module with appropriate warning suppression."""
303
+ if "langchain" in module_name:
304
+ with warnings.catch_warnings():
305
+ warnings.simplefilter("ignore", LangChainDeprecationWarning)
306
+ return importlib.import_module(module_name)
307
+ else:
308
+ return importlib.import_module(module_name)
309
+
310
+
311
+ def _handle_module_attributes(imported_module, node, module_name, exec_globals):
312
+ """Handle importing specific attributes from a module."""
313
+ for alias in node.names:
314
+ try:
315
+ # First try getting it as an attribute
316
+ exec_globals[alias.name] = getattr(imported_module, alias.name)
317
+ except AttributeError:
318
+ # If that fails, try importing the full module path
319
+ full_module_path = f"{module_name}.{alias.name}"
320
+ exec_globals[alias.name] = importlib.import_module(full_module_path)
321
+
322
+
301
323
  def prepare_global_scope(module):
302
324
  """Prepares the global scope with necessary imports from the provided code module.
303
325
 
@@ -334,27 +356,31 @@ def prepare_global_scope(module):
334
356
  raise ModuleNotFoundError(msg) from e
335
357
 
336
358
  for node in import_froms:
337
- try:
338
- module_name = node.module
339
- # Apply warning suppression only when needed
340
- if "langchain" in module_name:
341
- with warnings.catch_warnings():
342
- warnings.simplefilter("ignore", LangChainDeprecationWarning)
343
- imported_module = importlib.import_module(module_name)
344
- else:
345
- imported_module = importlib.import_module(module_name)
359
+ module_names_to_try = [node.module]
346
360
 
347
- for alias in node.names:
348
- try:
349
- # First try getting it as an attribute
350
- exec_globals[alias.name] = getattr(imported_module, alias.name)
351
- except AttributeError:
352
- # If that fails, try importing the full module path
353
- full_module_path = f"{module_name}.{alias.name}"
354
- exec_globals[alias.name] = importlib.import_module(full_module_path)
355
- except ModuleNotFoundError as e:
361
+ # If original module starts with langflow, also try lfx equivalent
362
+ if node.module and node.module.startswith("langflow."):
363
+ lfx_module_name = node.module.replace("langflow.", "lfx.", 1)
364
+ module_names_to_try.append(lfx_module_name)
365
+
366
+ success = False
367
+ last_error = None
368
+
369
+ for module_name in module_names_to_try:
370
+ try:
371
+ imported_module = _import_module_with_warnings(module_name)
372
+ _handle_module_attributes(imported_module, node, module_name, exec_globals)
373
+
374
+ success = True
375
+ break
376
+
377
+ except ModuleNotFoundError as e:
378
+ last_error = e
379
+ continue
380
+
381
+ if not success:
356
382
  msg = f"Module {node.module} not found. Please install it and try again"
357
- raise ModuleNotFoundError(msg) from e
383
+ raise ModuleNotFoundError(msg) from last_error
358
384
 
359
385
  if definitions:
360
386
  combined_module = ast.Module(body=definitions, type_ignores=[])
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: lfx-nightly
3
- Version: 0.1.11.dev6
3
+ Version: 0.1.12.dev0
4
4
  Summary: Langflow Executor - A lightweight CLI tool for executing and serving Langflow AI flows
5
5
  Author-email: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
6
6
  Requires-Python: <3.14,>=3.10
@@ -16,6 +16,7 @@ Requires-Dist: fastapi>=0.115.13
16
16
  Requires-Dist: httpx[http2]>=0.24.0
17
17
  Requires-Dist: json-repair>=0.30.3
18
18
  Requires-Dist: langchain-core>=0.3.66
19
+ Requires-Dist: loguru>=0.7.3
19
20
  Requires-Dist: nanoid>=2.0.0
20
21
  Requires-Dist: networkx>=3.4.2
21
22
  Requires-Dist: orjson>=3.10.15
@@ -29,7 +29,7 @@ lfx/base/curl/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
29
29
  lfx/base/curl/parse.py,sha256=Yw6mMbGg7e-ffrBItEUJeTiljneCXlNyt5afzEP9eUI,6094
30
30
  lfx/base/data/__init__.py,sha256=lQsYYMyAg_jA9ZF7oc-LNZsRE2uMGT6g16WzsUByHqs,81
31
31
  lfx/base/data/base_file.py,sha256=XFj3u9OGHcRbWfzslzvvxn-qpaCeX0uUQ0fStUCo65I,25495
32
- lfx/base/data/docling_utils.py,sha256=L0OFVys7QXCQz2BhgiWGdriLotpoC4oiHzE2galIHWk,9730
32
+ lfx/base/data/docling_utils.py,sha256=2kwI_eOPg-Wr2mfuGkOXFsW-53VqV8_F-XUTWruYMXg,9744
33
33
  lfx/base/data/utils.py,sha256=eZJgkOvQ3MaURDfgkH2MiZZOBF5_D0nSlmDY6LgLRik,5960
34
34
  lfx/base/document_transformers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
35
35
  lfx/base/document_transformers/model.py,sha256=etVEmyakiEgflB-fayClPnFRhaEdXfdUu4cqpgtk8ek,1317
@@ -536,7 +536,7 @@ lfx/custom/eval.py,sha256=6iekrFA2xHopjorhU06Je5cksgq9KWCHjr_84ehC58c,378
536
536
  lfx/custom/schema.py,sha256=WwHe0TnNauyiaC17-bKSyEb8K7KJxBtkB32OSbxiICY,678
537
537
  lfx/custom/tree_visitor.py,sha256=sa4j8VTwksN8ejTE9fnnH1TpD6OnnTtlg2KemiI-eQA,601
538
538
  lfx/custom/utils.py,sha256=eFZcNHvpUhb1Fx6Kbvna2wS0coN3Iub8CW0MvrpstMM,35958
539
- lfx/custom/validate.py,sha256=aJvAySmoGiC4KjUL9rNMOYYWxPGThVcHcInIV5aKNMQ,16313
539
+ lfx/custom/validate.py,sha256=d5bZTeYK64P2mOMPEJgbvgvtBxZ5P7XFuXCNof3dXPg,17074
540
540
  lfx/custom/code_parser/__init__.py,sha256=qIwZQdEp1z7ldn0z-GY44wmwRaywN3L6VPoPt6lqx1k,62
541
541
  lfx/custom/code_parser/code_parser.py,sha256=QAqsp4QF607319dClK60BsaiwZLV55n0xeGR-DthSoE,14280
542
542
  lfx/custom/custom_component/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -693,7 +693,7 @@ lfx/utils/schemas.py,sha256=NbOtVQBrn4d0BAu-0H_eCTZI2CXkKZlRY37XCSmuJwc,3865
693
693
  lfx/utils/util.py,sha256=xGR32XDRr_TtruhjnXfI7lEWmk-vgywHAy3kz5SBowc,15725
694
694
  lfx/utils/util_strings.py,sha256=nU_IcdphNaj6bAPbjeL-c1cInQPfTBit8mp5Y57lwQk,1686
695
695
  lfx/utils/version.py,sha256=cHpbO0OJD2JQAvVaTH_6ibYeFbHJV0QDHs_YXXZ-bT8,671
696
- lfx_nightly-0.1.11.dev6.dist-info/METADATA,sha256=V-zghRs6lOJPHN0E1iVd83Ol1G8CIm1TbZEwFvB8E78,7971
697
- lfx_nightly-0.1.11.dev6.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
698
- lfx_nightly-0.1.11.dev6.dist-info/entry_points.txt,sha256=1724p3RHDQRT2CKx_QRzEIa7sFuSVO0Ux70YfXfoMT4,42
699
- lfx_nightly-0.1.11.dev6.dist-info/RECORD,,
696
+ lfx_nightly-0.1.12.dev0.dist-info/METADATA,sha256=2-HWdV_bpI8ChwlifgmnuZ7U8rEfbmdeaszShAytmIw,8000
697
+ lfx_nightly-0.1.12.dev0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
698
+ lfx_nightly-0.1.12.dev0.dist-info/entry_points.txt,sha256=1724p3RHDQRT2CKx_QRzEIa7sFuSVO0Ux70YfXfoMT4,42
699
+ lfx_nightly-0.1.12.dev0.dist-info/RECORD,,