File size: 523 Bytes
6fdc19a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import streamlit as st
import asyncio
import nest_asyncio
from pickers import get_user_inputs
from utils import run_agent


nest_asyncio.apply()


with st.sidebar:
    user_inputs = get_user_inputs()
    is_valid = user_inputs is not None
    run_button = st.button("Run", disabled=not is_valid)


async def main():
    if run_button:
        await run_agent(user_inputs)
    else:
        st.write("Click run to start!")


if __name__ == "__main__":
    loop = asyncio.new_event_loop()
    loop.run_until_complete(main())