Skip to content

Commit aadaa94

Browse files
author
Shai Dvash
committedMar 11, 2025
webui - use dotnet to load any preexisting env vars
1 parent d4d04c0 commit aadaa94

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed
 

‎webui.py

+7-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import os
22
import subprocess
3-
from typing import Optional
43

54
import streamlit as st
5+
from dotenv import load_dotenv
66

77
from fuzzy.enums import EnvironmentVariables
88
from fuzzy.handlers.attacks.base import attack_handler_fm
@@ -13,6 +13,8 @@
1313
from fuzzy.llm.providers.enums import LLMProvider
1414
from utils import get_ollama_models
1515

16+
load_dotenv()
17+
1618
st.set_page_config(
1719
page_title="FuzzyAI Web UI",
1820
layout="wide",
@@ -48,6 +50,10 @@
4850
if new_env_key and new_env_value:
4951
st.session_state.env_vars[new_env_key] = new_env_value
5052

53+
for x in EnvironmentVariables:
54+
if x.value in os.environ:
55+
st.session_state.env_vars[x.value] = os.environ[x.value]
56+
5157
# Create a container for the table
5258
with st.sidebar.container():
5359
if st.session_state.env_vars:

0 commit comments

Comments
 (0)
Please sign in to comment.