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.
This commit is contained in:
parent
12cbd63dbf
commit
8ae543ac69
1 changed files with 2 additions and 4 deletions
|
|
@ -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:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue