Joshua Sundance Bailey commited on
Commit ·
60ba98a
1
Parent(s): 4cc9a14
state management
Browse files
langchain-streamlit-demo/app.py
CHANGED
|
@@ -152,13 +152,13 @@ if chain:
|
|
| 152 |
wait_for_all_tracers()
|
| 153 |
url = client.read_run(run.id).url
|
| 154 |
st.session_state.trace_link = url
|
| 155 |
-
if client and st.session_state.run_id:
|
| 156 |
feedback_component(client)
|
| 157 |
|
| 158 |
else:
|
| 159 |
st.error(f"Please enter a valid {provider} API key.", icon="❌")
|
| 160 |
|
| 161 |
-
if client and st.session_state.trace_link:
|
| 162 |
st.sidebar.markdown(
|
| 163 |
f'<a href="{st.session_state.trace_link}" target="_blank"><button>Latest Trace: 🛠️</button></a>',
|
| 164 |
unsafe_allow_html=True,
|
|
|
|
| 152 |
wait_for_all_tracers()
|
| 153 |
url = client.read_run(run.id).url
|
| 154 |
st.session_state.trace_link = url
|
| 155 |
+
if client and st.session_state.get("run_id"):
|
| 156 |
feedback_component(client)
|
| 157 |
|
| 158 |
else:
|
| 159 |
st.error(f"Please enter a valid {provider} API key.", icon="❌")
|
| 160 |
|
| 161 |
+
if client and st.session_state.get("trace_link"):
|
| 162 |
st.sidebar.markdown(
|
| 163 |
f'<a href="{st.session_state.trace_link}" target="_blank"><button>Latest Trace: 🛠️</button></a>',
|
| 164 |
unsafe_allow_html=True,
|