diff --git a/README.md b/README.md index 1212b242..7891eeaa 100644 --- a/README.md +++ b/README.md @@ -147,8 +147,16 @@ Preload these examples inside of our UI so that users can see them in action Provide a way to run these examples in the UI (via the commandline?) --> We love to see how Skyvern is being used in the wild. Here are some examples of how Skyvern is being used to automate workflows in the real world. Please open PRs to add your own examples! +You'll need to have Skyvern running locally if you want to try these examples out. Please run the following command after going through the quickstart guide: +``` +./run_skyvern.sh +``` ## Automate materials procurement for a manufacturing company +💡 See it in action +``` +./run_ui.sh finditparts +```

@@ -162,6 +170,11 @@ We love to see how Skyvern is being used in the wild. Here are some examples of

+ +💡 See it in action +``` +./run_ui.sh geico +```

diff --git a/run_ui.sh b/run_ui.sh index 7205296d..5c8e2dd6 100755 --- a/run_ui.sh +++ b/run_ui.sh @@ -1,3 +1,5 @@ + + source "$(poetry env info --path)/bin/activate" python scripts/tracking.py skyvern-oss-run-ui -streamlit run streamlit_app/visualizer/streamlit.py \ No newline at end of file +streamlit run streamlit_app/visualizer/streamlit.py -- $@ diff --git a/streamlit_app/visualizer/streamlit.py b/streamlit_app/visualizer/streamlit.py index 698d0a65..5553eda6 100644 --- a/streamlit_app/visualizer/streamlit.py +++ b/streamlit_app/visualizer/streamlit.py @@ -1,3 +1,5 @@ +import sys + import clipboard import pandas as pd import streamlit as st @@ -20,6 +22,8 @@ st.set_page_config(layout="wide") st.markdown(styles.page_font_style, unsafe_allow_html=True) st.markdown(styles.button_style, unsafe_allow_html=True) +tab_name = sys.argv[1] if len(sys.argv) > 1 else "" + # Configuration def reset_session_state() -> None: @@ -111,14 +115,18 @@ def copy_curl_to_clipboard(task_request_body: TaskRequest) -> None: with execute_tab: - example_tabs = st.tabs([supported_example.name for supported_example in supported_examples]) + # Streamlit doesn't support "focusing" on a tab, so this is a workaround to make the requested tab be the "first" tab + sorted_supported_examples = sorted( + supported_examples, key=lambda x: (-1 if x.name.lower() == tab_name.lower() else 0) + ) + example_tabs = st.tabs([supported_example.name for supported_example in sorted_supported_examples]) for i, example_tab in enumerate(example_tabs): with example_tab: create_column, explanation_column = st.columns([1, 2]) with create_column: run_task, copy_curl = st.columns([3, 1]) - task_request_body = supported_examples[i] + task_request_body = sorted_supported_examples[i] unique_key = f"{task_request_body.name}" copy_curl.button( @@ -129,7 +137,7 @@ with execute_tab: with st.form(f"task_form_{unique_key}"): run_task.markdown("## Run a task") - example = supported_examples[i] + example = sorted_supported_examples[i] # Create all the fields to create a TaskRequest object st_url = st.text_input("URL*", value=example.url, key=f"url_{unique_key}") st_webhook_callback_url = st.text_input(