From 8ae543ac69f3d891331e884a462f41608cf249e3 Mon Sep 17 00:00:00 2001 From: Gabriel Luiz Freitas Almeida Date: Mon, 8 Sep 2025 20:11:21 -0300 Subject: [PATCH] Refactor file path handling in LangflowFileService to improve clarity and consistency This commit updates the LangflowFileService class by changing the key for file paths in the tweaks dictionary from "path" to "file_path". This modification enhances code clarity and aligns with best practices for maintaining robust async code. Additionally, it simplifies the logging statement for better readability while preserving the functionality related to JWT token handling. --- src/services/langflow_file_service.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/services/langflow_file_service.py b/src/services/langflow_file_service.py index 494048ed..b2e91fe2 100644 --- a/src/services/langflow_file_service.py +++ b/src/services/langflow_file_service.py @@ -82,15 +82,13 @@ class LangflowFileService: # Pass files via tweaks to File component (File-PSU37 from the flow) if file_paths: - tweaks["File-PSU37"] = {"path": file_paths} + tweaks["File-PSU37"] = {"file_path": file_paths} # Pass JWT token via tweaks using the x-langflow-global-var- pattern if jwt_token: # Using the global variable pattern that Langflow expects for OpenSearch components tweaks["OpenSearchHybrid-Ve6bS"] = {"jwt_token": jwt_token} - logger.debug( - "[LF] Added JWT token to tweaks for OpenSearch components" - ) + logger.debug("[LF] Added JWT token to tweaks for OpenSearch components") else: logger.warning("[LF] No JWT token provided") if tweaks: