ericilavia commited on
Commit
c8a27d9
·
verified ·
1 Parent(s): 0a96e2c

Update src/streamlit_app.py

Browse files
Files changed (1) hide show
  1. src/streamlit_app.py +10 -6
src/streamlit_app.py CHANGED
@@ -13,21 +13,24 @@ st.set_page_config(
13
  layout = "wide"
14
  )
15
 
 
 
16
  if "openai_api_key" not in st.session_state:
17
  st.session_state.openai_api_key = ""
18
  if "firecrawl_api_key" not in st.session_state:
19
  st.session_state.firecrawl_api_key = ""
20
 
 
21
  with st.sidebar:
22
  st.title("API Configuration")
23
  openai_api_key = st.text_input(
24
- "OpenAI API key",
25
  value = st.session_state.openai_api_key,
26
  type = "password"
27
  )
28
 
29
  firecrawl_api_key = st.text_input(
30
- "OpenAI API key",
31
  value = st.session_state.firecrawl_api_key,
32
  type = "password"
33
  )
@@ -37,12 +40,13 @@ with st.sidebar:
37
  set_default_openai_key(openai_api_key)
38
  if firecrawl_api_key:
39
  st.session_state.firecrawl_api_key = firecrawl_api_key
40
- set_default_openai_key(firecrawl_api_key)
41
 
42
- st.title("Openai Deep Research Agent")
43
- st.markdown("This openai agent from openi agent SDK performs deep search on any topic")
 
44
 
45
- reasearch_topic = st.text_input("Enter research topic: ")
 
46
 
47
  @function_tool
48
  async def deep_research(query: str, max_depth: int, time_limit: int, max_urls: int):
 
13
  layout = "wide"
14
  )
15
 
16
+
17
+ # Initialize session state for API Key if don't exist
18
  if "openai_api_key" not in st.session_state:
19
  st.session_state.openai_api_key = ""
20
  if "firecrawl_api_key" not in st.session_state:
21
  st.session_state.firecrawl_api_key = ""
22
 
23
+ # Sidebar for API Key
24
  with st.sidebar:
25
  st.title("API Configuration")
26
  openai_api_key = st.text_input(
27
+ "OpenAI API Key",
28
  value = st.session_state.openai_api_key,
29
  type = "password"
30
  )
31
 
32
  firecrawl_api_key = st.text_input(
33
+ "Firecrawl API Key",
34
  value = st.session_state.firecrawl_api_key,
35
  type = "password"
36
  )
 
40
  set_default_openai_key(openai_api_key)
41
  if firecrawl_api_key:
42
  st.session_state.firecrawl_api_key = firecrawl_api_key
 
43
 
44
+ # Main Application and Input Field
45
+ st.title("🔍 OpenAI Deep Research Agent")
46
+ st.markdown("This OpenAI Agent from OpenAI Agent SDK performs deep research on any topic using Firecrawl")
47
 
48
+ # This takes the input from the user for the specific research related concern
49
+ research_topic = st.text_input("Enter research topic: ", placeholder = "e.g., Latest Development in AI")
50
 
51
  @function_tool
52
  async def deep_research(query: str, max_depth: int, time_limit: int, max_urls: int):