Skip to content

Commit b9ea359

Browse files
committed
chore: create set_env_from_globals helper
1 parent 159f022 commit b9ea359

File tree

1 file changed

+8
-0
lines changed
  • src/backend/base/langflow/services/tracing

1 file changed

+8
-0
lines changed

src/backend/base/langflow/services/tracing/utils.py

+8
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import os
12
from typing import Any
23

34
from langflow.schema.data import Data
@@ -27,3 +28,10 @@ def convert_to_langchain_types(io_dict: dict[str, Any]):
2728
for key, value in io_dict.items():
2829
converted[key] = convert_to_langchain_type(value)
2930
return converted
31+
32+
33+
def set_env_from_globals(key: str, global_vars: dict[str, Any] | None) -> None:
34+
if global_vars is not None and key in global_vars:
35+
value = global_vars.get(key)
36+
if isinstance(value, str):
37+
os.environ[key] = value

0 commit comments

Comments
 (0)